* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f8f7f3;
    color: #1a1a1a;
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
}

[v-cloak] {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    margin-bottom: 18px;
}

h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin: 16px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.furniture-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.furniture-button {
    padding: 8px 14px;
    border: 1px solid #e5e3dc;
    background: white;
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.15s;
    min-width: 110px;
}

.furniture-button:hover {
    border-color: #c5c2b7;
}

.furniture-button.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.furniture-button-name {
    font-size: 13px;
    font-weight: 600;
}

.furniture-button-desc {
    font-size: 11.5px;
    color: #888;
    margin-top: 1px;
}

.furniture-button.active .furniture-button-desc {
    color: #b8b8b0;
}

.stepper {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #e5e3dc;
    border-radius: 8px;
    overflow: hidden;
}

.stepper button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #444;
    font-family: inherit;
    transition: background 0.15s;
}

.stepper button:hover:not(:disabled) {
    background: #f1eee5;
}

.stepper button:disabled {
    color: #c8c5bd;
    cursor: not-allowed;
}

.stepper span {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.target-selector {
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e5e3dc;
}

.target-button {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    font-family: inherit;
}

.target-button:hover {
    color: #1a1a1a;
}

.target-button.active {
    background: #1a1a1a;
    color: white;
}

.action-button {
    padding: 8px 14px;
    border: 1px solid #e5e3dc;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #444;
    font-family: inherit;
    transition: all 0.15s;
}

.action-button:hover {
    background: #f1eee5;
    border-color: #d5d2c7;
}

.action-button.primary {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.action-button.primary:hover {
    background: #333;
    border-color: #333;
}

.save-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid #e5e3dc;
    border-radius: 8px;
    background: white;
}

.save-input input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    padding: 4px 8px;
    width: 200px;
    background: transparent;
}

.warning {
    background: #fff8e6;
    border: 1px solid #f0e2b6;
    color: #6b5a1f;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.saved-looks {
    margin-bottom: 16px;
}

.saved-looks-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.saved-look {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e5e3dc;
    border-radius: 10px;
    font-family: inherit;
    text-align: left;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.saved-look:hover {
    border-color: #1a1a1a;
}

.saved-look-body {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.look-action {
    padding: 5px 10px;
    border: 1px solid #e5e3dc;
    background: #f8f7f3;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s;
}

.look-action:hover {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

.look-swatches {
    display: flex;
    gap: 2px;
}

.look-swatches span {
    width: 14px;
    height: 32px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.look-text {
    padding-right: 4px;
}

.look-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.look-furniture {
    font-size: 11px;
    color: #888;
    line-height: 1.2;
    margin-top: 2px;
}

.look-delete {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1eee5;
    color: #777;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.look-delete:hover {
    background: #f5d4d4;
    color: #a32d2d;
}

.main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.main.picker-open {
    grid-template-columns: minmax(0, 1fr) min(380px, 32vw);
}

@media (max-width: 700px) {
    .main.picker-open {
        grid-template-columns: 1fr;
    }
}

.canvas {
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e3dc;
    padding: 24px 56px 20px 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 280px;
}

.chest-frame {
    position: relative;
    width: 100%;
}

.chest-svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.10));
}

.chest-svg rect,
.chest-svg circle {
    stroke: #1a1a1a;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.row-col-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 1px solid #e5e3dc;
    background: white;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    color: #444;
    cursor: pointer;
    font-family: inherit;
    transform: translateY(-50%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: all 0.15s;
    padding: 0;
}

.row-col-btn:hover:not(:disabled) {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

.row-col-btn:disabled {
    color: #c8c5bd;
    cursor: not-allowed;
    background: #f8f7f3;
}

.row-col-minus {
    right: calc(100% + 8px);
}

.row-col-plus {
    left: calc(100% + 8px);
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
}

.legs-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legs-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #666;
    margin-right: 2px;
}

.legs-chip {
    padding: 5px 12px;
    border: 1px solid #e5e3dc;
    background: white;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.legs-chip:hover {
    border-color: #1a1a1a;
}

.legs-chip.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.clickable {
    cursor: pointer;
}

.clickable:hover rect,
.clickable:hover circle {
    filter: brightness(0.94);
}

.picker {
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e3dc;
    padding: 22px;
}

.picker-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    overflow-y: auto;
    padding-top: 50px;
}

.picker-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f1eee5;
    color: #777;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    padding: 0;
}

.picker-close:hover {
    background: #1a1a1a;
    color: white;
}

.picker-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.picker-hint {
    font-size: 12.5px;
    color: #6b6b6b;
    margin-bottom: 18px;
}

.category {
    margin-bottom: 18px;
}

.category:last-child {
    margin-bottom: 4px;
}

.category-header {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 6px;
}

.swatch {
    border: 1px solid #e5e3dc;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    padding: 0;
    text-align: left;
    font-family: inherit;
    transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.swatch:hover {
    transform: translateY(-1px);
    border-color: #1a1a1a;
}

.swatch.active {
    border: 2px solid #2563eb;
    box-shadow: 0 0 0 2px #dbe7fb;
}

.swatch-color {
    height: 36px;
}

.swatch-label {
    padding: 5px 7px 6px;
    font-size: 10.5px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary {
    margin-top: 20px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e3dc;
    padding: 18px 22px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-swatch {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #e5e3dc;
    flex-shrink: 0;
}

.summary-label {
    font-size: 10.5px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 1px;
}

.summary-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 1px;
}

.summary-hex {
    font-size: 11.5px;
    color: #888;
    font-family: ui-monospace, 'SF Mono', monospace;
}

.disclaimer {
    margin-top: 16px;
    font-size: 12px;
    color: #888;
    font-style: italic;
    line-height: 1.6;
}

@media (max-width: 600px) {
    body {
        padding: 12px;
        overflow-x: hidden;
    }

    h1 {
        font-size: 19px;
    }

    .subtitle {
        font-size: 13px;
    }

    .section-label {
        margin: 12px 0 6px;
    }

    .furniture-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .furniture-button {
        min-width: 0;
        padding: 6px 10px;
    }

    .furniture-button-name {
        font-size: 12.5px;
    }

    .furniture-button-desc {
        font-size: 11px;
    }

    .toolbar {
        gap: 6px;
    }

    .target-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .action-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .canvas {
        padding: 16px 40px 12px 40px;
        min-height: 0;
    }

    .row-col-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .row-col-minus {
        right: calc(100% + 6px);
    }

    .row-col-plus {
        left: calc(100% + 6px);
    }

    .canvas-controls {
        gap: 6px 14px;
    }

    .legs-chip {
        padding: 4px 10px;
        font-size: 11.5px;
    }

    .picker-sidebar {
        position: relative;
        top: auto;
        max-height: none !important;
        padding-top: 22px;
    }

    .picker {
        padding: 16px;
    }

    .picker-close {
        top: 10px;
        right: 10px;
    }

    .summary {
        padding: 14px 16px;
        gap: 12px 18px;
    }

    .summary-item {
        flex: 1 1 100%;
    }

    .save-input input {
        width: 140px;
    }

    .swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    }
}
