/* TPM Licensing Admin v3 - shared styles.
   Commerce Code design system: spicy orange fills and highlights, caponata menu and deep fills,
   sandstone quiet lines, Brandon Grotesque throughout. Light and dark themes, fluid from phone to wide. */

@font-face { font-family: "Brandon Grotesque"; src: url("fonts/Brandon_reg.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Brandon Grotesque"; src: url("fonts/Brandon_med.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Brandon Grotesque"; src: url("fonts/Brandon_bld.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }

.app {
  --orange: #f68941; --caponata: #7a2f18; --sandstone: #b0a59b; --burnt: #c2532b; --light-orange: #f6ae60;
  --ink: #1c1c1c; --ink-muted: #6e655d; --kicker: #7a2f18;
  --surface: #ffffff; --surface-tint: #f3f0ee; --card: #ffffff; --line: #e6ded7; --orange-tint: #fde7d9;
  --on-orange: #1c1c1c; --on-caponata: #ffffff; --focus: #7a2f18; --side: #7a2f18; --side-deep: #5f2412;
  --ok: #2b6e44; --ok-tint: #e3f1e7; --warn: #8a5a00; --warn-tint: #fbefd2; --bad: #a8241c; --bad-tint: #fbe5e2;
  --shadow: 0 2px 10px rgba(122, 47, 24, 0.10); --shadow-lift: 0 10px 28px rgba(122, 47, 24, 0.16);
  --font: "Brandon Grotesque", Jost, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
.app.dark {
  --ink: #e8e2dc; --ink-muted: #b0a59b; --kicker: #f68941;
  --surface: #141414; --surface-tint: #1f1915; --card: #17120f; --line: #3a2a22; --orange-tint: #3a2419;
  --focus: #f6ae60; --side: #17120f; --side-deep: #0f0c0a;
  --ok: #7fd39b; --ok-tint: #17301f; --warn: #f6c76a; --warn-tint: #3a2e12; --bad: #ff8a7a; --bad-tint: #3d1814;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45); --shadow-lift: 0 12px 30px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
body { margin: 0; }
.app { font-family: var(--font); font-size: 15px; line-height: 22px; color: var(--ink); background: var(--surface-tint);
  display: flex; flex-wrap: wrap; min-height: 100vh; transition: background .3s var(--ease), color .3s var(--ease); }
.app a { color: var(--kicker); }
.app :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.ico, .app svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-muted); }
button { font: inherit; color: inherit; }

/* ---------- Side menu: dark console ---------- */
.side { flex: 0 0 256px; color: #e8e2dc; display: flex; flex-direction: column; gap: 16px; padding: 18px 12px 14px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(122, 47, 24, .55) 0%, rgba(122, 47, 24, 0) 60%),
    radial-gradient(90% 40% at 100% 100%, rgba(246, 137, 65, .14) 0%, rgba(246, 137, 65, 0) 70%),
    #110d0b;
  border-right: 1px solid rgba(246, 137, 65, .18); transition: flex-basis .35s var(--ease); }
.side::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(232, 226, 220, .09) 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.25) 55%, #000 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.25) 55%, #000 100%); }
.side::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #f68941 30%, #f6ae60 50%, #f68941 70%, transparent); background-size: 200% 100%; animation: scan 6s linear infinite; opacity: .85; }
.side > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; min-height: 40px; border-bottom: 1px solid rgba(232, 226, 220, .08); }
.brand-mark { width: 40px; height: 40px; flex: none; object-fit: contain; filter: drop-shadow(0 0 10px rgba(246, 137, 65, .35)); }
.brand-name { display: flex; flex-direction: column; line-height: 17px; white-space: nowrap; }
.brand-name strong { font-size: 17px; letter-spacing: .02em; color: #fff; }
.brand-name span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #f6ae60; }
.rail-btn { margin-left: auto; width: 30px; height: 30px; border-radius: 6px; border: 1px solid rgba(232, 226, 220, .14); background: rgba(255, 255, 255, .03); color: #b0a59b;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .35s var(--ease); flex: none; }
.rail-btn:hover { color: #fff; border-color: rgba(246, 137, 65, .6); background: rgba(246, 137, 65, .1); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group { display: flex; align-items: center; gap: 10px; padding: 14px 10px 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #8c8178; white-space: nowrap; }
.nav-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(232, 226, 220, .14), transparent); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; border-radius: 6px; color: #cfc7bf; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.nav a svg.ico { width: 18px; height: 18px; color: #8c8178; transition: color .2s, filter .2s; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; border-color: rgba(232, 226, 220, .08); }
.nav a:hover svg.ico { color: #f6ae60; }
.nav a.on { color: #fff; background: linear-gradient(90deg, rgba(246, 137, 65, .2), rgba(246, 137, 65, .04)); border-color: rgba(246, 137, 65, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .35); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #f68941; box-shadow: 0 0 12px 2px rgba(246, 137, 65, .7); }
.nav a.on svg.ico { color: #f68941; filter: drop-shadow(0 0 6px rgba(246, 137, 65, .6)); }
.nav a .lbl { font-weight: 500; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav a.on .lbl { font-weight: 700; }
.count { font-family: var(--mono); font-size: 11px; font-weight: 500; min-width: 22px; height: 20px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
  border: 1px solid rgba(232, 226, 220, .16); color: #b0a59b; }
.count.alert { border-color: rgba(246, 137, 65, .55); color: #f6ae60; background: rgba(246, 137, 65, .1); }
.nav a.on .count { color: #fff; border-color: rgba(246, 137, 65, .55); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 14px; font-size: 13px; white-space: nowrap; }
.sys { border: 1px solid rgba(232, 226, 220, .1); border-radius: 8px; padding: 12px; background: rgba(255, 255, 255, .03); display: flex; flex-direction: column; gap: 10px; }
.sys-top { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8c8178; }
.sys-top b { margin-left: auto; color: #7fd39b; font-weight: 500; letter-spacing: .06em; }
.sys-bars { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.sys-bars i { flex: 1; border-radius: 1px; background: #f68941; opacity: .85; transform-origin: bottom; animation: growy .8s var(--ease) both; }
.sys-bars i.m { background: rgba(232, 226, 220, .22); }
.sys-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: #b0a59b; }
.live { position: relative; width: 8px; height: 8px; flex: none; }
.live i, .live::after { position: absolute; inset: 0; border-radius: 50%; background: #7fd39b; content: ""; }
.live::after { animation: ping 2.2s var(--ease) infinite; }
.live.warn i, .live.warn::after { background: var(--light-orange); }
.cc-logo { width: 150px; max-width: 100%; height: auto; display: block; opacity: .9; margin: 2px 6px 0; }
.cc-sym { display: none; width: 30px; height: 30px; object-fit: contain; margin: 0 auto; opacity: .9; }
.nav a .dotc { display: none; position: absolute; top: 8px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: #f68941; box-shadow: 0 0 8px rgba(246, 137, 65, .9); }
.icon-btn.on { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.b-logos { position: relative; display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-radius: 8px; background: rgba(255,255,255,.55); }
.b-logos img { display: block; width: auto; }
.b-div { width: 1px; align-self: stretch; background: rgba(28,28,28,.3); }
@keyframes scan { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* collapsed rail */
.app.rail .side { flex-basis: 76px; overflow: visible; }
.app.rail .brand-name, .app.rail .nav .lbl, .app.rail .nav .count, .app.rail .sys, .app.rail .cc-logo { display: none; }
.app.rail .nav-group { padding: 8px 14px; font-size: 0; }
.app.rail .nav-group::after { background: rgba(232, 226, 220, .12); }
.app.rail .brand { flex-direction: column; gap: 10px; padding: 0 0 14px; }
.app.rail .rail-btn { margin: 0; transform: rotate(180deg); }
.app.rail .nav a { justify-content: center; padding: 0; }
.app.rail .nav a .dotc { display: block; }
.app.rail .cc-sym { display: block; }
.app.rail .nav a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 62px; top: 50%; transform: translateY(-50%); background: #1c1c1c; color: #fff; border: 1px solid rgba(246, 137, 65, .4);
  font-size: 13px; padding: 4px 10px; border-radius: 4px; white-space: nowrap; z-index: 50; pointer-events: none; }

/* ---------- Work area ---------- */
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: relative; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 36px);
  background: var(--surface); border-bottom: 1px solid var(--line); transition: background .3s; }
.search-wrap { position: relative; flex: 1 1 300px; max-width: 560px; }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-tint);
  color: var(--ink-muted); transition: border-color .2s, box-shadow .2s, background .2s; }
.search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); background: var(--surface); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; color: var(--ink); background: transparent; }
.kbd { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--ink-muted); white-space: nowrap; }
.palette { position: absolute; left: 0; right: 0; top: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lift);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: pop .18s var(--ease); max-height: 380px; overflow: auto; }
.pal-head { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); padding: 8px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px; text-decoration: none; color: var(--ink) !important; }
.pal-item:hover { background: var(--orange-tint); }
.pal-item b { display: block; font-weight: 700; }
.pal-item small { display: block; font-size: 12px; line-height: 15px; color: var(--ink-muted); }
.pal-ic { width: 32px; height: 32px; border-radius: 4px; background: var(--surface-tint); display: inline-flex; align-items: center; justify-content: center; color: var(--kicker); flex: none; }
.pal-empty { padding: 14px 10px; color: var(--ink-muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; transition: border-color .2s, background .2s, transform .2s; }
.icon-btn:hover { border-color: var(--orange); transform: translateY(-1px); color: var(--ink); }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--orange); color: var(--on-orange);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--surface); }
.pop-wrap { position: relative; }
.popover { position: absolute; right: 0; top: 50px; width: min(340px, 86vw); background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lift);
  padding: 6px; animation: pop .18s var(--ease); z-index: 30; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--caponata); color: var(--on-caponata); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.o { background: var(--orange); color: var(--on-orange); }
.avatar.s { background: var(--sandstone); color: var(--ink); }
.me-txt { display: flex; flex-direction: column; line-height: 17px; font-weight: 700; white-space: nowrap; }
.me-txt small { font-weight: 500; font-size: 12px; color: var(--ink-muted); }

.content { width: 100%; max-width: 1520px; margin: 0 auto; padding: clamp(16px, 2.6vw, 32px) clamp(16px, 3vw, 36px) 48px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- Banner ---------- */
.banner { position: relative; overflow: hidden; border-radius: 8px; background: var(--caponata); color: var(--on-caponata); padding: clamp(22px, 3vw, 34px) clamp(20px, 3vw, 40px);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 32px; box-shadow: var(--shadow); animation: rise .5s var(--ease) both; }
.banner.black { background: #141414; }
.banner.sand { background: #b0a59b; color: #1c1c1c; }
.banner .hex { position: absolute; right: -60px; top: 50%; width: 380px; height: 420px; transform: translateY(-50%); pointer-events: none; animation: drift 14s ease-in-out infinite alternate; }
.banner .hex path { fill: none; stroke: #f68941; }
.banner.sand .hex path { stroke: #7a2f18; }
.banner .b-txt { position: relative; flex: 1 1 380px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.banner .kick { font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #f6ae60; display: flex; align-items: center; gap: 10px; }
.banner.sand .kick { color: #7a2f18; }
.banner h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -.005em; }
.banner .b-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.b-stat { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 4px; background: rgba(255,255,255,.12); font-size: 14px; white-space: nowrap; }
.banner.sand .b-stat { background: rgba(255,255,255,.4); }
.b-stat b { font-weight: 700; font-size: 16px; }
.banner .b-act { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
.banner .btn.ghost { color: var(--on-caponata); border-color: rgba(255,255,255,.45); background: transparent; }
.banner .btn.ghost:hover { background: rgba(255,255,255,.12); color: var(--on-caponata); }
.banner.sand .btn.ghost { color: #1c1c1c; border-color: rgba(28,28,28,.4); }

/* ---------- Buttons, chips, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 4px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; }
.btn.primary { background: var(--orange); color: var(--on-orange) !important; }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(246,137,65,.38); transform: translateY(-1px); }
.btn.primary:active { background: var(--burnt); transform: none; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink) !important; }
.btn.ghost:hover { border-color: var(--orange); }
.btn.deep { background: var(--caponata); color: #fff !important; }
.btn.danger { background: var(--bad); color: #fff !important; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 6px; background: var(--surface-tint); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 12px; border-radius: 4px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink-muted);
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg .n { font-size: 12px; font-weight: 700; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--line); display: inline-flex; align-items: center; justify-content: center; }
.seg button.on .n { background: var(--orange); color: var(--on-orange); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.mute { background: var(--surface-tint); color: var(--ink-muted); }
.pill.info { background: var(--orange-tint); color: var(--kicker); }
.pill.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }

/* tooltip */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: var(--ink-muted); cursor: help; flex: none; }
.tip:hover { color: var(--kicker); }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); width: max-content; max-width: 260px;
  background: var(--ink); color: var(--surface); font-size: 13px; line-height: 18px; font-weight: 400; padding: 8px 10px; border-radius: 4px; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 40; text-transform: none; letter-spacing: 0; }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 0; transition: background .3s, border-color .3s, box-shadow .25s, transform .25s var(--ease); }
.card.lead { border-top: 3px solid var(--orange); }
a.card, .card.hov { text-decoration: none; color: var(--ink); }
a.card:hover, .card.hov:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); border-color: var(--sandstone); color: var(--ink); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 22px 0; }
.card-head h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card-head .end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 18px 22px 22px; }
.kick { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--kicker); }

.grid { display: grid; gap: 20px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.g-2e { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.g-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.toolbar .grow { flex: 1 1 200px; }

/* KPI tile */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 14px; position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.kpi .val { font-size: 40px; line-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 16px; font-weight: 500; color: var(--ink-muted); }
.kpi .spark { height: 34px; width: 100%; }
.kpi .spark path.l { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 400; animation: draw 1.4s var(--ease) both .2s; }
.kpi .spark path.a { fill: var(--orange-tint); stroke: none; opacity: .9; animation: fade .8s ease both .5s; }
.kpi.bad .spark path.l { stroke: var(--bad); }
.kpi.bad .spark path.a { fill: var(--bad-tint); }
.kpi .ic { width: 28px; height: 28px; border-radius: 4px; background: var(--orange-tint); color: var(--kicker); display: inline-flex; align-items: center; justify-content: center; }
.kpi .ic svg { width: 16px; height: 16px; }
.kpi.bad .ic { background: var(--bad-tint); color: var(--bad); }
.kpi .go { position: absolute; top: 16px; right: 16px; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; color: var(--kicker); }
a.kpi:hover .go { opacity: 1; transform: none; }

/* ring gauge */
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--surface-tint); }
.ring .fg { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); animation: ring 1.2s var(--ease) both; }
.ring.bad .fg { stroke: var(--bad); }
.ring .rv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring .rv b { font-size: 26px; font-weight: 700; }
.ring .rv small { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

/* meters and bars */
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--surface-tint); overflow: visible; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--orange); transform-origin: left; animation: growx .9s var(--ease) both; transition: width .5s var(--ease); }
.meter > span.over { background: var(--bad); }
.meter > span.deep { background: var(--caponata); }
.meter > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; transition: left .5s var(--ease); }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 92px; align-items: center; gap: 14px; padding: 9px 8px; border-radius: 4px; text-decoration: none; color: var(--ink) !important; transition: background .2s; }
.hbar:hover { background: var(--surface-tint); }
.hbar .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-muted); white-space: nowrap; }
.hbar .v b { color: var(--ink); }
.hbar .meter { height: 12px; }

