/* /app, the console: title and tabs, the balance strip, one hairline box per panel (copy, form, side), review cards */

.app-top { padding: 72px 48px 28px; display: grid; gap: 14px; justify-items: start; }
.app-top .lede { max-width: 640px; }
.app-tabs { margin-top: 18px; justify-content: flex-start; }
.app-tabs button { min-height: 38px; }
.app-tabs .n { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.app-tabs [aria-selected='true'] .n { color: rgba(255, 251, 245, .75); }

.lbl { font: 500 11.5px/1.25 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mute { color: var(--mute); }
.small { font-size: 13.5px; line-height: 1.5; }
.r { text-align: right; }

/* balance strip */
.app-strip { padding: 0 48px 8px; }
.strip { display: grid; grid-template-columns: 1.25fr repeat(5, minmax(0, 1fr)); }
.strip .sc { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }
.strip .sc:last-child { border-right: 0; }
.strip b { font: 500 20px/1.15 var(--sans); letter-spacing: -0.02em; color: var(--head); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip b.addr { font: 400 15px/1.35 var(--mono); letter-spacing: 0; padding-top: 2px; }
.strip [data-bal='ai'] { color: var(--or-2); }

/* panels */
.panel { padding: 28px 48px 16px; }
.pgrid { display: grid; grid-template-columns: 0.9fr 1.2fr 1.05fr; align-items: stretch; }
.pgrid.wide { grid-template-columns: 0.9fr 2.25fr; }
.pgrid > div { min-width: 0; padding: 28px; border-right: 1px solid var(--line); }
.pgrid > div:last-child { border-right: 0; }
.pcopy { display: flex; flex-direction: column; gap: 14px; }
.pcopy .lbl { color: var(--or); }
.pcopy .lead { font-size: 26px; line-height: 1.12; letter-spacing: -0.02em; }
.pcopy .body { color: var(--mute); font-size: 15px; line-height: 1.55; }
.pcopy .link, .pside .link { display: inline; }

.pform { display: flex; flex-direction: column; gap: 14px; }
.fld { display: grid; gap: 8px; }
.fld .input, .fld input, .fld select, .fld textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--head); font-size: 19px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; outline: none; transition: border-color .2s;
}
.fld textarea { font-size: 15.5px; line-height: 1.5; resize: vertical; min-height: 116px; letter-spacing: 0; }
.fld select {
  font-size: 15.5px; appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.fld select option { background: var(--bg-1); color: var(--head); }
.fld .input:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--or); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 34px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; font: 500 13px/1 var(--mono); color: var(--ink); transition: border-color .2s, color .2s; }
.chips button:hover { border-color: var(--or); color: var(--head); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { min-height: 40px; padding: 0 10px; border-radius: 999px; font-weight: 500; font-size: 14.5px; color: var(--ink); }
.seg button:hover { background: rgba(240, 227, 222, 0.05); }
.seg button[aria-checked='true'] { background: var(--or); color: var(--head); }

.quote { margin: 0; border-top: 1px solid var(--line); }
.quote > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.quote dt { color: var(--mute); }
.quote dd { margin: 0; text-align: right; color: var(--head); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.quote dd.big { font-size: 18px; font-weight: 500; }
.quote .good { color: var(--or-2); }
.go { display: flex; gap: 10px; flex-wrap: wrap; }
.go .btn { min-height: 40px; }
.go .btn.btn-s { min-height: 32px; }

/* the shared button names from js/ui/action.js and the generated forms */
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--line-2); color: var(--head); }
.btn.violet { background: var(--or); border-color: var(--or); color: var(--head); }
.btn:disabled { opacity: .45; cursor: default; }

/* review card */
.act { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); }
.act > .lbl { color: var(--or); }
.act h4 { font-size: 19px; line-height: 1.25; letter-spacing: -0.015em; }
.act-sum { font-size: 14.5px; color: var(--mute); }
.act-rows { margin: 0; }
.act-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.act-rows dt { color: var(--mute); }
.act-rows dd { margin: 0; text-align: right; color: var(--head); overflow-wrap: anywhere; min-width: 0; }
.act-warn { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--warn); }
.act-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: s; }
.act-steps li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 14px; }
.act-steps li::before {
  counter-increment: s; content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  background: var(--bg-3); color: var(--mute); font: 600 11px/1 var(--mono);
}
.act-steps li span { flex: 1; min-width: 0; }
.act-steps em { font-style: normal; font: 500 11.5px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--dim); text-align: right; }
.act-steps em a { text-decoration: underline; text-underline-offset: 2px; }
.act-steps li[data-s='signing'] { border-color: var(--or); }
.act-steps li[data-s='signing'] em { color: var(--or-2); }
.act-steps li[data-s='pending'] em { color: var(--head); }
.act-steps li[data-s='confirmed'] { border-style: solid; border-color: rgba(74, 222, 128, .45); }
.act-steps li[data-s='confirmed']::before { background: rgba(74, 222, 128, .16); color: var(--ok); }
.act-steps li[data-s='confirmed'] em { color: var(--ok); }
.act-steps li[data-s='failed'] em { color: var(--bad); }
.act-err { color: var(--bad); font-size: 14px; }
.act-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.act-btns .btn { min-height: 40px; }
.act.ok { border-color: rgba(74, 222, 128, .5); }

