/* Hidden1 app (/app): draft A's timetable model. One precise table per screen; the chosen row opens inside
   it. Calm: nothing moves unless you act or a real state changes (a step starts, a quote arrives). */

.loadline { font-family: var(--font-mono); font-size: 13px; color: var(--muted); min-height: 20px; margin: 0 0 16px; overflow-wrap: anywhere; }
.loadline b { color: var(--fg-2); font-weight: 400; margin-right: 6px; }
.problems ul { margin: 6px 0 10px; padding-left: 20px; color: var(--fg-2); font-size: 15px; }
.problems li { margin: 4px 0; }

main [hidden] { display: none !important; }

/* screens */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-strong); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs [role=tab] { position: relative; min-height: 44px; padding: 0 16px; background: transparent; border: 0; color: var(--fg-2); font-family: var(--font-mono); font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard); }
.tabs [role=tab]:hover { color: var(--fg); background: var(--surface); }
.tabs [role=tab][aria-selected=true] { color: var(--fg); }
.tabs [role=tab][aria-selected=true]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); }
.tabs [role=tab]:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.tabs .count { color: var(--muted); margin-left: 6px; }
.view[hidden] { display: none; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.bar .caption { margin: 0; }
.h2.sub2 { font-size: var(--text-lg); margin: 36px 0 10px; }

/* the table and its opening rows */
.app-t tr.row { cursor: pointer; }
.app-t tr.row.static { cursor: default; }
.app-t tr.row.open { background: var(--surface-2); }
.app-t tr.row td.id small.sub { color: var(--muted); margin-left: 8px; font-size: 13px; }
.app-t tr.row td small.third { color: var(--signal); }
.app-t tr.row td.id, .app-t tr.row td.c-author { white-space: normal; line-height: 1.3; }
.app-t tr.row td.c-author small { display: block; margin-top: 2px; }
.app-t tr.row.note td { height: auto; min-height: 40px; padding-top: 10px; padding-bottom: 10px; white-space: normal; line-height: 1.45; }
.app-t td.ch { padding-right: 4px !important; }
.chev { width: 44px; height: 44px; background: none; border: 0; color: var(--fg-2); cursor: pointer; font-size: 16px; transition: transform 0.25s var(--ease-out), color var(--motion-fast); }
.chev:hover { color: var(--fg); }
tr.row.open .chev { transform: rotate(90deg); color: var(--fg); }
.chev:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.app-t tbody.grp th { height: 40px; text-align: left; font-weight: 400; font-size: 14px; color: var(--fg-2); padding: 18px 12px 6px; border-bottom: 1px solid var(--border); }
.app-t tbody.grp th span { color: var(--muted); margin-left: 10px; }
.app-t tr.empty td { padding: 32px 12px !important; border-bottom: 1px solid var(--border); white-space: normal; }
.app-t tr.empty b { display: block; color: var(--fg); font-weight: 400; font-size: 16px; margin-bottom: 4px; }
.app-t tr.empty p { color: var(--muted); font-size: 14px; margin: 0 0 14px; max-width: 64ch; }
tr.det > td { padding: 0 !important; border-bottom: 1px solid var(--border-strong); background: var(--surface); white-space: normal; }
.det-in { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.26s cubic-bezier(0.215, 0.61, 0.355, 1); }
tr.det.open .det-in { grid-template-rows: 1fr; }
.det-in > div { overflow: hidden; min-height: 0; }
tr.det:not(.open) .det-body { visibility: hidden; }
tr.det.open .det-body { visibility: visible; }

/* a run panel: amount and quote | trail check | prove and run */
.panel { display: grid; grid-template-columns: 1.05fr 1fr 1fr; }
.panel.one { grid-template-columns: 1fr; }
.panel > section { padding: 22px 24px 26px; border-right: 1px solid var(--border); min-width: 0; }
.panel > section:last-child { border-right: 0; }
.panel h3 { font-size: 14px; color: var(--muted); font-weight: 400; margin: 0 0 14px; display: flex; justify-content: space-between; gap: 12px; }
.panel h3 b { font-weight: 400; color: var(--fg); font-family: var(--font-mono); }
.panel .touch { font-size: 14px; color: var(--fg-2); margin: 10px 0 0; line-height: 1.5; }
.panel .field { margin-top: 12px; }
.amt { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--border-strong); padding-bottom: 6px; }
.amt input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-family: var(--font-mono); font-weight: 300; font-size: 34px; color: var(--fg); padding: 0; font-variant-numeric: tabular-nums; }
.amt:focus-within { border-bottom-color: var(--fg); }
.amt .unit { font-family: var(--font-mono); font-size: 16px; color: var(--fg-2); }
.panel .hint { min-height: 20px; margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); margin: 4px 0 14px; }
.seg button { min-height: 44px; padding: 0 14px; background: transparent; border: 0; color: var(--fg-2); cursor: pointer; font-family: var(--font-mono); font-size: 14px;
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed=true] { background: var(--fg); color: var(--accent-on); }
.seg button:hover:not([aria-pressed=true]) { background: var(--surface-2); color: var(--fg); }
.seg button:active { transform: scale(0.97); }
.quote { min-height: 120px; transition: opacity var(--motion-fast) var(--ease-standard); }
.quote.stale { opacity: 0.55; }
.quote .k { font-size: 14px; color: var(--fg-2); margin: 0; }
.quote .big { font-family: var(--font-mono); font-weight: 300; font-size: 30px; color: var(--fg); margin: 2px 0 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quote .big .unit { font-size: 16px; color: var(--fg-2); }
.quote .details { font-size: 13px; color: var(--muted); margin: 0 0 6px; font-family: var(--font-mono); overflow-wrap: anywhere; }
.panel .src { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.panel .src.err { color: var(--fg); }

/* the trail check: the one signal colour means "this can be linked to you" */
.verdict { font-size: var(--text-lg); color: var(--fg); margin: 0 0 8px; }
.verdict.risk { color: var(--signal); }
.verdict small { display: block; font-size: 14px; color: var(--fg-2); margin-top: 4px; line-height: 1.45; }
ul.trail, ul.sugg { list-style: none; margin: 0 0 8px; padding: 0; font-size: 14px; }
ul.trail li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
ul.trail .tag { font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); }
ul.trail li.risk .tag { color: var(--signal); }
ul.trail .why { color: var(--fg-2); }
ul.sugg li { padding: 6px 0 6px 14px; position: relative; color: var(--fg-2); }
ul.sugg li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0 2px; min-height: 24px; color: var(--fg); font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.linkbtn:hover { color: var(--muted); }
.linkbtn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* proving steps */
.runbox { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.runbox .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.stepline { font-size: 13px; color: var(--muted); margin: 0; }
ol.steps { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
ol.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 0; color: var(--muted); }
ol.steps li .m { font-family: var(--font-mono); display: inline-flex; align-items: center; height: 20px; }
ol.steps li.done { color: var(--fg-2); }
ol.steps li.done .m::before { content: "✓"; color: var(--fg); }
ol.steps li.now { color: var(--fg); }
ol.steps li.now .m::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.9s linear infinite; }
ol.steps li.fail { color: var(--fg); }
ol.steps li.fail .m::before { content: "✕"; color: var(--signal); }
ol.steps li.wait .m::before { content: "·"; }
@keyframes spin { to { transform: rotate(360deg); } }
.outcome { margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--border-strong); font-size: 14px; color: var(--fg); overflow-wrap: anywhere; }
.outcome a, .outcome code { color: var(--fg); font-family: var(--font-mono); }
.outcome.warn { border-color: rgba(234, 179, 8, 0.5); }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* publish */
.pub { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; max-width: 760px; }
.pub .field { flex: 1 1 320px; }
#pubDraft .field { max-width: 520px; margin: 4px 0 8px; }
.pubrow { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pubrow .field { flex: 1 1 200px; max-width: 360px; }
.acc select, .acc input[type=text] { width: 100%; min-height: 40px; background: var(--bg); border: 1px solid var(--border-strong); color: var(--fg); font-family: var(--font-mono); font-size: 13px; padding: 0 8px; border-radius: 0; }
.acc td { white-space: normal !important; }
pre.logs { margin: 8px 0 0; padding: 10px 12px; background: var(--bg-deep); border: 1px solid var(--border); font-size: 12px; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }

/* this page's own requests */
.ledger { margin-top: 40px; border-top: 1px solid var(--border); }
.ledger summary { list-style: none; cursor: pointer; font-size: 14px; color: var(--muted); min-height: 44px; display: flex; align-items: center; justify-content: space-between; max-width: 760px; }
.ledger summary::-webkit-details-marker { display: none; }
.ledger summary b { color: var(--fg); font-weight: 400; font-family: var(--font-mono); }
.ledger summary:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.ledger .sum { font-size: 14px; color: var(--fg-2); max-width: 86ch; margin: 0 0 8px; }
.ledger ol { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; max-width: 760px; }
.ledger li { font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); padding: 4px 0; border-top: 1px solid var(--border); }
.ledger li em { font-style: normal; color: var(--muted); }