/* column chart */
.chart { display: flex; flex-direction: column; gap: 8px; }
.readout { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-height: 26px; }
.readout b { font-size: 20px; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 4px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 36.5px, var(--line) 36.5px 37.5px); }
.colb { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; cursor: pointer; border-radius: 3px 3px 0 0; position: relative; }
.colb > span { display: block; border-radius: 2px; transform-origin: bottom; animation: growy .8s var(--ease) both; }
.colb .s-ok { background: var(--orange); }
.colb .s-mis { background: repeating-linear-gradient(45deg, var(--sandstone) 0 3px, var(--surface-tint) 3px 6px); }
.colb .s-rej { background: var(--bad); }
.colb:hover > span, .colb.on > span { filter: brightness(1.08); }
.colb.on::before { content: ""; position: absolute; inset: -4px -3px -1px; border-radius: 4px; background: var(--orange-tint); z-index: -1; }
.xlab { display: flex; gap: 6px; }
.xlab span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* area chart */
.area { width: 100%; height: 170px; display: block; }
.area .fill { fill: var(--orange-tint); animation: fade .8s ease both .3s; }
.area .line { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linejoin: round; stroke-dasharray: 1600; animation: draw 1.6s var(--ease) both; }
.area .lim { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.area .gl { stroke: var(--line); stroke-width: 1; }
.area text { fill: var(--ink-muted); font-size: 11px; font-family: var(--font); }

/* ---------- To-do list ---------- */
.todo { display: flex; flex-direction: column; }
.task { border-top: 1px solid var(--line); animation: rise .45s var(--ease) both; }
.task:first-child { border-top: 0; }
.task-row { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 24px; align-items: center; gap: 14px; padding: 14px 22px; background: transparent; border: 0;
  text-align: left; cursor: pointer; transition: background .2s; }
.task-row:hover { background: var(--surface-tint); }
.task-row b { display: block; font-size: 16px; line-height: 21px; }
.task-row .meta { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.sev { width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.sev.bad { background: var(--bad-tint); color: var(--bad); }
.sev.warn { background: var(--warn-tint); color: var(--warn); }
.sev.info { background: var(--orange-tint); color: var(--kicker); }
.chev { transition: transform .3s var(--ease); color: var(--ink-muted); }
.task.open .chev { transform: rotate(180deg); }
.task-more { padding: 0 22px 18px 76px; display: flex; flex-direction: column; gap: 12px; animation: fadeup .3s var(--ease); }
.task-more p { margin: 0; color: var(--ink-muted); max-width: 620px; }
.due { font-size: 13px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.due.hot { color: var(--bad); }
.empty { padding: 40px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--ink-muted); animation: fadeup .4s var(--ease); }
.empty .big { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.qa { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink) !important;
  background: var(--card); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; position: relative; overflow: hidden; }
.qa:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--orange); }
.qa .ic { width: 40px; height: 40px; border-radius: 8px; background: var(--caponata); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .25s, color .25s; }
.qa:hover .ic { background: var(--orange); color: var(--on-orange); }
.qa b { font-size: 15px; }

/* timeline track */
.track { position: relative; height: 64px; margin: 6px 6px 0; }
.track .rail { position: absolute; left: 0; right: 0; top: 30px; height: 4px; border-radius: 2px; background: var(--surface-tint); }
.track .zone { position: absolute; top: 30px; height: 4px; border-radius: 2px; background: var(--light-orange); }
.track .tick { position: absolute; top: 44px; font-size: 12px; color: var(--ink-muted); transform: translateX(-50%); }
.pin { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; padding: 0; }
.pin span { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--surface-tint); color: var(--ink); transition: background .2s, color .2s; white-space: nowrap; }
.pin i { width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--caponata); transition: transform .2s; }
.pin.on span { background: var(--caponata); color: #fff; }
.pin.on i, .pin:hover i { transform: scale(1.25); border-color: var(--orange); }
.mini-list { display: flex; flex-direction: column; }
.mini-list .mi { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink) !important; transition: background .2s; }
.mini-list .mi:first-child { border-top: 0; }
.mini-list .mi.on, .mini-list .mi:hover { background: var(--orange-tint); }
.mini-list .mi .grow { flex: 1; min-width: 0; }
.mini-list .mi .d { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { background: var(--caponata); color: var(--on-caponata); font-weight: 700; text-align: left; padding: 11px 14px; white-space: nowrap; font-size: 14px; }
table.t th:first-child { border-top-left-radius: 4px; }
table.t th:last-child { border-top-right-radius: 4px; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:nth-child(even) { background: var(--surface-tint); }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: var(--orange-tint); }
table.t tbody tr.sel { background: var(--orange-tint); box-shadow: inset 3px 0 0 var(--orange); }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; }
table.t td small { display: block; color: var(--ink-muted); font-size: 13px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .fl { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.inp, .field input, .field select, .field textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; min-height: 42px; padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.inp:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.field .help { font-size: 13px; color: var(--ink-muted); }
.f-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.numstep { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--surface); }
.numstep button { width: 44px; border: 0; background: var(--surface-tint); cursor: pointer; font-size: 20px; font-weight: 700; transition: background .2s; }
.numstep button:hover { background: var(--orange-tint); }
.numstep output { min-width: 84px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.switch .tr { width: 44px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .25s; flex: none; }
.switch .tr::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .25s var(--ease); }
.switch.on .tr { background: var(--orange); }
.switch.on .tr::after { transform: translateX(20px); }
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; background: var(--surface-tint); outline: 0; border: 0; padding: 0; min-height: 0; }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); border: 3px solid var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; }
input[type=range].rng::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); border: 3px solid var(--card); cursor: pointer; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.chk { display: flex; align-items: flex-start; gap: 10px; animation: fadeup .35s var(--ease) both; }
.chk .ci { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chk .ci svg { width: 14px; height: 14px; stroke-width: 2.4; }
.chk.ok .ci { background: var(--ok-tint); color: var(--ok); }
.chk.bad .ci { background: var(--bad-tint); color: var(--bad); }
.chk.wait .ci { background: var(--surface-tint); color: var(--ink-muted); }
.chk.wait .ci svg { animation: spin 1s linear infinite; }
.chk small { display: block; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.callout { background: var(--orange-tint); border-radius: 8px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; animation: fadeup .3s var(--ease); }
.callout.ok { background: var(--ok-tint); }
.callout.bad { background: var(--bad-tint); }
.callout b { display: block; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--kicker); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .chev { transform: rotate(180deg); }
details.more > div { padding-top: 12px; animation: fadeup .3s var(--ease); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { position: relative; border: 0; background: none; padding: 12px 14px; font-weight: 500; font-size: 15px; color: var(--ink-muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 700; }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--orange); animation: growx .3s var(--ease); }
.big-tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.big-tab { flex: 1 1 220px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); box-shadow: var(--shadow); }
.big-tab:hover { transform: translateY(-2px); }
.big-tab.on { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint), var(--shadow); }
.big-tab .ic { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-tint); color: var(--kicker); display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; flex: none; }
.big-tab.on .ic { background: var(--orange); color: var(--on-orange); }
.big-tab b { display: block; font-size: 17px; }
.big-tab small { color: var(--ink-muted); font-size: 13px; }

