﻿.ak-layout-planner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    color: #111827;
}

.ak-layout-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 26px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.07);
}

.ak-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.82rem;
    font-weight: 700;
}

.ak-layout-hero h1 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.ak-layout-hero p {
    margin: 0;
    max-width: 760px;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.55;
}

.ak-expert-switch-box {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
}

.ak-mode-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #64748b;
}

.ak-layout-planner.ak-expert-on .ak-expert-label,
.ak-layout-planner:not(.ak-expert-on) .ak-simple-label {
    color: #111827;
}

.ak-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 31px;
    margin: 0;
}

    .ak-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.ak-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.2s;
    border-radius: 999px;
}

    .ak-slider:before {
        position: absolute;
        content: "";
        height: 25px;
        width: 25px;
        left: 3px;
        top: 3px;
        background-color: #ffffff;
        transition: 0.2s;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
    }

.ak-switch input:checked + .ak-slider {
    background-color: #111827;
}

    .ak-switch input:checked + .ak-slider:before {
        transform: translateX(25px);
    }

.ak-card,
.ak-preview-card,
.ak-status,
.ak-hint-box,
.ak-metric,
.ak-selection-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.ak-card,
.ak-preview-card,
.ak-selection-card {
    padding: 22px;
}

.ak-selection-card {
    margin-bottom: 24px;
}

.ak-card {
    margin-bottom: 18px;
}

.ak-card-head {
    margin-bottom: 16px;
}

.ak-card-head-large {
    margin-bottom: 18px;
}

.ak-card h2,
.ak-preview-card h2,
.ak-selection-card h2 {
    margin: 0 0 6px 0;
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ak-card p,
.ak-preview-card p,
.ak-selection-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.ak-selection-wrap {
    display: flex;
    gap: 22px;
    align-items: stretch;
}

.ak-selection-left {
    flex: 0 0 34%;
    min-width: 320px;
}

.ak-selection-right {
    flex: 1 1 auto;
    min-width: 0;
}

.ak-layout-grid {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.ak-layout-left {
    flex: 0 0 32%;
    min-width: 320px;
}

.ak-layout-right {
    flex: 1 1 auto;
    min-width: 0;
}

.ak-form-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -7px;
}

.ak-form-grid-selection .ak-field {
    width: 50%;
}

.ak-field {
    width: 50%;
    padding: 7px;
    box-sizing: border-box;
}

.ak-field-wide {
    width: 100%;
}

.ak-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
}

.ak-field input,
.ak-field select {
    min-height: 46px;
    border-radius: 12px;
    border-color: #e5e7eb;
}

    .ak-field input:focus,
    .ak-field select:focus {
        border-color: #f59e0b;
        box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.16);
    }

    .ak-field select:disabled {
        background-color: #f8fafc;
        color: #94a3b8;
        cursor: not-allowed;
    }

.ak-filter-info {
    margin-top: 7px;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.35;
}

    .ak-filter-info strong {
        color: #111827;
    }

.ak-auto-suggestion-box {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

    .ak-auto-suggestion-box strong {
        display: block;
        margin-bottom: 5px;
        color: #111827;
        font-weight: 800;
    }

    .ak-auto-suggestion-box p {
        margin: 0;
        color: #64748b;
        line-height: 1.45;
    }

    .ak-auto-suggestion-box.ak-auto-ok {
        background: #f0fdf4;
        border-color: #bbf7d0;
    }

    .ak-auto-suggestion-box.ak-auto-warning {
        background: #fffbeb;
        border-color: #fde68a;
    }

.ak-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
}

    .ak-check-row input {
        min-height: auto;
    }

.ak-expert-only {
    display: none;
}

.ak-layout-planner.ak-expert-on .ak-expert-only {
    display: block;
}

    .ak-layout-planner.ak-expert-on .ak-expert-only.ak-field,
    .ak-layout-planner.ak-expert-on .ak-expert-only.ak-field-wide,
    .ak-layout-planner.ak-expert-on .ak-expert-only.ak-dot,
    .ak-layout-planner.ak-expert-on .ak-expert-only.ak-series-legend {
        display: block;
    }

.ak-status {
    padding: 18px 20px;
    margin-bottom: 18px;
    border-left: 8px solid #94a3b8;
}

.ak-status-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.ak-status-text {
    color: #64748b;
    line-height: 1.45;
}

.ak-status-ok {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.ak-status-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.ak-status-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.ak-preview-card {
    margin-bottom: 18px;
}

.ak-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.ak-preview-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.86rem;
    font-weight: 800;
}

.ak-svg-shell {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: linear-gradient(#eef2f7 1px, transparent 1px), linear-gradient(90deg, #eef2f7 1px, transparent 1px), #f8fafc;
    background-size: 24px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
}

.ak-layout-svg {
    width: 100%;
    height: 500px;
    display: block;
    touch-action: none;
}

.ak-shape-outline {
    fill: rgba(255, 255, 255, 0.72);
    stroke: #111827;
    stroke-width: 2.5;
}

.ak-workspace-outline {
    fill: none;
    stroke: rgba(100, 116, 139, 0.55);
    stroke-width: 1.2;
    stroke-dasharray: 5 4;
}

.ak-dimension-line {
    stroke: #6b7280;
    stroke-width: 1.35;
    stroke-linecap: square;
}

.ak-dimension-helper {
    stroke: #94a3b8;
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: 0.9;
}

.ak-dimension-tick {
    stroke: #6b7280;
    stroke-width: 1.35;
    stroke-linecap: square;
}

.ak-dimension-text {
    fill: #6b7280;
    font-size: 11px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 3px;
}

.ak-dimension-text-vertical {
    writing-mode: tb;
    glyph-orientation-vertical: 0;
}

.ak-cell-used {
    stroke: #ffffff;
    stroke-width: 1.4;
}

.ak-cell-leftover {
    fill: rgba(148, 163, 184, 0.18);
    stroke: rgba(148, 163, 184, 0.65);
    stroke-width: 1.1;
}

.ak-cell-plus-pole {
    fill: #6b7280;
    stroke: #f8fafc;
    stroke-width: 1.2px;
    pointer-events: none;
}

.ak-cell-plus {
    fill: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(17, 24, 39, 0.45);
    stroke-width: 1.2px;
}

.ak-series-line,
.ak-main-line-plus,
.ak-main-line-minus {
    stroke: #111827;
    stroke-width: 2.4;
    stroke-linecap: round;
    opacity: 0.9;
}

.ak-handle {
    fill: #ffffff;
    stroke: #111827;
    stroke-width: 2.5;
    cursor: grab;
}

    .ak-handle:active {
        cursor: grabbing;
    }

.ak-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 14px;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 600;
}

