/* The desk: the screen behind "Open your desk". Loaded after style.css and made of the same materials:
   lit paper ground, dark anodised panels, ice anodised controls, engraved lines instead of boxes. */
:root {
  --engr: 0 1px 0 #8ae3f51c;
  --engr-line: #010b0dd9;
  --well: #02131799;
  --well-in: inset 0 2px 6px #00000080;
}
.app .top { gap: 30px; }
.app .nav { gap: 28px; }
.acct { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; color: var(--fg-1); transition: color 180ms ease; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--fg-3); transition: background-color 240ms ease, border-color 240ms ease; }
.acct.is-live .acct-dot { background: var(--ice); border-color: var(--ice); }
.acct span { font-variant-numeric: tabular-nums; }
.text-btn { color: var(--ice); font-weight: 500; font-size: 15px; transition: color 180ms ease; }
@media (hover: hover) and (pointer: fine) { .acct:hover, .text-btn:hover { color: var(--fg); } }

.dk { padding-block: 8px 72px; opacity: 0; transition: opacity 420ms ease; }
html[data-ready] .dk { opacity: 1; }

/* ---------- what this desk shows ---------- */
.dk-mode { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 32px; padding-block: 14px 16px; border-bottom: 1px solid var(--engr-line); box-shadow: var(--engr); }
.dk-mode p { flex: 1 1 22em; max-width: 44em; font-size: 15px; line-height: 1.5; color: var(--fg-1); text-wrap: pretty; }
.dk-mode p b { font-weight: 500; color: var(--fg); }
.dk-mode-ctl { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.dk-mode-ctl[hidden] { display: none; }
.field-in { flex-direction: row; align-items: center; gap: 10px; }
.field-in .money { height: 42px; width: 132px; border-radius: 13px; padding-inline: 13px; }
.field-in .money i { font-size: 17px; }
.field-in .money input { font-size: 17px; }
.field-in .seg { height: 42px; width: 328px; border-radius: 13px; }
.field-in .seg button, .field-in .seg-pill { border-radius: 10px; }
.field-in .seg button { font-size: 13.5px; }

/* ---------- the total ---------- */
.dk-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 48px; align-items: end; padding-block: 44px 34px; }
.dk-label { font-size: 17px; font-weight: 300; color: var(--fg-1); }
.dk-fig { display: inline-block; margin-top: 4px; padding-right: 0.06em; font-size: clamp(76px, 9.4vw, 152px); line-height: 0.94; font-weight: 200; letter-spacing: -0.05em; background: var(--sheen); -webkit-background-clip: text; background-clip: text; color: transparent; transition: filter 200ms ease, opacity 200ms ease; }
.dk-fig.is-swapping { filter: blur(4px); opacity: 0.5; }
.dk-live { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 16px; color: var(--fg-1); }
.dk-live b { font-weight: 500; color: var(--fg); }
.dk-live .live-dot { margin-right: 10px; }
.dk-today { padding-bottom: 4px; }
.dk-today .cells { margin-top: 14px; }
.dk-today .cells .hr { height: 40px; }
.dk-today-sum { margin-top: 12px; font-size: 14.5px; color: var(--fg-2); }
.dk-today-sum b { font-weight: 500; color: var(--fg); }

.dk-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--engr-line); box-shadow: inset 0 1px 0 #8ae3f51c; }
.stat { display: flex; flex-direction: column; gap: 5px; padding: 18px 20px 4px 0; text-align: left; min-width: 0; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat > span { font-size: 13.5px; color: var(--fg-2); }
.stat > b { font-size: clamp(24px, 2.3vw, 34px); line-height: 1.1; font-weight: 300; letter-spacing: -0.03em; color: var(--fg); transition: color 200ms ease; }
.stat > small { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-go { cursor: pointer; transition: transform 160ms var(--ease-out); }
.stat-go > span::after { content: "→"; display: inline-block; margin-left: 6px; color: var(--fg-3); transition: transform 220ms var(--ease-out), color 200ms ease; }
.stat-go:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .stat-go:hover > b { color: var(--ice); } .stat-go:hover > span::after { transform: translateX(3px); color: var(--ice); } }

/* ---------- chart and rail ---------- */
.dk-main { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 44px; align-items: start; margin-top: 36px; }
.dk-chart, .dk-pay { padding: clamp(18px, 2.2vw, 32px); }
.dk-chart-head, .dk-pay-head { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; }
.dk-chart-head h2, .dk-pay-head h2 { font-size: 26px; font-weight: 300; line-height: 1.1; letter-spacing: -0.025em; }
.dk-pay-head p { margin-top: 4px; font-size: 14.5px; color: var(--fg-2); }
.dk-chart .seg { height: 44px; width: 356px; border-radius: 14px; }
.dk-chart .seg button { font-size: 13.5px; }
.dk-left { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.dk-chart .chart { height: 440px; margin-top: 20px; cursor: crosshair; }
.chart .sel { stroke: var(--ice); stroke-width: 1; opacity: 0.55; shape-rendering: crispEdges; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-2); font-size: 15px; text-align: center; }
.chart-empty[hidden] { display: none; }
.inspect-7 { grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr)); }
.inspect-7 > div { padding: 13px 14px; min-width: 0; }
.inspect b { transition: color 160ms ease; }

