/* ===== Cubicar Theme — Neobrutalista, fondo claro, colores vibrantes ===== */

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

:root {
    --ink: #101014;
    --paper: #fffaf0;
    --muted: #6b665c;
    --line: rgba(16, 16, 20, .14);
    --acid: #ccff00;
    --cyan: #00dcff;
    --pink: #ff3da9;
    --orange: #ff8b2c;
    --violet: #7755ff;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 7px 7px 0 var(--ink);
    --shadow-sm: 4px 4px 0 var(--ink);
    --sidebar-width: 320px;
}

html, body {
    height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink);
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.25));
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: .10;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* ===== Layout ===== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    background: rgba(255,255,255,.72);
    border-bottom: 2px solid var(--ink);
    backdrop-filter: blur(14px);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--ink);
}

.logo svg {
    color: var(--ink);
}

.logo strong {
    color: var(--violet);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255,255,255,.68);
    border-right: 2px solid var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex-shrink: 0;
    backdrop-filter: blur(14px);
}

.panel {
    border-bottom: 2px solid var(--ink);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: white;
    border-bottom: 2px solid var(--ink);
    background: #ff3da9;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.panel-header h2,
.panel-header h3 {
    font-size: 13px;
    font-weight: 900;
    flex: 1;
}

.badge {
    background: white;
    color: var(--ink);
    border: 2px solid var(--ink);
    font-size: 11px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.panel-body {
    padding: 24px 24px 28px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 24px 26px;
    border-top: 2px solid var(--ink);
    background: rgba(255,255,255,.62);
    font-size: 11px;
    line-height: 1.55;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.sidebar-footer p + p {
    margin-top: 6px;
}

.sidebar-footer a {
    color: var(--violet);
    font-weight: 900;
    text-decoration: none;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.form-group input:focus {
    outline: none;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
}

.form-group input:focus-visible,
.btn:focus-visible,
.btn-icon:focus-visible,
.template-chip:focus-visible,
.export-option:focus-visible,
.color-option:focus-visible,
.faq-item summary:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 3px;
}

.form-group input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

.form-hint {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
    font-weight: 650;
}

.cost-mode-options {
    display: grid;
    gap: 8px;
}

.choice-card {
    position: relative;
    display: block;
    padding: 11px 12px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 0;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.choice-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
}

.choice-card.active {
    border-color: var(--ink);
    background: var(--acid);
    box-shadow: var(--shadow);
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card-title,
.choice-card-caption {
    display: block;
}

.choice-card-title {
    font-size: 13px;
    font-weight: 900;
    color: var(--ink);
}

.choice-card-caption {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
    font-weight: 650;
}

/* Toggle */
.toggle-group {
    margin-top: 8px;
}

.form-group label.toggle,
.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
    width: 100%;
    font-weight: 800;
}

.toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: 999px;
    transition: background .2s;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--ink);
    border-radius: 50%;
    transition: transform .2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--acid);
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.toggle.small .toggle-slider {
    width: 34px;
    height: 19px;
}

.toggle.small .toggle-slider::after {
    width: 11px;
    height: 11px;
}

.toggle.small input:checked + .toggle-slider::after {
    transform: translateX(13px);
}

.toggle-label {
    flex: 1;
    line-height: 1.35;
    user-select: none;
}

/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 2px solid var(--ink);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.color-option:hover {
    transform: translate(-1px, -1px) scale(1.08);
    box-shadow: 6px 6px 0 var(--ink);
}

.color-option.active {
    border-color: var(--ink);
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--ink);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--ink);
    color: white;
    box-shadow: 6px 6px 0 var(--orange);
}

.btn-primary:hover {
    box-shadow: 9px 9px 0 var(--orange);
}

.btn-secondary {
    background: white;
    color: var(--ink);
    box-shadow: 6px 6px 0 var(--cyan);
}

.btn-secondary:hover {
    box-shadow: 9px 9px 0 var(--cyan);
}

.btn-ghost {
    background: rgba(255,255,255,.72);
    color: var(--ink);
    box-shadow: 6px 6px 0 var(--cyan);
}

.btn-ghost:hover {
    background: white;
    box-shadow: 9px 9px 0 var(--cyan);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.72);
    color: var(--ink);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
}