@media (max-width: 1180px) {
  .panel { grid-template-columns: 1fr 1fr; }
  .panel > section:last-child { grid-column: span 2; border-top: 1px solid var(--border); border-right: 0; }
  .c-prog, .c-runs, .c-src, .c-hooks, .c-rel { display: none; }
}
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; }
  .panel > section { border-right: 0; border-bottom: 1px solid var(--border); padding: 18px 16px 20px; }
  .panel > section:last-child { grid-column: auto; border-bottom: 0; }
  table.tt.app-t { min-width: 0; }
  .app-t, .app-t tbody { display: block; }
  .app-t colgroup, .app-t thead { display: none; }
  .app-t tr.row { display: flex; align-items: center; gap: 8px; min-height: 52px; height: auto; border-bottom: 1px solid var(--border); padding: 4px 0; }
  .app-t tr.row td { border-bottom: 0; padding: 0 6px; }
  .app-t tr.row td.id { flex: 1; min-width: 0; white-space: normal; }
  .app-t tr.row td.c-author, .app-t tr.row td.c-q, .app-t tr.row td.c-prog, .app-t tr.row td.c-runs, .app-t tr.row td.c-src { display: none; }
  .app-t tr.row td.ch { margin-left: auto; }
  #tBal tr.row.static { flex-wrap: wrap; }
  #tAct tr.row td:nth-child(3), #tAct tr.row td:nth-child(6) { display: none; }
  #tSeats tr.row[data-seat] td:nth-child(3), #tSeats tr.row[data-seat] td:nth-child(4), #tSeats tr.row[data-seat] td:nth-child(5), #tSeats tr.row[data-seat] td:nth-child(6) { display: none; }
  #tSeats tr.row[data-seat] td.id { flex: 1; }
  #tBal tr[data-street] td.id { flex: none; }
  #tBal tr[data-street] td.c-io { flex: 1; min-width: 0; white-space: normal; }
  #tBal tr[data-street] td.r.mono { display: none; }
  #tAct tr.row { flex-wrap: wrap; }
  .app-t tr.det, .app-t tr.det > td, .app-t tr.empty, .app-t tr.empty td, .app-t tbody.grp tr, .app-t tbody.grp th { display: block; }
  .app-t tbody.grp th { height: auto; }
  .amt input { font-size: 28px; }
  .tabs [role=tab] { padding: 0 8px; font-size: 13px; }
  .acc { min-width: 0 !important; }
  .acc thead, .acc colgroup { display: none; }
  .acc, .acc tbody { display: block; }
  .acc tr.row { display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 8px; height: auto !important; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .acc tr.row td { border-bottom: 0 !important; padding: 0 !important; overflow: visible !important; white-space: normal !important; height: auto; }
  .acc tr.row td:nth-child(4), .acc tr.row td:nth-child(5) { grid-column: 1 / -1; }
  #pubLints li > .tx { grid-column: 2; }
  .quote .big { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .det-in, .chev, .tabs [role=tab], .seg button, .quote { transition: none; }
  ol.steps li.now .m::before { animation-duration: 2.4s; }
}
.acc small.ata { display: block; color: var(--muted); font-size: 12px; font-family: var(--font-mono); margin-top: 2px; }
.amt input:focus-visible { box-shadow: none; outline: none; }

/* seats */
dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; }
dl.kv dt, dl.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
dl.kv dt { color: var(--muted); padding-right: 16px; }
dl.kv dd { text-align: right; font-family: var(--font-mono); color: var(--fg); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--fg); }
@media (max-width: 1180px) { .c-usdc, .c-limit { display: none; } }
