/* daftar prototype. Tokens from hpy design-taste.md: Mono palette, 4px grid, radius 4/8/16/24/32/128, control heights 32/40/48. */
:root {
  --white: #ffffff; --mist: #f2f2f2; --ash: #adadad; --lucid: #444444; --night: #2f2f2f; --midnight: #212121;
  --peach: #fff4ea;
  --danger: #c44545; --warn: #9a6519; --ok: #27805a;
  --teal: #2fa39c; --amber: #d9b93c; --apricot: #db8f5c; --mauve: #b781a4;
  --line: rgba(173, 173, 173, .32); --line-strong: rgba(173, 173, 173, .48); --field: #888888;
  --shadow: 0 16px 48px rgba(33, 33, 33, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --inter: 'Inter', system-ui, -apple-system, sans-serif;
  --lora: 'Lora', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--mist); color: var(--night); font: 400 15px/1.45 var(--inter); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ic.s { width: 16px; height: 16px; }
.ic.xs { width: 12px; height: 12px; }
.ic.l { width: 24px; height: 24px; }
.ic.xl { width: 48px; height: 48px; }
:focus-visible { outline: 2px solid var(--midnight); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--white); box-shadow: 1px 0 0 var(--line); display: flex; flex-direction: column; padding: 24px 16px 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 8px; margin-bottom: 20px; }
.wordmark { font: 400 22px/1 var(--lora); color: var(--midnight); letter-spacing: -.01em; }
.brand small { font-size: 12px; color: var(--lucid); border-left: 1px solid var(--line-strong); padding-left: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Search is a plain inline box. Results appear under it, inside the sidebar. */
.search { position: relative; margin-bottom: 16px; }
.search .field { height: 40px; color: var(--lucid); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--midnight); }
.search input::placeholder { color: var(--lucid); }
.sr { margin-top: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 2px; animation: pop .16s var(--ease); }
.sr .sg { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--lucid); padding: 8px 8px 4px; }
.sr a { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 8px; font-size: 14px; color: var(--night); }
.sr a:hover { background: var(--mist); }
.sr a .ic { color: var(--lucid); }
.sr a small { margin-left: auto; font-size: 12px; color: var(--lucid); white-space: nowrap; }
.sr .none { font-size: 13px; color: var(--lucid); padding: 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--night); font-size: 15px; transition: background .16s var(--ease); }
.nav a:hover { background: rgba(242, 242, 242, .6); }
.nav a.on { background: var(--mist); color: var(--midnight); font-weight: 500; }
.nav a .n { margin-left: auto; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 12px 8px; }
.nav .grp { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--lucid); padding: 12px 12px 4px; }
.me-wrap { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; position: relative; }
.me { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; text-align: left; color: var(--lucid); transition: background .16s var(--ease); }
.me:hover, .me[aria-expanded="true"] { background: var(--mist); }
.me b, .sw-row b { display: block; font-weight: 500; font-size: 14px; color: var(--midnight); }
.me small, .sw-row small { display: block; font-size: 12px; color: var(--lucid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch { position: absolute; left: 0; right: -80px; bottom: calc(100% + 8px); background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 8px 8px; z-index: 20; animation: pop .2s var(--ease); }
.switch .eyebrow { padding: 0 8px 8px; }
.sw-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--night); }
.sw-row:hover { background: var(--mist); }
.main { min-width: 0; }
.page { max-width: 1200px; margin: 0 auto; padding: 40px 48px 96px; animation: in .28s var(--ease); }
.page.wide { max-width: 1440px; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }

/* Type */
.eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--lucid); font-weight: 500; }
h1 { font: 500 32px/1.25 var(--inter); color: var(--midnight); letter-spacing: -.01em; }
h1.serif { font: 400 36px/1.2 var(--lora); letter-spacing: 0; }
h2 { font: 500 16px/1.3 var(--inter); color: var(--midnight); }
h3 { font: 500 15px/1.35 var(--inter); color: var(--midnight); }
.sub { color: var(--lucid); font-size: 15px; }
.muted { color: var(--lucid); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.strong { color: var(--midnight); font-weight: 500; }
.code { font-family: var(--mono); font-size: 13px; }
.ok { color: var(--ok); } .warn-t { color: var(--warn); } .danger-t { color: var(--danger); }

/* Page head */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.head .t { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--night); font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lucid); margin-bottom: 12px; }
.crumbs .ic { width: 12px; height: 12px; color: var(--ash); }