/* ===== Pieces List ===== */
.pieces-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.piece-card {
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.piece-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
}

.piece-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--piece-color, var(--acid));
    border-right: 2px solid var(--ink);
}

.piece-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.piece-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--piece-color, var(--acid));
    border: 2px solid var(--ink);
    flex-shrink: 0;
}

.piece-name {
    font-size: 13px;
    font-weight: 900;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.piece-qty {
    font-size: 12px;
    font-weight: 900;
    color: var(--ink);
    background: var(--acid);
    border: 2px solid var(--ink);
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.piece-card-details {
    font-size: 11px;
    color: var(--muted);
    padding-left: 20px;
    font-weight: 650;
}

.piece-card-actions {
    position: absolute;
    right: 6px;
    top: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}

.piece-card:hover .piece-card-actions {
    opacity: 1;
}

.piece-card-actions button {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    border: 2px solid var(--ink);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform .1s;
}

.piece-card-actions button:hover {
    transform: translate(-1px, -1px);
    background: var(--pink);
    color: white;
}

/* ===== Templates ===== */
.templates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
}

.template-chip {
    padding: 12px 14px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.template-chip:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
    background: var(--acid);
}

/* ===== Canvas Area ===== */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 10%, rgba(0, 220, 255, .22), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(255, 61, 169, .18), transparent 34%),
        linear-gradient(135deg, #fffaf0 0%, #fff4d5 42%, #f8fff6 100%);
}

.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,255,255,.72);
    border-bottom: 2px solid var(--ink);
    flex-shrink: 0;
    backdrop-filter: blur(14px);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-value {
    font-size: 13px;
    font-weight: 900;
    color: var(--ink);
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.view-options {
    display: flex;
    gap: 16px;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 40px;
}

#mainCanvas {
    background: #fffdf5;
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 16px 16px 0 rgba(16, 16, 20, .96), var(--shadow);
    cursor: grab;
    user-select: none;
}

#mainCanvas:active {
    cursor: grabbing;
}

#mainCanvas.dragging {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    opacity: .6;
}

.empty-state svg {
    margin-bottom: 12px;
    color: var(--ink);
}

.empty-state p {
    font-size: 14px;
    font-weight: 700;
}

/* ===== Metrics Bar ===== */
.metrics-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,.72);
    border-top: 2px solid var(--ink);
    padding: 12px 24px;
    min-height: 72px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    backdrop-filter: blur(14px);
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 28px;
    border-right: 2px solid var(--ink);
    min-width: 140px;
    gap: 6px;
}

.metric:last-child {
    border-right: none;
}

.metric-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 900;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 20px;
    font-weight: 950;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.04em;
    line-height: 1.1;
}

.metric-meta {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.metric.warning .metric-value {
    color: var(--pink);
}

.metric.warning .metric-label {
    color: var(--pink);
    opacity: 0.8;
}

.metric.warning .metric-meta {
    color: var(--pink);
    opacity: 0.78;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 16, 20, .45);
    backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.modal-content-wide {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--ink);
    background: rgba(255,255,255,.5);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.faq-modal-header {
    align-items: flex-start;
    padding: 24px 24px 20px;
    background:
        radial-gradient(circle at top right, rgba(0,220,255,.16), transparent 32%),
        radial-gradient(circle at left center, rgba(255,61,169,.12), transparent 30%),
        rgba(255,255,255,.76);
}

.faq-header-copy {
    max-width: 680px;
}

.faq-header-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--acid);
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.faq-modal-header h3 {
    font-size: 22px;
    line-height: 1.05;
    margin-bottom: 10px;
}

.faq-header-note {
    max-width: 640px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
    font-weight: 650;
}

.faq-modal-header .close-modal {
    background: rgba(255,255,255,.94);
    width: 56px;
    height: 56px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.faq-modal-body {
    display: grid;
    gap: 22px;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.1)),
        repeating-linear-gradient(
            0deg,
            rgba(16,16,20,.04) 0,
            rgba(16,16,20,.04) 1px,
            transparent 1px,
            transparent 24px
        );
}