/* stepper */
.steps { display: flex; align-items: center; gap: 0; position: relative; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.step .no { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
  transition: background .3s, border-color .3s, color .3s, transform .3s var(--ease); }
.step .sl { font-weight: 500; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.on .no { background: var(--orange); border-color: var(--orange); color: var(--on-orange); transform: scale(1.1); box-shadow: 0 0 0 5px var(--orange-tint); }
.step.on .sl { color: var(--ink); font-weight: 700; }
.step.done .no { background: var(--caponata); border-color: var(--caponata); color: #fff; }
.step .bar { flex: 1; height: 3px; border-radius: 2px; background: var(--line); margin: 0 10px; position: relative; overflow: hidden; min-width: 16px; }
.step .bar span { position: absolute; inset: 0; background: var(--caponata); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease); }
.step.done .bar span { transform: scaleX(1); }
.step:last-child .bar { display: none; }

/* select cards */
.opt { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; width: 100%;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.opt:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.opt.on { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.opt .rad { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 1px; position: relative; transition: border-color .2s; }
.opt.on .rad { border-color: var(--orange); }
.opt.on .rad::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--orange); animation: pop .2s var(--ease); }
.opt b { display: block; font-size: 16px; }
.opt .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* code reveal */
.code { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.code span { min-width: 30px; height: 46px; border-radius: 4px; background: var(--surface-tint); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 22px; font-weight: 700; animation: flip .5s var(--ease) both; }
.code span.dash { min-width: 10px; background: none; border: 0; color: var(--ink-muted); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(20,20,20,.38); z-index: 60; animation: fade .2s ease; backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--card); z-index: 61; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.25);
  animation: slidein .35s var(--ease); }
.drawer-head { padding: 22px 24px 0; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.drawer-head h2 { margin: 0; font-size: 26px; line-height: 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; background: var(--surface-tint); }
.x-btn { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 8px;
  background: #1c1c1c; color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: toast .35s var(--ease); font-weight: 500; max-width: calc(100% - 32px); }
.toast .ok { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #1c1c1c; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.toast .ok svg { width: 14px; height: 14px; stroke-width: 2.6; }

/* list rows (master) */
.lrow { width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr) 120px; gap: 14px; align-items: center; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); background: transparent;
  text-align: left; cursor: pointer; transition: background .2s, box-shadow .2s; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--surface-tint); }
.lrow.on { background: var(--orange-tint); box-shadow: inset 3px 0 0 var(--orange); }
.lrow b { display: block; font-size: 16px; }
.hdot { width: 12px; height: 12px; border-radius: 50%; position: relative; }
.hdot.ok { background: var(--ok); }
.hdot.warn { background: #d89412; }
.hdot.bad { background: var(--bad); }
.hdot.mute { background: var(--sandstone); }
.hdot.warn::after, .hdot.bad::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2s var(--ease) infinite; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 8px; background: var(--surface-tint); }
.fact span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.fact b { font-size: 17px; }
.act-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.act { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.act:hover { transform: translateY(-2px); }
.act.on { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.act.danger.on { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-tint); }
.act .ic { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-tint); display: inline-flex; align-items: center; justify-content: center; color: var(--kicker); }
.act.danger .ic { color: var(--bad); }
.hist { display: flex; flex-direction: column; gap: 0; }
.hi { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 8px 0; position: relative; }
.hi::before { content: ""; position: absolute; left: 8px; top: 24px; bottom: -8px; width: 2px; background: var(--line); }
.hi:last-child::before { display: none; }
.hi .nd { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--orange); background: var(--card); margin-top: 2px; position: relative; z-index: 1; }
.hi .nd.bad { border-color: var(--bad); }
.hi .nd.deep { border-color: var(--caponata); }
.hi small { display: block; color: var(--ink-muted); font-size: 13px; }

