@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap&subset=cyrillic");

/* GLASS — static renditions of the web app's components, hand-written from
   web/src (iter-3-jira), on tokens.json. Both themes come from the tokens;
   the few per-theme literals below are alpha blends the tokens cannot express. */

:root { --tint-rgb: 45 156 255; }
[data-theme="light"] { --tint-rgb: 18 99 184; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans, Inter, "Segoe UI", system-ui, sans-serif);
  font-size: 13px; line-height: 18px;
  color: var(--foreground);
  background:
    radial-gradient(900px 420px at 85% -8%, rgb(var(--tint-rgb) / 0.07), transparent 70%),
    radial-gradient(700px 360px at 0% 110%, rgb(246 180 82 / 0.035), transparent 70%),
    var(--background);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
[data-theme="light"] body { color-scheme: light; background:
    radial-gradient(900px 420px at 85% -8%, rgb(var(--tint-rgb) / 0.05), transparent 70%),
    radial-gradient(700px 360px at 0% 110%, rgb(224 147 44 / 0.06), transparent 70%),
    var(--background); }
::selection { background: rgb(var(--tint-rgb) / 0.35); }
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 14px; height: 14px; }
svg.i.xs { width: 12px; height: 12px; }
.muted { color: var(--muted-foreground); }
.key { font-family: var(--font-mono); color: var(--primary); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font: 600 11px/16px var(--font-sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted-foreground); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pad { padding: 20px; }

/* ---------- GlassHat ---------- */
.glass-hat { --glass-eye: var(--eye); position: relative; display: inline-block; flex-shrink: 0; }
.glass-hat img { position: relative; width: 100%; height: 100%; object-fit: contain; user-select: none; display: block; }
.glass-hat__glow { position: absolute; inset: 2% -6% -14% -6%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(from var(--glass-eye) r g b / 0.28), transparent 72%); }
.glass-hat--thinking .glass-hat__glow { animation: gh-pulse 2.6s ease-in-out infinite; }
.glass-hat--focus .glass-hat__glow { animation: gh-pulse 1.6s ease-in-out infinite alternate; }
.glass-hat--success { --glass-eye: var(--eye-success); }
.glass-hat--warning { --glass-eye: var(--eye-warning); }
.glass-hat--error { --glass-eye: var(--eye-error); }
.glass-hat--sleep { --glass-eye: var(--eye-sleep); }
@keyframes gh-pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
.glass-mark { border-radius: 9999px; display: block; }

/* HatLoader — the developer-kit scenario on the canonical frames:
   hat appears → eyes open (sleep → awake crossfade) → glow rises → ready. */
.hat-loader { position: relative; display: inline-block; --glass-eye: var(--eye); }
.hat-loader img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hat-loader .glass-hat__glow { opacity: 0; animation: hl-glow 1.8s ease-in-out 0.9s forwards, gh-pulse 2.6s ease-in-out 2.7s infinite; }
.hat-loader__sleep { animation: hl-in .6s ease-out both, hl-fade .6s ease-in-out 1.2s forwards; }
.hat-loader__awake { opacity: 0; animation: hl-rise .6s ease-in-out 1.2s forwards; }
@keyframes hl-in { from { opacity: 0; transform: translateY(8px) scale(.96) } to { opacity: 1; transform: none } }
@keyframes hl-fade { to { opacity: 0 } }
@keyframes hl-rise { to { opacity: 1 } }
@keyframes hl-glow { to { opacity: 1 } }

/* ---------- StateMessage ---------- */
.state-message { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 40px 24px; text-align: center; }
.state-message .glass-hat { margin-bottom: 8px; }
.state-message__title { font-size: 15px; line-height: 22px; font-weight: 600; }
.state-message__text { max-width: 24rem; color: var(--muted-foreground); }
.state-message__actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }

