/* tools/margin.html — Margin AI, screen by screen.
   Margin's own look inside the mocks (specification/design.md): ink on the page, one raised grey,
   framed record cards, money in mono, the pixel bull; colour only on the Registry. */

.t-margin {
  --mg-frame: #1b1b1a;
  --mg-raised: #f2f2f7;
  --mg-ring: #8a8a8e;
  --k-slaughter-bg: #f7dfd3; --k-slaughter: #6e2a17;
  --k-cutting-bg: #f3e5c6;   --k-cutting: #5e4309;
  --k-processing-bg: #eadff4; --k-processing: #47297a;
  --k-cold-bg: #d8e9f7;      --k-cold: #104a78;
  --k-farm-bg: #eeecc6;      --k-farm: #4f4f0c;
  --k-trader-bg: #d6eee9;    --k-trader: #0c5249;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-margin {
    --mg-frame: #2c2c2a;
    --mg-raised: #26262a;
    --mg-ring: #7c7c80;
    --k-slaughter-bg: #3a1e15; --k-slaughter: #f4c9b6;
    --k-cutting-bg: #352a10;   --k-cutting: #ebd6a0;
    --k-processing-bg: #2a1d42; --k-processing: #dacaf0;
    --k-cold-bg: #122c42;      --k-cold: #bbdcf6;
    --k-farm-bg: #2f2e10;      --k-farm: #e3e0a4;
    --k-trader-bg: #102f2b;    --k-trader: #b5e7dd;
  }
}

/* ---------- Hero ---------- */
.t-margin .mg-hero { padding: var(--space-12) 0 var(--space-8); }
.t-margin .mg-hero__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.t-margin .mg-hero__text { display: grid; gap: var(--space-8); align-content: center; }
.t-margin .mg-hero__text .mb-eyebrow { margin-bottom: calc(var(--space-2) * -1); }
.t-margin .mg-hero__stage { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.t-margin .mg-hero__note { max-width: 300px; font-size: 13.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.t-margin .mg-hero__note b { color: var(--ink); font-weight: 500; }
.t-margin .mg-runs { list-style: none; margin: var(--space-4) 0 0; padding: var(--space-6) 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); font-size: 15px; color: var(--ink); }
.t-margin .mg-runs li { display: inline-flex; align-items: center; gap: 8px; }
.t-margin .mg-runs svg { width: 18px; height: 18px; color: var(--muted); }

/* ---------- The phone ---------- */
.t-margin .mg-ph { flex: none; width: 292px; height: 604px; padding: 9px; border-radius: 46px; background: var(--mg-frame); box-shadow: var(--shadow-window), 0 0 0 1px var(--line-strong); }
.t-margin .mg-ph__scr { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 37px; background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 1.35; }
.t-margin .mg-st { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 24px; font-size: 12px; }
.t-margin .mg-st b { font-weight: 600; font-variant-numeric: tabular-nums; }
.t-margin .mg-st__isl { position: absolute; left: 50%; top: 9px; width: 80px; height: 22px; margin-left: -40px; border-radius: 12px; background: var(--mg-frame); }
.t-margin .mg-st__sig { display: flex; align-items: flex-end; gap: 2px; height: 9px; }
.t-margin .mg-st__sig i { width: 3px; border-radius: 1px; background: currentColor; }
.t-margin .mg-st__sig i:nth-child(1) { height: 4px; } .t-margin .mg-st__sig i:nth-child(2) { height: 6px; } .t-margin .mg-st__sig i:nth-child(3) { height: 9px; }

.t-margin .mg-hd { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 12px 6px; }
.t-margin .mg-hd__b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--mg-raised); font-size: 12px; letter-spacing: .05em; }
.t-margin .mg-hd__b:empty { background: none; }
.t-margin .mg-hd__b svg { width: 16px; height: 16px; }
.t-margin .mg-hd__t { font-size: 13px; font-weight: 600; }
.t-margin .mg-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 4px 14px 10px; }
.t-margin .mg-body--page { gap: 0; }

