/* TradeHub concept components: ledger, card, fact, chat, rfq sheet, stamps, buttons, feed. */

/* Buttons: one primary (ink), one secondary (ruled) */
.th-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; height: 40px; padding: 0 16px; border: 1px solid var(--th-ink); border-radius: var(--th-radius); background: var(--th-ink); color: #fff; font: 600 14px/1 var(--th-sans); text-decoration: none; cursor: default; }
.th-btn.secondary { background: transparent; color: var(--th-ink); }
.th-btn.quiet { background: transparent; color: var(--th-ink-2); border-color: var(--th-rule); }
.th-btn.danger { background: transparent; color: var(--th-alert); border-color: var(--th-alert); }
.th-btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.th-btn.lg { height: 48px; padding: 0 22px; font-size: 16px; }

/* Stamps: rectangular ruled labels; ink fill only for the primary state */
.stamp { display: inline-block; font-family: var(--th-mono); font-size: 11px; letter-spacing: 0.04em; line-height: 1; padding: 5px 7px; border: 1px solid currentColor; border-radius: var(--th-radius); color: var(--th-ink-2); white-space: nowrap; }
.stamp.ink { background: var(--th-ink); color: #fff; border-color: var(--th-ink); }
.stamp.ok { color: var(--th-ok); }
.stamp.alert { color: var(--th-alert); }
.stamp.accent { color: var(--th-accent-ink); }
.stamp.agent::before { content: "◇ "; }

/* Ledger table: ruled rows and column rules, tabular numerals */
.th-ledger { width: 100%; border-collapse: collapse; border-top: 1px solid var(--th-ink); font-size: 14px; }
.th-ledger th { text-align: left; font: 500 11px/1.4 var(--th-mono); letter-spacing: 0.04em; color: var(--th-muted); padding: 10px 12px 8px; border-bottom: 1px solid var(--th-rule); border-right: 1px solid var(--th-rule-2); vertical-align: bottom; }
.th-ledger td { padding: 11px 12px; border-bottom: 1px solid var(--th-rule); border-right: 1px solid var(--th-rule-2); vertical-align: top; }
.th-ledger th:last-child, .th-ledger td:last-child { border-right: 0; }
.th-ledger td.num, .th-ledger th.num { text-align: right; font-family: var(--th-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-ledger td .src { display: block; font: 400 11px/1.4 var(--th-mono); color: var(--th-muted); margin-top: 3px; }
.th-ledger tr.hl td { background: var(--th-accent-wash); }
.th-ledger tr.dim td { color: var(--th-muted); }
.th-ledger.dense td { padding: 7px 10px; font-size: 13px; }
.th-ledger .name { font-weight: 600; }
.th-ledger caption { caption-side: top; text-align: left; font: 500 12px/1.4 var(--th-mono); color: var(--th-muted); padding: 0 0 8px; letter-spacing: 0.02em; }

/* Card: ruled panel */
.th-card { border: 1px solid var(--th-rule); border-radius: var(--th-radius); background: #fff; padding: 18px 20px; }
.th-card.ink { background: var(--th-ink); color: #fff; border-color: var(--th-ink); }
.th-card.paper { background: var(--th-paper-2); }
.th-card h3 { margin-bottom: 10px; }
.th-card .lead { font-size: 15px; color: var(--th-ink-2); }
.th-card + .th-card { margin-top: 16px; }
.th-cols > .th-card + .th-card { margin-top: 0; }
.th-card .rows { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.th-card .rows dt { color: var(--th-muted); }
.th-card .rows dd { margin: 0; }
.th-card .rows dd.num { font-family: var(--th-mono); font-variant-numeric: tabular-nums; }

/* Fact block: value + source line (provenance is the product) */
.th-fact { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--th-rule-2); }
.th-fact:last-child { border-bottom: 0; }
.th-fact .k { font: 500 11px/1.4 var(--th-mono); letter-spacing: 0.04em; color: var(--th-muted); }
.th-fact .v { font-size: 15px; }
.th-fact .v.num { font-family: var(--th-mono); font-variant-numeric: tabular-nums; font-size: 16px; }
.th-fact .s { font: 400 11px/1.4 var(--th-mono); color: var(--th-muted); }
.th-fact .s b { font-weight: 500; color: var(--th-ink-2); }
.th-facts { border-top: 1px solid var(--th-ink); }
.th-facts h3 { padding: 10px 0 4px; font-size: 14px; }

/* Source icons: drawn, 1.5px stroke, inline SVG via class on <i> */
i.src-ic { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
i.src-ic.call { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M5 4h4l2 5-3 2a11 11 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M5 4h4l2 5-3 2a11 11 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z'/></svg>"); }
i.src-ic.mail { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='5' width='18' height='14' rx='1'/><path d='M3 7l9 6 9-6'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='5' width='18' height='14' rx='1'/><path d='M3 7l9 6 9-6'/></svg>"); }
i.src-ic.doc { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M6 3h8l4 4v14H6z'/><path d='M14 3v4h4M9 12h6M9 16h6'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M6 3h8l4 4v14H6z'/><path d='M14 3v4h4M9 12h6M9 16h6'/></svg>"); }
i.src-ic.web { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/></svg>"); }
i.src-ic.agent { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M12 3l9 9-9 9-9-9z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M12 3l9 9-9 9-9-9z'/></svg>"); }

/* Concierge chat */
.th-chat { display: flex; flex-direction: column; gap: 22px; max-width: 62ch; }
.th-chat .turn { display: grid; grid-template-columns: 88px 1fr; gap: 16px; }
.th-chat .turn .who { font: 500 11px/1.6 var(--th-mono); letter-spacing: 0.04em; color: var(--th-muted); padding-top: 5px; }
.th-chat .turn .say { font-size: 18px; line-height: 1.45; }
.th-chat .turn.buyer .say { color: var(--th-ink); }
.th-chat .turn.assistant .say { color: var(--th-ink-2); }
.th-chat .turn.assistant .say em { font-style: normal; color: var(--th-ink); font-weight: 600; }
.th-input { margin-top: 28px; border-top: 1px solid var(--th-ink); padding-top: 14px; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; }
.th-input .field { font-size: 16px; color: var(--th-muted); padding: 10px 0; border-bottom: 1px solid var(--th-rule); }
.th-input .field .caret { display: inline-block; width: 2px; height: 18px; background: var(--th-ink); vertical-align: -3px; margin-left: 2px; }
.mobile .th-chat .turn { grid-template-columns: 1fr; gap: 4px; }
.mobile .th-chat .turn .say { font-size: 17px; }
.mobile .th-input { grid-template-columns: 1fr; }
.mobile .th-input .stamp { justify-self: start; }
.mobile .th-offers .big { font-size: 18px; }

/* RFQ sheet (structured request that fills in during the dialogue) */
.th-rfq { border: 1px solid var(--th-ink); border-radius: var(--th-radius); background: #fff; }
.th-rfq header { padding: 12px 16px; border-bottom: 1px solid var(--th-ink); display: flex; justify-content: space-between; align-items: baseline; }
.th-rfq header h3 { font-size: 14px; }
.th-rfq header .id { font-family: var(--th-mono); font-size: 12px; color: var(--th-muted); }
.th-rfq .line { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--th-rule-2); font-size: 14px; min-height: 42px; align-items: center; }
.th-rfq .line:last-child { border-bottom: 0; }
.th-rfq .line .k { font: 500 11px/1.4 var(--th-mono); letter-spacing: 0.04em; color: var(--th-muted); }
.th-rfq .line .v { font-weight: 500; }
.th-rfq .line .v.num { font-family: var(--th-mono); font-variant-numeric: tabular-nums; }
.th-rfq .line.empty .v { color: var(--th-rule); border-bottom: 1px dashed var(--th-rule); height: 1px; align-self: end; margin-bottom: 12px; }
.th-rfq .line.asking .v { color: var(--th-accent-ink); font-weight: 500; }
.th-rfq .line.asking .v::after { content: ""; display: inline-block; width: 2px; height: 14px; background: var(--th-accent); margin-left: 3px; vertical-align: -2px; }

/* Activity feed: what agents did, one line each, time at left */
.th-feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--th-ink); }
.th-feed li { display: grid; grid-template-columns: 52px 118px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--th-rule-2); font-size: 13.5px; align-items: baseline; }
.th-feed li time { font-size: 12px; color: var(--th-muted); }
.th-feed li .actor { font: 500 11px/1.5 var(--th-mono); letter-spacing: 0.04em; color: var(--th-ink-2); }
.th-feed li .actor.human { color: var(--th-accent-ink); }
.th-feed li.needs-you .what { color: var(--th-alert); font-weight: 600; }

/* Section heading row inside a page */
.th-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.th-sec h2 { font-size: 17px; }
.th-sec .note { font: 400 12px/1.4 var(--th-mono); color: var(--th-muted); }
.th-sec:first-child { margin-top: 0; }

/* Compare columns: offers side by side on one basis */
.th-offers { display: grid; grid-template-columns: 180px repeat(3, 1fr); border-top: 1px solid var(--th-ink); font-size: 14px; }
.th-offers > div { padding: 11px 12px; border-bottom: 1px solid var(--th-rule); border-right: 1px solid var(--th-rule-2); }
.th-offers > div:nth-child(4n) { border-right: 0; }
.th-points > div:nth-child(3n) { border-right: 0; }
.th-points > div { padding: 14px 16px 16px; }
.th-points > div:first-child { padding-left: 0; }
.mobile .th-points { grid-template-columns: 1fr !important; }
.mobile .th-points > div { border-right: 0; padding: 14px 0; border-bottom: 1px solid var(--th-rule); }
.th-offers .k { font: 500 11px/1.4 var(--th-mono); letter-spacing: 0.04em; color: var(--th-muted); padding-top: 13px; }
.th-offers .h { font-weight: 650; font-size: 15px; }
.th-offers .num { font-family: var(--th-mono); font-variant-numeric: tabular-nums; }
.th-offers .big { font-family: var(--th-mono); font-size: 22px; font-weight: 500; }
.th-offers .diff { font-size: 13px; color: var(--th-ink-2); }
.th-offers .rec { background: var(--th-accent-wash); }
.mobile .th-offers { grid-template-columns: 1fr; }

/* Checklist (decision panel) */
.th-check { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--th-ink); }
.th-check li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--th-rule-2); font-size: 14px; align-items: start; }
.th-check li .box { width: 16px; height: 16px; border: 1px solid var(--th-ink); border-radius: var(--th-radius); margin-top: 2px; position: relative; }
.th-check li.done .box::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--th-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.th-check li .why { font: 400 12px/1.5 var(--th-mono); color: var(--th-muted); display: block; margin-top: 2px; }

/* Gallery (index) */
.gallery { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--th-ink); }
.gallery li { display: grid; grid-template-columns: 48px 92px 1fr 1.2fr 220px; gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--th-rule); }
.gallery li .n, .gallery li .deck { font-family: var(--th-mono); font-size: 12px; color: var(--th-muted); }
.gallery li h3 { font-size: 16px; }
.gallery li h3 a { color: var(--th-ink); text-decoration: none; border-bottom: 1px solid var(--th-rule); }
.gallery li h3 a:hover { border-bottom-color: var(--th-ink); }
.gallery li .agent { font-size: 13.5px; color: var(--th-ink-2); }
.gallery li img { width: 220px; height: 138px; object-fit: cover; object-position: top; border: 1px solid var(--th-rule); background: #fff; display: block; }
.gallery li .side { font: 400 11px/1.5 var(--th-mono); color: var(--th-muted); }
@media (max-width: 900px) { .gallery li { grid-template-columns: 1fr; gap: 8px; } .gallery li img { width: 100%; height: auto; } }

/* Prototype chrome: role switch, bottom bar, quick-reply chips, real inputs */
.th-nav .role { margin-left: 18px; font: 500 11px/1 var(--th-mono); letter-spacing: 0.04em; color: var(--th-ink-2); text-decoration: none; border: 1px solid var(--th-rule); padding: 7px 9px; border-radius: var(--th-radius); white-space: nowrap; }
.th-nav .role:hover { border-color: var(--th-ink); color: var(--th-ink); }
.mobile .th-nav .role { display: none; }
.th-proto { display: flex; justify-content: space-between; gap: 16px; padding: 9px 40px; background: var(--th-paper-2); border-top: 1px dashed var(--th-rule); font: 400 11px/1.6 var(--th-mono); color: var(--th-muted); letter-spacing: 0.01em; }
.th-proto a { color: var(--th-ink-2); text-decoration: none; border-bottom: 1px solid var(--th-rule); }
.th-proto a:hover { color: var(--th-ink); border-bottom-color: var(--th-ink); }
.mobile .th-proto { padding: 8px 16px; flex-direction: column; gap: 4px; }
.th-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.th-chips button { font: 500 13px/1 var(--th-sans); color: var(--th-accent-ink); background: var(--th-accent-wash); border: 1px solid transparent; border-radius: var(--th-radius); padding: 9px 12px; cursor: pointer; text-align: left; }
.th-chips button:hover { border-color: var(--th-accent); }
.th-chips button:disabled { opacity: .5; cursor: default; }
.th-input input.field { border: 0; border-bottom: 1px solid var(--th-rule); background: transparent; font: 400 16px/1.4 var(--th-sans); color: var(--th-ink); padding: 10px 0; outline: none; min-width: 0; }
.th-input input.field:focus { border-bottom-color: var(--th-ink); }
.th-input input.field::placeholder { color: var(--th-muted); }
.th-input button.th-btn { cursor: pointer; }
.th-btn:disabled { opacity: .5; cursor: default; }
a.th-btn { cursor: pointer; }
.th-chat .turn.pending .say { color: var(--th-muted); }
.status.err { color: var(--th-alert); }
.th-rfq .line .v.filled { color: var(--th-ink); }
.th-nav .live { display: flex; gap: 6px; margin-left: 14px; }
.th-nav .live a { font: 500 11px/1 var(--th-mono); letter-spacing: 0.04em; color: var(--th-accent-ink); background: var(--th-accent-wash); border: 1px solid transparent; padding: 7px 9px; border-radius: var(--th-radius); text-decoration: none; white-space: nowrap; }
.th-nav .live a:hover, .th-nav .live a[aria-current="page"] { border-color: var(--th-accent); }
.mobile .th-nav .live { display: none; }
/* Nav density: the page path lives in the footer; keep the top bar within 1440 with the live links */
.th-nav .wordmark small { display: none; }
.th-nav { gap: 18px; }
.th-nav ul { gap: 16px; }
.th-nav .who { margin-left: 12px; }
.th-nav .role { margin-left: 10px; padding: 7px 8px; }
.th-nav .live { margin-left: 8px; }