/* Buttons: fixed heights 32 / 40 / 48, 1px transparent border so variants line up */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 128px; border: 1px solid transparent; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), color .16s var(--ease); position: relative; }
.btn:active { transform: scale(.98); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.p0 { background: var(--midnight); color: var(--white); }
.btn.p0:hover { background: var(--night); }
.btn.sec { background: var(--white); border-color: var(--line-strong); color: var(--night); }
.btn.sec:hover { border-color: var(--field); }
.btn.ghost { color: var(--night); }
.btn.ghost:hover { background: var(--mist); }
.btn.danger { background: var(--danger); color: var(--white); }
.btn.danger-t { color: var(--danger); }
.btn.danger-t:hover { background: color-mix(in srgb, var(--danger) 10%, var(--white)); }
.btn.inv { background: var(--white); color: var(--midnight); }
.btn.inv:hover { background: var(--mist); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .4; cursor: default; }
/* A button that writes holds its own spinner */
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 128px; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; color: var(--white); }
.btn.sec.busy::after, .btn.ghost.busy::after { color: var(--night); }
.btn.done { background: var(--white); border-color: var(--line-strong); color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips: mono, quiet, warn, danger; .cat for categorical kinds */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 32px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.chip .ic { width: 12px; height: 12px; }
.chip.mono { background: var(--mist); color: var(--night); }
.chip.on-mist { background: var(--white); }
.chip.quiet { background: var(--white); border-color: var(--line-strong); color: var(--lucid); }
.chip.warn { background: var(--warn); color: var(--white); }
.chip.danger { background: var(--danger); color: var(--white); }
.chip.night { background: var(--night); color: var(--white); }
.chip.cat { background: color-mix(in srgb, var(--c) 10%, var(--white)); border-color: color-mix(in srgb, var(--c) 32%, transparent); color: var(--night); }
.chip.cat::before { content: ''; width: 8px; height: 8px; border-radius: 128px; background: var(--c); flex-shrink: 0; }
.chip.cat.on-mist { background: color-mix(in srgb, var(--c) 10%, var(--mist)); }
.dot { width: 8px; height: 8px; border-radius: 128px; background: var(--c, var(--ash)); display: inline-block; flex-shrink: 0; }

/* Surfaces */
.card { background: var(--white); border-radius: 16px; padding: 24px; }
.card.hero { border-radius: 24px; padding: 32px; }
.card.flush { padding: 0; overflow: hidden; }
.card.dark { background: var(--midnight); color: var(--white); }
.card.dark h2, .card.dark h3, .card.dark .strong { color: var(--white); }
.card.dark .muted, .card.dark .sub { color: var(--ash); }
.card.peach { background: var(--peach); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; gap: 16px; }
.sec-h .meta { font-size: 13px; color: var(--lucid); }
.group + .group { margin-top: 40px; }
.alert { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; border-radius: 16px; background: color-mix(in srgb, var(--k) 10%, var(--white)); border: 1px solid color-mix(in srgb, var(--k) 32%, transparent); color: var(--night); }
.alert > .ic { color: var(--k); }
.alert .grow { flex: 1; }
.alert b { color: var(--midnight); font-weight: 500; }
.line-status { display: flex; align-items: center; gap: 8px; color: var(--lucid); font-size: 14px; }
.line-status .ic { color: var(--k, var(--lucid)); }

/* Icon tiles: duotone glyph on a soft tile tinted by kind */
.tile { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--c, var(--ash)) 12%, var(--white)); color: color-mix(in srgb, var(--c, var(--lucid)) 100%, var(--midnight) 24%); }
.tile.sm { width: 32px; height: 32px; }
.tile.sm .ic { width: 16px; height: 16px; }
.tile.lg { width: 48px; height: 48px; border-radius: 8px; }
.on-mist .tile, .tile.on-mist { background: color-mix(in srgb, var(--c, var(--ash)) 12%, var(--mist)); }

/* Avatars: Mist fill, Night initials; White on a Mist ground */
.av { width: 40px; height: 40px; border-radius: 128px; background: var(--mist); color: var(--night); display: grid; place-items: center; font-size: 14px; font-weight: 500; flex-shrink: 0; letter-spacing: .02em; }
.av.s { width: 32px; height: 32px; font-size: 12px; }
.av.xs { width: 24px; height: 24px; font-size: 10px; }
.av.l { width: 64px; height: 64px; font-size: 22px; }
.on-canvas .av, .av.w { background: var(--white); }
.avs { display: inline-flex; }
.avs .av { box-shadow: 0 0 0 2px var(--white); margin-left: -8px; }
.avs .av:first-child { margin-left: 0; }