/* ---------- Button ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px;
  border-radius: var(--radius-md); border: 1px solid transparent; font: 500 14px/20px var(--font-sans);
  white-space: nowrap; cursor: pointer; transition: all .15s; outline: none; color: inherit; background: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:focus-visible, .focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--tint-rgb) / 0.5); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--default { background: var(--primary-strong); color: var(--primary-foreground); }
.btn--default:hover { opacity: .85; }
.btn--outline { border-color: var(--input); background: rgb(from var(--input) r g b / 0.3); }
[data-theme="light"] .btn--outline { background: var(--card); }
.btn--outline:hover { background: var(--muted); }
.btn--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn--ghost:hover { background: var(--muted); }
.btn--destructive { background: rgb(from var(--destructive) r g b / 0.15); color: var(--destructive); }
.btn--destructive:hover { background: rgb(from var(--destructive) r g b / 0.25); }
.btn--link { color: var(--primary); text-underline-offset: 4px; }
.btn--link:hover { text-decoration: underline; }
.btn--sm { height: 28px; font-size: 12.8px; gap: 4px; }
.btn--xs { height: 24px; font-size: 12px; padding: 0 8px; gap: 4px; }
.btn--lg { height: 36px; }
.btn--icon { width: 32px; padding: 0; }
.btn--icon-sm { width: 28px; height: 28px; padding: 0; }
.btn--loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Inputs ---------- */
.input, .textarea, .select-trigger {
  width: 100%; min-width: 0; height: 32px; padding: 4px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--input); background: rgb(from var(--input) r g b / 0.3);
  color: var(--foreground); font: 400 14px/20px var(--font-sans); outline: none; transition: border-color .15s, box-shadow .15s;
}
[data-theme="light"] .input, [data-theme="light"] .textarea, [data-theme="light"] .select-trigger { background: var(--card); }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.input:focus-visible, .textarea:focus-visible, .select-trigger:focus-visible, .is-focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--tint-rgb) / 0.5); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--destructive); box-shadow: 0 0 0 3px rgb(from var(--destructive) r g b / 0.3); }
.input:disabled, .textarea:disabled { opacity: .5; cursor: not-allowed; }
.textarea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }
.input--sm { height: 28px; font-size: 13px; }
.select-trigger { display: inline-flex; width: fit-content; align-items: center; justify-content: space-between; gap: 6px; padding-right: 8px; cursor: default; }
.select-trigger svg { color: var(--muted-foreground); }
.select-trigger[data-placeholder] { color: var(--muted-foreground); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted-foreground); }
.field .error { font-size: 12px; color: var(--destructive); }

.input-group { position: relative; display: flex; align-items: center; height: 32px; border-radius: var(--radius-md); border: 1px solid var(--input); background: rgb(from var(--input) r g b / 0.3); }
[data-theme="light"] .input-group { background: var(--card); }
.input-group .input { border: 0; background: transparent; height: 30px; }
.input-group .addon { display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--muted-foreground); font-size: 14px; }
.input-group .addon + .input { padding-left: 0; }
.kbd { display: inline-flex; align-items: center; height: 16px; padding: 0 4px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--background); font: 400 10px/16px var(--font-sans); color: var(--muted-foreground); }

.checkbox { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: var(--radius-xs); border: 1px solid var(--input); background: rgb(from var(--input) r g b / 0.3); color: transparent; flex-shrink: 0; }
[data-theme="light"] .checkbox { background: var(--card); }
.checkbox[data-checked] { border-color: var(--primary-strong); background: var(--primary-strong); color: var(--primary-foreground); }
.checkbox svg { width: 12px; height: 12px; stroke-width: 3; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: default; }
.check[aria-disabled] { opacity: .5; }

/* ---------- Chips & marks ---------- */
.state-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 500; white-space: nowrap;
  --t: var(--tone-slate); --h: 148 163 184; color: var(--t); background: rgb(var(--h) / .10); box-shadow: inset 0 0 0 1px rgb(var(--h) / .25); }
.state-badge[data-tone="violet"]  { --t: var(--tone-violet);  --h: 167 139 250; }
.state-badge[data-tone="sky"]     { --t: var(--tone-sky);     --h: 56 189 248; }
.state-badge[data-tone="blue"]    { --t: var(--tone-blue);    --h: 96 165 250; }
.state-badge[data-tone="amber"]   { --t: var(--tone-amber);   --h: 251 191 36; }
.state-badge[data-tone="teal"]    { --t: var(--tone-teal);    --h: 45 212 191; }
.state-badge[data-tone="orange"]  { --t: var(--tone-orange);  --h: 251 146 60; }
.state-badge[data-tone="emerald"] { --t: var(--tone-emerald); --h: 52 211 153; }
.state-badge[data-tone="zinc"]    { --t: var(--tone-zinc);    --h: 161 161 170; }
.waiting { font-size: 11px; color: var(--muted-foreground); margin-left: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; background: rgb(var(--h)); }

