/* The options book (track.html): the member's trades as the numbers that matter for a premium
   seller, in the company page's grammar: a head, KPI tiles, chart cells, tables, and the web door
   for a new trade. Builds on app.css (kpis, co-chart) and lab.css (figures, tips, controls). */

.tk-who { display: flex; align-items: center; gap: 12px; font: 400 11px/1 var(--mono); text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tk-who:empty { display: none; } /* signed out: no gap held open before the theme button */
.tk-who a { padding-left: 12px; border-left: 1px dotted var(--guide); }
.tk-who b { color: var(--text); font-weight: 400; }
.tk-who a { color: var(--muted); text-decoration: none; }
.tk-who a:hover { color: var(--text); }

/* head: a dashboard's top, not a company page's */
.tk-head { padding-block: 28px 18px; }
.tk-title { margin: 8px 0 0; font-size: clamp(24px, 2.8vw, 34px); line-height: 1.05; }
.tk-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 28px; margin-top: 8px; }
.tk-head-row .lab-deck { margin: 0; font-size: 15px; max-width: 60ch; }
.tk-head-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 11px/1.6 var(--mono); text-transform: uppercase; color: var(--muted); }
.tk-head-meta b { color: var(--text); font-weight: 400; }
.tk-accounts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.tk-accounts .tk-label { font: 400 10.5px/1 var(--mono); text-transform: uppercase; color: var(--muted); }

/* sign-in */
.tk-signin { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; padding-block: 52px 56px; align-items: start; }
.tk-signin h1 { margin: 10px 0 0; font-size: clamp(36px, 5.4vw, 64px); line-height: 0.98; }
.tk-signin .lab-deck { margin-top: 18px; }
.tk-card { padding: 22px 24px 24px; border: var(--line) solid var(--stroke); border-radius: var(--card-radius); background: var(--surface); }
.tk-card h2 { margin: 0 0 6px; font: 600 18px/1.2 var(--sans); letter-spacing: -0.01em; }
.tk-card p { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.tk-card .btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 9px; }
.tk-card .btn svg { width: 16px; height: 16px; fill: currentColor; }
.tk-dev { margin-top: 18px; padding-top: 16px; border-top: 1px dotted var(--guide); }
.tk-dev form { display: flex; gap: 6px; margin-top: 8px; }
.tk-dev input { flex: 1; height: 32px; padding: 0 10px; border: var(--line) solid var(--stroke); border-radius: var(--radius); background: var(--bg); color: var(--text); font: 400 13px/1 var(--sans); min-width: 0; }
.tk-dev .btn { width: auto; }
.tk-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tk-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14px; color: var(--text); }
.tk-steps li i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: var(--line) solid var(--stroke-strong); font: 400 10.5px/1 var(--mono); font-style: normal; color: var(--muted); }
.tk-steps code { font: 400 12px/1.5 var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 3px; }

/* kpis: eight compact tiles */
.tk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tk-kpis .kpi { padding: 12px var(--pad) 13px; }
.tk-kpis .kpi b { margin-top: 4px; font-size: 26px; }
.tk-kpis .kpi i { margin-top: 3px; font-size: 11.5px; }
.tk-kpis .kpi:nth-child(5) { border-left-color: transparent; }
.tk-kpis .kpi:nth-child(n + 5) { border-top: 1px dotted var(--guide); }
.kpi b.pos { color: var(--cobalt); } .kpi b.neg { color: var(--cherry); }
.kpi .flat { color: var(--muted); }
@media (min-width: 1180px) {
  .tk-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .tk-kpis .kpi { padding-inline: 18px; }
  .tk-kpis .kpi b { font-size: 24px; }
  .tk-kpis .kpi:nth-child(5) { border-left-color: var(--guide); }
  .tk-kpis .kpi:nth-child(n + 5) { border-top: 0; }
}

/* positions tabs */
.tk-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 6px; }
.tk-tabs .tk-label { font: 400 10.5px/1 var(--mono); text-transform: uppercase; color: var(--muted); }

/* charts */
.tk-stage { min-height: 250px; }
.tk-empty { display: grid; place-items: center; min-height: 230px; padding: 24px; border: 1px dotted var(--guide); border-radius: var(--radius); font: 400 12px/1.6 var(--mono); text-transform: uppercase; color: var(--muted); text-align: center; background: var(--chart-bg); }
.lab-svg .tk-bar { transition: filter 0.2s; }
.lab-svg .tk-bar.on { filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.18)); }
.lab-svg .tk-tag rect { fill: var(--surface); stroke: var(--stroke); stroke-width: 1; }
.lab-svg .tk-tag text { font-size: 10.5px; fill: var(--text); font-variant-numeric: tabular-nums; }
.lab-svg .tk-rung { fill: color-mix(in oklab, var(--slate) 38%, var(--chart-bg)); }
.lab-svg .tk-rung.soon { fill: color-mix(in oklab, var(--vermilion) 42%, var(--chart-bg)); }
.lab-svg .tk-rung-p { fill: var(--cobalt); }
.lab-svg .tk-rung-p.neg { fill: var(--cherry); }
.lab-svg .tk-row.on .tk-rung { filter: brightness(0.94); }
.lab-svg .tk-rl { fill: var(--text); font-size: 11px; }
.lab-svg .tk-rl.dim { fill: var(--muted); }
.lab-svg .tk-zero { stroke: var(--muted); stroke-width: 1; }
.lab-svg .tk-neg-line { fill: none; stroke: var(--cherry); stroke-width: 2; stroke-linejoin: round; }