/* Rows and lists */
.list > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 24px; }
.row.tight { padding: 12px 24px; }
.row .grow { flex: 1; min-width: 0; }
a.row, .row.click { transition: background .16s var(--ease); cursor: pointer; }
a.row:hover, .row.click:hover { background: rgba(242, 242, 242, .48); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagger > * { animation: in .32s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms; } .stagger > *:nth-child(3) { animation-delay: 80ms; } .stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; } .stagger > *:nth-child(6) { animation-delay: 200ms; } .stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; } .stagger > *:nth-child(n+9) { animation-delay: 320ms; }

/* Segmented control */
.seg { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 32px; padding: 4px; gap: 4px; }
.seg.on-white { background: var(--mist); border-color: transparent; }
.seg a, .seg button { height: 32px; padding: 0 12px; border-radius: 32px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lucid); font-weight: 500; transition: background .16s var(--ease), color .16s var(--ease); white-space: nowrap; }
.seg .on { background: var(--mist); color: var(--midnight); }
.seg.on-white .on { background: var(--white); }
.seg .ct { font-weight: 400; color: var(--lucid); }

/* Tabs: underlined, for records with sections */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a { height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lucid); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .16s var(--ease); }
.tabs a:hover { color: var(--midnight); }
.tabs a.on { color: var(--midnight); border-bottom-color: var(--midnight); }
.tabs a .ct { font-weight: 400; color: var(--lucid); font-size: 12px; }