.priority { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 32px; padding: 0 6px; border-radius: var(--radius-sm);
  font: 600 11.5px/20px var(--font-mono); font-variant-numeric: tabular-nums; --h: 148 163 184; color: var(--t, var(--muted-foreground)); background: rgb(var(--h) / .12); box-shadow: inset 0 0 0 1px rgb(var(--h) / .45); }
.priority[data-p="1"] { --t: var(--tone-red);         --h: 239 68 68; }
.priority[data-p="2"] { --t: var(--tone-amber-light); --h: 251 191 36; }
.priority[data-p="3"] { --t: var(--tone-emerald);     --h: 52 211 153; }
.priority[data-p="4"] { --t: var(--tone-slate);       --h: 148 163 184; }
.rc { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: var(--radius-xs); font-size: 10px; font-weight: 600; line-height: 1; }
.rc[data-v="change"] { color: var(--tone-indigo); background: rgb(129 140 248 / .10); box-shadow: inset 0 0 0 1px rgb(129 140 248 / .30); }
.rc[data-v="run"] { color: var(--tone-slate); background: rgb(148 163 184 / .10); box-shadow: inset 0 0 0 1px rgb(148 163 184 / .25); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 9999px; flex-shrink: 0;
  background: var(--avatar-bg); color: var(--avatar-fg); font-size: 9px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--avatar-ring); }
