/* ============================================================
   Shivah Ops Console — stylesheet
   (design system ported from the prototype; light + dark)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  font-family: "IBM Plex Sans", system-ui, sans-serif; color: #6c776f;
  background: #eceff2;
}
@media (prefers-color-scheme: dark) { .boot { background: #0e130f; color: #899287; } }


  :root {
    --ground:      #eceff2;
    --surface:     #ffffff;
    --surface-2:   #f4f6f8;
    --surface-3:   #eef1f4;
    --ink:         #17211d;
    --ink-soft:    #43514b;
    --muted:       #6c776f;
    --line:        #d9ded8;
    --line-strong: #bcc4bb;
    --accent:      #0f6d5c;
    --accent-ink:  #0a4a3f;
    --accent-soft: #dcece5;
    --good:        #1f7a52;
    --good-soft:   #dcefe3;
    --warn:        #9a6b00;
    --warn-soft:   #f6ecd2;
    --bad:         #b23c26;
    --bad-soft:    #f4ddd5;
    --info:        #2f5aa8;
    --info-soft:   #dde6f4;
    --input-tint:  #fffaf0;
    --input-edge:  #e6c86a;
    --shadow-sm:   0 1px 2px rgba(23,33,29,.06);
    --shadow-md:   0 1px 2px rgba(23,33,29,.05), 0 10px 26px -12px rgba(23,33,29,.22);
    --radius:      8px;
  }
  @media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --ground:      #0e1310;
      --surface:     #161c18;
      --surface-2:   #1c231e;
      --surface-3:   #232b25;
      --ink:         #e6ece6;
      --ink-soft:    #b4beb5;
      --muted:       #899287;
      --line:        #2c352e;
      --line-strong: #3c463d;
      --accent:      #55bfa4;
      --accent-ink:  #8ad9c3;
      --accent-soft: #1b2b25;
      --good:        #55bd8e;
      --good-soft:   #16281f;
      --warn:        #d5a53e;
      --warn-soft:   #2c2413;
      --bad:         #e28a71;
      --bad-soft:    #2f1c16;
      --info:        #7ba7e6;
      --info-soft:   #182233;
      --input-tint:  #221f13;
      --input-edge:  #6a5a2a;
      --shadow-sm:   0 1px 2px rgba(0,0,0,.4);
      --shadow-md:   0 1px 2px rgba(0,0,0,.4), 0 16px 36px -16px rgba(0,0,0,.6);
  }
  }
  :root[data-theme="dark"] {
    --ground:#0e1310; --surface:#161c18; --surface-2:#1c231e; --surface-3:#232b25;
    --ink:#e6ece6; --ink-soft:#b4beb5; --muted:#899287; --line:#2c352e; --line-strong:#3c463d;
    --accent:#55bfa4; --accent-ink:#8ad9c3; --accent-soft:#1b2b25;
    --good:#55bd8e; --good-soft:#16281f; --warn:#d5a53e; --warn-soft:#2c2413;
    --bad:#e28a71; --bad-soft:#2f1c16; --info:#7ba7e6; --info-soft:#182233;
    --input-tint:#221f13; --input-edge:#6a5a2a;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow-md:0 1px 2px rgba(0,0,0,.4), 0 16px 36px -16px rgba(0,0,0,.6);
  }

  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  h1,h2,h3 { font-family: "Fraunces", Georgia, serif; font-weight: 500; margin: 0; text-wrap: balance; }
  a { color: var(--accent-ink); }
  .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
  [hidden] { display: none !important; }

  /* ---------------- login ---------------- */
  .login-shell {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
  }
  .login-card {
    width: min(560px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  .login-head {
    padding: 1.6rem 1.6rem 1.3rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--accent-soft), transparent);
  }
  .login-head .brandline {
    font-family: "IBM Plex Mono", monospace;
    font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink);
  }
  .login-head h1 { font-size: 1.75rem; margin: .2rem 0 .15rem; }
  .login-head p { margin: 0; color: var(--muted); font-size: .85rem; }
  .login-body { padding: 1.4rem 1.6rem 1.6rem; }
  .login-body .prompt {
    font-family: "IBM Plex Mono", monospace;
    font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
    margin-bottom: .75rem;
  }
  .people {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem;
    max-height: 340px; overflow-y: auto; padding-right: .2rem;
  }
  .person {
    display: flex; align-items: center; gap: .6rem; text-align: left;
    padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2); color: var(--ink); cursor: pointer; font: inherit;
    transition: border-color .12s, background .12s, transform .06s;
  }
  .person:hover { border-color: var(--accent); background: var(--surface); }
  .person:active { transform: translateY(1px); }
  .avatar {
    width: 30px; height: 30px; flex: none; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-weight: 600; font-size: .78rem;
    font-family: "IBM Plex Mono", monospace;
  }
  .person .who { min-width: 0; }
  .person .nm { display: block; font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .person .dp { display: block; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tag-admin {
    font-family: "IBM Plex Mono", monospace; font-size: .58rem; letter-spacing: .1em;
    padding: .1rem .3rem; border-radius: 4px; background: var(--info-soft); color: var(--info);
    text-transform: uppercase;
  }

  .pin-view { text-align: center; padding: .5rem 0 0; }
  .pin-view .pin-name { font-weight: 700; font-size: 1rem; }
  .pin-view .pin-sub { color: var(--muted); font-size: .8rem; margin-bottom: 1rem; }
  .pin-dots { display: flex; gap: .55rem; justify-content: center; margin: .8rem 0 1rem; }
  .pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; }
  .pin-dot.filled { background: var(--accent); border-color: var(--accent); }
  .pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 260px; margin: 0 auto; }
  .pinpad button {
    font-family: "IBM Plex Mono", monospace; font-size: 1.15rem; padding: .7rem 0;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
    color: var(--ink); cursor: pointer;
  }
  .pinpad button:hover { border-color: var(--accent); }
  .pinpad button.ghost { background: transparent; border-color: transparent; font-size: .8rem; color: var(--muted); }
  .pin-err { color: var(--bad); font-size: .8rem; min-height: 1.2em; margin-top: .4rem; }
  .disclaimer {
    margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line);
    font-size: .74rem; color: var(--muted); line-height: 1.45;
  }
  .link-btn { background: none; border: 0; color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

  /* ---------------- app frame ---------------- */
  .app { min-height: 100%; display: grid; grid-template-columns: 244px 1fr; }
  @media (max-width: 880px) { .app { grid-template-columns: 1fr; } }

  .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  @media (max-width: 880px) { .sidebar { position: static; height: auto; } }
  .side-id { padding: 1rem 1rem .9rem; border-bottom: 1px solid var(--line); }
  .side-id .id-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
  .side-id .co { font-family: "Fraunces", serif; font-size: 1.05rem; font-weight: 600; line-height: 1.15; }
  .side-id .co small { display:block; font-family: "IBM Plex Mono", monospace; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-top: .2rem; }
  .id-icons { display: flex; gap: .25rem; flex: none; }
  .icon-bell {
    position: relative; width: 30px; height: 30px; border-radius: 7px; padding: 0;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
    cursor: pointer; display: grid; place-items: center;
  }
  .icon-bell:hover { border-color: var(--accent); color: var(--accent-ink); }
  .icon-bell .ic-badge {
    position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 8px; background: var(--bad); color: #fff; border: 1.5px solid var(--surface);
    font-family: "IBM Plex Mono", monospace; font-size: .56rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .side-user { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; }
  .side-user .who { min-width: 0; }
  .side-user .nm { display: block; font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user .rl { display: block; font-size: .68rem; color: var(--muted); }
  .side-user button { margin-left: auto; }

  nav { padding: .6rem .5rem 1.5rem; flex: 1; }
  .nav-group { font-family: "IBM Plex Mono", monospace; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: .9rem .6rem .35rem; }
  .nav-item {
    display: flex; align-items: center; gap: .5rem; width: 100%;
    padding: .48rem .6rem; border: 0; border-radius: 6px; background: none; color: var(--ink-soft);
    font: inherit; font-size: .84rem; text-align: left; cursor: pointer;
  }
  .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .nav-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
  .nav-item .lvl { margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: .58rem; color: var(--muted); letter-spacing: .06em; }
  .nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-family: "IBM Plex Mono", monospace; font-size: .62rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
  .nav-item[aria-current="true"] .nav-badge { background: var(--bad); }

  .main { min-width: 0; padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 4rem; }
  .alert-banner {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
    color: var(--bad); border-radius: var(--radius); padding: .6rem .85rem; margin-bottom: 1.1rem;
    font-size: .84rem;
  }
  .alert-banner .ab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
  .alert-banner b { font-weight: 600; color: var(--ink); }
  .alert-banner .ab-go { margin-left: auto; font-weight: 600; font-size: .78rem; }
  @media (prefers-reduced-motion: no-preference) { .alert-banner .ab-dot { animation: pulse 1.6s ease-in-out infinite; } }

  tr.row-unread td { background: color-mix(in srgb, var(--info-soft) 55%, transparent); }
  tr.row-unread td:first-child { box-shadow: inset 3px 0 0 var(--info); }

  .cmt-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; max-height: 420px; overflow-y: auto; }
  .cmt { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; background: var(--surface-2); }
  .cmt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .25rem; }
  .cmt-who { font-weight: 600; font-size: .82rem; }
  .cmt-ts { font-size: .68rem; color: var(--muted); }
  .cmt-body { font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; }
  .cmt-form { display: flex; gap: .6rem; align-items: flex-start; }
  .cmt-form textarea { flex: 1; resize: vertical; min-height: 2.4rem; font-family: inherit; }
  .cmt-form .btn { flex: none; }

  /* ---- chat / messages ---- */
  .chat-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: stretch; min-height: 460px; }
  @media (max-width: 820px) { .chat-wrap { grid-template-columns: 1fr; } }
  .chat-list {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow-y: auto; max-height: 620px; padding: .35rem;
  }
  .chat-person {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    padding: .55rem .6rem; border: 0; background: transparent; color: var(--ink);
    font: inherit; cursor: pointer; border-radius: 6px;
  }
  .chat-person:hover { background: var(--surface-2); }
  .chat-person.active { background: var(--accent-soft); }
  .chat-person .cp-body { min-width: 0; flex: 1; }
  .chat-person .cp-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
  .chat-person .cp-name { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-person .cp-time { font-size: .6rem; color: var(--muted); flex: none; }
  .chat-person .cp-prev { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .chat-thread {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    max-height: 620px; overflow: hidden;
  }
  .chat-th-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
  .chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
  .bubble-row { display: flex; }
  .bubble-row.me { justify-content: flex-end; }
  .bubble {
    max-width: min(78%, 460px); padding: .5rem .7rem; border-radius: 12px;
    font-size: .86rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
    background: var(--surface-2); border: 1px solid var(--line);
  }
  .bubble-row.me .bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
  :root[data-theme="dark"] .bubble-row.me .bubble, :root:not([data-theme="light"]) .bubble-row.me .bubble { color: #0c130f; }
  .bubble .b-time { display: block; font-size: .58rem; opacity: .65; margin-top: .2rem; }
  .chat-compose { display: flex; gap: .6rem; padding: .7rem; border-top: 1px solid var(--line); align-items: flex-end; }
  .chat-compose textarea { flex: 1; resize: none; min-height: 2.3rem; max-height: 120px; font-family: inherit; }
  .chat-compose .btn { flex: none; }

  tr.subtask-row td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
  tr.subtask-row td:first-child { padding-left: 1.4rem; }
  tr.subtask-row input.wide { max-width: 240px; font-size: .78rem; }
  .sub-caret { color: var(--muted); font-size: .8rem; margin-right: .1rem; }
  .modhead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
  .modhead h2 { font-size: 1.7rem; }
  .modhead p { margin: .15rem 0 0; color: var(--muted); font-size: .86rem; max-width: 62ch; }
  .modhead .spacer { flex: 1; }
  .readonly-note {
    font-family: "IBM Plex Mono", monospace; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--warn); background: var(--warn-soft); padding: .3rem .55rem; border-radius: 5px;
  }

  /* ---------------- KPI cards ---------------- */
  .kpigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
  .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
  .kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
  .kpi.good::before { background: var(--good); }
  .kpi.warn::before { background: var(--warn); }
  .kpi.bad::before  { background: var(--bad); }
  .kpi.accent::before { background: var(--accent); }
  .kpi .k-label { font-family: "IBM Plex Mono", monospace; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .kpi .k-value { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.6rem; line-height: 1.1; margin-top: .25rem; font-variant-numeric: tabular-nums; }
  .kpi .k-value.neg { color: var(--bad); }
  .kpi .k-sub { font-size: .72rem; color: var(--muted); margin-top: .2rem; }

  /* ---------------- cards / sections ---------------- */
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.4rem; }
  .card > .card-h { padding: .85rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
  .card > .card-h h3 { font-size: 1.05rem; }
  .card > .card-h .sub { color: var(--muted); font-size: .78rem; }
  .card > .card-b { padding: 1rem; }
  .card > .card-b.flush { padding: 0; }

  /* ---------------- tables ---------------- */
  .tablewrap { overflow-x: auto; }
  table.grid { width: 100%; border-collapse: collapse; font-size: .8rem; }
  table.grid th, table.grid td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
  table.grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--surface-3);
    font-family: "IBM Plex Mono", monospace; font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600;
  }
  table.grid tbody tr:hover { background: var(--surface-2); }
  table.grid td.num, table.grid th.num { text-align: right; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
  table.grid td.calc { color: var(--ink-soft); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
  table.grid tfoot td { padding: .55rem .6rem; border-top: 2px solid var(--line-strong); font-weight: 700; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
  .t-neg { color: var(--bad); }
  .t-pos { color: var(--good); }

  /* inputs */
  input, select, textarea {
    font: inherit; font-size: .8rem; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px;
    padding: .34rem .45rem; width: 100%;
  }
  input.mono, td input, td select { font-family: "IBM Plex Mono", monospace; }
  td input, td select { min-width: 84px; }
  td input.wide, td select.wide { min-width: 150px; }
  input[type="number"] { text-align: right; }
  .cell-edit { background: var(--input-tint); border-color: var(--input-edge); }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  input:disabled, select:disabled { opacity: .65; cursor: not-allowed; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  label.fld { display: block; }
  label.fld > span { display: block; font-family: "IBM Plex Mono", monospace; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }

  /* pills */
  .pill { display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; padding: .16rem .45rem; border-radius: 999px; border: 1px solid transparent; }
  .pill.good { background: var(--good-soft); color: var(--good); }
  .pill.warn { background: var(--warn-soft); color: var(--warn); }
  .pill.bad  { background: var(--bad-soft); color: var(--bad); }
  .pill.mute { background: var(--surface-3); color: var(--muted); }
  .pill.info { background: var(--info-soft); color: var(--info); }

  /* buttons */
  .btn {
    font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
    padding: .45rem .8rem; border-radius: 6px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: .4rem;
  }
  .btn:hover { border-color: var(--accent); color: var(--accent-ink); }
  .btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn--primary:hover { background: var(--accent-ink); color: #fff; }
  .btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
  .btn--sm { padding: .28rem .5rem; font-size: .72rem; }
  .btn--danger:hover { border-color: var(--bad); color: var(--bad); }
  .icon-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 5px; width: 26px; height: 26px; padding: 0; cursor: pointer; font-size: .9rem; line-height: 1; }
  .icon-btn:hover { border-color: var(--bad); color: var(--bad); }

  /* 3-way access control */
  .seg3 { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
  .seg3 button { border: 0; background: var(--surface-2); color: var(--muted); font: inherit; font-size: .68rem; padding: .28rem .5rem; cursor: pointer; }
  .seg3 button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }
  .seg3 button[data-v="none"][aria-pressed="true"] { background: var(--surface-3); color: var(--ink-soft); }

  /* clock panel */
  .clockpanel { display: grid; grid-template-columns: 1fr; gap: 1rem; }
  @media (min-width: 620px) { .clockpanel { grid-template-columns: 1.1fr 1fr; } }
  .clock-status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
  .clock-state { font-family: "IBM Plex Mono", monospace; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .clock-timer { font-family: "Fraunces", serif; font-weight: 600; font-size: 3rem; line-height: 1; margin: .35rem 0 .1rem; font-variant-numeric: tabular-nums; }
  .clock-since { font-size: .78rem; color: var(--muted); }
  .clock-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
  .clock-actions .btn { padding: .55rem 1rem; }
  .dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: .4rem; }
  .dot-break { background: var(--warn); }
  @media (prefers-reduced-motion: no-preference) {
    .dot-live { animation: pulse 1.6s ease-in-out infinite; }
    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
    .flash { animation: cell-flash .5s ease; }
    @keyframes cell-flash { from { background: var(--accent-soft); } to { background: transparent; } }
  }

  .grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .formrow { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
  .empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
  .kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .84rem; }
  .kv dt { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; align-self: center; }
  .kv dd { margin: 0; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; text-align: right; }
  .kv dd.big { font-family: "Fraunces", serif; font-size: 1.15rem; font-weight: 600; }

  /* CRUD — bulk bar + forms */
  .bulkbar {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    margin: 0 0 .8rem; padding: .55rem .8rem; font-size: .8rem;
    border: 1px solid var(--line-strong); border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  }
  .crud-form { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .crud-form textarea { width: 100%; min-height: 3.2em; font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
  table.grid td.rowsel, table.grid th.rowsel { width: 34px; text-align: center; padding-right: 0; }