.dk-rail { display: flex; flex-direction: column; }
.rb { padding-block: 26px; border-top: 1px solid var(--engr-line); box-shadow: inset 0 1px 0 #8ae3f51c; }
.rb:first-child { border-top: 0; box-shadow: none; padding-top: 4px; }
.rb[hidden] { display: none; }
.rb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.rb-head h3 { font-size: 21px; font-weight: 400; letter-spacing: -0.01em; }
.rb-head span { font-size: 13.5px; color: var(--fg-3); text-align: right; }
.rb .seg { width: 100%; }
.seg button:disabled { opacity: 0.32; cursor: not-allowed; }
.gauge-line[hidden] { display: none; }
.rb-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.btn-ano { height: 48px; padding-inline: 18px; font-size: 15px; color: var(--fg); background: linear-gradient(180deg, #134350 0%, #0a2b35 100%); box-shadow: inset 0 1px 0 #8ae3f559, inset 0 -1px 0 #00000080, 0 12px 22px -16px #000000; }
@media (hover: hover) and (pointer: fine) { .btn-ano:hover { background: linear-gradient(180deg, #1a5565 0%, #0d3541 100%); } }
.rb-note { margin-top: 14px; font-size: 13.5px; line-height: 1.55; color: var(--fg-3); text-wrap: pretty; }
.rb-note[hidden], .rb-btns[hidden] { display: none; }

.pos-state.is-on { color: var(--ice); }
.pos-state.is-off { color: var(--down); }
.scale { display: grid; grid-template-columns: 1fr 2px 1fr; align-items: center; height: 28px; }
.scale-side { position: relative; height: 12px; background: var(--well); box-shadow: var(--well-in); overflow: hidden; }
.scale-short { border-radius: 6px 0 0 6px; }
.scale-held { border-radius: 0 6px 6px 0; }
.scale-side u { position: absolute; inset: 0; transform: scaleX(0); transition: transform 600ms var(--ease-out); }
.scale-short u { transform-origin: right; background: linear-gradient(180deg, #d5e3e7 0%, #8fa9b0 100%); }
.scale-held u { transform-origin: left; background: var(--anodised); }
.scale-pin { height: 28px; border-radius: 1px; background: var(--fg); }
.scale-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--fg-3); }
.rows { margin-top: 14px; }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 14.5px; }
.rows dt { color: var(--fg-2); white-space: nowrap; }
.rows dd { text-align: right; font-variant-numeric: tabular-nums; }
.rows dd b { font-weight: 500; }
.rows dd span { display: block; font-size: 12.5px; color: var(--fg-3); }
.rows dd span:empty { display: none; }

.rb-fig { display: flex; align-items: baseline; gap: 10px; }
.rb-fig .fig { font-size: 46px; line-height: 1; font-weight: 200; background: var(--sheen); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rb-fig span { font-size: 14.5px; color: var(--fg-2); }
.gauge { position: relative; height: 12px; margin-top: 16px; border-radius: 6px; background: var(--well); box-shadow: var(--well-in); }
.gauge i { display: block; height: 100%; width: 0; max-width: 100%; border-radius: 6px; background: var(--anodised); box-shadow: var(--anodised-edge); transition: width 600ms var(--ease-out); }
.gauge.is-hot i { background: linear-gradient(160deg, #ffc2b6, #ff9c8a 50%, #e97e6b); }
.gauge-line { position: absolute; left: 90%; top: -5px; bottom: -5px; width: 2px; border-radius: 1px; background: var(--fg); opacity: 0.8; }
.gauge-l { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 12.5px; color: var(--fg-3); }
.gauge-l span:first-child { color: var(--fg); }

.key-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; border-top: 1px solid var(--line); font-size: 14.5px; }
.key-list li span { color: var(--fg-2); }
.key-list b { font-weight: 500; }
.key-list code { font: 400 12.5px var(--mono); color: var(--fg); }
.key-list .yes { color: var(--ice); }
.key-list .no { color: var(--down); }

.kp-log { margin-top: 14px; }
.kp-log li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding-block: 9px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--fg-2); }
.kp-log time { font: 400 12px var(--mono); color: var(--fg-3); padding-top: 1px; }
.kp-log b { font-weight: 500; color: var(--fg); }
.kp-log .is-halt b { color: var(--down); }
.step-btn { margin-top: 12px; }
.step-btn[hidden], .step-seg[hidden] { display: none; }
.step-btn:disabled { opacity: 0.5; cursor: progress; }
.step-seg { margin-top: 12px; width: 100%; height: 44px; border-radius: 14px; }

/* ---------- payments ---------- */
.dk-pay .coupons { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.coupon time { display: flex; justify-content: space-between; align-items: center; }
.coupon time i { width: 2px; height: 9px; border-radius: 1px; background: currentColor; opacity: 0.85; }
.chart-key[hidden], .chart-key [hidden] { display: none; }
.chart .brk { stroke: #062730; stroke-width: 2; }
.dk-pay .ledger-day { margin-top: 22px; }
.dk-pay .ledger-day h3 { font-size: 26px; }
button.coupon { text-align: left; cursor: pointer; transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
.coupon:active { transform: scale(0.97); }
.coupon.is-sel { box-shadow: inset 0 0 0 1.5px var(--ice), 0 14px 22px -16px #8ae3f5; }
.coupon.is-none { border: 1px solid var(--line); color: var(--fg-3); }
.coupon.is-none b { font-size: 13.5px; font-weight: 400; letter-spacing: 0; }
.dk-pay .table { min-width: 800px; font-size: 14.5px; }
.dk-pay .table td { padding-left: 12px; }
.dk-pay .table tbody tr { cursor: pointer; }
.dk-pay .table tbody tr.is-sel td { background: #8ae3f512; }
.dk-pay .table td:last-child { color: inherit; font-size: inherit; width: auto; font-weight: 500; }
.dk-foot { margin-top: 26px; font-size: 13.5px; color: var(--fg-3); }

/* ---------- sheets ---------- */
.grab { display: none; }
.view { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.view label { display: block; font-size: 14.5px; color: var(--fg-2); }
.view-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.well { height: 48px; min-width: 0; padding-inline: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--well); box-shadow: var(--well-in); font: 400 13.5px var(--mono); color: var(--fg); outline: 0; transition: border-color 180ms ease; }
.well:focus { border-color: var(--ice); }
.well::placeholder { color: var(--fg-3); }
.view-err { margin-top: 8px; font-size: 13.5px; color: var(--down); }
.view-err[hidden] { display: none; }
.sheet-plan h2 { font-size: 38px; padding-right: 48px; }
.plan-amount { margin-top: 18px; flex-direction: row; align-items: center; gap: 12px; font-size: 15px; }
.plan-amount[hidden] { display: none; }
.orders { margin-top: 18px; counter-reset: o; }
.orders li { counter-increment: o; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-block: 13px; border-top: 1px solid var(--line); font-size: 15px; }
.orders li::before { content: counter(o); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(160deg, #0d3a45, #03191d); box-shadow: inset 0 1px 0 #8ae3f54d; color: var(--ice); font-size: 12.5px; font-weight: 600; }
.orders b { font-weight: 500; }
.orders span { color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-after { margin-top: 0; border-bottom: 1px solid var(--line); }
.plan-go { width: 100%; margin-top: 20px; }
.plan-go:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.plan-go[hidden] { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .dk-head { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .dk-main { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  /* One column: the position comes straight after the chart, the ledger last. */
  .dk-left { display: contents; }
  .dk-rail { order: 2; }
  .dk-pay { order: 3; }
  .dk-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; }
  .rb:nth-child(2) { border-top: 0; box-shadow: none; padding-top: 4px; }
}
@media (max-width: 760px) {
  .acct { display: none; }
  .app .top .btn { margin-left: auto; }
  .dk-mode { padding-block: 12px 14px; }
  .dk-mode p { font-size: 14px; }
  .dk-mode-ctl { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; }
  .dk-mode-ctl .field-in { width: 100%; flex: none; }
  .field-in > span:first-child { width: 62px; flex: none; }
  .field-in .money, .field-in .seg { flex: 1; width: auto; }
  .dk-head { padding-block: 30px 26px; gap: 26px; }
  .dk-label { font-size: 16px; }
  .dk-fig { font-size: clamp(60px, 19vw, 84px); }
  .dk-live { font-size: 15px; }
  .dk-today .cells .hr { height: 30px; }
  .dk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 12px 12px 0; }
  .stat:first-child { grid-column: 1 / -1; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(odd):not(:first-child) { padding-left: 16px; border-left: 1px solid var(--line); }
  .stat > b { font-size: 28px; }
  .dk-main { margin-top: 26px; }
  .dk-chart .seg { width: 100%; }
  .dk-chart .chart { height: 320px; }
  .dk-chart-head h2, .dk-pay-head h2 { font-size: 23px; }
  .inspect-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inspect-7 > div:first-child { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: baseline; }
  .inspect-7 > div { border-left: 0; padding: 11px 12px; }
  .inspect-7 > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .inspect-7 > div:nth-child(3), .inspect-7 > div:nth-child(4), .inspect-7 > div:nth-child(6), .inspect-7 > div:nth-child(7) { border-left: 1px solid var(--line); }
  .inspect-7 b { font-size: 14.5px; }
  .dk-rail { grid-template-columns: minmax(0, 1fr); }
  .rb:nth-child(2) { border-top: 1px solid var(--engr-line); box-shadow: inset 0 1px 0 #8ae3f51c; padding-top: 26px; }
  .dk-left { gap: 28px; }
  .dk-pay .coupons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--fg-3); opacity: 0.6; margin: -14px auto 16px; }
  .sheet { touch-action: pan-y; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
  .sheet.is-dragging { transition: none; }
  .sheet-plan h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .dk { transition: none; }
  .scale-side u, .gauge i { transition-duration: 1ms; }
}