.faq-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.faq-section {
    position: relative;
    background: rgba(255,255,255,.72);
    border: 2px solid var(--ink);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.faq-section h4 {
    font-size: 15px;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 6px;
}

.faq-section-note {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    font-weight: 650;
    margin-bottom: 14px;
}

.faq-section-guide {
    background:
        radial-gradient(circle at top left, rgba(0,220,255,.16), transparent 40%),
        rgba(255,255,255,.78);
}

.faq-steps {
    list-style: none;
    counter-reset: faq-step;
    display: grid;
    gap: 12px;
}

.faq-steps li {
    counter-increment: faq-step;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    background: rgba(255,255,255,.92);
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: 4px 4px 0 rgba(16,16,20,.9);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 750;
}

.faq-steps li::before {
    content: counter(faq-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background: var(--cyan);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.faq-guide-note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 2px dashed var(--ink);
    border-radius: 18px;
    background: rgba(204,255,0,.18);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 700;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88));
    border: 2px solid var(--ink);
    border-radius: 22px;
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(180deg, var(--pink), var(--cyan));
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 56px 18px 22px;
    font-size: 17px;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.15;
    letter-spacing: -.03em;
    position: relative;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink);
    border-radius: 10px;
    background: rgba(255,255,255,.95);
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '−';
    background: var(--acid);
}

.faq-answer {
    padding: 0 22px 20px 22px;
}

.faq-answer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    font-weight: 650;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 2px solid var(--ink);
    background: rgba(255,255,255,.5);
}

/* Export options */
.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    font-weight: 900;
}

.export-option:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
    background: var(--acid);
}

.export-option span {
    font-size: 13px;
    font-weight: 900;
}

/* Configs list */
.configs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255,255,255,.85);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.config-item:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--ink);
    background: var(--acid);
}

.config-item-info {
    flex: 1;
    min-width: 0;
}

.config-item-name {
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.config-item-date {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 650;
}

.config-item-actions {
    display: flex;
    gap: 4px;
}

.config-item-actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    border: 2px solid var(--ink);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform .1s;
}

.config-item-actions button:hover {
    transform: translate(-1px, -1px);
    background: var(--pink);
    color: white;
}

.empty-text {
    text-align: center;
    color: var(--muted);
    padding: 24px;
    font-size: 13px;
    font-weight: 700;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(16,16,20,.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16,16,20,.35);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
    }

    .faq-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 2px solid var(--ink);
    }
    .canvas-wrapper {
        padding: 16px;
    }
    .metrics-bar {
        padding: 0 12px;
    }
    .metric {
        padding: 0 12px;
        min-width: auto;
    }
    .modal-content-wide {
        max-width: calc(100vw - 24px);
    }
    .faq-modal-body {
        padding: 18px;
    }
    .faq-item summary {
        padding: 16px 52px 16px 18px;
        font-size: 16px;
    }
    .faq-answer {
        padding: 0 18px 18px;
    }
}

/* Toast notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn .3s ease;
    color: var(--ink);
}

.toast.success {
    border-color: var(--ink);
    background: var(--acid);
}

.toast.error {
    border-color: var(--ink);
    background: var(--pink);
    color: white;
}

@keyframes toastIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Sheet Tooltip ===== */
.sheet-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 10px 12px;
    min-width: 160px;
    font-size: 12px;
    color: var(--ink);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.sheet-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sheet-tooltip-title {
    font-weight: 900;
    font-size: 13px;
    color: var(--violet);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ink);
}

.sheet-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
}

.sheet-tooltip-row span:first-child {
    color: var(--muted);
    font-weight: 700;
}

.sheet-tooltip-row span:last-child {
    font-weight: 900;
    color: var(--ink);
}

/* ===== Sheet Info Panel ===== */
.sheet-info-panel {
    background: rgba(255,255,255,.72);
    border-top: 2px solid var(--ink);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    backdrop-filter: blur(14px);
}

.sheet-info-title {
    font-weight: 900;
    font-size: 13px;
    color: var(--violet);
    white-space: nowrap;
    min-width: 80px;
}

.sheet-info-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sheet-info-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.sheet-info-item span {
    color: var(--muted);
    font-weight: 700;
}

.sheet-info-item strong {
    font-weight: 900;
    color: var(--ink);
    font-size: 13px;
}