.avatar--md { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.online { display: inline-block; width: 6px; height: 6px; border-radius: 9999px; background: var(--success); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 2px 8px; border-radius: var(--radius-4xl); border: 1px solid transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge--default { background: var(--primary-strong); color: var(--primary-foreground); }
.badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge--destructive { background: rgb(from var(--destructive) r g b / 0.15); color: var(--destructive); }
.badge--outline { border-color: var(--border); color: var(--foreground); }
.badge--count { background: var(--primary); color: #04101c; height: 16px; min-width: 16px; padding: 0 4px; font: 600 10px/16px var(--font-sans); }
[data-theme="light"] .badge--count { color: #ffffff; }

.due--overdue { color: var(--destructive); font-weight: 500; }
.due--soon { color: var(--amber); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.delta--up { color: var(--destructive); } .delta--down { color: var(--success); }

.filter-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; max-width: 288px; padding: 0 2px 0 8px; border-radius: var(--radius-sm); border: 1px solid rgb(var(--tint-rgb) / .35); background: rgb(var(--tint-rgb) / .10); font-size: 12px; }
.filter-chip .x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; color: var(--muted-foreground); }
.filter-chip .x:hover { background: rgb(from var(--foreground) r g b / 0.1); color: var(--foreground); }
.segmented { display: inline-flex; align-items: center; height: 32px; padding: 2px; gap: 2px; border-radius: var(--radius-md); border: 1px solid var(--border); background: rgb(from var(--muted) r g b / 0.4); }
.segmented button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); font: 500 12.8px/20px var(--font-sans); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
[data-theme="light"] .segmented button[aria-pressed="true"] { background: var(--card); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 12px; height: 40px; align-items: stretch; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 2px; font: 500 14px/20px var(--font-sans); color: var(--muted-foreground); border: 0; background: none; cursor: pointer; }
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"] { color: var(--foreground); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--foreground); }
.tab .cnt { display: inline-flex; align-items: center; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--muted); box-shadow: inset 0 0 0 1px var(--border); font: 400 11px/16px var(--font-sans); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tabs--pill { height: 32px; padding: 3px; gap: 1px; border: 0; border-radius: var(--radius-md); background: var(--muted); width: fit-content; }
.tabs--pill .tab { padding: 0 6px; border-radius: 6px; height: 100%; }
.tabs--pill .tab::after { display: none; }
.tabs--pill .tab[aria-selected="true"] { background: var(--background); box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
[data-theme="light"] .tabs--pill .tab[aria-selected="true"] { background: var(--card); }

/* ---------- Surfaces & overlays ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.glass-panel { background: linear-gradient(180deg, rgb(20 36 54 / 0.72), rgb(15 27 41 / 0.86)); box-shadow: var(--shadow-panel); border: 1px solid var(--border); border-radius: var(--radius-2xl); }
[data-theme="light"] .glass-panel { background: linear-gradient(180deg, rgb(255 255 255 / 0.85), rgb(255 255 255 / 0.65)); }
.glow-primary { box-shadow: var(--shadow-glow-primary); }
.popover { background: var(--popover); color: var(--popover-foreground); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); font-size: 14px; }
.popover--sm { font-size: 13px; }
.menu { padding: 4px; min-width: 160px; }
.menu-label { padding: 4px 6px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.menu-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; font-size: 14px; cursor: default; }
.menu-item svg { color: var(--muted-foreground); }
.menu-item[data-highlighted], .menu-item:hover { background: var(--accent); color: var(--accent-foreground); }
.menu-item[data-highlighted] svg, .menu-item:hover svg { color: var(--accent-foreground); }
.menu-item--destructive { color: var(--destructive); } .menu-item--destructive svg { color: var(--destructive); }
.menu-item--destructive[data-highlighted] { background: rgb(from var(--destructive) r g b / 0.15); color: var(--destructive); }
.menu-item .shortcut { margin-left: auto; font-size: 12px; letter-spacing: .1em; color: var(--muted-foreground); }
.menu-item .check { width: 14px; display: inline-flex; justify-content: center; }
.menu-sep { height: 1px; margin: 4px -4px; background: var(--border); }
.tooltip { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; padding: 6px 12px; border-radius: 6px; background: var(--tooltip); color: var(--tooltip-foreground); font-size: 12px; line-height: 16px; }
.tooltip .kbd { background: transparent; border-color: rgb(from var(--tooltip-foreground) r g b / 0.3); color: var(--tooltip-foreground); }
.dialog-scrim { position: absolute; inset: 0; background: rgb(from var(--overlay) r g b / 0.10); backdrop-filter: blur(2px); }
[data-theme="light"] .dialog-scrim { background: rgb(from var(--overlay) r g b / 0.25); }
.dialog { position: relative; width: 100%; max-width: 384px; padding: 16px; border-radius: var(--radius-xl); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-dialog); font-size: 14px; display: grid; gap: 16px; }
.dialog h2 { margin: 0; font: 500 16px/1 var(--font-sans); }
.dialog p { margin: 4px 0 0; color: var(--muted-foreground); }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin: 0 -16px -16px; padding: 16px; border-top: 1px solid var(--border); background: rgb(from var(--muted) r g b / 0.5); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.hover-card { width: 320px; padding: 12px; border-radius: var(--radius-xl); background: var(--popover); box-shadow: var(--shadow-dialog); }
.toast { display: flex; align-items: flex-start; gap: 10px; width: 356px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-popover); font-size: 13px; }
.toast svg { margin-top: 1px; }
.toast--success svg { color: var(--success); } .toast--error svg { color: var(--destructive); } .toast--info svg { color: var(--primary); }
.toast b { display: block; font-weight: 500; }
.toast .muted { margin-top: 2px; }
.skeleton { border-radius: 6px; background: var(--muted); animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pulse { 50% { opacity: .5 } }
.separator { height: 1px; background: var(--border); } .separator--v { width: 1px; height: auto; align-self: stretch; }

/* Command palette */
.command { width: 100%; max-width: 672px; border-radius: var(--radius-xl); background: var(--popover); box-shadow: var(--shadow-dialog); overflow: hidden; }
.command .search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.command .search input { flex: 1; border: 0; background: transparent; outline: none; font: 400 14px var(--font-sans); color: var(--foreground); }
.command .group { padding: 4px; }
.command .group-label { padding: 6px 8px 4px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.command .item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 6px; font-size: 13px; }
.command .item[data-highlighted] { background: var(--accent); }
.command .item .k { width: 96px; flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }
.command .item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command .item .r { margin-left: auto; font-size: 12px; color: var(--muted-foreground); }

/* ---------- Navigation ---------- */
.rail { display: flex; width: 76px; flex-direction: column; align-items: center; padding: 12px 0 16px; border-right: 1px solid var(--sidebar-border); background: rgb(from var(--sidebar) r g b / 0.9); }
.rail .brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--radius-xl); }
.rail .brand img { filter: drop-shadow(0 0 10px rgb(247 166 42 / 0.25)); }
.rail .brand span { font: 500 10px/14px var(--font-sans); letter-spacing: .22em; color: var(--wordmark); }
.rail nav { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 4px; padding: 0 8px; margin-top: 20px; }
.rail a { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius-xl); text-align: center; font: 400 11px/1.25 var(--font-sans); color: rgb(from var(--sidebar-foreground) r g b / 0.85); text-decoration: none; }
.rail a svg { width: 20px; height: 20px; }
.rail a:hover { background: rgb(from var(--foreground) r g b / 0.05); color: var(--foreground); }
.rail a[aria-current] { background: rgb(var(--tint-rgb) / .15); color: var(--primary); font-weight: 500; box-shadow: inset 0 0 0 1px rgb(var(--tint-rgb) / .4); }
.rail .help { margin-top: auto; width: 60px; }

