/* ---------- Calidad (modules/quality.js) ---------- */
.q-tabs { margin-bottom: 16px; }
.q-pane > .card + .card, .q-cva-card { margin-top: 16px; }
.q-card-h { padding: 16px 20px 12px; margin: 0; }

/* CVA sheet: full screen on phones, a tall panel on desktop */
html.q-lock, html.q-lock body { overflow: hidden; }
.q-sheet { position: fixed; inset: 0; z-index: 400; background: rgba(20, 17, 15, .38); display: flex; justify-content: center; align-items: flex-end; }
.q-sheet-card { width: min(720px, 100%); max-height: min(94dvh, 100%); background: var(--surface); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: qUp .22s var(--ease); }
@media (min-width: 760px) { .q-sheet { align-items: center; } .q-sheet-card { border-radius: 16px; } }
@keyframes qUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .q-sheet-card { animation: none; } }
.q-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.q-sheet-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.q-sheet-sub { color: var(--text3); font-size: 13px; margin-top: 2px; }
.q-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
.q-sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 16px 16px; }
.q-total { display: flex; align-items: baseline; gap: 8px; }
.q-total span { color: var(--text3); font-size: 13px; }
.q-total b { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.q-total small { color: var(--text3); font-size: 12px; }
.q-sheet-foot .primary { height: 44px; padding: 0 22px; }
.q-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.q-sec:last-child { border-bottom: 0; }
.q-sec h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.q-sec h4 small, .q-sub-h small { font-weight: 400; color: var(--text3); font-size: 12px; margin-left: 6px; }
.q-aff { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 10px; padding: 4px 0; }
.q-aff-label { font-size: 13.5px; color: var(--text2); }
.q-nine { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.q-nine button { height: 40px; padding: 0; border-radius: 8px; font-variant-numeric: tabular-nums; font-size: 14px; box-shadow: none; }
.q-nine button:nth-child(5) { border-color: var(--border-strong); }
.q-nine button.on, .q-nine button.on:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
@media (max-width: 560px) { .q-aff { grid-template-columns: 1fr; gap: 6px; padding: 6px 0; } .q-nine button { height: 44px; } }
.q-cups { display: flex; gap: 24px; flex-wrap: wrap; }
.q-step { display: flex; align-items: center; gap: 10px; }
.q-step span { font-size: 13.5px; color: var(--text2); min-width: 92px; }
.q-step button { width: 40px; height: 40px; padding: 0; font-size: 18px; border-radius: 50%; }
.q-step b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.q-defects { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.q-desc summary { list-style: none; cursor: pointer; }
.q-desc summary::-webkit-details-marker { display: none; }
.q-desc summary h4::after { content: '▾'; margin-left: 6px; color: var(--text3); font-weight: 400; }
.q-desc[open] summary h4::after { content: '▴'; }
.q-int { display: grid; grid-template-columns: 132px minmax(0, 1fr) 44px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; color: var(--text2); }
.q-int input[type=range] { width: 100%; --pct: 0%; }
.q-int output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.q-sub-h { font-size: 12.5px; color: var(--text3); margin: 14px 0 8px; }
.q-cata { display: flex; flex-wrap: wrap; gap: 6px; }
.q-cata-group { display: contents; }
.q-chip { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 450; box-shadow: none; background: var(--surface); }
.q-chip.sub { color: var(--text2); }
.q-chip.on, .q-chip.on:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Tapping must answer at once: no fade on the choice buttons. */
.q-chip, .q-nine button, .q-step button { transition: none; }

/* Sessions */
.q-new-session { flex-wrap: wrap; align-items: flex-start; }
.q-blind { flex: 0 0 auto !important; flex-direction: row !important; align-items: center; gap: 8px; align-self: flex-end; height: 38px; }
.q-blind input { width: 16px; height: 16px; accent-color: var(--accent); }
.q-picker { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; }
.q-picker-h { font-size: 12.5px; color: var(--text2); font-weight: 500; }
.q-picks { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow-y: auto; }
.q-guest { display: flex; gap: 8px; max-width: 420px; }
.q-guest input { flex: 1; }
.q-back { margin-bottom: 8px; }
.q-session-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-session-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.q-session-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.q-progress { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.q-prog { display: grid; grid-template-columns: 160px minmax(0, 1fr) 70px; align-items: center; gap: 12px; font-size: 13.5px; }
.q-prog b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; color: var(--text2); }
.q-bar { height: 6px; border-radius: 6px; background: var(--hover-strong); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--text); border-radius: inherit; }
.q-result { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(120px, 1fr) 96px; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.q-rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text2); }
.q-result:first-of-type .q-rank { background: var(--accent); color: var(--on-accent); }
.q-warn { font-size: 12px; color: var(--amber); margin-top: 3px; }
.q-whisker { position: relative; height: 18px; }
.q-whisker::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; border-radius: 2px; background: var(--hover-strong); }
.q-whisker .w { position: absolute; top: 6px; height: 6px; border-radius: 3px; background: var(--border-strong); }
.q-whisker .d { position: absolute; top: 3px; width: 2px; height: 12px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.q-result-score { text-align: right; }
.q-result-score b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.q-result-score small { color: var(--text3); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .q-result { grid-template-columns: 28px minmax(0, 1fr) 80px; } .q-whisker { display: none; } .q-prog { grid-template-columns: 110px minmax(0, 1fr) 60px; } }

/* Cupper view (#cata/ID) */
.q-cupper-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.q-cupper-head h2 { margin: 2px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.q-as { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.q-cups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.q-cup { height: auto; min-height: 120px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; border-radius: 14px; background: var(--surface); text-align: left; gap: 6px; white-space: normal; }
.q-cup-code { font-family: var(--font-mono); font-size: 30px; font-weight: 500; letter-spacing: .04em; color: var(--text); }
.q-cup-state { font-size: 13px; color: var(--text3); font-variant-numeric: tabular-nums; }
.q-cup-name { font-size: 12.5px; color: var(--text2); }
.q-cup.done { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.q-cup.done .q-cup-state { color: var(--green); font-weight: 600; }

/* Compare */
.q-compare-bar { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.q-compare-chart svg { display: block; width: 100%; }
.q-compare-chart .g { stroke: var(--border); }
.q-compare-chart .a { fill: var(--text3); font-family: var(--font-mono); font-size: 11px; }
.q-compare-chart .other { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.q-compare-chart .best { fill: none; stroke: var(--bt); stroke-width: 2.2; }
.q-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.q-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--border-strong); vertical-align: middle; margin-right: 6px; }
.q-legend .best { color: var(--text); font-weight: 500; }
.q-legend .best i { border-top-color: var(--bt); }
tr.q-best td { background: var(--signal-soft); }
/* Same look as the app's other modals: veil, blur, card edge. */
.q-sheet { background: rgba(20, 16, 14, 0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.q-sheet-card { border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
@media (min-width: 760px) { .q-sheet-card { border-radius: 18px; } }
.q-total b.empty { color: var(--text3); font-weight: 400; }