/* tables */
.tk-table { width: 100%; border-collapse: collapse; font: 400 13px/1.45 var(--sans); }
.tk-table th { text-align: left; padding: 8px 0 8px 16px; border-bottom: 1px dotted var(--guide); font: 400 10.5px/1.4 var(--mono); text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tk-table td { padding: 9px 0 9px 16px; border-bottom: 1px solid var(--rule-faint); vertical-align: top; font-variant-numeric: tabular-nums; }
.tk-table th:first-child, .tk-table td:first-child { padding-left: 0; }
.tk-table td.num, .tk-table th.num { text-align: right; white-space: nowrap; }
.tk-table .mono { font: 400 12px/1.5 var(--mono); }
.tk-table .pos { color: var(--cobalt); } .tk-table .neg { color: var(--cherry); }
.tk-table .tag { display: inline-block; padding: 2px 6px; border-radius: 3px; font: 400 10px/1.3 var(--mono); text-transform: uppercase; background: var(--bg); border: var(--line) solid var(--stroke); color: var(--muted); }
.tk-table .tag.open { color: var(--cobalt-deep); background: var(--cobalt-tint); border-color: transparent; }
.tk-table .tag.rolled { color: var(--slate-deep); background: var(--slate-tint); border-color: transparent; }
.tk-table .tag.expired { color: var(--mint-deep); background: var(--mint-tint); border-color: transparent; }
.tk-table .tag.closed { color: var(--eyebrow); }
.tk-table .tag.assigned { color: var(--burgundy-deep); background: var(--burgundy-tint); border-color: transparent; }
.tk-scroll { overflow-x: auto; }

/* the composer: a small chat, centred */
.tk-chatcell { padding-block: 34px 40px; }
.tk-chat { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }
.tk-chat h2 { margin: 6px 0 0; font-size: clamp(24px, 2.8vw, 34px); }
.tk-chat .lab-deck { margin: 0; font-size: 15px; }
.tk-thread { display: grid; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 6px 2px 2px; scrollbar-width: thin; }
.tk-thread:empty { display: none; }
.tk-msg { max-width: 86%; padding: 9px 13px; font: 400 14px/1.5 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-msg.member { justify-self: end; background: var(--ink); color: var(--on-ink); border-radius: 12px 12px 3px 12px; }
.tk-msg.book { justify-self: start; background: var(--surface); border: var(--line) solid var(--stroke); border-radius: 12px 12px 12px 3px; }
.tk-msg.book.ask { border-color: var(--stroke-strong); }
.tk-msg.book.pending { color: var(--muted); font-style: italic; }
.tk-msg.book.pending::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--vermilion); vertical-align: middle; animation: tk-pulse 1s ease-in-out infinite; }
@keyframes tk-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.tk-msg.book.cardmsg { max-width: 100%; width: 100%; padding: 14px 16px 14px; }
.tk-msg .note { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.tk-msg .state { display: inline-block; margin-top: 8px; font: 400 10.5px/1.3 var(--mono); text-transform: uppercase; color: var(--muted); }
.tk-msg .state.saved { color: var(--mint-deep); }
.tk-composer { display: grid; gap: 8px; }
.tk-composer textarea { width: 100%; min-height: 76px; padding: 10px 12px; border: var(--line) solid var(--stroke); border-radius: 8px; background: var(--surface); color: var(--text); font: 400 13.5px/1.5 var(--mono); resize: vertical; transition: border-color 0.15s, outline-color 0.15s; }
.tk-composer textarea:focus { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.tk-composer textarea.over { border-style: dashed; border-color: var(--text); }
.tk-composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tk-hint { flex: 1 1 220px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.tk-attach { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: var(--line) solid var(--stroke); border-radius: var(--radius); font: 400 11px/1.4 var(--mono); color: var(--text); background: var(--surface); }
.tk-attach button { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 2px; }
.tk-attach button:hover { color: var(--text); }
.tk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-chips .seg-b { height: 24px; padding: 0 9px; font-size: 10.5px; }
.tk-chips .seg-pill { height: 24px; }
.tk-chip-add { height: 26px; padding: 0 9px; border: var(--line) dashed var(--stroke-strong); border-radius: var(--radius); background: transparent; color: var(--muted); font: 400 10.5px/1 var(--mono); text-transform: uppercase; cursor: pointer; }
.tk-chip-add:hover { color: var(--text); border-color: var(--text); }
.tk-newacct { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-newacct input { height: 28px; padding: 0 9px; border: var(--line) solid var(--stroke); border-radius: var(--radius); background: var(--surface); color: var(--text); font: 400 12px/1 var(--mono); min-width: 0; width: 140px; }
.tk-newacct input:focus { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.tk-newacct .btn { height: 28px; padding: 0 10px; }
.tk-cardbox { padding: 0; border: 0; background: none; }
.tk-cardbox.dup { opacity: 0.85; }
.tk-cardbox p { margin: 0 0 6px; font: 400 13px/1.55 var(--sans); white-space: normal; }
.tk-cardbox p.title { font: 600 15px/1.3 var(--sans); margin-bottom: 10px; }
.tk-cardbox pre { margin: 4px 0 10px; padding: 10px 12px; border-radius: 4px; background: var(--bg); font: 400 12px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.tk-cardbox .warn { color: var(--vermilion-deep); }
.tk-cardbox .src { color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tk-revise { display: grid; gap: 8px; margin-top: 12px; }
.tk-revise textarea { width: 100%; min-height: 72px; padding: 8px 10px; border: var(--line) solid var(--stroke); border-radius: 6px; background: var(--bg); color: var(--text); font: 400 12.5px/1.5 var(--mono); resize: vertical; }
.tk-in { flex: 1; min-width: 120px; height: 30px; padding: 0 9px; border: var(--line) solid var(--stroke); border-radius: var(--radius); background: var(--bg); color: var(--text); font: 400 12px/1 var(--mono); }
.tk-in:focus, .tk-revise textarea:focus { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.tk-msgline { font: 400 13px/1.55 var(--sans); color: var(--muted); }
.tk-msgline.bad { color: var(--cherry); }
/* statement import */
.tk-import-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--stroke-strong); border-radius: 8px; font: 400 11px/1.5 var(--mono); text-transform: uppercase; color: var(--muted); cursor: pointer; background: transparent; }
.tk-import-strip.over, .tk-import-strip:hover { border-color: var(--text); color: var(--text); }
.tk-import-strip input { display: none; }
.tk-import { display: grid; gap: 12px; padding: 16px 18px 18px; border: var(--line) solid var(--stroke); border-radius: var(--card-radius); background: var(--surface); }
.tk-import[hidden] { display: none; }
.tk-sub { margin: 0; font: 600 15px/1.3 var(--sans); letter-spacing: -0.01em; }
.tk-import-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.tk-files { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.tk-files li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12px; }
.tk-filestate { font: 400 10.5px/1.5 var(--mono); text-transform: uppercase; color: var(--muted); }
.tk-filestate.busy { color: var(--vermilion-deep); }
.tk-filestate.ok { color: var(--mint-deep); }
.tk-filestate.bad { color: var(--cherry); }
.tk-preview { display: grid; gap: 12px; padding-top: 10px; border-top: 1px dotted var(--guide); }
.tk-preview-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tk-preview-table tr.tk-month td { padding-top: 14px; font: 400 10.5px/1.4 var(--mono); text-transform: uppercase; color: var(--text); border-bottom: 1px dotted var(--guide); }
.tk-preview-table tr.dup td { color: var(--muted); }
.tk-preview-table input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--ink); }
.tk-flag { display: inline-block; margin-left: 4px; color: var(--vermilion-deep); }
.tk-skipped summary { cursor: pointer; font: 400 11px/1.5 var(--mono); text-transform: uppercase; color: var(--muted); }
.tk-skipped ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.tk-undo { height: 26px; padding: 0 10px; font-size: 10.5px; }
[data-imports] { margin-top: 28px; display: grid; gap: 10px; }
.btn-outline { background: transparent; color: var(--text); border: var(--line) solid var(--stroke-strong); }
.btn-outline:hover { border-color: var(--text); }
.btn-danger { background: transparent; color: var(--cherry); border: var(--line) solid var(--stroke); }
.btn-danger:hover { border-color: var(--cherry); }
.btn[disabled] { opacity: 0.5; cursor: progress; }

@media (max-width: 960px) {
  .tk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-kpis .kpi:nth-child(odd) { border-left-color: transparent; }
  .tk-kpis .kpi:nth-child(even) { border-left-color: var(--guide); }
  .tk-kpis .kpi:nth-child(n + 3) { border-top: 1px dotted var(--guide); }
  .tk-signin { grid-template-columns: 1fr; }
}
/* the nav's middle cell holds four links: the "signed in as" label only fits on wide screens */
@media (max-width: 1100px) {
  .tk-who span { display: none; }
  .tk-who a { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .tk-kpis .kpi { padding-inline: 14px; }
  .tk-kpis .kpi b { font-size: 22px; }
  .tk-msg { max-width: 94%; }
  .tk-thread { max-height: 56vh; }
  .tk-hint { flex-basis: 100%; }
}