/* diff */
.diff { font-family: var(--mono); font-size: 13px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.diff div { padding: 6px 12px; }
.diff .del { background: var(--bad-tint); color: var(--bad); }
.diff .add { background: var(--ok-tint); color: var(--ok); }

/* lifecycle (guide) */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.fnode { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 6px 4px; position: relative; text-align: center; }
.fnode::before { content: ""; position: absolute; top: 34px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.fnode:first-child::before { display: none; }
.fnode.past::before, .fnode.on::before { background: var(--orange); }
.fnode .hx { width: 60px; height: 60px; position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; transition: transform .3s var(--ease); }
.fnode .hx svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fnode .hx svg.bg path { fill: var(--card); stroke: var(--line); stroke-width: 3; transition: fill .3s, stroke .3s; }
.fnode.past .hx svg.bg path { stroke: var(--orange); }
.fnode.on .hx { transform: scale(1.12); }
.fnode.on .hx svg.bg path { fill: var(--orange); stroke: var(--orange); }
.fnode .hx .ico { position: relative; color: var(--kicker); }
.fnode.on .hx .ico { color: var(--on-orange); }
.fnode b { font-size: 14px; line-height: 18px; }
.zone-bar { display: flex; height: 40px; border-radius: 6px; overflow: hidden; position: relative; }
.zone-bar > div { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #1c1c1c; transition: filter .3s; }
.zone-bar .z1 { background: #f6ae60; }
.zone-bar .z2 { background: #f68941; }
.zone-bar .z3 { background: #c2532b; color: #fff; }
.zone-bar .z4 { background: #7a2f18; color: #fff; }
.zone-bar .mk { position: absolute; top: -6px; bottom: -6px; width: 4px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 3px var(--card); transition: left .25s var(--ease); }
.state-card { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 8px; background: var(--surface-tint); animation: fadeup .3s var(--ease); }
.state-card .big { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

/* drop zone */
.drop { border: 2px dashed var(--sandstone); border-radius: 8px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; background: var(--surface-tint);
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease); width: 100%; }
.drop:hover { border-color: var(--orange); background: var(--orange-tint); transform: scale(1.005); }
.drop .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--card); color: var(--kicker); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); animation: bob 2.4s ease-in-out infinite; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); }
.file-chip .ext { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--caponata); color: #fff; letter-spacing: .06em; }

/* people */
.pcard { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pcard .top { display: flex; gap: 12px; align-items: center; }
.pcard .top b { display: block; font-size: 16px; }
.matrix td.c, .matrix th.c { text-align: center; }
.yes { color: var(--ok); }
.no { color: var(--sandstone); }
table.t th.hl, table.t td.hl { box-shadow: inset 0 0 0 9999px rgba(246,137,65,.16); }
table.t th.hl { box-shadow: inset 0 -3px 0 var(--orange); }

/* stagger */
.stagger > * { animation: rise .55s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }
.stagger > *:nth-child(n+7) { animation-delay: .34s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes ring { from { stroke-dashoffset: 340; } }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes drift { from { transform: translateY(-50%) rotate(0deg); } to { transform: translateY(-54%) rotate(8deg); } }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes flip { from { opacity: 0; transform: rotateX(90deg); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.area .line { animation-name: drawlong; }
@keyframes drawlong { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-2, .g-2e { grid-template-columns: minmax(0, 1fr); }
  .me-txt { display: none; }
}
@media (max-width: 860px) {
  .app .side, .app.rail .side { flex: 1 1 100%; flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; overflow-x: auto; overflow-y: hidden; }
  .side::before, .side::after, .side-foot, .rail-btn, .nav-group, .brand-name { display: none !important; }
  .brand { border-bottom: 0; padding: 0; }
  .nav a.on::before { display: none; }
  .brand { flex-direction: row !important; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a, .app.rail .nav a { min-height: 40px; padding: 0 10px; justify-content: flex-start; }
  .app .nav .lbl, .app.rail .nav .lbl { display: inline; font-size: 14px; }
  .app.rail .nav .count { display: inline-flex; }
  .nav a .dotc { display: none !important; }
  .f-grid { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .fnode:nth-child(4)::before { display: none; }
  .kbd { display: none; }
  .hbar { grid-template-columns: 100px minmax(0, 1fr) 76px; gap: 10px; }
  .step .sl { display: none; }
  .task-more { padding-left: 22px; }
  .banner .hex { opacity: .5; }
}
@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
