/* Shrink v1.7 — mode chooser, numbered steps, live readout */
.mode-chooser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: -6px 0 14px; }
.mode-card { appearance: none; display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px 16px; text-align: left; color: var(--text); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; transition: .16s ease; font: inherit; }
.mode-card:hover { border-color: #505866; background: rgba(255,255,255,.04); transform: translateY(-1px); }
.mode-card.active { border-color: var(--accent); background: rgba(255,75,75,.075); box-shadow: inset 0 0 0 1px rgba(255,75,75,.1); }
.mode-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #222731; font-size: 20px; }
.mode-card.active .mode-icon { background: var(--accent); }
.mode-card strong { display: block; font-size: 15px; margin-bottom: 2px; }
.mode-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.workflow-strip { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 38px; margin: 0 0 16px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; overflow-x: auto; }
.workflow-strip b { color: var(--text); } .workflow-strip i { color: #5c6471; font-style: normal; }

/* what shows in which mode */
.app-mode-game .print-only, .app-mode-game .print-only-inline { display: none !important; }
.app-mode-print .game-only { display: none !important; }
.app-mode-print .model-paint-controls { display: none !important; }
.hidden-legacy { display: none !important; }
#retouchDetails:has(#textureEditor.hidden) { display: none !important; }
.chip[hidden], .topo-line[hidden], .custom-detail[hidden] { display: none !important; }

/* steps */
.step { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.02); }
.step-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px; }
.step-num { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.step-head strong { display: block; font-size: 15px; }
.step-head small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }

.target-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.target-card { appearance: none; font: inherit; text-align: left; color: var(--text); background: #1d2128; border: 1px solid #343a45; border-radius: 12px; padding: 10px 9px; cursor: pointer; transition: .14s; }
.target-card:hover { border-color: #5a6372; }
.target-card.active { border-color: var(--accent); background: rgba(255,75,75,.09); }
.target-card .t-icon { display: block; font-size: 18px; margin-bottom: 4px; }
.target-card b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.target-card small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }

.chip { margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; border: 1px solid; }
.chip[data-level="good"], .topo-line[data-level="good"] { color: #9be8b0; background: rgba(75,172,112,.1); border-color: #2f5a40; }
.chip[data-level="warn"], .topo-line[data-level="warn"] { color: #ffd58a; background: rgba(255,190,60,.08); border-color: #5d4a22; }
.topo-line { margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; border: 1px solid; }

.slider-block { margin-bottom: 10px; }
.slider-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; }
.live-card { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid #292e37; margin-bottom: 10px; }
.live-line strong { font-size: 18px; }
.live-line .dim, .dim { color: var(--muted); font-size: 12px; } .dim2 { opacity: .7; }
.live-line > .dim { display: block; margin-top: 2px; }
.verdict { display: flex; gap: 9px; align-items: center; margin-top: 10px; padding: 9px 11px; border-radius: 10px; font-weight: 800; font-size: 13px; border: 1px solid #3a404b; background: #1d2128; }
.v-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #6b7280; }
.verdict[data-level="good"] { border-color: #2f5a40; background: rgba(75,172,112,.1); color: #9be8b0; } .verdict[data-level="good"] .v-dot { background: #4bac70; }
.verdict[data-level="warn"] { border-color: #5d4a22; background: rgba(255,190,60,.08); color: #ffd58a; } .verdict[data-level="warn"] .v-dot { background: #f0b429; }
.verdict[data-level="bad"] { border-color: #6a2b2b; background: rgba(255,80,80,.09); color: #ff9b9b; } .verdict[data-level="bad"] .v-dot { background: #ff5b5b; }
.verdict[data-level="busy"] .v-dot { animation: pulse 1s ease-in-out infinite; }
.verdict-nums { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 6px; }
.auto-btn { width: 100%; border: 1px solid var(--accent); background: rgba(255,75,75,.08); color: var(--text); padding: 10px; font-weight: 800; }
.auto-btn:hover:not(:disabled) { background: rgba(255,75,75,.16); }
.tri-field { margin: 12px 0 0; }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid #555; border-top-color: #ff8a8a; border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -1px; margin-left: 8px; }
@keyframes sp { to { transform: rotate(360deg); } } @keyframes pulse { 50% { opacity: .25; } }

.fold { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: rgba(255,255,255,.015); overflow: hidden; }
.fold > summary { cursor: pointer; list-style: none; padding: 11px 13px; color: #c8d0db; font-size: 12.5px; font-weight: 800; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: '＋'; float: right; color: var(--muted); } .fold[open] > summary::after { content: '−'; }
.fold-inner { padding: 0 13px 13px; }
.fold.tiny > summary { font-size: 11.5px; padding: 8px 4px; } .fold.tiny { border: 0; background: none; }
.fold-inner .texture-editor { border: 0; padding: 0; margin: 0; background: none; }
.print-setup .field-grid { margin-bottom: 10px; }
.print-setup select { width: 100%; }
.export-row { display: flex; gap: 8px; margin-bottom: 10px; } .export-row .button { flex: 1; }
.kept-line { font-size: 11.5px; color: #c3cad6; line-height: 1.5; margin: 10px 0; padding: 9px 10px; border-radius: 10px; background: rgba(75,172,112,.07); }
.save-main { margin-top: 6px; }
.app-mode-print .save-main { background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; font-weight: 700; }

/* the 3D view stays in sight while you work down the steps */
.viewer-panel { height: calc(100vh - 36px); min-height: 560px; }
.viewer { min-height: 0; }
@media (max-width: 900px) { .viewer-panel { height: 70vh; position: relative; top: 0; } .target-cards { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .mode-chooser { grid-template-columns: 1fr; } .workflow-strip { justify-content: flex-start; } }

.step .print-panel { border: 0; padding: 0; margin: 0; background: none; }
.step .print-panel .protect-box { margin-bottom: 0; }

/* compact header so the 3D view is in sight immediately */
.workflow-strip { display: none !important; }
.title-row h1 { font-size: 40px !important; line-height: 1 !important; margin: 0 !important; }
.subtitle { margin: 4px 0 0 !important; font-size: 13px !important; }
.mode-chooser { margin: 0 0 12px; gap: 10px; }
.mode-card { padding: 9px 14px; } .mode-icon { width: 32px; height: 32px; flex-basis: 32px; font-size: 17px; }
.mode-card small { font-size: 11.5px; }
.viewer-panel { height: calc(100vh - 28px); top: 14px; }

.export-row { display: grid !important; grid-template-columns: 1fr; gap: 8px; }
.viewer-panel { height: calc(100vh - 200px) !important; min-height: 520px !important; }
@media (max-width: 900px) { .viewer-panel { height: 70vh !important; } }
/* v2.83 Game mode on a desktop-width window: the viewer uses (almost) the whole window height. This must come after the rule above, which is !important. */
@media (min-width: 901px) { .app-mode-game .viewer-panel { height: calc(100vh - 36px) !important; min-height: 560px !important; top: 18px; } }
/* drag handle along the bottom edge of the viewer (Game mode, desktop) */
.viewer-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; cursor: ns-resize; z-index: 40; display: none; touch-action: none; }
.viewer-grip::after { content: ''; position: absolute; left: 50%; top: 6px; width: 64px; height: 4px; margin-left: -32px; border-radius: 4px; background: rgba(255,255,255,.35); }
.viewer-grip:hover::after, .viewer-grip.dragging::after { background: #ff4e55; }
@media (min-width: 901px) { .app-mode-game .viewer-grip { display: block; } }

/* v2.85 one-line header: SHRINK 3D [version]  Reduce your models, keep the detail ............ [Runs locally] */
.topbar { align-items: center !important; margin-bottom: 10px !important; gap: 14px; }
.brand-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.brand-line .title-row { align-items: baseline; }
.brand-line .title-row h1 { font-size: 30px !important; }
.brand-line .subtitle { margin: 0 !important; font-size: 14px !important; }
.privacy-pill { padding: 6px 12px !important; }
@media (max-width: 720px) { .topbar { flex-direction: column; align-items: flex-start !important; gap: 6px; } }
.brand-line .version-badge { margin-bottom: 0 !important; }

/* v2.93 Game mode: one Optimise button that goes red when the settings have changed */
.app-mode-game #stepSave { position: sticky; bottom: 0; z-index: 6; background: var(--panel); box-shadow: 0 -10px 24px rgba(0,0,0,.35); }
.app-mode-game #stepSave .step-head { display: none; }
.app-mode-game #resultCard .download { display: none; }
.flow-bar { display: flex; gap: 10px; align-items: stretch; }
.app-mode-game .flow-bar .save-main { flex: 2; margin: 0; width: auto; min-height: 54px; font-size: 17px; background: #2fa866; color: #fff; transition: none; }
.app-mode-game .flow-bar .save-main.flow-done { background: #1f6b43; }
.app-mode-game .flow-bar .save-main.flow-stale { background: #e23d3d; }
.app-mode-game .flow-bar .save-main:disabled { opacity: .7; }
.app-mode-game .flow-bar .flow-download { flex: 1; min-height: 54px; font-weight: 800; background: #2b313b; color: #8b94a3; transition: none; }
.app-mode-game .flow-bar .flow-download.ready { background: #f3f5f7; color: #111317; }
.app-mode-game .flow-bar .flow-download:disabled { cursor: not-allowed; }
.flow-note { margin-top: 8px; min-height: 0; color: #8fe0b0; }
.flow-note.stale { color: #ff9a9a; }
.settings-file-row { display: flex; gap: 8px; margin-top: 8px; }
.settings-file-row .button { flex: 1; }
.flow-note:empty { display: none; }
.app-mode-print #flowBar .flow-download, .app-mode-print #flowNote { display: none; }
.app-mode-print #flowBar { display: block; }

.wheel-group { margin: 12px 0 2px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #cfd6df; }
.wheel-group:first-child { border-top: 0; margin-top: 4px; }

/* v2.106 Game mode: a shallower Optimise bar and result box */
.app-mode-game .flow-bar { gap: 8px; }
.app-mode-game .flow-bar .save-main, .app-mode-game .flow-bar .flow-download { min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
.app-mode-game #stepSave { padding-top: 8px; padding-bottom: 8px; }
.app-mode-game #stepSave .status { min-height: 0; padding-top: 4px; font-size: 11px; }
.app-mode-game #stepSave .progress-wrap { margin-top: 6px; }
.app-mode-game .flow-note { margin-top: 4px; font-size: 11px; line-height: 1.35; }
.app-mode-game .settings-file-row { margin-top: 4px; gap: 6px; }
.app-mode-game .settings-file-row .button { padding-top: 4px; padding-bottom: 4px; font-size: 11.5px; }
.app-mode-game #resultCard { margin-top: 6px; padding: 7px 10px; border-radius: 10px; display: block; min-width: 0; overflow: hidden; box-sizing: border-box; }
.app-mode-game #resultCard .result-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.app-mode-game #resultCard .saving-badge { white-space: nowrap; }
.app-mode-game #resultCard span { display: inline; margin: 0 5px 0 0; font-size: 10px; }
.app-mode-game #resultCard strong { font-size: 15px; }
.app-mode-game #resultCard .saving-badge { padding: 3px 8px; font-size: 11px; }
.app-mode-game #resultCard .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 0; }
.app-mode-game #resultCard .stat { min-width: 0; }
.app-mode-game #resultCard .kept-line { margin: 6px 0 0; overflow-wrap: anywhere; padding: 4px 7px; font-size: 11px; line-height: 1.35; }
.app-mode-game #resultCard .stat { padding: 2px 8px; border-radius: 8px; }

/* v2.118: in Game mode the slider and the target cards set the detail; "Find the smallest" is for 3D print (SHRINK IT clicks it), so its row is hidden there */
.app-mode-game .detail-row:has(#autoBtn) { display: none; }