.ak-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: -1px;
}

.ak-dot-used {
    background: #ef4444;
}

.ak-dot-leftover {
    background: #cbd5e1;
}

.ak-dot-series {
    background: #f59e0b;
}

.ak-series-legend {
    display: none;
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.ak-layout-planner.ak-expert-on .ak-series-legend.ak-series-legend-visible {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ak-series-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    font-size: 0.86rem;
    font-weight: 700;
}

.ak-series-legend-color {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.ak-metric-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -7px -7px 11px -7px;
}

.ak-metric {
    width: calc(20% - 14px);
    min-height: 92px;
    margin: 7px;
    padding: 16px;
    box-sizing: border-box;
}

    .ak-metric span {
        display: block;
        margin-bottom: 8px;
        color: #64748b;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1.25;
    }

    .ak-metric strong {
        display: block;
        color: #111827;
        font-size: 1.2rem;
        line-height: 1.15;
        font-weight: 800;
        word-break: break-word;
    }

.ak-metric-main {
    background: #eef2ff;
}

.ak-hint-box {
    padding: 18px 20px;
    margin-bottom: 16px;
    background: #f8fafc;
}

    .ak-hint-box strong {
        display: block;
        margin-bottom: 5px;
        font-size: 1rem;
    }

    .ak-hint-box p {
        margin: 0;
        color: #64748b;
        line-height: 1.45;
    }

.ak-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: 0.18s ease;
}

.ak-btn-full {
    width: 100%;
}

.ak-btn-primary {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

    .ak-btn-primary:hover {
        background: #000000;
        border-color: #000000;
    }

.ak-btn-red {
    background: #ef333b;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 12px 22px rgba(239, 51, 59, 0.22);
}

    .ak-btn-red:hover {
        background: #dc2626;
        color: #ffffff;
        border-color: #b91c1c;
    }

.ak-btn-light {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
}

    .ak-btn-light:hover {
        background: #f8fafc;
    }

.ak-btn-3d {
    border-color: #cbd5e1;
}

.ak-save-result {
    margin-top: 12px;
    font-weight: 700;
    color: #374151;
}

    .ak-save-result.ak-save-ok {
        color: #15803d;
    }

    .ak-save-result.ak-save-error {
        color: #b91c1c;
    }

.ak-preset-head {
    margin-bottom: 12px;
}

    .ak-preset-head h3 {
        margin: 0 0 4px 0;
        font-size: 1rem;
        font-weight: 800;
        color: #111827;
    }

    .ak-preset-head p {
        margin: 0;
        color: #64748b;
        font-size: 0.92rem;
    }

.ak-preset-row {
    display: flex;
    flex-wrap: wrap;
    margin: -6px;
}

.ak-preset-col {
    padding: 6px;
    box-sizing: border-box;
}

.ak-preset-col-2 {
    width: 50%;
}

.ak-preset-card {
    display: block;
    width: 100%;
    padding: 14px 14px 12px 14px;
    border: 1px solid #dbe1e8;
    border-radius: 18px;
    background: #f8fafc;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

    .ak-preset-card:hover {
        transform: translateY(-1px);
        border-color: #cbd5e1;
    }

    .ak-preset-card.is-active {
        background: #fff7f7;
        border-color: #dc2626;
        box-shadow: 0 14px 30px rgba(220, 38, 38, 0.12);
    }

    .ak-preset-card img {
        display: block;
        width: 100%;
        max-width: 220px;
        height: 120px;
        margin: 0 auto 10px auto;
        object-fit: contain;
    }

.ak-preset-title,
.ak-preset-subtitle {
    display: block;
}

.ak-preset-title {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

.ak-preset-subtitle {
    margin-top: 3px;
    font-size: 0.88rem;
    color: #64748b;
}

@media (max-width: 1199px) {
    .ak-selection-wrap,
    .ak-layout-grid {
        flex-direction: column;
    }

    .ak-selection-left,
    .ak-selection-right,
    .ak-layout-left,
    .ak-layout-right {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .ak-metric {
        width: calc(25% - 14px);
    }
}

@media (max-width: 767px) {
    .ak-layout-planner {
        padding: 14px;
    }

    .ak-layout-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .ak-expert-switch-box {
        width: 100%;
        justify-content: center;
    }

    .ak-field,
    .ak-form-grid-selection .ak-field,
    .ak-preset-col-2 {
        width: 100%;
    }

    .ak-svg-shell {
        min-height: 360px;
    }

    .ak-layout-svg {
        height: 360px;
    }

    .ak-metric {
        width: calc(50% - 14px);
    }
}

@media (max-width: 480px) {
    .ak-metric {
        width: calc(100% - 14px);
    }

    .ak-preview-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ak-action-row {
        flex-direction: column;
    }

    .ak-btn {
        width: 100%;
    }
}
