/* Typeflow 2.0 · design tokens and shared components (from handoff/design/*.dc.html) */
:root {
  --bg: #111214; --bg-deep: #0A0B0C; --bg-bar: #0E0F10; --bg-side: #0F1011; --bg-page: #0B0C0D;
  --field: #16181A; --field-bd: #26292C; --raise: #141517; --raise2: #151618; --hover: #1C1E20;
  --line: #222528; --line2: #1D2022; --line3: #24272A; --line4: #2A2D30; --line5: #2E3134;
  --fg: #EDEEEA; --fg2: #B9BCB6; --fg3: #A4A8A2; --fg4: #9A9E98; --mute: #8E928C; --mute2: #7F837D; --white: #F4F5F2;
  --lime: #C5F66A; --lime-hi: #D6FF8A; --lime-ink: #0E1208; --lime-soft: #D9FF9B; --lime-bg: #1A2410; --lime-bd: #3A4A22;
  --lime-tile: #1D2A10; --lime-tile-bd: #34471B; --lime-foot: #1A2111;
  --blue: #8FB7FF; --orange: #FF8A3D; --gold: #E8C77A; --pink: #FF7AB6; --violet: #B79CFF; --red: #FF9A9A;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tight: 'Inter Tight', Inter, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
/* The whole UI renders at 70 %. vh isn't scaled by zoom in CEP's Chromium, so full-height roots divide by --z. */
:root { --z: .7; } body { zoom: var(--z); }
body.sz-small { --z: .63; } body.sz-large { --z: .78; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:disabled { cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--lime); width: 16px; height: 16px; margin: 0; cursor: pointer; flex: none; }
a { color: var(--lime); cursor: pointer; text-decoration: none; } a:hover { color: #DDFF9A; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.tight { font-family: var(--tight); }
.scr::-webkit-scrollbar { width: 8px; height: 8px; } .scr::-webkit-scrollbar-thumb { background: #2A2D30; border-radius: 8px; } .scr::-webkit-scrollbar-track { background: transparent; }
.ghost:hover { background: var(--hover) !important; }
.applybtn { transition: background .15s ease; }
.applybtn:hover:not(:disabled) { background: var(--lime-hi) !important; }
.applybtn:disabled, .applybtn.off { background: #1E2022 !important; color: #6F736D !important; border: 1px solid #2A2D30; }
.lbl { font-size: 11px; font-weight: 500; color: var(--fg4); letter-spacing: .02em; }
.sec { font-size: 13px; font-weight: 600; color: var(--fg); }
.sh { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--mute); }
.kbd { font-family: var(--mono); font-size: 10.5px; color: #C9CCC6; background: #24272A; border: 1px solid #33373A; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.kbd2 { font-family: var(--mono); font-size: 10.5px; color: var(--mute); border: 1px solid var(--line5); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }

.logo { flex: none; border-radius: 9px; background: var(--lime); color: var(--lime-ink); display: flex; align-items: center; justify-content: center; font-family: var(--tight); font-weight: 800; font-style: italic; letter-spacing: -0.04em; }

.seg { display: flex; padding: 3px; gap: 2px; background: var(--bg-bar); border: 1px solid var(--line3); border-radius: 9px; }
.seg > button { flex: 1; height: 30px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--fg4); text-align: center; white-space: nowrap; padding: 0 6px; }
.seg > button.on { background: #26292C; color: #FFFFFF; }
.seg.sm > button { height: 26px; font-size: 11.5px; }
.seg.fit > button { flex: none; padding: 0 12px; height: 28px; border-radius: 6px; }

.stepper { display: flex; align-items: center; height: 38px; background: var(--field); border: 1px solid var(--field-bd); border-radius: 9px; overflow: hidden; }
.stepper > button { width: 32px; height: 100%; color: var(--fg3); font-size: 16px; text-align: center; flex: none; }
.stepper > button:hover { background: #202326; color: #fff; }
.stepper > span { flex: 1; text-align: center; font-family: var(--mono); font-size: 12.5px; }
.stepper.sm { height: 34px; }

.sel { appearance: none; -webkit-appearance: none; height: 34px; width: 100%; padding: 0 30px 0 10px; background-color: var(--field); background-image: linear-gradient(45deg, transparent 50%, #A4A8A2 50%), linear-gradient(135deg, #A4A8A2 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; border: 1px solid var(--field-bd); border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.sel option, .sel optgroup { background: var(--field); color: var(--fg); }
.fld { height: 40px; padding: 0 12px; background: var(--field); border: 1px solid var(--field-bd); border-radius: 9px; font-size: 13px; outline: none; width: 100%; }
.fld.err { border-color: #7A3434; }
textarea.fld { height: auto; min-height: 64px; padding: 10px 12px; line-height: 1.5; resize: vertical; font-size: 12.5px; }

.btn2 { height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line5); background: #1A1C1E; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn2:hover:not(:disabled) { background: #222527; }
.btn2.sm { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.btn2.danger { color: var(--red); }
.btn2:disabled { opacity: .5; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.pill { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--fg3); border: 1px solid var(--line); white-space: nowrap; }
.pill.on { background: #1F2224; color: #fff; border-color: #34383B; }
.pill .dot { width: 6px; height: 6px; border-radius: 3px; }

.sw { width: 36px; height: 20px; border-radius: 10px; padding: 2px; display: flex; flex: none; background: #33383D; justify-content: flex-start; }
.sw > span { width: 16px; height: 16px; border-radius: 8px; background: #fff; }
.sw.on { background: var(--lime); justify-content: flex-end; }

.chk { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }

.toast { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--lime-bg); border: 1px solid var(--lime-bd); color: var(--lime-soft); font-size: 12px; }
.toast.err { background: #2A1414; border-color: #5A2A2A; color: #FFC2C2; }
.toast .undo { margin-left: auto; height: 26px; padding: 0 10px; border-radius: 7px; background: #2A3A16; color: #EAFFC6; font-size: 12px; font-weight: 600; }
.badge { flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; border-radius: 4px; padding: 2px 5px; }

/* preview cards ------------------------------------------------------- */
.card { text-align: left; border-radius: 11px; overflow: hidden; background: var(--field); border: 1px solid var(--line3); display: flex; flex-direction: column; transition: border-color .15s ease, transform .15s ease; min-width: 0; }
.card:hover { border-color: #3C4043; transform: translateY(-1px); }
.card.on { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 9px; background: var(--raise2); border-top: 1px solid #202326; }
.card.on .foot { background: var(--lime-foot); }
.card .nm { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pvbox { position: relative; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pvbox > .pv { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--s, .7)); transform-origin: 50% 50%; }
.pvbox > .gt { position: relative; text-align: center; line-height: 1.08; color: var(--white); padding: 0 10px; max-width: 100%; }
.pvbox .corner { position: absolute; top: 7px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; border-radius: 4px; padding: 2px 5px; z-index: 2; }
.pvbox .check { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 5px; background: var(--lime); display: flex; align-items: center; justify-content: center; z-index: 2; }
.gm.w { margin-right: .26em; }
.gm.k { overflow: hidden; padding: 0 .03em .06em; margin-bottom: -.06em; }
.tf-still .pv *, .tf-still .gp { animation-play-state: paused !important; animation-delay: -1.5s !important; }
.stage-big { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #17191B 0%, #0C0D0E 70%); }
.stage-big .safe { position: absolute; inset: 18px 34px; border: 1px dashed #2A2E31; border-radius: 4px; pointer-events: none; }
.stage-big .cap { position: absolute; top: 9px; left: 12px; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.stage-big .meta { position: absolute; top: 9px; right: 12px; font-size: 10px; color: var(--mute); font-family: var(--mono); }

/* modal --------------------------------------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal > .dlg { width: 100%; max-width: 380px; background: #16181A; border: 1px solid #34383B; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.menu { position: absolute; z-index: 40; min-width: 220px; max-height: 300px; overflow-y: auto; background: #16181A; border: 1px solid #34383B; border-radius: 10px; padding: 4px; box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.menu > button { display: block; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; }
.menu > button:hover { background: #222527; }
.menu .empty { padding: 10px; color: var(--mute); font-size: 12px; }
@keyframes tfPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.pls { animation: tfPulse 1.8s ease-in-out infinite; }