.t-margin .mg-ttl { font-size: 25px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.t-margin .mg-h2 { font-size: 18px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.t-margin .mg-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.t-margin .mg-lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 13px 0 3px; font-size: 11px; color: var(--muted); }
.t-margin .mg-lbl span { font-size: 10.5px; }
.t-margin .mg-chev { font-style: normal; color: var(--muted); }

.t-margin .mg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-row > span { flex: 1; min-width: 0; }
.t-margin .mg-row b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-row small { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-row em, .t-margin .mg-pl em, .t-margin .mg-stand em, .t-margin .mg-sides em, .t-margin .mg-money em { font: 500 12px/1.2 var(--font-mono); font-style: normal; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* A record of the trader's in the chat: one hairline frame, radius 12, no fill. */
.t-margin .mg-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.t-margin .mg-card { padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 12px; }
.t-margin .mg-card .mg-row { border-bottom: 0; }
/* The trader's own turn: the one raised grey. */
.t-margin .mg-you { align-self: flex-end; max-width: 82%; padding: 8px 11px; border-radius: 12px; background: var(--mg-raised); font-size: 12.5px; color: var(--ink); }
.t-margin .mg-headline { margin-top: 2px; font-size: 13px; font-weight: 600; }
.t-margin .mg-out { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 11.5px; }
.t-margin .mg-out span { flex: none; width: 82px; color: var(--muted); }
.t-margin .mg-out b { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.t-margin .mg-cmp { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; margin: 6px 10px 12px; padding: 0 5px 0 11px; border-radius: 999px; background: var(--mg-raised); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.t-margin .mg-cmp__plus svg { width: 16px; height: 16px; }
.t-margin .mg-cmp__f { flex: 1; color: var(--muted); }
.t-margin .mg-cmp__mic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--surface); }
.t-margin .mg-cmp__mic svg { width: 15px; height: 15px; }

/* Today */
.t-margin .mg-call, .t-margin .mg-task { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-call > span, .t-margin .mg-task > span { min-width: 0; }
.t-margin .mg-call b, .t-margin .mg-task b { display: block; font-weight: 500; }
.t-margin .mg-call small, .t-margin .mg-task small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-call u { text-decoration: none; color: var(--ink); font-weight: 600; }
.t-margin .mg-av { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mg-raised); font: 600 10px/1 var(--font-sans); font-style: normal; color: var(--ink); }
.t-margin .mg-task i { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--mg-ring); }
.t-margin .mg-verbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 0 8px; }
.t-margin .mg-cap { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--mg-raised); font-size: 11px; font-weight: 500; white-space: nowrap; }
.t-margin .mg-cap--on { background: var(--ink); color: var(--surface); }