.header { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-bottom: 1px solid var(--border); background: rgb(from var(--background) r g b / 0.8); }
.header .title { font: 600 15px/20px var(--font-sans); margin-right: auto; display: flex; align-items: center; gap: 8px; }
.header .search { display: flex; align-items: center; gap: 8px; width: 288px; height: 32px; padding: 0 8px 0 10px; border-radius: var(--radius-md); border: 1px solid var(--input); background: rgb(from var(--muted) r g b / 0.4); color: var(--muted-foreground); font-size: 13px; }
.header .search span { flex: 1; }
.header .user { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 2px; border-radius: var(--radius-md); }
.header .user .name { font-weight: 500; font-size: 13px; line-height: 16px; } .header .user .role { font-size: 11px; color: var(--muted-foreground); }
.bell { position: relative; }
.bell .dotn { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 9999px; background: var(--amber-vivid); box-shadow: 0 0 0 2px var(--background); }

.nav-panel { display: flex; width: 240px; flex-direction: column; overflow: hidden; }
.nav-panel .head { display: flex; height: 44px; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.nav-panel .body { padding: 8px; display: flex; flex-direction: column; gap: 16px; }
.nav-panel .label { display: flex; align-items: center; gap: 6px; padding: 4px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 6px; cursor: default; }
.nav-item .n { margin-left: auto; font: 400 11px var(--font-mono); color: var(--muted-foreground); }
.nav-item:hover { background: rgb(from var(--foreground) r g b / 0.05); }
.nav-item[aria-current] { background: rgb(var(--tint-rgb) / .15); color: var(--primary); font-weight: 500; }
.nav-item[aria-current] .n { color: var(--primary); }

/* ---------- Table ---------- */
.table { width: 100%; font-size: 13px; }
.table .thead { position: sticky; top: 0; z-index: 1; display: grid; height: 36px; align-items: center; border-bottom: 1px solid var(--border); background: rgb(from var(--table-header) r g b / 0.95); backdrop-filter: blur(4px); font: 500 12px var(--font-sans); color: var(--muted-foreground); }
.table .tr { display: grid; min-height: 40px; align-items: center; border-bottom: 1px solid var(--border); }
.table .tr:hover { background: rgb(from var(--foreground) r g b / 0.03); }
.table .tr[aria-selected="true"] { background: rgb(var(--tint-rgb) / .08); box-shadow: inset 2px 0 0 var(--primary); }
.table .td, .table .th { padding: 0 12px; min-width: 0; overflow: hidden; }
.table .td .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.table .td .s { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-foreground); }
.table .td .s .key { color: rgb(from var(--primary) r g b / 0.85); font-size: 11px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-xl); border: 1px solid rgb(var(--tint-rgb) / .35); background: rgb(var(--tint-rgb) / .07); }
.bulk-bar .n { font-weight: 500; }