.sub { border-top: 1px dashed var(--line); padding-top: 12px; }
.sub summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; min-height: 32px; font-size: 15px; color: var(--head); }
.sub summary::-webkit-details-marker { display: none; }
.sub summary:hover { color: var(--or-2); }
.sub-b { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }

/* side column */
.pside { display: flex; flex-direction: column; gap: 14px; }
.side-card { padding: 16px 16px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); }
.side-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.book-scroll { max-height: 452px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--stud) transparent; }
.book-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-1); }
.tbl.mini th { padding: 8px 10px 8px 0; font-size: 11px; }
.tbl.mini td { padding: 8px 10px 8px 0; font-size: 14px; vertical-align: middle; color: var(--ink); }
.tbl.mini tr:last-child td { border-bottom: 0; }
.tbl.mini td.barcell { width: 38%; padding-right: 0; }
.tbl.mini .skel td, .tbl.mini td.mute { color: var(--dim); }
.bar { display: block; height: 8px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 8px); }
.bar.best { background: repeating-linear-gradient(90deg, var(--or) 0 6px, transparent 6px 8px); }
.num { font-variant-numeric: tabular-nums; }

.term pre[data-key-env] { white-space: pre-wrap; word-break: break-all; font-size: 12.5px; }
.term-h .copy-btn { cursor: pointer; }

.keybox { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0f0e0e; }
.keybox code { font: 400 13px/1.5 var(--mono); color: var(--or-3); word-break: break-all; }
.keybox .go { gap: 8px; }

.orders { display: flex; flex-direction: column; }
.orders .o { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--head); }
.orders .o small { grid-column: 1; color: var(--mute); }
.orders .o button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.claims { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 6px; }

.run-form .out {
  min-height: 180px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #0f0e0e; color: var(--ink);
  font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.run-form .out.err { border-color: var(--bad); color: var(--bad); }
.cursor { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--or); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.gate { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 12px; }
.gate p { font-size: 15px; color: var(--mute); }
.gate code { display: block; max-width: 100%; padding: 8px 12px; border-radius: 8px; background: #0f0e0e; border: 1px solid var(--line); color: var(--or-3); font-size: 13.5px; overflow-wrap: anywhere; }

.app-note { padding: 20px 48px 64px; font-size: 14px; color: var(--dim); max-width: 860px; }
.app-note .link { display: inline; }

@media (max-width: 1080px) {
  .app-top { padding-left: 32px; padding-right: 32px; }
  .app-strip { padding-left: 32px; padding-right: 32px; }
  .panel { padding-left: 32px; padding-right: 32px; }
  .app-note { padding-left: 32px; padding-right: 32px; }
  .seg { border-radius: 16px; }
  .seg button { border-radius: 12px; padding: 0 8px; font-size: 14px; line-height: 1.2; }
  .pgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .pgrid > div:nth-child(2) { border-right: 0; }
  .pgrid > .pside { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .pgrid.wide { grid-template-columns: minmax(0, 1fr); }
  .pgrid.wide > div { border-right: 0; }
  .pgrid.wide > div + div { border-top: 1px solid var(--line); }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip .sc:nth-child(3n) { border-right: 0; }
  .strip .sc:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .app-top { padding: 48px 18px 22px; }
  .app-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 2px; scrollbar-width: none; }
  .app-tabs::-webkit-scrollbar { display: none; }
  .app-tabs button { flex: none; min-height: 40px; padding: 7px 11px; font-size: 14px; }
  .app-tabs .n { display: none; }
  .app-strip { padding: 0 12px 4px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip .sc { padding: 14px 16px; }
  .strip .sc:nth-child(3n) { border-right: 1px solid var(--line); }
  .strip .sc:nth-child(2n) { border-right: 0; }
  .strip .sc:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .strip b { font-size: 17px; }
  .strip b.addr { font-size: 14px; }
  .panel { padding: 20px 12px 8px; }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .pgrid > div { padding: 20px 16px; border-right: 0; }
  .pgrid > div + div { border-top: 1px solid var(--line); }
  .pcopy .lead { font-size: 23px; }
  .fld .input, .fld input, .fld select { font-size: 17px; }
  .fld textarea { font-size: 16px; }
  .seg { border-radius: 16px; }
  .seg button { font-size: 13.5px; padding: 0 6px; border-radius: 12px; line-height: 1.2; }
  .book-scroll { max-height: 380px; }
  .chips button { min-height: 40px; padding: 4px 16px; }
  .app-note { padding: 16px 18px 48px; }
}