/* Deal */
.t-margin .mg-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; margin-top: 12px; }
.t-margin .mg-sides > div { display: grid; gap: 1px; padding: 8px 9px; border-radius: 10px; background: var(--mg-raised); }
.t-margin .mg-sides small { font-size: 10px; color: var(--muted); }
.t-margin .mg-sides b { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-sides > span { color: var(--muted); }
.t-margin .mg-money { display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 8px; align-items: baseline; margin: 10px 0 2px; font-size: 11.5px; color: var(--muted); }
.t-margin .mg-line { padding: 3px 0; font-size: 12px; }
.t-margin .mg-q { margin: 0; padding: 1px 0 1px 10px; border-left: 2px solid var(--line-strong); font-size: 12px; }
.t-margin .mg-q small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.t-margin .mg-file { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-file > svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.t-margin .mg-file > span { min-width: 0; }
.t-margin .mg-file b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-file small { display: block; font-size: 11px; color: var(--muted); }

/* Price list */
.t-margin .mg-pl { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-pl i svg { width: 14px; height: 14px; }
.t-margin .mg-pl b { display: block; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-pl small { display: block; font-size: 10.5px; color: var(--muted); }

/* Company */
.t-margin .mg-co { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.t-margin .mg-co b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.t-margin .mg-co small { font-size: 11px; color: var(--muted); }
.t-margin .mg-av--co { width: 40px; height: 40px; border-radius: 12px; }
.t-margin .mg-av--co svg { width: 18px; height: 18px; }
.t-margin .mg-reach { display: flex; gap: 6px; margin-top: 10px; }
.t-margin .mg-reach span { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 7px 0; border-radius: 10px; background: var(--mg-raised); font-size: 10.5px; font-weight: 500; }
.t-margin .mg-reach svg { width: 16px; height: 16px; }
.t-margin .mg-facts { margin: 0; padding: 0 0 0 14px; font-size: 12px; }
.t-margin .mg-facts li { padding: 2px 0; }
.t-margin .mg-stand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-stand > span { font-size: 11.5px; color: var(--muted); }
.t-margin .mg-stand em.mg-plain { font-family: var(--font-sans); font-weight: 400; }
.t-margin .mg-stand small { width: 100%; text-align: right; font-size: 10.5px; color: var(--muted); }

/* Registry: the one screen in colour */
.t-margin .mg-search { display: flex; align-items: center; height: 32px; margin-top: 10px; padding: 0 10px; border-radius: 10px; background: var(--mg-raised); font-size: 12px; color: var(--muted); }
.t-margin .mg-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.t-margin .mg-kind { display: grid; gap: 1px; padding: 8px 10px 9px; border-radius: 12px; background: var(--k-bg); color: var(--k-ink); }
.t-margin .mg-kind__s { width: 28px; height: 21px; margin-bottom: 4px; }
.t-margin .mg-kind b { font-size: 11.5px; font-weight: 600; }
.t-margin .mg-kind small { font: 500 10.5px/1.2 var(--font-mono); opacity: .85; }
.t-margin .mg-kind--slaughter { --k-bg: var(--k-slaughter-bg); --k-ink: var(--k-slaughter); }
.t-margin .mg-kind--cutting { --k-bg: var(--k-cutting-bg); --k-ink: var(--k-cutting); }
.t-margin .mg-kind--processing { --k-bg: var(--k-processing-bg); --k-ink: var(--k-processing); }
.t-margin .mg-kind--cold { --k-bg: var(--k-cold-bg); --k-ink: var(--k-cold); }
.t-margin .mg-kind--farm { --k-bg: var(--k-farm-bg); --k-ink: var(--k-farm); }
.t-margin .mg-kind--trader { --k-bg: var(--k-trader-bg); --k-ink: var(--k-trader); }
.t-margin .mg-look { display: grid; gap: 2px; padding: 10px 11px 2px; border-radius: 12px; background: var(--mg-raised); }
.t-margin .mg-look b { font-size: 13px; font-weight: 600; }
.t-margin .mg-look small { font-size: 11px; color: var(--muted); }
.t-margin .mg-look p { margin-top: 4px; font-size: 12px; }
.t-margin .mg-look .mg-cap { background: var(--surface); }
.t-margin .mg-look .mg-cap--on { background: var(--ink); }

/* The pixel bull: ink, whole pixels, it blinks while on screen */
.t-margin .mg-bull { width: 56px; height: 44px; color: var(--ink); }
.t-margin .mg-bull__lids { opacity: 0; }
.t-margin .mg-bull.is-live .mg-bull__lids { animation: mg-blink 4.6s steps(1) infinite; }
@keyframes mg-blink { 0%, 100% { opacity: 0; } 90% { opacity: 1; } 93% { opacity: 0; } 95% { opacity: 1; } 97% { opacity: 0; } }

/* ---------- Hero phone: the drawer ---------- */
.t-margin .mg-ph--hero { width: 304px; height: 628px; }
.t-margin .mg-dr { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 1px; padding: 46px 12px 14px; background: var(--mg-raised); }
.t-margin .mg-dr a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 999px; font-size: 15px; color: var(--ink); text-decoration: none; transition: background-color .15s ease; }
.t-margin .mg-dr a svg { flex: none; width: 18px; height: 18px; }
.t-margin .mg-dr a:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.t-margin .mg-dr a.is-on { background: var(--surface); font-weight: 600; }
.t-margin .mg-dr a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.t-margin .mg-dr__lbl { margin: 12px 12px 2px; font-size: 11.5px; color: var(--muted); }
.t-margin .mg-dr a.mg-dr__rec { padding: 6px 12px; font-size: 13.5px; }
.t-margin .mg-dr__acct { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; }
.t-margin .mg-dr__acct i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font: 600 9.5px/1 var(--font-sans); font-style: normal; }
/* The chat, leaving as a rounded card when the drawer opens (design.md, Drawer) */
.t-margin .mg-dr__chat { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; padding-top: 38px; border-radius: 37px; background: var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.06), -8px 0 24px -12px rgba(0,0,0,.25); transform: translateX(80%); pointer-events: none; }
.t-margin.mg-js .mg-dr__chat { transform: translateX(0); }
.t-margin .mg-dr__chat.mg-play { animation: mg-open 1.1s cubic-bezier(.2,.7,.2,1) .5s both; }
@keyframes mg-open { from { transform: translateX(0); } to { transform: translateX(80%); } }
.t-margin .mg-dr__chat .mg-empty, .t-margin .mg-dr__chat .mg-cmp__f { opacity: 0; }
.t-margin.mg-js .mg-dr__chat .mg-empty, .t-margin.mg-js .mg-dr__chat .mg-cmp__f { opacity: 1; }
.t-margin .mg-dr__chat.mg-play .mg-empty, .t-margin .mg-dr__chat.mg-play .mg-cmp__f { animation: mg-fade .5s ease .8s both; }
@keyframes mg-fade { to { opacity: 0; } }
.t-margin .mg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; text-align: center; }
.t-margin .mg-empty .mg-bull { margin-bottom: 6px; }
.t-margin .mg-empty b { font-size: 15px; font-weight: 600; }
.t-margin .mg-empty p { margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.t-margin .mg-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: var(--mg-raised); font-size: 11.5px; }
.t-margin .mg-chip svg { width: 13px; height: 13px; }

/* ---------- Six screens ---------- */
.t-margin .mg-screens { padding: var(--space-16) 0 var(--space-24); }
.t-margin .mg-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-16) var(--space-8); }
.t-margin .mg-shot { margin: 0; display: grid; justify-items: center; align-content: start; gap: var(--space-6); scroll-margin-top: 96px; }
.t-margin .mg-shot figcaption { width: 100%; max-width: 320px; }
.t-margin .mg-shot__n { display: flex; gap: 10px; font: 500 12px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.t-margin .mg-shot__n span { color: var(--muted); }
.t-margin .mg-shot__line { margin: 10px 0 8px; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }
.t-margin .mg-shot figcaption > p:not([class]) { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.t-margin .mg-shot__ai { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--muted); }
.t-margin .mg-shot__ai svg { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--carmine); }
.t-margin .mg-shot__ai b { font-weight: 500; color: var(--ink); }
.t-margin.mg-js .mg-shot { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.t-margin.mg-js .mg-shot.is-in { opacity: 1; transform: none; }

.t-margin .mg-rest { margin-top: var(--space-16); padding-top: var(--space-6); border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.t-margin .mg-rest__h { margin-bottom: var(--space-4); font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.t-margin .mg-rest ul { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-6); }
.t-margin .mg-rest li { display: grid; gap: 8px; align-content: start; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.t-margin .mg-rest li svg { width: 20px; height: 20px; color: var(--ink); }
.t-margin .mg-rest li b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }

/* ---------- The web workbench on a laptop ---------- */
.t-margin .mg-lap__wrap { margin: 0 calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter) var(--space-6); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-margin .mg-lap__wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.t-margin .mg-lap { min-width: 980px; max-width: 1160px; margin: 0 auto; }
.t-margin .mg-lap__lid { padding: 14px 14px 0; border-radius: 18px 18px 0 0; background: var(--mg-frame); box-shadow: var(--shadow-window); }
.t-margin .mg-lap__scr { height: 520px; display: flex; flex-direction: column; overflow: hidden; border-radius: 6px 6px 0 0; background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 1.4; }
.t-margin .mg-lap__base { height: 14px; margin: 0 -3%; border-radius: 0 0 14px 14px; background: var(--line-strong); }
.t-margin .mg-w__bar { flex: none; display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-sunk); }
.t-margin .mg-w__dots { display: flex; gap: 6px; }
.t-margin .mg-w__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.t-margin .mg-w__url { flex: 0 1 460px; padding: 4px 10px; border-radius: 6px; background: var(--surface); font: 400 11px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-w { flex: 1; min-height: 0; display: grid; grid-template-columns: 188px minmax(0, 1fr) 300px; }
.t-margin .mg-w__side { display: flex; flex-direction: column; gap: 1px; padding: 12px 8px; background: var(--mg-raised); }
.t-margin .mg-w__brand { padding: 2px 8px 12px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.t-margin .mg-w__nav { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; }
.t-margin .mg-w__nav svg { width: 15px; height: 15px; }
.t-margin .mg-w__nav b { flex: 1; font-weight: 400; }
.t-margin .mg-w__nav kbd, .t-margin .mg-w__k { font: 400 10px/1 var(--font-mono); color: var(--muted); }
.t-margin .mg-w__nav.is-on { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.t-margin .mg-w__nav.is-on b { font-weight: 600; }
.t-margin .mg-w__k { margin-top: auto; padding: 8px; }
.t-margin .mg-w__stage { min-width: 0; padding: 16px 20px; overflow: hidden; }
.t-margin .mg-w__head { display: flex; align-items: center; gap: 12px; }
.t-margin .mg-w__head > b { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.t-margin .mg-w__seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--mg-raised); }
.t-margin .mg-w__seg i { padding: 3px 10px; border-radius: 999px; font-style: normal; font-size: 11.5px; color: var(--muted); }
.t-margin .mg-w__seg i.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.t-margin .mg-w__sort { margin-left: auto; font-size: 12px; color: var(--muted); }
.t-margin .mg-w__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.t-margin .mg-w__chips span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--ink-2); }
.t-margin .mg-w__deal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 72px; gap: 12px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.t-margin .mg-w__deal.is-on { border-radius: 8px; border-bottom-color: transparent; background: var(--mg-raised); }
.t-margin .mg-w__deal b { display: block; font-weight: 500; }
.t-margin .mg-w__deal small { display: block; font-size: 11.5px; color: var(--muted); }
.t-margin .mg-w__line { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-margin .mg-w__deal em { font: 500 12px/1 var(--font-mono); font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.t-margin .mg-w__panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-left: 1px solid var(--line); }
.t-margin .mg-w__ph { font-size: 14px; font-weight: 600; }
.t-margin .mg-w__intents, .t-margin .mg-w__send { display: flex; flex-wrap: wrap; gap: 6px; }
.t-margin .mg-w__intents span, .t-margin .mg-w__send span { padding: 4px 11px; border-radius: 999px; background: var(--mg-raised); font-size: 11.5px; font-weight: 500; }
.t-margin .mg-w__intents span.is-on, .t-margin .mg-w__send span.is-on { background: var(--ink); color: var(--surface); }
.t-margin .mg-w__lang { font-size: 11.5px; color: var(--muted); }
.t-margin .mg-w__draft { padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.55; }
.t-margin .mg-w__adj { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--mg-raised); font-size: 12px; color: var(--muted); }
.t-margin .mg-w__adj span { padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 500; }
.t-margin .mg-w__fine { margin-top: auto; font-size: 11px; color: var(--muted); }

.t-margin .mg-desk__pts { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
.t-margin .mg-desk__pts li { padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.t-margin .mg-desk__pts b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink); }
.t-margin kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); font: 500 12px/1.4 var(--font-mono); color: var(--ink); }