/* Details grid (task card) */
.details { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }
.details dt { margin: 0; color: var(--muted-foreground); } .details dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl); overflow: hidden; }
.task-card .top { display: flex; height: 44px; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.task-card .top .key { margin-right: auto; padding-left: 8px; font-size: 13px; }
.task-card .head { padding: 8px 16px 12px; border-bottom: 1px solid var(--border); }
.task-card .head h3 { margin: 4px 0 0; font: 600 15px/1.375 var(--font-sans); }
.task-card .meta { display: flex; align-items: center; gap: 8px; height: 28px; font-size: 12px; color: var(--muted-foreground); }
.task-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task-card .body { padding: 12px 16px; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); gap: 4px; }
.tag--amber { color: var(--amber); border-color: rgb(from var(--amber) r g b / 0.3); background: rgb(from var(--amber) r g b / 0.1); font-weight: 500; }

.list { padding: 4px; }
.list .li { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; font-size: 13px; }
.list .li[data-highlighted] { background: var(--accent); }
.list .li .n { margin-left: auto; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .glass-hat *, .hat-loader *, .skeleton, .btn--loading svg { animation: none !important; transition: none !important; }
  .hat-loader__sleep { opacity: 0 } .hat-loader__awake, .hat-loader .glass-hat__glow { opacity: 1 }
}

/* === hat motion vocabulary (same as assets/Code/glass-hat-motion.css) === */


