:root { --ink: #111827; --muted: #5b6474; --line: #e5e7eb; --bg: #f5f7fb; --card: #fff; --good: #137a43; --bad: #b42318; --accent: #1d4ed8; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", -apple-system, sans-serif; }
a { color: var(--accent); font-weight: 600; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header { background: #0d1b3e; color: #fff; }
.bar { display: flex; gap: 14px; align-items: center; min-height: 54px; flex-wrap: wrap; }
.bar b { font-size: 17px; }
.bar span { opacity: .8; margin-right: auto; }
.bar a { color: #fff; padding: 10px 0; }
main { padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0 0 16px; }
.narrow { max-width: 460px; margin: 40px auto; }
h1 { font-size: 24px; margin: 0 0 6px; } h2 { font-size: 18px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
input { font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; width: 100%; min-height: 44px; }
button { font: inherit; font-weight: 700; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; margin-top: 10px; min-height: 44px; cursor: pointer; }
.err { color: var(--bad); font-weight: 600; min-height: 1.3em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tile b { display: block; font-size: 22px; } .tile span { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 170px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.good { color: var(--good); font-weight: 700; } .bad { color: var(--bad); font-weight: 700; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: #eef2ff; color: #3730a3; font-weight: 700; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.calc label { font-size: 13px; font-weight: 600; }
.calc-out { font-size: 17px; margin: 14px 0 0; }
.calc-block + .calc-block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.calc-block h3 { margin: 0 0 10px; font-size: 17px; }
.calc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.calc-actions .chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-height: 44px; }
.calc-actions .chk input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.looks { display: flex; flex-wrap: wrap; gap: 8px; }
.looks a { border: 1.5px solid var(--line); border-radius: 99px; padding: 9px 14px; text-decoration: none; }
.looks a.on { border-color: var(--accent); background: #eef2ff; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 6px 0 12px; }
.switch input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.field { display: block; margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.field input { margin-top: 4px; }
/* shop order (drag and drop) */
.olist { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.oitem { position: relative; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; cursor: grab; user-select: none; }
.oitem.dragging { opacity: .4; }
.oitem.over { border-color: var(--accent); box-shadow: 0 0 0 3px #e0e7ff; }
.oitem .num { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
.oitem .pic { aspect-ratio: 1 / 1.1; background: #f1f3f8; border-radius: 8px; overflow: hidden; }
.oitem .pic svg, .oitem .pic img { width: 100%; height: 100%; display: block; pointer-events: none; }
.oitem b { display: block; font-size: 13px; line-height: 1.25; margin: 6px 0 2px; }
.oitem .small { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.oitem .arrows { display: flex; gap: 6px; margin-top: 6px; }
.oitem .arrows button { flex: 1; min-height: 44px; margin: 0; padding: 0; font-size: 18px; }
.oitem .arrows button:disabled { opacity: .35; cursor: default; }
button.ghost { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
/* shop filter names preview */
.lpreview { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.lpreview span { border: 1.5px solid var(--line); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; background: #fff; }
.lpreview span.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lpreview i { width: 100%; height: 0; }
/* bundles + discount codes */
.bset[hidden] { display: none; }
.row-inline { display: flex; gap: 6px; }
.row-inline input { flex: 1; }
.row-inline button { margin-top: 4px; min-height: 40px; padding: 0 12px; }
dialog#cdDialog { border: 0; border-radius: 16px; padding: 22px; max-width: 640px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog#cdDialog::backdrop { background: rgba(15,20,30,.45); }
#cdTable td button { margin: 0; min-height: 34px; padding: 4px 10px; font-size: 13px; }
label.inline { font-weight: 500; }
.calc select { display: block; width: 100%; margin-top: 4px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: #fff; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; font-weight: 500; }
label.inline input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--accent); }

/* S51: minimize panels */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h2 { margin-bottom: 8px; }
.min-btn { background: #fff; color: var(--accent); border: 1.5px solid var(--line); padding: 6px 14px; margin: -4px 0 0; min-height: 44px; font-size: 14px; flex: none; }
.min-btn:hover { border-color: var(--accent); }
.card.min { padding-top: 12px; padding-bottom: 12px; }
.card.min > :not(.card-head) { display: none; }
.card.min .card-head h2 { margin: 0; align-self: center; }
.panel-tools { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.panel-tools .ghost { margin: 0; }
/* S57: Dashboard / Settings tabs and the money charts */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { flex: none; white-space: nowrap; }
.tab-intro { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 0.95em; }
.tabs button { margin: 0; background: transparent; color: var(--muted); border-radius: 10px 10px 0 0; border-bottom: 3px solid transparent; padding: 10px 16px; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.dash-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 4px 0 8px; }
.dash-tools select { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; min-height: 40px; margin-left: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { margin: 0; background: #fff; color: var(--accent); border: 1.5px solid var(--accent); padding: 8px 12px; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chart { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: #9aa1ad; stroke-width: 1; }
.chart .cross { stroke: #9aa1ad; stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .dot { stroke: var(--card); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top-style: dashed; }
.readout { font-size: 13px; min-height: 1.5em; margin: 6px 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 4px 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.mini { margin: 0 0 0 6px; padding: 4px 10px; min-height: 36px; font-size: 13px; }
.calc[hidden] { display: none; }
.card .tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 8px; }
.steps { margin: 6px 0 0; padding-left: 20px; } .steps li { margin: 0 0 8px; }
#order select { display: block; margin-top: 4px; font: inherit; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; min-height: 44px; }
/* S63: Pause orders bar, always above the tabs */
.pause-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; }
.pause-bar > div { display: flex; flex-direction: column; margin-right: auto; }
.pause-bar b { font-size: 17px; } .pause-bar .pause-msg { flex: 1 1 260px; font-size: 13px; font-weight: 600; }
.pause-bar .pause-msg input { margin-top: 4px; min-height: 40px; padding: 8px 10px; }
.pause-bar button { margin: 0; }
.pause-bar.paused { background: #fdecec; border-color: var(--bad); }
.pause-bar.paused b { color: var(--bad); }
.pause-bar.paused button { background: var(--good); }