/* ---------- Ways in ---------- */
.t-margin .mg-doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--line); }
.t-margin .mg-door { display: grid; gap: 8px; align-content: start; padding: var(--space-6); background: var(--paper); }
.t-margin .mg-door__i { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); }
.t-margin .mg-door__i svg { width: 18px; height: 18px; }
.t-margin .mg-door b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.t-margin .mg-door p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.t-margin .mg-door small { margin-top: 4px; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.t-margin .mg-door--book { background: var(--ink); align-content: end; }
.t-margin .mg-door--book b { color: var(--paper); font-size: 22px; letter-spacing: -0.02em; }
.t-margin .mg-door--book p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.t-margin .mg-door--book small { color: color-mix(in srgb, var(--paper) 60%, transparent); }

/* ---------- How it remembers ---------- */
.t-margin .mg-tag { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; font: 500 10px/1 var(--font-mono); font-style: normal; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.t-margin .mg-tag svg { width: 10px; height: 10px; }
.t-margin .mg-tag--ai { background: var(--carmine-soft); color: var(--carmine); }
.t-margin .mg-tag--code { background: var(--frost); color: var(--frost-ink); }
.t-margin .mg-tag--you { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.t-margin .mg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: var(--space-6); font-size: 14px; color: var(--muted); }
.t-margin .mg-legend > span { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; }
.t-margin .mg-flow { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.t-margin .mg-step { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 10px; }
.t-margin .mg-step__h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
.t-margin .mg-step__h > span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font: 500 11px/1 var(--font-mono); }
.t-margin .mg-step__box { display: flex; flex-direction: column; gap: 10px; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); font-size: 13px; color: var(--ink); }
.t-margin .mg-you--l { align-self: stretch; max-width: none; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.t-margin .mg-src { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.t-margin .mg-src svg { width: 14px; height: 14px; }
.t-margin .mg-read { margin: 0; }
.t-margin .mg-read div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.t-margin .mg-read dt { font-size: 12px; color: var(--muted); }
.t-margin .mg-read dd { margin: 0; font-size: 12.5px; }
.t-margin .mg-read .mg-tag { height: 17px; padding: 0 6px; font-size: 9px; margin-left: 2px; }
.t-margin .mg-step__note { font-size: 12px; line-height: 1.45; color: var(--muted); }
.t-margin .mg-step .mg-card { padding: 0 10px; }
.t-margin .mg-receipt { padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; }
.t-margin .mg-receipt__h { display: flex; align-items: center; gap: 6px; padding: 9px 0 2px; font-weight: 600; }
.t-margin .mg-receipt__h svg { width: 15px; height: 15px; }
.t-margin .mg-receipt__h span { margin-left: auto; font-weight: 400; color: var(--muted); }
.t-margin .mg-receipt .mg-row { border-bottom: 0; }
.t-margin .mg-receipt__undo { padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; font-weight: 500; }
.t-margin.mg-js .mg-flow .mg-step { opacity: 0; transform: translateY(12px); }
.t-margin.mg-js .mg-flow.mg-play .mg-step { animation: mg-up .6s cubic-bezier(.2,.7,.2,1) both; }
.t-margin.mg-js .mg-flow.mg-play .mg-step:nth-child(2) { animation-delay: .35s; }
.t-margin.mg-js .mg-flow.mg-play .mg-step:nth-child(3) { animation-delay: .7s; }
.t-margin.mg-js .mg-flow.mg-play .mg-step:nth-child(4) { animation-delay: 1.05s; }
@keyframes mg-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.t-margin .mg-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); margin-top: var(--space-16); }
.t-margin .mg-rules ul { list-style: none; margin: var(--space-4) 0 0; padding: 0; border-top: 1px solid var(--line); }
.t-margin .mg-rules li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.t-margin .mg-rules li b { font-weight: 600; color: var(--ink); }
.t-margin .mg-never li { display: flex; gap: 12px; align-items: flex-start; }
.t-margin .mg-never svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ink); }