/* Fields */
.field { height: 40px; border: 1px solid var(--field); border-radius: 8px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: var(--white); color: var(--lucid); font-size: 14px; }
.field.grow { flex: 1; }
.field.sm { height: 32px; font-size: 13px; }
.field input, .field select { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--midnight); }
.field .ic { color: var(--lucid); }
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld label { font-size: 13px; font-weight: 500; color: var(--midnight); }
.fld .help { font-size: 12px; color: var(--lucid); }
.fld.err .field { border-color: color-mix(in srgb, var(--danger) 32%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--white)); }
.fld.err .help { color: var(--danger); }
.textarea { min-height: 96px; border: 1px solid var(--field); border-radius: 8px; padding: 12px; font-size: 14px; color: var(--midnight); background: var(--white); resize: vertical; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.box { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--field); background: var(--white); display: grid; place-items: center; color: var(--white); transition: background .16s var(--ease), border-color .16s var(--ease); flex-shrink: 0; }
.box .ic { width: 16px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .16s var(--ease), transform .2s var(--ease); }
.check.on .box, .box.on { background: var(--night); border-color: var(--night); }
.check.on .box .ic, .box.on .ic { opacity: 1; transform: scale(1); }
.check.on .lbl { color: var(--lucid); text-decoration: line-through; }
.toggle { width: 40px; height: 24px; border-radius: 32px; background: var(--ash); position: relative; transition: background .2s var(--ease); flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 128px; background: var(--white); transition: transform .2s var(--ease); }
.toggle.on { background: var(--night); }
.toggle.on::after { transform: translateX(16px); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--lucid); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl tbody tr { transition: background .16s var(--ease); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: rgba(242, 242, 242, .48); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl td.strong { color: var(--midnight); font-weight: 500; }
.tbl.dense td { padding: 8px 16px; font-size: 13px; }
.tbl th.sort { color: var(--midnight); }
.tbl th .ic { width: 12px; height: 12px; vertical-align: -1px; margin-left: 4px; }

/* Stats */
.stats { display: grid; gap: 16px; }
.stat { background: var(--white); border-radius: 16px; padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .v { font: 500 28px/1.2 var(--inter); color: var(--midnight); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .l { font-size: 13px; color: var(--lucid); }
.stat .d { font-size: 12px; color: var(--lucid); display: flex; align-items: center; gap: 4px; }
.stat.attn .v { color: var(--danger); }

/* Progress and meters */
.bar { height: 8px; background: var(--mist); border-radius: 4px; overflow: hidden; position: relative; }
.on-mist .bar, .bar.on-mist { background: var(--white); }
.bar b { display: block; height: 100%; background: var(--night); border-radius: 4px; transform-origin: left; animation: grow .6s var(--ease) both; }
.bar b.c { background: var(--c); }
.bar b.warn { background: var(--warn); } .bar b.danger { background: var(--danger); } .bar b.ok { background: var(--ok); }
.bar.thin { height: 4px; }
.bar.stack { display: flex; }
.bar.stack b { border-radius: 0; animation: none; }
.bar.stack b:first-child { border-radius: 4px 0 0 4px; } .bar.stack b:last-child { border-radius: 0 4px 4px 0; }
@keyframes grow { from { transform: scaleX(0); } }
.ring { width: 40px; height: 40px; border-radius: 128px; background: conic-gradient(var(--night) calc(var(--p) * 1%), var(--mist) 0); display: grid; place-items: center; flex-shrink: 0; }
.ring::after { content: ''; width: 28px; height: 28px; border-radius: 128px; background: var(--white); }

/* Layout helpers */
.cols { display: grid; gap: 32px; align-items: start; }
.cols.g24 { gap: 24px; }
.flex { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; } .mt40 { margin-top: 40px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Empty and error states: a large Ash glyph, a heading, one line, one way forward */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.empty .ic { color: var(--ash); opacity: .48; margin-bottom: 8px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--lucid); font-size: 14px; max-width: 360px; }
.empty .btn { margin-top: 8px; }

/* Skeletons: shaped like the result, shimmer across */
.sk { position: relative; overflow: hidden; background: var(--mist); border-radius: 8px; }
.on-white .sk, .card .sk { background: var(--mist); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shimmer 1.2s var(--ease) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk.t { height: 16px; width: 60%; } .sk.t.w { width: 40%; } .sk.t.n { width: 25%; } .sk.h { height: 32px; width: 40%; border-radius: 8px; }
.sk.card { height: 120px; width: 100%; border-radius: 16px; background: var(--white); }
.sk.row { height: 56px; width: 100%; border-radius: 0; background: var(--white); }
.sk.circle { width: 40px; height: 40px; border-radius: 128px; flex-shrink: 0; }
.skel { display: flex; flex-direction: column; gap: 16px; }

/* Drawer: slides in from the right for a record that stays in context */
.scrim { position: fixed; inset: 0; background: rgba(33, 33, 33, .32); z-index: 50; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; background: var(--white); z-index: 51; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .28s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer .dh { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.drawer .db { flex: 1; overflow-y: auto; padding: 24px; }
.drawer .group { margin-top: 32px; }
.drawer .df { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.drawer h2.big { font: 500 22px/1.3 var(--inter); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; font-size: 14px; align-items: center; }
.kv dt { color: var(--lucid); }
.kv dd { color: var(--midnight); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }

/* Dialog */
.dialog-wrap { position: fixed; inset: 0; z-index: 52; display: grid; place-items: start center; padding-top: 96px; }
.dialog { width: 560px; background: var(--white); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; animation: pop .24s var(--ease); }
.dialog .dh { padding: 24px 24px 0; }
.dialog .db { padding: 16px 24px 24px; }
.dialog .df { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* Menus */
.menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 200px; background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; z-index: 30; animation: pop .16s var(--ease); }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--night); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--mist); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }
.rel { position: relative; }

/* Toast: rare, four seconds, never over the primary action */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--midnight); color: var(--white); padding: 0 20px; height: 48px; display: flex; align-items: center; gap: 12px; border-radius: 128px; font-size: 14px; z-index: 60; animation: toast 4s var(--ease) both; box-shadow: var(--shadow); white-space: nowrap; }
.toast .ic { color: var(--ash); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 6% { opacity: 1; transform: translate(-50%, 0); } 92% { opacity: 1; } 100% { opacity: 0; } }

/* Timeline */
.tl { display: flex; flex-direction: column; }
.tl-i { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding-bottom: 20px; position: relative; }
.tl-i::before { content: ''; position: absolute; left: 12px; top: 24px; bottom: 0; border-left: 1px solid var(--line); }
.tl-i:last-child::before { display: none; }
.tl-i .g { width: 24px; height: 24px; border-radius: 128px; background: var(--mist); display: grid; place-items: center; color: var(--lucid); }
.tl-i .g .ic { width: 12px; height: 12px; }
.tl-i .g.ok { color: var(--ok); }
.tl-i .w { font-size: 14px; color: var(--night); }
.tl-i .w small { display: block; font-size: 12px; color: var(--lucid); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
