/* The Forge -- design/forge/Forge.dc.html + HogLoader.dc.html, the handoff
   "The Forge, rethought". Every number here is read off those files.

   Light surface on the arena tokens (static/css/arena/chrome.css). The one
   dark thing left is the SPEND card: the moment the conversation asks for a
   decision, and it keeps its literal dark values in both themes. The hog's
   colours are the drawing's own and are not tokens either. */

@keyframes fg-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes fg-ov-pop  { 0% { opacity: 0; transform: translateY(12px) scale(.985); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fg-ov-fade { 0% { opacity: 0; } 100% { opacity: 1; } }

/* --- The overlay shell (unchanged: 1120x680 on the scrim) ------------------ */
.fg-ov[hidden] { display: none; }
.fg-ov-scrim {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(14, 11, 8, .44);
  backdrop--webkit-backdrop-animation: fg-ov-fade .14s ease-out;
}
.fg-ov-frame {
  position: fixed; inset: 0; z-index: 121;
  display: flex; align-items: center; justify-content: center;
  padding: 28px; pointer-events: none;
}
.fg-ov-card {
  position: relative;
  width: min(1120px, 96vw); height: min(680px, 90vh);
  pointer-events: auto; border-radius: 18px;
  
}
.fg-ov-x {
  position: absolute; top: -13px; right: -13px; z-index: 3;
  width: 30px; height: 30px;
  border: 1px solid #3c362f; border-radius: 999px;
  background: #1a1714; color: #a39c8f; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.fg-ov-x:hover { color: #f1ede6; border-color: #5a544a; }
.fg-ov-inner {
  width: 100%; height: 100%; border-radius: 18px; overflow: hidden;
  border: 2px solid var(--line-2); background: var(--bg-1);
  box-shadow: 0 7px 0 rgba(20, 15, 10, .3), 0 46px 120px rgba(14, 10, 7, .5);
}

/* --- The surface ------------------------------------------------------------ */
.fg {
  position: relative; display: flex; width: 100%; height: 100%; min-height: 520px;
  background: var(--bg-1); color: var(--ink); overflow: hidden;
  font-family: 'Onest', system-ui, sans-serif;
}
.fg .da-mono { font-family: ui-monospace, monospace; }
.fg-spacer { flex: 1; }
.fg button { font-family: inherit; }

/* --- Rail ------------------------------------------------------------------- */
.fg-rail {
  width: 232px; flex: none; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--bg-2);
}
.fg-rail-hd { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 14px; flex: none; color: var(--ink-3); }
.fg-rail-title { font-size: 10px; letter-spacing: .18em; color: var(--ink-3); }
.fg-new {
  height: 24px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--bg-1); color: var(--ink-2); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: border-color 120ms, color 120ms;
}
.fg-new:hover { border-color: var(--brand); color: var(--ink); }
.fg-threads { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 3px; }
.fg-rail-empty { font-size: 10px; color: var(--ink-4); padding: 8px 9px; }

.fg-thread {
  display: block; width: 100%; text-align: left; padding: 8px 10px 9px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
}
.fg-thread:hover { background: var(--bg-1); }
.fg-thread.is-on { background: var(--bg-1); box-shadow: inset 2px 0 0 var(--brand), 0 4px 12px rgba(28, 20, 12, .06); }
.fg-thread-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fg-thread-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-thread-time { font-size: 9.5px; color: var(--ink-4); white-space: nowrap; flex: none; }
.fg-thread-last { margin-top: 4px; font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-thread-wait { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 10px; color: #8a6a00; min-width: 0; }
.fg-thread-wait i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: none; }
.fg-thread-wait span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Thread header ---------------------------------------------------------- */
.fg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.fg-head { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.fg-head[hidden] { display: none; }
.fg-head-name { font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-status { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 9.5px; letter-spacing: .06em; flex: none; }
.fg-status i { width: 5px; height: 5px; border-radius: 50%; }
.fg-status[data-st="answered"]   { background: var(--bg-2); color: var(--ink-3); }
.fg-status[data-st="answered"] i { background: var(--ink-4); }
.fg-status[data-st="running"]    { background: rgba(239, 89, 32, .10); color: var(--brand-2); }
.fg-status[data-st="running"] i  { background: var(--brand);  }
.fg-status[data-st="waiting"]    { background: rgba(199, 145, 0, .10); color: #8a6a00; }
.fg-status[data-st="waiting"] i  { background: var(--amber); }
.fg-head-tab { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; flex: none; }

/* --- Stream ----------------------------------------------------------------- */
.fg-stream { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 24px 12px; display: flex; flex-direction: column; }
.fg-log { display: flex; flex-direction: column; }
.fg-cold { margin: auto; display: flex; flex-direction: column; gap: 12px; width: 560px; max-width: 100%; padding: 12px 0; }
.fg-cold[hidden] { display: none; }
.fg-cold h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: var(--ink); text-wrap: pretty; }
.fg-cold p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-3); text-wrap: pretty; }
.fg-starters { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fg-starter {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-1); color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.fg-starter > span:first-child { flex: 1; }
.fg-starter:hover { border-color: var(--brand); color: var(--ink); }
.fg-starter-tag { font-size: 9.5px; color: var(--ink-4); white-space: nowrap; }

.fg-div { display: flex; align-items: center; gap: 10px; padding: 6px 0 8px; }
.fg-div span:first-child, .fg-div span:last-child { flex: 1; height: 1px; background: var(--line); }
.fg-div-label { font-size: 9.5px; letter-spacing: .16em; color: var(--ink-4); flex: none; }

/* A turn: speaker gutter, body, time. */
.fg-row { display: grid; grid-template-columns: 56px 1fr 44px; column-gap: 10px; padding: 6px 8px; align-items: baseline; }
.fg-who { font-size: 10px; color: var(--ink-3); }
.fg-row[data-who="forge"] .fg-who { color: var(--brand-2); }
.fg-body { min-width: 0; }
.fg-body p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: break-word; text-wrap: pretty; white-space: pre-wrap; }
.fg-row[data-who="you"] .fg-body p { color: var(--ink); font-weight: 500; }
.fg-time { font-size: 10px; color: var(--ink-4); text-align: right; }

/* Under the gutter: a receipt, a note, a resolved row, a block, a card. */
.fg-under { display: grid; grid-template-columns: 56px 1fr; column-gap: 10px; padding: 0 8px 8px; }
.fg-under > :first-child { min-width: 0; }
.fg-under.fg-under-tight { padding-top: 2px; }
.fg-receipt, .fg-note { font-size: 10px; color: var(--ink-4); }
.fg-note[data-tone="rust"] { color: #b8452c; }

/* Resolved rows: three registers. Green for ran, ink-3 for a refund where
   "nothing was charged" is the headline, rust for provider down, amber for
   402. The strings in them are the server's own. */
.fg-resolved {
  display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 8px;
  background: var(--bg-2); font-size: 10.5px; color: var(--ink-3); min-width: 0;
}
.fg-resolved .fg-sep { color: var(--ink-4); }
.fg-resolved .fg-target { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fg-resolved .fg-outcome { color: var(--ink); font-weight: 500; }
.fg-resolved[data-kind="ran"] { color: var(--green); }
.fg-resolved[data-kind="ran"] .fg-verb { font-weight: 500; }
.fg-resolved[data-kind="provider_down"] { background: rgba(214, 48, 96, .07); color: #b8452c; }
.fg-resolved[data-kind="provider_down"] .fg-outcome { color: #b8452c; }
.fg-resolved[data-kind="provider_down"] .fg-target { color: #b8452c; }
.fg-resolved[data-kind="short"] { background: rgba(199, 145, 0, .10); border: 1px solid rgba(199, 145, 0, .35); color: #8a6a00; }
.fg-resolved[data-kind="short"] .fg-outcome { color: #8a6a00; }
.fg-resolved a.fg-buy { color: var(--brand-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.fg-resolved a.fg-buy:hover { color: var(--brand); }

/* --- Blocks: search results, a page, a brief ------------------------------- */
.fg-block { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); overflow: hidden; }
.fg-block-hd {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--ink-3); min-width: 0;
}
.fg-block-hd .fg-strong { color: var(--ink); font-weight: 500; }
.fg-block-hd .fg-dim { color: var(--ink-4); }
.fg-block-hd .fg-sep { color: var(--ink-4); }
.fg-block-hd .fg-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fg-block-hd .fg-tail { white-space: nowrap; color: var(--ink-4); }

.fg-hit { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.fg-hit:last-child { border-bottom: 0; }
.fg-hit > div { min-width: 0; }
.fg-hit-title { font-size: 13px; font-weight: 600; color: var(--brand-2); text-decoration: none; overflow-wrap: break-word; }
.fg-hit-title:hover { color: var(--brand); }
.fg-hit-meta { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; min-width: 0; }
.fg-hit-host { font-size: 10px; color: var(--ink-4); white-space: nowrap; }
.fg-hit-snip { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fg-read {
  height: 24px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--bg-1); color: var(--ink-2); font-size: 9.5px; white-space: nowrap; cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.fg-read:hover { border-color: var(--brand); color: var(--ink); }
.fg-read[disabled] { opacity: .5; cursor: default; }

.fg-page-hd { padding: 11px 14px 10px; border-bottom: 1px solid var(--line); }
.fg-page-title { font-size: 13px; font-weight: 600; color: var(--ink); text-wrap: pretty; overflow-wrap: break-word; }
.fg-page-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 10px; color: var(--ink-4); flex-wrap: wrap; }
.fg-page-meta a { color: var(--brand-2); text-decoration: none; overflow-wrap: anywhere; }
.fg-page-meta a:hover { color: var(--brand); }
.fg-clipped { padding: 2px 7px; border-radius: 99px; background: rgba(199, 145, 0, .10); color: #8a6a00; }
.fg-page-meta .fg-tail { margin-left: auto; white-space: nowrap; }

.fg-fold { position: relative; overflow: hidden; }
.fg-fold-page { max-height: 150px; padding: 10px 14px 0; }
.fg-fold-brief { max-height: 220px; padding: 12px 14px 0; display: flex; flex-direction: column; gap: 12px; }
.fg-fold.is-open { max-height: none; padding-bottom: 10px; }
.fg-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--bg-1)); pointer-events: none; }
.fg-fold.is-open .fg-fade { display: none; }
.fg-fold-page p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; text-wrap: pretty; overflow-wrap: break-word; }
.fg-sec-label { font-size: 9.5px; letter-spacing: .14em; color: var(--ink-4); margin-bottom: 4px; }
.fg-sec p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; white-space: pre-wrap; overflow-wrap: break-word; }
.fg-sec ul { margin: 0; padding-left: 16px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.fg-more { padding: 6px 14px 10px; }
.fg-more button { border: 0; background: none; padding: 0; font-size: 10.5px; color: var(--brand-2); cursor: pointer; }
.fg-more button:hover { color: var(--brand); }

/* --- answer block: the answer, then its sources as hit rows ------------------ */
.fg-ans { padding: 12px 14px; }
.fg-ans p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; white-space: pre-wrap; overflow-wrap: break-word; }
.fg-cites { border-top: 1px solid var(--line); }
.fg-cites .fg-sec-label { display: block; padding: 8px 14px 0; margin-bottom: 0; }
.fg-hit-date { font-size: 10px; color: var(--ink-4); white-space: nowrap; }

/* --- SPEND card: Forge-proposed only ----------------------------------------- */
/* Dark in both themes on purpose: the one moment the conversation asks for a
   decision. Restyled, not restructured -- SPEND, what will run, the price,
   APPROVE, DISMISS, "nothing is charged until you approve". The price is
   proposal.credits; the server re-validates and re-prices on approve. */
.fg-card {
  border-radius: 12px; background: #1a1714; border: 1px solid #3c362f;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.fg-card-hd { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.fg-card-tag { font-size: 9.5px; letter-spacing: .12em; color: #ff8a3c; flex: none; }
.fg-card-title { font-size: 13px; font-weight: 600; color: #f1ede6; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-card-price { font-size: 12px; color: #ffb27a; flex: none; }
.fg-card-payload { font-size: 11.5px; color: #c6bfb2; background: #241f1b; border-radius: 7px; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-card-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fg-approve, .fg-dismiss {
  height: 26px; padding: 0 12px; border-radius: 7px; font-size: 10px; letter-spacing: .08em;
  cursor: pointer; user-select: none; border: 0;
}
.fg-approve { background: var(--green); color: #0a2415; box-shadow: 0 2px 0 #0a8754; }
.fg-approve:active { transform: translateY(2px); box-shadow: 0 0 0 #0a8754; }
.fg-dismiss { background: #241f1b; color: #a39c8f; border: 1px solid #3c362f; }
.fg-dismiss:hover { color: #f1ede6; border-color: #5a544a; }
.fg-approve[disabled], .fg-dismiss[disabled] { opacity: .5; cursor: default; }
.fg-card-note { font-size: 10px; color: #8e8779; margin-left: 4px; }

/* --- The hog ---------------------------------------------------------------- */
/* design/forge/HogLoader.dc.html, geometry intact. */
@keyframes fg-hog-run    { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(516px); opacity: 0; } }
@keyframes fg-hog-fill   { 0% { width: 12px; opacity: 1; } 93% { opacity: 1; } 100% { width: 528px; opacity: 0; } }
@keyframes fg-hog-gallop { 0% { transform: translateY(0) rotate(2deg) scale(1.05, .95); } 35% { transform: translateY(-8px) rotate(-5deg) scale(.97, 1.05); } 65% { transform: translateY(-3px) rotate(-1deg) scale(1, 1); } 100% { transform: translateY(0) rotate(2deg) scale(1.05, .95); } }
@keyframes fg-hog-shadow { 0%, 100% { transform: scale(1.05, 1); opacity: .22; } 35% { transform: scale(.8, .7); opacity: .12; } }
@keyframes fg-hog-puff   { 0% { transform: translate(0, 0) scale(.25) rotate(0deg); } 100% { transform: translate(-120px, -34px) scale(2.4) rotate(-160deg); opacity: 0; } }
@keyframes fg-hog-puff2  { 0% { transform: translate(0, 0) scale(.3) rotate(0deg); } 100% { transform: translate(-95px, 8px) scale(2) rotate(170deg); opacity: 0; } }
@keyframes fg-hog-wisp   { 0% { transform: translate(0, 0) scaleY(.4) rotate(0deg); } 100% { transform: translate(-80px, -46px) scaleY(1.7) rotate(-35deg); opacity: 0; } }
@keyframes fg-hog-kick   { 0% { transform: translate(0, 0) scale(.3); } 100% { transform: translate(-34px, -8px) scale(1.3); opacity: 0; } }
@keyframes fg-hog-bubble { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 10% { opacity: 1; transform: translateY(0) scale(1.06); } 17% { transform: translateY(0) scale(1); } 78% { opacity: 1; transform: translateY(0) scale(1); } 92%, 100% { opacity: 0; transform: translateY(-6px) scale(.96); } }

.fg-hog { display: flex; flex-direction: column; gap: 4px; width: 600px; max-width: 100%; }
.fg-hog-stage { width: 600px; max-width: 100%; height: 120px; position: relative; overflow: visible; }
.fg-hog-trail {
  position: absolute; left: 20px; bottom: 16px; height: 10px; width: 12px;
  background: none;
  
}
.fg-hog-runner { position: absolute; left: 0; bottom: 8px; height: 74px; width: 64px;  }
.fg-hog-shadow { position: absolute; left: 12px; bottom: 0; width: 44px; height: 9px; border-radius: 50%; background: #6b5a4e;  }
.fg-hog-gallop { position: absolute; left: 4px; top: 4px; width: 60px; height: 60px; transform-origin: 50% 90%;  }
.fg-hog-gallop img { width: 60px; height: 60px; display: block; transform: scaleX(-1); }

/* Dust. Three cloud shapes, three greys, each puff on its own delay. */
.fg-hog-d { position: absolute; }
.fg-hog-d.d1  { left: 16px; bottom: 4px;   width: 34px; height: 30px; border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; background: none; opacity: .85;  animation-delay: 0s; }
.fg-hog-d.d2  { left: 8px;  bottom: 12px;  width: 46px; height: 40px; border-radius: 45% 55% 50% 50% / 60% 45% 55% 40%; background: none; opacity: .8;   animation-delay: -.2s; }
.fg-hog-d.d3  { left: 22px; bottom: -2px;  width: 26px; height: 22px; border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%; background: none; opacity: .8;   animation-delay: -.4s; }
.fg-hog-d.d4  { left: 0;    bottom: 8px;   width: 58px; height: 50px; border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; background: none; opacity: .75;  animation-delay: -.6s; }
.fg-hog-d.d5  { left: 12px; bottom: 16px;  width: 40px; height: 36px; border-radius: 45% 55% 50% 50% / 60% 45% 55% 40%; background: none; opacity: .8;   animation-delay: -.8s; }
.fg-hog-d.d6  { left: -6px; bottom: 0;     width: 66px; height: 56px; border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%; background: none; opacity: .7;   animation-delay: -1s; }
.fg-hog-d.d7  { left: 14px; bottom: 6px;   width: 16px; height: 56px; border-radius: 50%; background: none; opacity: .7;   animation-delay: -.3s; }
.fg-hog-d.d8  { left: 2px;  bottom: 2px;   width: 12px; height: 64px; border-radius: 50%; background: none; opacity: .65;  animation-delay: -.7s; }
.fg-hog-d.d9  { left: 30px; bottom: 0;     width: 14px; height: 10px; border-radius: 50%; background: #a09386; opacity: .7;  }
.fg-hog-d.d10 { left: 24px; bottom: 2px;   width: 12px; height: 9px;  border-radius: 50%; background: #b3a698; opacity: .7;  animation-delay: -.25s; }
.fg-hog-d.d11 { left: -2px; bottom: 8px;   width: 36px; height: 32px; border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; background: none; opacity: .5;   animation-delay: -.15s; }
.fg-hog-d.d12 { left: 12px; bottom: -2px;  width: 28px; height: 24px; border-radius: 45% 55% 50% 50% / 60% 45% 55% 40%; background: none; opacity: .5;   animation-delay: -.55s; }
.fg-hog-d.d13 { left: -8px; bottom: 4px;   width: 12px; height: 52px; border-radius: 50%; background: none; opacity: .45;  animation-delay: -.4s; }

.fg-hog-bubble {
  position: absolute; right: -6px; bottom: 70px; padding: 3px 8px 4px;
  border: 1px solid rgba(107, 90, 78, .5); border-radius: 4px; background: rgba(251, 248, 244, .94);
  color: #6b5a4e; font-size: 12px; line-height: 1.2; letter-spacing: .2px; white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(107, 90, 78, .16); transform-origin: 80% 100%;
  
}
.fg-hog-bubble i {
  position: absolute; right: 12px; bottom: -5px; width: 8px; height: 8px;
  background: rgba(251, 248, 244, .94);
  border-right: 1px solid rgba(107, 90, 78, .5); border-bottom: 1px solid rgba(107, 90, 78, .5);
  transform: rotate(45deg);
}
.fg-hog-step { display: flex; align-items: baseline; gap: 8px; padding-left: 20px; font-size: 10.5px; color: var(--ink-3); }
.fg-hog-elapsed { color: var(--ink-4); }

/* --- Composer --------------------------------------------------------------- */
.fg-composer { position: relative; flex: none; background: var(--bg-0); border-top: 1px solid var(--line); padding: 12px 16px 10px; }
.fg-field {
  display: flex; align-items: flex-start; min-height: 44px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-1); box-sizing: border-box;
}
.fg-field:focus-within { border-color: var(--brand); }
.fg .fg-input {
  flex: 1; min-width: 0; width: 100%; display: block; resize: none; margin: 0; padding: 0;
  border: 0; outline: none; background: transparent; box-shadow: none;
  font-family: 'Onest', system-ui, sans-serif; font-size: 13.5px; line-height: 1.5;
  color: var(--ink); caret-color: var(--brand); max-height: 140px; overflow-y: auto;
}
.fg .fg-input::placeholder { color: var(--ink-4); }
.fg-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fg-attach {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-1);
  color: var(--ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fg-attach:hover { color: var(--ink); border-color: var(--line-2); }
.fg-attach[disabled] { opacity: .5; cursor: default; }
.fg-seg { display: flex; align-items: center; height: 26px; padding: 2px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); box-sizing: border-box; }
.fg-seg button {
  height: 20px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-3); font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .06em; cursor: pointer;
}
.fg-seg button.is-on { background: var(--bg-1); color: var(--ink); box-shadow: 0 1px 0 var(--line-2); }
.fg-send {
  width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--brand); color: var(--on-brand);
  box-shadow: 0 3px 0 #a83a12; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fg-send:active { transform: translateY(2px); box-shadow: 0 1px 0 #a83a12; }
.fg-send[disabled] { opacity: .5; cursor: default; }
.fg-hint { margin-top: 8px; font-size: 9.5px; color: var(--ink-4); }

/* The / menu. Floats above the stream rather than pushing it. */
.fg-cmds {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% - 6px); z-index: 12;
  display: flex; flex-direction: column; gap: 1px; padding: 6px;
  border-radius: 12px; background: var(--bg-1); border: 1px solid var(--line-2);
  box-shadow: 0 -10px 30px rgba(28, 20, 12, .10), 0 2px 6px rgba(28, 20, 12, .06);
}
.fg-cmds[hidden] { display: none; }
.fg-cmd-group { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 3px; font-size: 9px; letter-spacing: .14em; color: var(--ink-4); }
.fg-cmd-group + .fg-cmd-group, .fg-cmd + .fg-cmd-group { padding-top: 8px; }
.fg-cmd-note { letter-spacing: 0; }
.fg-cmd {
  display: grid; grid-template-columns: 104px 1fr auto; column-gap: 12px; align-items: baseline;
  padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer;
}
.fg-cmd:hover, .fg-cmd.is-on { background: var(--bg-2); }
.fg-cmd[disabled] { opacity: .55; cursor: default; }
.fg-cmd[disabled]:hover { background: transparent; }
.fg-cmd-k { font-size: 11px; color: var(--brand-2); }
.fg-cmd-d { font-size: 12px; color: var(--ink-3); }
.fg-cmd-tag { font-size: 10px; color: var(--ink-4); white-space: nowrap; }
.fg-cmd-tag[data-tone="rust"] { color: #b8452c; }
@media (max-width: 640px) { .fg-cmd-d { display: none; } .fg-cmd { grid-template-columns: 104px auto; } }

/* The rail is the first thing to go on a narrow viewport: the conversation is
   the page, the thread list is navigation. */
@media (max-width: 760px) {
  .fg-rail { display: none; }
  .fg-ov-frame { padding: 10px; }
  .fg-stream { padding: 12px 12px 10px; }
  .fg-row { grid-template-columns: 40px 1fr 40px; }
  .fg-under { grid-template-columns: 40px 1fr; }
  .fg-hog-stage { overflow: hidden; }
}