/* ---------- What it connects to ---------- */
.t-margin .mg-conns__grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; margin-bottom: var(--space-6); }
.t-margin .mg-conns__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.t-margin .mg-conn { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .2s ease; }
.t-margin a.mg-conn:hover { border-color: var(--ink-2); }
.t-margin a.mg-conn:hover .mb-arrow { transform: translateX(3px); }
.t-margin .mg-conn .mb-arrow { display: inline-block; transition: transform .2s ease; }
.t-margin .mg-conn .app-ico, .t-margin .mg-conn__i { width: 40px; height: 40px; margin: 0; }
.t-margin .mg-conn__i { display: grid; place-items: center; border-radius: 12px; background: var(--surface-sunk); color: var(--ink); }
.t-margin .mg-conn__i svg { width: 20px; height: 20px; }
.t-margin .mg-conn b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.t-margin .mg-conn small { display: block; margin-top: 2px; font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.t-margin .mg-conn p { grid-column: 1 / -1; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.t-margin .mg-conn--wide { grid-column: 1 / -1; }
.t-margin .mg-conn em { grid-column: 1 / -1; margin-top: 4px; font-style: normal; font-size: 14px; font-weight: 500; color: var(--ink); }
.t-margin .mg-ask { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); font-size: 13px; }
.t-margin .mg-sys { padding: 2px 12px 4px; border: 1px solid var(--line-strong); border-radius: 12px; }
.t-margin .mg-sys__h { display: flex; align-items: center; gap: 8px; padding: 8px 0 4px; font-size: 13px; font-weight: 600; }
.t-margin .mg-sys .app-ico { width: 22px; height: 22px; margin: 0; border-radius: 6px; }
.t-margin .mg-sys .app-ico svg { width: 12px; height: 12px; }
.t-margin .mg-sys .mg-stand:last-child { border-bottom: 0; }
.t-margin .mg-ask__fine { font-size: 12px; color: var(--muted); }

/* ---------- Where it runs, who it is for ---------- */
.t-margin .mg-runs-sec__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); align-items: start; }
.t-margin .mg-runs-sec h2 { margin: var(--space-6) 0; }
.t-margin .mg-plats { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.t-margin .mg-plats li { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.t-margin .mg-plats svg { width: 20px; height: 20px; margin-bottom: 6px; color: var(--ink); }
.t-margin .mg-plats b { font-size: 15px; font-weight: 600; color: var(--ink); }
.t-margin .mg-plats small { font-size: 12.5px; color: var(--muted); }
.t-margin .mg-plats li.is-soon { border-style: dashed; background: transparent; }
.t-margin .mg-plats li.is-soon small { color: var(--warn); }
.t-margin .mg-langs, .t-margin .mg-price { margin-bottom: var(--space-3); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.t-margin .mg-price b { font-weight: 600; color: var(--ink); }
.t-margin .mg-runs-sec .todo { margin-top: var(--space-4); }
.t-margin .mg-whos { display: grid; border-top: 1px solid var(--line); }
.t-margin .mg-who { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-4); padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.t-margin .mg-who b { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.t-margin .mg-who span { font-size: 15px; color: var(--muted); }
.t-margin .mg-who em { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; color: var(--ink); }
.t-margin .mg-who .mb-arrow { display: inline-block; transition: transform .2s ease; }
.t-margin .mg-who:hover .mb-arrow { transform: translateX(4px); }

/* ---------- Contact ---------- */
.t-margin .mg-end { padding: var(--section) 0 var(--space-16); border-top: 1px solid var(--line); }
.t-margin .mg-end__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-12); align-items: end; }
.t-margin .mg-end__in { display: grid; justify-items: start; gap: var(--space-6); }
.t-margin .mg-end__say { display: grid; gap: var(--space-4); padding-bottom: 6px; }
.t-margin .mg-end__cmp { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 18px; border-radius: 30px; background: var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 1px var(--line); color: var(--ink); }
.t-margin .mg-end__cmp .mg-cmp__plus svg { width: 20px; height: 20px; }
.t-margin .mg-end__cmp .mg-cmp__mic { flex: none; width: 44px; height: 44px; }
.t-margin .mg-end__cmp .mg-cmp__mic svg { width: 20px; height: 20px; }
.t-margin .mg-end__f { flex: 1; min-width: 0; font-size: 17px; line-height: 1.4; color: var(--muted); }
.t-margin .mg-end__f.is-typed { color: var(--ink); }
.t-margin .mg-end__rc { background: var(--surface); color: var(--ink); font-size: 13px; }
.t-margin .mg-end__rc .mg-row { border-bottom: 1px solid var(--line); }
.t-margin .mg-end__rc .mg-row em { font-family: var(--font-sans); font-weight: 400; color: var(--muted); }
.t-margin.mg-js .mg-end__rc { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.t-margin.mg-js .mg-end__rc.is-in { opacity: 1; transform: none; }
.t-margin .mg-end__bull .mg-bull { width: 70px; height: 55px; }
.t-margin .mg-others { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); margin-top: var(--space-16); padding-top: var(--space-6); border-top: 1px solid var(--line); font-size: 14px; }
.t-margin .mg-others > span { font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.t-margin .mg-others a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.t-margin .mg-others a:hover { text-decoration: underline; text-underline-offset: 3px; }
.t-margin .mg-others .app-ico { width: 28px; height: 28px; margin: 0; border-radius: 8px; }
.t-margin .mg-others .app-ico svg { width: 14px; height: 14px; }
.t-margin .mg-others__all { margin-left: auto; font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .t-margin .mg-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-margin .mg-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-margin .mg-rest ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .t-margin .mg-conns__grid { grid-template-columns: minmax(0, 1fr); }
  .t-margin .mg-ask { position: static; max-width: 460px; }
}
@media (max-width: 960px) {
  .t-margin .mg-hero { padding: var(--space-8) 0 var(--space-16); }
  .t-margin .mg-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .t-margin .mg-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-margin .mg-desk__pts, .t-margin .mg-rules, .t-margin .mg-runs-sec__grid, .t-margin .mg-end__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .t-margin .mg-runs-sec__grid { gap: var(--space-12); }
}
@media (max-width: 700px) {
  .t-margin .mg-shots { display: flex; gap: var(--space-4); margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .t-margin .mg-shot { flex: 0 0 292px; scroll-snap-align: center; }
  .t-margin.mg-js .mg-shot { opacity: 1; transform: none; }
  .t-margin .mg-flow, .t-margin .mg-conns__list { grid-template-columns: minmax(0, 1fr); }
  .t-margin .mg-rest ul { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .t-margin .mg-rest li { grid-template-columns: 20px minmax(0, 1fr); gap: 12px; }
  .t-margin .mg-plats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-margin .mg-others__all { margin-left: 0; }
  .t-margin .mg-lap { min-width: 620px; }
  .t-margin .mg-w { grid-template-columns: minmax(0, 1fr) 270px; }
  .t-margin .mg-w__side { display: none; }
  .t-margin .mg-w__deal { grid-template-columns: minmax(0, 1fr) 64px; }
  .t-margin .mg-w__line { display: none; }
}
@media (max-width: 520px) {
  .t-margin .mg-doors { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .t-margin .mg-dr__chat.mg-play, .t-margin .mg-dr__chat.mg-play .mg-empty, .t-margin .mg-dr__chat.mg-play .mg-cmp__f, .t-margin .mg-bull.is-live .mg-bull__lids, .t-margin.mg-js .mg-flow.mg-play .mg-step { animation: none; }
  .t-margin.mg-js .mg-shot, .t-margin.mg-js .mg-flow .mg-step { opacity: 1; transform: none; transition: none; }
}