.gh { position: relative; display: inline-block; flex-shrink: 0; --glass-eye: var(--eye, #f7a62a);
      --gh-fade: 220ms; --gh-glow: .28; transform-origin: 50% 80%; will-change: transform; }
.gh__f { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0;
         transition: opacity var(--gh-fade) ease-in-out; user-select: none; -webkit-user-drag: none; }
.gh__awake { opacity: 1; }
.gh__glow { position: absolute; inset: 2% -6% -14% -6%; border-radius: 50%; pointer-events: none;
            background: radial-gradient(closest-side, rgb(from var(--glass-eye) r g b / var(--gh-glow)), transparent 72%);
            transition: background 400ms ease; }

/* --- Idle: slow float, soft glow breath, a blink every ~6 s via the sleep frame --- */
.gh--idle { animation: gh-float 4s ease-in-out infinite; }
.gh--idle .gh__glow { animation: gh-breathe 4s ease-in-out infinite; }
.gh--idle .gh__sleep { animation: gh-blink 6.2s step-end infinite; animation-delay: var(--gh-blink-delay, 1.4s); }
@keyframes gh-float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
@keyframes gh-breathe { 0%, 100% { opacity: .6 } 50% { opacity: 1 } }
@keyframes gh-blink { 0%, 100% { opacity: 0 } 93% { opacity: 1 } 95.5% { opacity: 0 } }

/* --- Moods (persistent) --- */
.gh--thinking .gh__awake { opacity: 0 } .gh--thinking .gh__think { opacity: 1 }
.gh--thinking { animation: gh-sway 3.2s ease-in-out infinite; }
.gh--thinking .gh__glow { animation: gh-breathe 2.6s ease-in-out infinite; }
@keyframes gh-sway { 0%, 100% { transform: rotate(-1.5deg) } 50% { transform: rotate(1.5deg) } }

.gh--focus { transform: scale(1.03); }
.gh--focus .gh__glow { --gh-glow: .4; animation: gh-breathe 1.6s ease-in-out infinite alternate; }

.gh--sleep .gh__awake { opacity: 0 } .gh--sleep .gh__sleep { opacity: 1 }
.gh--sleep { --glass-eye: var(--eye-sleep, #4c617d); animation: gh-doze 6s ease-in-out infinite; }
.gh--sleep .gh__glow { --gh-glow: .18; }
@keyframes gh-doze { 0%, 100% { transform: rotate(2deg) translateY(0) } 50% { transform: rotate(2.6deg) translateY(2px) } }

/* --- Reactions (one-shot; re-add the class to replay) --- */
.gh--success { --glass-eye: var(--eye-success, #79e8a7); }
.gh--success .gh__glow { animation: gh-flash .9s ease-out 1; }
.gh--success::after { content: ""; position: absolute; inset: 8% 2% -6%; border-radius: 50%; pointer-events: none;
                      border: 2px solid var(--glass-eye); animation: gh-ripple .8s ease-out 1 forwards; }
@keyframes gh-flash { 0% { opacity: .4 } 25% { opacity: 1.4 } 100% { opacity: .7 } }
@keyframes gh-ripple { 0% { transform: scale(.7); opacity: .9 } 100% { transform: scale(1.25); opacity: 0 } }

.gh--warning { --glass-eye: var(--eye-warning, #ffc45a); }
.gh--warning .gh__glow { animation: gh-blip .35s ease-in-out 2; }
@keyframes gh-blip { 0%, 100% { opacity: .5 } 50% { opacity: 1.3 } }

.gh--error { --glass-eye: var(--eye-error, #ff625f); animation: gh-shake .36s cubic-bezier(.36,.07,.19,.97) 1; }
.gh--error .gh__glow { animation: gh-flash .7s ease-out 1; }
@keyframes gh-shake { 10%, 90% { transform: translateX(-2px) } 20%, 80% { transform: translateX(3px) }
                      30%, 50%, 70% { transform: translateX(-4px) } 40%, 60% { transform: translateX(4px) } }

.gh--nudge { animation: gh-nudge .6s cubic-bezier(.2,.9,.3,1.3) 1; }
@keyframes gh-nudge { 0% { transform: translateY(0) } 35% { transform: translateY(-7px) rotate(-2deg) } 100% { transform: translateY(0) } }

.gh--enter { animation: gh-enter .5s cubic-bezier(.2,.8,.2,1) both; }
.gh--enter .gh__glow { animation: gh-bloom .9s ease-out both; }
@keyframes gh-enter { from { opacity: 0; transform: translateY(6px) scale(.94) } to { opacity: 1; transform: none } }
@keyframes gh-bloom { 0% { opacity: 0 } 60% { opacity: 1.3 } 100% { opacity: 1 } }

/* Wake: asleep → eyes open → glow rises (page load) */
.gh--wake .gh__awake { opacity: 0; animation: gh-rise .6s ease-in-out 1.2s forwards; }
.gh--wake .gh__sleep { opacity: 1; animation: gh-enter .6s ease-out both, gh-fade .6s ease-in-out 1.2s forwards; }
.gh--wake .gh__glow { opacity: 0; animation: gh-rise 1.8s ease-in-out .9s forwards, gh-breathe 2.6s ease-in-out 2.7s infinite; }
@keyframes gh-rise { to { opacity: 1 } }
@keyframes gh-fade { to { opacity: 0 } }

/* --- Gaze: follows the pointer. Set --gh-dx / --gh-dy in [-1, 1] from JS (see README). --- */
.gh--gaze { transition: transform 260ms cubic-bezier(.2,.8,.2,1);
            transform: rotate(calc(var(--gh-dx, 0) * 4deg)) translate(calc(var(--gh-dx, 0) * 3px), calc(var(--gh-dy, 0) * 2px)); }

/* Hover on an interactive instance (assistant button, rail mark): a little lift and bloom */
a:hover > .gh, button:hover > .gh, .gh--hover:hover { transform: translateY(-2px); transition: transform 200ms ease; }
a:hover > .gh .gh__glow, button:hover > .gh .gh__glow, .gh--hover:hover .gh__glow { --gh-glow: .42; }

@media (prefers-reduced-motion: reduce) {
  .gh, .gh *, .gh::after { animation: none !important; transition: opacity var(--gh-fade) ease-in-out !important; transform: none !important; }
  .gh--wake .gh__awake, .gh--wake .gh__glow { opacity: 1 } .gh--wake .gh__sleep { opacity: 0 }
}

/* Progress — a determinate bar on the tokens (AML mmd-439: term of a white-list pair, re-screen job).
   <div class="progress" role="progressbar" aria-valuenow="40" style="--value:40%"><div class="progress__bar"></div></div> */
.progress { position: relative; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress__bar { height: 100%; width: var(--value, 0%); border-radius: inherit; background: var(--primary); transition: width .3s ease; }
.progress[data-tone="warn"] .progress__bar { background: var(--amber-vivid); }
.progress[data-tone="destructive"] .progress__bar { background: var(--destructive); }
.progress--indeterminate .progress__bar { width: 40%; animation: progress-slide 1.4s ease-in-out infinite; }
@keyframes progress-slide { from { transform: translateX(-100%) } to { transform: translateX(250%) } }
@media (prefers-reduced-motion: reduce) { .progress__bar { transition: none; } .progress--indeterminate .progress__bar { animation: none; } }
