/* ==========================================================================
   Opeerion Dashboard — internal team dashboard
   Built on the opeerion.com design language: near-black ground, hairline
   borders, a blue→magenta accent ramp, and a faint grid texture.

   Geist is the brand typeface. It is not self-hosted here (no licensed woff2
   in the repo), so the stack falls back to the system grotesques named in
   CLAUDE.md. Drop Geist woff2 files in assets/ and add @font-face to upgrade.
   ========================================================================== */

:root {
  --ink:        #05070c;
  --ink-soft:   #0a0d15;
  --ink-raise:  #10131c;
  --paper:      #f7f6f2;
  --muted:      #636873;
  --muted-soft: #8b909b;

  --blue:    #0258d3;
  --violet:  #7b2fd6;
  --magenta: #e13dea;
  --accent:  linear-gradient(90deg, #0258d3, #e13dea);
  --accent-135: linear-gradient(135deg, #0258d3, #7b2fd6, #e13dea);

  --line:      #ffffff29;
  --line-soft: #ffffff14;

  --ok:    #2fbf71;
  --warn:  #e0a33a;
  --bad:   #e5484d;

  --radius:    12px;
  --radius-sm: 8px;
  --wrap:      1180px;

  --font: "Geist", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--paper);
  background-color: var(--ink);
  /* Faint grid texture, both axes. */
  background-image:
    linear-gradient(#ffffff0a 1px, #0000 1px),
    linear-gradient(90deg, #ffffff0a 1px, #0000 1px);
  background-size: 64px 64px, 64px 64px;
  background-attachment: fixed;
}

a { color: #7fb0ff; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 27px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

p { margin: 0 0 12px; }

small { font-size: 12px; }

.muted { color: var(--muted-soft); }
.big   { font-size: 22px; font-weight: 600; font-family: var(--mono); }

/* ------------------------------- Top bar -------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  height: 62px;
  background: #05070ccc;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { height: 17px; width: auto; display: block; }
.brand-sub {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

/* Desktop: the nav is simply always visible; the toggle and its checkbox are
   not rendered at all. The mobile block at the end of the file collapses it. */
.nav-checkbox { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-toggle { display: none; }
.nav-only-mobile { display: none; }

.topbar nav { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.topbar nav a {
  color: var(--muted-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid transparent;
}
.topbar nav a:hover { color: var(--paper); background: #ffffff0f; text-decoration: none; }
.topbar nav a.nav-on {
  color: var(--paper);
  background: #ffffff0f;
  border-color: var(--line);
}

/* Count of open tasks assigned to you, on the Tasks nav link. */
.nav-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-135);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.userbox { display: flex; align-items: center; gap: 12px; flex: none; }
.who { color: var(--paper); font-size: 14px; }
.who small { color: var(--muted); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 72px; }

.foot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 24px 40px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}

/* ------------------------------ Structure ------------------------------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0; }

.crumb { font-size: 13px; color: var(--muted-soft); margin-bottom: 6px; }

.card {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.split { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.split-col { min-width: 0; }
.col-main, .col-side { min-width: 0; }

.cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-even  { grid-template-columns: 1fr 1fr; }
.cols-match { align-items: stretch; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
.inline-details { display: inline-block; }

/* -------------------------------- Chips --------------------------------- */

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted-soft);
  font-size: 13px;
  background: #ffffff08;
}
.chip:hover { color: var(--paper); text-decoration: none; border-color: #ffffff40; }
.chip-on {
  color: #fff;
  border-color: transparent;
  background: var(--accent-135);
}
.chip-on:hover { color: #fff; }

/* ------------------------------- Buttons -------------------------------- */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff0d;
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { background: #ffffff1a; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent-135);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}
.btn-primary:hover { filter: brightness(1.12); background: var(--accent-135); }

.btn-danger { border-color: #e5484d55; color: #ff8b8e; }
.btn-danger:hover { background: #e5484d1f; }

.btn-small { padding: 4px 11px; font-size: 13px; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.linklike:hover { color: #ff8b8e; }

/* -------------------------------- Forms --------------------------------- */

label { display: block; font-size: 13px; color: var(--muted-soft); margin-bottom: 10px; }

/* `input` with no type attribute defaults to text, and an [type=text]
   selector does not match it — hence the :not() list rather than a type list. */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]),
select, textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4b7fe0;
  box-shadow: 0 0 0 3px #0258d333;
}
textarea { resize: vertical; min-height: 68px; }
select { appearance: none; background-image: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid button { margin-top: 6px; justify-self: start; }

.reveal > summary { cursor: pointer; list-style: none; display: inline-block; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { margin-bottom: 12px; }
/* A disclosure sitting straight above a heading — the Edit form above
   "Discussion" on a ticket — left its Save button flush against it. Give the
   heading room, open or closed. */
.reveal + h2,
.reveal + h3 { margin-top: 22px; }

/* -------------------------------- Flashes -------------------------------- */

.flash {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff0d;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-ok    { border-color: #2fbf7155; background: #2fbf7114; }
.flash-error { border-color: #e5484d55; background: #e5484d14; }
/* Done, but something now needs doing elsewhere — not a failure, not a shrug. */
.flash-warn  { border-color: #e0a33a55; background: #e0a33a14; }

/* -------------------------------- Badges --------------------------------- */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: #ffffff0d;
  color: var(--muted-soft);
  white-space: nowrap;
}

/* App status */
.st-live     { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.st-beta     { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.st-dev      { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.st-archived { color: var(--muted); }

/* App kind */
.kd-desktop { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }

/* Contribution kind */
.k-feature  { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.k-function { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }
.k-fix      { color: #f5a3f8; border-color: #e13dea55; background: #e13dea1f; }

/* Contribution status */
.cs-proposed    { color: var(--muted-soft); }
.cs-approved    { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.cs-in_progress { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.cs-done        { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.cs-rejected    { color: #ff8b8e; border-color: #e5484d55; background: #e5484d14; }

/* Request status */
.rq-open      { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.rq-converted { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.rq-declined  { color: var(--muted); }

/* Ticket state (derived from the request + the work item it became) */
.tk-open        { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.tk-in_progress { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }
.tk-completed   { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.tk-declined    { color: var(--muted); }
.tk-rejected    { color: #ff8b8e; border-color: #e5484d55; background: #e5484d14; }
.tk-converted   { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }

.tkt-id {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
  letter-spacing: -0.02em;
}

/* Changelog entry type */
.ct-added   { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.ct-fixed   { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.ct-changed { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.ct-removed { color: #ff8b8e; border-color: #e5484d55; background: #e5484d14; }

/* Client status */
.cl-lead        { color: var(--muted-soft); }
.cl-contacted   { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.cl-negotiating { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.cl-active      { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }
.cl-licensed    { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.cl-sold        { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.cl-passed      { color: var(--muted); }

/* Team task status */
.ts-requested   { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }
.ts-accepted    { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.ts-in_progress { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }
.ts-done        { color: #7ce0a6; border-color: #2fbf7155; background: #2fbf7114; }
.ts-declined    { color: #ff8b8e; border-color: #e5484d55; background: #e5484d14; }
.ts-mine        { color: #fff; border-color: transparent; background: var(--accent-135); }
.ts-unassigned  { color: #f0c674; border-color: #e0a33a88; background: #e0a33a22; }

/* CRM activity kind */
.act-note    { color: var(--muted-soft); }
.act-call    { color: #9fc0ff; border-color: #0258d366; background: #0258d31f; }
.act-email   { color: #d8a8ff; border-color: #7b2fd666; background: #7b2fd61f; }
.act-meeting { color: #f5a3f8; border-color: #e13dea55; background: #e13dea1f; }
.act-task    { color: #f0c674; border-color: #e0a33a55; background: #e0a33a14; }

/* ------------------------------ Uptime dot ------------------------------- */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-up      { background: var(--ok);   box-shadow: 0 0 0 3px #2fbf7126; }
.dot-down    { background: var(--bad);  box-shadow: 0 0 0 3px #e5484d26; }
.dot-unknown { background: var(--muted); }

/* ------------------------------- App grid -------------------------------- */

.app-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s;
}
.app-card:hover::before { opacity: 1; }
.app-card.is-archived { opacity: .55; }

.app-card-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.app-card-link { font-size: 17px; font-weight: 600; color: var(--paper); }
.app-card-link:hover { text-decoration: none; color: #fff; }

.app-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted-soft);
  font-family: var(--mono);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.app-card-request { font-size: 13px; }

.applinks { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }

.last-change { font-size: 13px; color: var(--muted-soft); }

/* --------------------------------- Lists --------------------------------- */

.list { display: flex; flex-direction: column; }

.list-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.list-row:last-child { border-bottom: 0; }

.row-title { font-weight: 500; }
.row-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.timeline { display: flex; flex-direction: column; gap: 2px; }

/* Requests */
.req-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.req-row:last-child { border-bottom: 0; }
.req-main { flex: 1 1 auto; min-width: 0; }
.req-actions { display: flex; gap: 7px; flex: none; flex-wrap: wrap; }

/* Socials */
.socials { display: flex; flex-direction: column; gap: 10px; }
.social-name  { font-weight: 500; }
.social-email { font-family: var(--mono); font-size: 12.5px; color: var(--muted-soft); }

/* Marketing assets */
.asset-group { margin-bottom: 18px; }
.asset-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.asset-row:last-child { border-bottom: 0; }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed > div, .feed > li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.feed > div:last-child, .feed > li:last-child { border-bottom: 0; }
.feed-time { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* --------------------------------- Table --------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}
tbody tr:hover { background: #ffffff08; }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* ------------------------------ CRM activity ----------------------------- */

.act-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.act-form { margin-top: 10px; }

.act-tasks { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.act-todo {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff08;
}
.act-todo-body { flex: 1 1 auto; min-width: 0; }
.act-overdue { border-color: #e5484d55; background: #e5484d14; }
.act-check {
  background: none;
  border: 0;
  color: var(--muted-soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.act-check:hover { color: var(--ok); }

.act-list { list-style: none; margin: 0; padding: 0; }
.act-list li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.act-list li:last-child { border-bottom: 0; }
.act-kind { flex: none; }
.act-body { flex: 1 1 auto; min-width: 0; }
.act-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.act-when { color: var(--warn); }
.act-done { opacity: .55; }
.act-del { flex: none; }

/* ---------------------------- Notifications ------------------------------ */

.push-msg { font-size: 13px; margin: 10px 0 0; min-height: 1em; }
.push-msg.push-ok   { color: #7ce0a6; }
.push-msg.push-hint { color: var(--muted-soft); }

/* --------------------- Ticket photos (screenshots) ----------------------- */

.shots {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  margin: 14px 0;
}

.shot { margin: 0; }
.shot a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff0a;
}
.shot a:hover { border-color: #ffffff40; }
.shot img { display: block; width: 100%; height: 108px; object-fit: cover; }
.shot figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  padding-top: 5px;
}

/* -------------------------------- Library -------------------------------- */

.lib-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.lib-search input[name=q] { width: auto; min-width: 240px; margin-top: 0; flex: 0 1 320px; }
.lib-search .muted { font-size: 12.5px; margin-left: auto; }

.lib-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.lib-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff08;
  overflow: hidden;
}

.lib-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  /* Chequerboard so transparent logos are readable on a dark ground. */
  background-color: #ffffff0a;
  background-image:
    linear-gradient(45deg, #ffffff08 25%, #0000 25%, #0000 75%, #ffffff08 75%),
    linear-gradient(45deg, #ffffff08 25%, #0000 25%, #0000 75%, #ffffff08 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border-bottom: 1px solid var(--line-soft);
}
.lib-thumb:hover { text-decoration: none; }
.lib-thumb img { max-width: 82%; max-height: 100px; object-fit: contain; }

.lib-ext {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
}

.lib-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; }
.lib-body .actions { margin-top: 4px; }

/* Small preview beside an asset row on an app page. */
.asset-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff0a;
}
.asset-thumb img { max-width: 26px; max-height: 26px; object-fit: contain; }

/* App-card logo, next to the name on the Apps page. */
.app-logo {
  height: 20px;
  width: auto;
  max-width: 76px;
  object-fit: contain;
  vertical-align: middle;
}

input[type=file] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--ink);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-soft);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
input[type=file]:hover { border-color: #ffffff40; color: var(--paper); }

/* --------------------------------- Pager --------------------------------- */

.pager { display: flex; gap: 5px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted-soft);
}
.pager a:hover { color: var(--paper); background: #ffffff12; text-decoration: none; }
.pager .current { color: #fff; background: var(--accent-135); border-color: transparent; }
.pager .disabled { opacity: .35; }
.pager .ellipsis { border: 0; padding: 4px 2px; }

/* --------------------------------- Login --------------------------------- */

.auth-card {
  max-width: 380px;
  margin: 68px auto;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
}
.auth-mark { display: block; height: 19px; width: auto; margin-bottom: 14px; }
.auth-card h1 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin-bottom: 20px;
}
.auth-card .btn { width: 100%; margin-top: 6px; }

/* ------------------------------ Responsive ------------------------------- */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .cols-even { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  /* Collapse the menu behind a toggle. The userbox goes with it, so the bar is
     just wordmark + toggle — everything else is one tap away. */
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .brand-sub { display: none; }
  .userbox   { display: none; }

  .nav-toggle {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff0d;
    color: var(--paper);
    font-size: 14px;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
  }
  .nav-checkbox:checked ~ .nav-toggle { background: #ffffff1a; border-color: #ffffff40; }
  .nav-checkbox:focus-visible ~ .nav-toggle { outline: 2px solid #4b7fe0; outline-offset: 2px; }

  .nav-toggle-bars {
    width: 15px;
    height: 9px;
    flex: none;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    position: relative;
  }
  .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 100%;
    border-top: 2px solid currentColor;
  }
  .nav-toggle-text { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; }

  /* The panel: hidden until the toggle is checked, anchored under the bar,
     never wider than the screen. .topbar is sticky, so it positions this. */
  .topbar nav { display: none; }
  .nav-checkbox:checked ~ nav {
    position: absolute;
    right: 16px;
    top: calc(100% - 6px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 208px;
    max-width: calc(100vw - 32px);
    padding: 8px;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px #00000073;
  }
  .topbar nav a {
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .nav-only-mobile {
    display: flex;
    border-top: 1px solid var(--line-soft);
    margin-top: 4px;
    padding-top: 11px !important;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 56px; }
  .foot { padding: 18px 16px 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .req-row { flex-direction: column; gap: 8px; }
  .page-head { gap: 12px; }
  .page-head > details, .page-head > details > summary { width: 100%; }
  h1 { font-size: 23px; }

  /* Filter chips scroll sideways rather than stacking into a wall. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: none; }

  .lib-search { gap: 6px; }
  .lib-search input[name=q] { flex: 1 1 100%; min-width: 0; }
  .lib-search .muted { margin-left: 0; flex-basis: 100%; }

  .lib-grid { grid-template-columns: 1fr; }
  .act-todo { flex-wrap: wrap; }
  .row-meta { gap: 6px; }
}

/* ------------------------- Overflow containment -------------------------- */

/* Nothing may push the page sideways. Long unbroken strings (URLs, tokens,
   filenames) wrap instead of stretching their container. */
body { overflow-wrap: anywhere; }

/* ...but not in places where a mid-word break would be wrong. */
.badge, .chip, .btn, .pager a, .pager span, .tkt-id, .lib-ext, th { overflow-wrap: normal; }

img, svg, video { max-width: 100%; height: auto; }

/* Tables are the one thing that genuinely cannot reflow — let them scroll
   inside their own box rather than widening the page. */
.card table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
.card table td, .card table th { white-space: nowrap; }
.card table td .btn, .card table td form { white-space: normal; }

/* Grids never demand more width than the viewport can give. */
.app-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.lib-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.cols     { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

pre, code { overflow-x: auto; max-width: 100%; }

/* Checkbox rows read as a line, not a stacked label above a control. */
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
  font-size: 14px;
  cursor: pointer;
}
label.check input { width: auto; margin: 0; flex: none; }

/* Client-submitted tickets ------------------------------------------------ */

/* The origin filter sits under the status chips as a second, quieter row. */
.chips-sub { margin-top: -6px; align-items: center; }
.chips-label { color: var(--muted); font-size: 12px; margin-right: 2px; }

/* Teal: the one hue no state or kind badge uses, so a client ticket is
   spottable in a list without reading it and cannot be mistaken for the amber
   'Open' badge sitting next to it. */
.badge.o-client { color: #7ee0e8; border-color: #2fb6bf66; background: #2fb6bf1f; }
.chip-oclient.chip-on { background: #2fb6bf; border-color: transparent; }

.client-note {
  border-left: 3px solid #2fb6bf;
  background: #2fb6bf12;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.client-note p { margin: 6px 0 0; }
.client-note code { font-size: 12px; }

/* A switched-off intake source stays listed, just faded. */
tr.row-off { opacity: .55; }
