/* The helpdesk's one stylesheet, no frameworks. Colors are tokens so dark mode is one block.
   The brand colors here are only fallbacks: /brand/theme.css (Settings, Branding) sets them. */

:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --ink: #1b2420;
  --ink-2: #4a5550;
  --ink-3: #6f7a74;
  --line: #dde1dc;
  --line-strong: #c6ccc6;
  --brand: #1d6b47;
  --brand-ink: #ffffff;
  --brand-soft: #e3f0e9;
  --top: #173d2c;
  --top-ink: #e9f2ec;
  --top-ink-2: #a9c2b4;
  --top-hover: rgba(255,255,255,.06);
  --top-active: rgba(255,255,255,.1);
  --accent: #173d2c;
  --mark: #3f9a6d;
  --mark-ink: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok-soft: #e3f0e9;

  --s-open: #1e5fa8;      --s-open-bg: #e6eff9;
  --s-progress: #8a5a00;  --s-progress-bg: #fbf0d9;
  --s-waiting: #6b4aa8;   --s-waiting-bg: #efe9f8;
  --s-done: #4f5a55;      --s-done-bg: #eceeeb;
  --p-urgent: #b3261e;    --p-high: #a85a00;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 1px 1px rgba(20, 30, 25, .04);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1a201d;
    --surface-2: #222a26;
    --ink: #e6ebe8;
    --ink-2: #b4beb8;
    --ink-3: #8a958f;
    --line: #2d3632;
    --line-strong: #3b4641;
    --brand: #4fb07f;
    --brand-ink: #0d1a13;
    --brand-soft: #1f3329;
    --top: #0e1512;
    --top-ink: #e6ebe8;
    --top-ink-2: #8fa89a;
    --top-hover: rgba(255,255,255,.06);
    --top-active: rgba(255,255,255,.1);
    --accent: #0e1512;
    --danger: #f08b82;
    --danger-soft: #3a1f1d;
    --ok-soft: #1f3329;
    --s-open: #8dbcf0;     --s-open-bg: #1c2b3d;
    --s-progress: #f0c56b; --s-progress-bg: #3a2e14;
    --s-waiting: #c3abf0;  --s-waiting-bg: #2e2540;
    --s-done: #a9b3ae;     --s-done-bg: #262d2a;
    --p-urgent: #f08b82;   --p-high: #f0b56b;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.topbar { background: var(--top); color: var(--top-ink); box-shadow: inset 0 -3px 0 var(--accent); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--top-ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--mark); color: var(--mark-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.brand-logo { height: 44px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.scheme-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 1rem; }
.scheme-body .swatch { margin-bottom: .5rem; }
.scheme { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; }
.scheme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.swatch { display: block; }
.brand-preview { padding: .75rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; margin-bottom: .5rem; display: inline-block; }
.brand-preview img { max-height: 80px; max-width: 280px; width: auto; height: auto; display: block; }
.brand-preview img.icon-preview { width: 64px; height: 64px; border-radius: 14px; }
input[type=color] { width: 4rem; height: 2.4rem; padding: .15rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.site-footer { text-align: center; color: var(--ink-3); font-size: .78rem; padding: 0 1rem 1.5rem; }
.signin-logo { display: block; max-width: 240px; max-height: 120px; width: auto; height: auto; margin: 0 auto 1rem; }
.brand-split { width: 1px; height: 26px; background: var(--top-ink-2); opacity: .5; }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav-link { color: var(--top-ink-2); padding: .35rem .65rem; border-radius: 6px; }
.nav-link:hover { color: var(--top-ink); background: var(--top-hover); text-decoration: none; }
.nav-link.active { color: var(--top-ink); background: var(--top-active); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--mark); color: var(--mark-ink); display: grid; place-items: center; font-size: .8rem; font-weight: 600; }
.usermenu-panel { position: absolute; right: 0; top: 40px; z-index: 10; min-width: 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; box-shadow: 0 8px 24px rgba(0,0,0,.15); display: grid; gap: .2rem; }
.usermenu-name { font-weight: 600; }
.usermenu-panel form { margin-top: .5rem; }
.usermenu-link { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .9rem; }

/* Page */
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: .35rem; }
.crumbs a { color: var(--ink-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.1rem 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.stack { display: grid; gap: 1.25rem; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .grid-2, .split { grid-template-columns: 1fr; } }

/* Flash */
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-ok { background: var(--ok-soft); color: var(--ink); border: 1px solid var(--line); }
.flash-error, .errors { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.errors { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.errors ul { margin: 0; padding-left: 1.2rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .9rem; border-radius: 6px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { text-decoration: none; }
.btn-sm { padding: .35rem .7rem; font-size: .875rem; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; border: 0; color: var(--brand); padding: 0; font: inherit; cursor: pointer; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Forms */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .3rem; }
.field label, .label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .82rem; color: var(--ink-3); }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
input[type=text], input[type=password], input[type=url], input[type=email], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type=file] { font: inherit; color: var(--ink-2); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.checks-inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-fields select, select.inline-select { width: auto; }
input.num-input { width: 5.5rem; }
.plain-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.stack-sm { display: grid; gap: .9rem; }
.check input { margin-top: .25rem; }
.checks { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.field-validation-error, .text-danger { color: var(--danger); font-size: .85rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ticket-title { font-weight: 600; color: var(--ink); }
.ticket-sub { font-size: .82rem; color: var(--ink-3); }
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--ink-3); }

/* Pills */
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill-open { color: var(--s-open); background: var(--s-open-bg); }
.pill-progress { color: var(--s-progress); background: var(--s-progress-bg); }
.pill-waiting { color: var(--s-waiting); background: var(--s-waiting-bg); }
.pill-done { color: var(--s-done); background: var(--s-done-bg); }
.pill-plain { color: var(--ink-2); background: var(--surface-2); }
.prio { font-size: .78rem; font-weight: 600; }
.prio-Urgent { color: var(--p-urgent); }
.prio-High { color: var(--p-high); }
.prio-Normal, .prio-Low { color: var(--ink-3); font-weight: 400; }

/* Filters / tabs */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 .75rem; }
.tab { padding: .65rem .75rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count { color: var(--ink-3); font-weight: 400; margin-left: .25rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--line); align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; }
.filters input[type=search] { flex: 1; min-width: 200px; }

/* Home stats */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.25rem; }
.stat { padding: 1rem 1.15rem; }
.stat-num { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.stat-label { color: var(--ink-3); font-size: .85rem; }
.stat a { color: inherit; }

/* Ticket detail */
.ticket-head h1 { margin-bottom: .35rem; }
.ticket-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: .9rem; }
.timeline { display: grid; gap: 0; }
.entry { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .avatar { width: 36px; height: 36px; background: var(--surface-2); color: var(--ink-2); }
.entry-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .25rem; }
.entry-who { font-weight: 600; }
.entry-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-internal { background: var(--s-progress-bg); }
.entry-internal .tag { color: var(--s-progress); }
.tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.event { display: flex; gap: .5rem; padding: .5rem 1.25rem .5rem 4.25rem; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: .85rem; }
.files { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.file { display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 6px; font-size: .85rem; background: var(--surface); }
.facts { display: grid; gap: .1rem; margin: 0; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-top: .65rem; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; }
.reply-box { padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.reply-tools { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: .65rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .3rem .15rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; }
.chip form { display: inline; }
.chip button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }

/* Admin */
.admin-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.admin-tile { display: block; padding: 1rem 1.15rem; color: var(--ink); }
.admin-tile:hover { text-decoration: none; border-color: var(--brand); }
.admin-tile h2 { margin-bottom: .25rem; }
.admin-tile p { color: var(--ink-3); margin: 0; font-size: .9rem; }
.badge-off { color: var(--ink-3); font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem; }

/* Sign-in pages */
.center-card { max-width: 520px; margin: 3rem auto; }
.person-list { display: grid; gap: .5rem; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.person:hover { border-color: var(--brand); }

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: .6rem; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .topbar-actions { margin-left: auto; }
  .brand-name { display: none; }
  .table th, .table td { padding: .55rem .7rem; }
  .hide-sm { display: none; }
  .event { padding-left: 1.25rem; }
}
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin-top: 1rem; }
.copy-form { margin-top: .75rem; } .copy-form select, .copy-form input[type=text] { flex: 1; width: auto; }
.validation-summary-valid { display: none; }
.field { align-content: start; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .35rem; }

/* Request catalog and forms */
.catalog { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.catalog-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.15rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); transition: border-color .12s, background .12s; }
.catalog-tile:hover, .catalog-tile:focus-visible { text-decoration: none; border-color: var(--brand); background: var(--surface-2); }
.catalog-tile:hover .catalog-name { color: var(--brand); }
.catalog-dept { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.catalog-name { font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.catalog-summary { color: var(--ink-3); font-size: .9rem; line-height: 1.45; }
.catalog-tile .badge-off { align-self: flex-start; margin-top: .25rem; }
.catalog-search { margin: 0 0 1rem; max-width: 520px; }
.catalog-search input { width: 100%; }
.form-heading { font-size: 1rem; margin: .5rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); }
.form-paragraph, .form-instructions { white-space: pre-line; color: var(--ink-2); margin: 0; }
.form-instructions { padding: .75rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.req { color: var(--danger); }
[hidden] { display: none !important; }
.answers { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: .35rem 1rem; margin: .75rem 0 0; padding: .75rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.answers dt { color: var(--ink-3); font-size: .875rem; }
.answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) { .answers { grid-template-columns: 1fr; } .answers dd { margin-bottom: .4rem; } }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag-chip { font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; background: var(--brand-soft); color: var(--ink); }
form.inline { display: inline; }
.indent { margin-left: 1.6rem; display: grid; gap: .5rem; }
.cond-row select { width: auto; max-width: 100%; }
.cond-row select:first-child { flex: 1; min-width: 220px; }
.rule-group, .rule-action { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: grid; gap: .5rem; }
.rule-group + .rule-group, .rule-action + .rule-action { margin-top: .5rem; }
.cond-row .pick { flex: 1; min-width: 240px; width: auto; }
.cond-row .op { width: auto; }
.cond-row .newtag { width: 160px; flex: 0 1 160px; }
.only-if summary { cursor: pointer; color: var(--ink-3); font-size: .85rem; }
.only-if[open] summary { margin-bottom: .4rem; }
.hours td, .hours th { padding: .4rem .5rem; } .hours input[type=time] { width: auto; }
.sentence select, select.auto { width: auto; }
textarea.short { min-height: 0; }
input[type=date], input[type=datetime-local], input[type=time], input[type=tel] {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.grid-2 { align-items: start; }
.form > .btn, .form > button { justify-self: start; }
input:not([type]) {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: inherit;
}

/* Alerts page and email settings */
.device-list { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .5rem; }
.device-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; background: var(--surface-2); border-radius: var(--radius); }
details.help { margin-top: 1rem; color: var(--ink-2); font-size: .92rem; }
details.help summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.help p { margin: .5rem 0 0; }
.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; background: var(--ink-3); vertical-align: middle; }
.status-dot.ok { background: var(--brand); }
.status-dot.bad { background: var(--danger); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 0; padding: 1rem; background: var(--surface-2); border-radius: var(--radius); }
.placeholders { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; font-size: .88rem; margin: 0; }
.placeholders dt { font-family: ui-monospace, Consolas, monospace; color: var(--ink); }
.placeholders dd { margin: 0; color: var(--ink-3); }
.card-foot { margin: 0; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.mail-frame { width: 100%; height: 620px; border: 1px solid var(--line); background: #f4f4f2; padding: 0; }
.totp { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; margin-top: .5rem; }
.totp img { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; image-rendering: pixelated; }
.totp-key { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.steps-list { margin: .5rem 0 1rem; padding-left: 1.25rem; color: var(--ink-2); }
.steps-list li { margin: .25rem 0; }
.field.short { max-width: 340px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 1rem; }
.signin { max-width: 420px; }
.btn-wide { width: 100%; justify-content: center; }
.center { text-align: center; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--ink-3); font-size: .85rem; margin: 1rem 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Jumping to a section after a button keeps it clear of the top bar. */
.anchor { scroll-margin-top: 5rem; }

/* Settings, System: a menu down the side, one page per part */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 1rem; }
.side-nav a { padding: .55rem .8rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
@media (max-width: 760px) {
    .settings-layout { grid-template-columns: 1fr; gap: 1rem; }
    .side-nav { flex-direction: row; overflow-x: auto; position: static; padding-bottom: .25rem; }
    .side-nav a { white-space: nowrap; }
    .side-nav a.active { box-shadow: inset 0 -3px 0 var(--brand); }
}

/* SLAs, approvals, surveys */
.pill-sla-late { color: var(--danger); background: var(--danger-soft); }
.pill-sla-soon { color: var(--s-progress); background: var(--s-progress-bg); }
.pill-sla-ok { color: var(--brand); background: var(--brand-soft); }
.pill-sla-plain { color: var(--ink-2); background: var(--surface-2); }
.sla-note { margin: .75rem 0 0; }
.approval-card { border-color: var(--s-waiting); box-shadow: inset 3px 0 0 var(--s-waiting); }
.approval-card .btn { margin-top: .25rem; }
.inline-form { display: inline; margin-left: .25rem; }
.votes { list-style: none; margin: .25rem 0 .75rem; padding: 0; display: grid; gap: .4rem; }
.votes li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .inline-h { display: inline; margin: 0; }
details.card > summary::after { content: "+"; float: right; color: var(--ink-3); font-weight: 600; }
details.card[open] > summary::after { content: "\2212"; }
details.card[open] > summary { margin-bottom: .75rem; }
.stars { font-size: 1.05rem; margin-bottom: .35rem; }
.stars strong { font-size: 1.6rem; color: var(--brand); }
.rate-row .btn { min-width: 2.6rem; }
.due-late { color: var(--danger); font-weight: 600; }
.due-soon { color: var(--s-progress); font-weight: 600; }
.rating-pick { display: flex; gap: .5rem; flex-wrap: wrap; }
.rating-pick label { position: relative; }
.rating-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rating-pick span { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 700; font-size: 1.15rem; background: var(--surface); }
.rating-pick input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.rating-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-count { display: inline-block; min-width: 1.25rem; margin-left: .35rem; padding: 0 .35rem; border-radius: 999px; background: #e0a43a; color: #1b2420; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.25rem; }
.sub-h { font-size: .95rem; margin: 1.1rem 0 .4rem; }
.survey { max-width: 560px; margin: 0 auto; }
.survey fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.survey legend { font-weight: 600; margin-bottom: .5rem; }
.sla-targets input { max-width: 9rem; }
.card-head form.btn-row { flex-wrap: nowrap; }
.card-head form.btn-row select { width: auto; }
.small-pick span { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.survey-fixed { padding: .65rem .9rem; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: .92rem; }
.survey-questions { display: grid; gap: .75rem; margin-top: .5rem; }
.survey-q { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: .75rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius); }
.survey-q-new { border-style: dashed; }
.survey-q-pos { width: 3.5rem; text-align: center; }
.survey-q-body { display: grid; gap: .6rem; }
.results-grid { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: .5rem; }
.bars { display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: minmax(2rem, 9rem) minmax(0, 1fr) 2.5rem; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: .7rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; min-width: 2px; }
.bar-fill.bar-low { background: var(--danger); }
.bar-num { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.said { margin: .25rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .92rem; }
.said-inline { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .25rem; }
/* Bar widths, for pages that can't use inline styles. */
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }
.survey-answers { margin: .5rem 0; }
.survey-q-pos { align-self: start; }
.survey-q-choices[hidden] { display: none; }
.sub-h-tight { margin-top: .1rem; }
/* Reports */
.report-chart { margin: 0 0 1rem; }
.report-chart figcaption { margin-bottom: .5rem; }
.bar-row-wide { grid-template-columns: minmax(6rem, 16rem) minmax(0, 1fr) 4.5rem; }
.columns { width: 100%; height: 170px; display: block; }
.col-bar { fill: var(--brand); }
.col-target { fill: transparent; }
.col-hit:hover .col-bar { fill: var(--ink-2); }
.col-base { stroke: var(--line-strong); stroke-width: 1; }
.col-axis { display: flex; justify-content: space-between; margin-top: .25rem; }
.report-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } }
.report-builder { display: grid; gap: .9rem; }
.report-builder details { border-top: 1px solid var(--line); padding-top: .6rem; }
.report-builder summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.report-builder .checks { grid-template-columns: 1fr; gap: .3rem; margin-top: .4rem; }
.report-builder details .checks { max-height: 14rem; overflow-y: auto; }
.report-builder .field-row { grid-template-columns: 1fr; gap: .9rem; }
.report-builder input:not([type=checkbox]):not([type=radio]), .report-builder select { min-width: 0; width: 100%; }
.report-builder .check { font-size: .9rem; }
.filter-count { color: var(--brand); font-weight: 600; margin-left: .3rem; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tr.total td { font-weight: 600; border-top: 2px solid var(--line-strong); }
.report-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.report-tile { display: block; padding: 1rem 1.15rem; color: inherit; }
.report-tile:hover { text-decoration: none; border-color: var(--brand); }
.report-tile h3 { margin: 0 0 .25rem; font-size: 1rem; }
.report-tile p { margin: 0; color: var(--ink-3); font-size: .88rem; }
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--ink-2); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; background: var(--brand); }
.legend i.second { background: var(--s-open); }
.col-bar2 { fill: var(--s-open); }
.report-actions { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-title-row h2 { margin: 0; }
.split-even { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
form.btn-row select { width: auto; }
@media (max-width: 640px) {
    .bar-row-wide { grid-template-columns: minmax(0, 1fr) auto; row-gap: .2rem; }
    .bar-row-wide .bar { grid-column: 1 / -1; grid-row: 2; }
    .bar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: .2rem; }
    .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
}
.report-tiles + .hint { display: block; margin-top: .75rem; }
/* Knowledge base */
.kb-search { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.kb-search input[type=search] { flex: 1 1 18rem; min-width: 0; }
.kb-search select { width: auto; }
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.kb-layout > .stack:only-child { grid-column: 1 / -1; }
@media (max-width: 900px) { .kb-layout { grid-template-columns: 1fr; } }
.kb-list { list-style: none; margin: 0; padding: 0; }
.kb-list li { padding: .85rem 1.25rem; border-top: 1px solid var(--line); }
.kb-list li:first-child { border-top: 0; }
.kb-title { font-weight: 600; }
.kb-snippet { color: var(--ink-2); margin: .2rem 0; }
.kb-drafts { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .65rem; }
.kb-toggle { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.kb-waiting { display: grid; gap: .2rem; color: inherit; }
.kb-waiting:hover { text-decoration: none; }
.kb-article { max-width: 760px; }
.kb-body { font-size: 1rem; line-height: 1.6; }
.kb-body > :first-child { margin-top: 0; }
.kb-body h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.kb-body h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.kb-body h4 { font-size: 1rem; margin: 1rem 0 .3rem; }
.kb-body p, .kb-body ul, .kb-body ol { margin: 0 0 .85rem; }
.kb-body img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: .35rem 0; }
.kb-body a.kb-picture { display: inline-block; max-width: 100%; line-height: 0; cursor: zoom-in; }
.kb-body pre { background: var(--surface-2); padding: .75rem 1rem; border-radius: var(--radius); overflow-x: auto; font-size: .88rem; }
.kb-body code { background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.kb-body pre code { background: none; padding: 0; }
.kb-callout { border-left: 3px solid var(--s-progress); background: var(--s-progress-bg); padding: .6rem .9rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 .85rem; }
.kb-banner { padding: .75rem 1rem; border-radius: var(--radius); background: var(--s-waiting-bg); border: 1px solid var(--line); margin-bottom: 1rem; }
.kb-helpful { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.kb-editor textarea.kb-body-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92rem; min-height: 22rem; }
/* Callouts: the old format's div and the editor's blockquote look the same. */
.kb-body blockquote { border-left: 3px solid var(--s-progress); background: var(--s-progress-bg); padding: .6rem .9rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 .85rem; }
.kb-body blockquote p:last-child { margin-bottom: 0; }
.kb-body li > p { margin: 0 0 .25rem; }
.kb-body hr { border: 0; border-top: 1px solid var(--line-strong); margin: 1.25rem 0; }
.kb-body table { border-collapse: collapse; margin: 0 0 1rem; width: 100%; display: block; overflow-x: auto; }
.kb-body th, .kb-body td { border: 1px solid var(--line-strong); padding: .4rem .6rem; text-align: left; vertical-align: top; min-width: 4rem; }
.kb-body th { background: var(--surface-2); font-weight: 600; }
.kb-body th > p, .kb-body td > p { margin: 0; }

/* The article editor. Until its script runs, the plain box shows instead. */
.kb-editor-box { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.kb-editor-box:not(.is-ready) .kb-toolbar, .kb-editor-box:not(.is-ready) .kb-editor-mount { display: none; }
.kb-editor-box:not(.is-ready) textarea.kb-body-input { border: 0; border-radius: var(--radius); }
.kb-editor-box.is-ready textarea.kb-body-input { display: none; }
.kb-editor-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.kb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: .45rem .55rem; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 2; }
.kb-toolbar[hidden] { display: none; }
.kb-table-tools { border-radius: 0; position: static; gap: .35rem; }
.kb-tool-group { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.kb-toolbar button { font: inherit; font-size: .85rem; line-height: 1; padding: .42rem .6rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; min-height: 2rem; }
.kb-toolbar button:hover:not(:disabled) { background: var(--surface); border-color: var(--line); }
.kb-toolbar button.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.kb-toolbar button:disabled { color: var(--ink-3); cursor: default; }
.kb-toolbar button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.kb-linkbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem .55rem; border-bottom: 1px solid var(--line); }
.kb-linkbar[hidden] { display: none; }
.kb-linkbar input { flex: 1 1 16rem; min-width: 0; width: auto; }
/* As wide as the article readers see, so a picture's size here is its size there. */
.kb-editable { min-height: 22rem; padding: .9rem 1.1rem; outline: none; max-width: calc(720px + 2.2rem); }
.kb-editable > :first-child { margin-top: 0; }
.kb-editable p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--ink-3); float: left; height: 0; pointer-events: none; }
.kb-editable img.ProseMirror-selectednode, .kb-editable .ProseMirror-selectednode img { outline: 3px solid var(--brand); }
/* Drag handles on pictures: shown on hover and when the picture is picked. */
.kb-editable [data-resize-container] { margin: .35rem 0; max-width: 100%; }
.kb-editable [data-resize-wrapper] { max-width: 100%; }
.kb-editable [data-resize-wrapper] img { margin: 0; display: block; }
.kb-editable [data-resize-handle] { width: 12px; height: 12px; background: var(--brand); border: 2px solid var(--surface); border-radius: 3px; opacity: 0; transition: opacity .1s; z-index: 1; }
.kb-editable [data-resize-wrapper]:hover [data-resize-handle], .kb-editable .ProseMirror-selectednode [data-resize-handle], .kb-editable [data-resize-state="true"] [data-resize-handle] { opacity: 1; }
.kb-editable [data-resize-handle="top-left"] { margin: -6px 0 0 -6px; cursor: nwse-resize; }
.kb-editable [data-resize-handle="bottom-right"] { margin: 0 -6px -6px 0; cursor: nwse-resize; }
.kb-editable [data-resize-handle="top-right"] { margin: -6px -6px 0 0; cursor: nesw-resize; }
.kb-editable [data-resize-handle="bottom-left"] { margin: 0 0 -6px -6px; cursor: nesw-resize; }
.kb-tool-hint { margin-left: .25rem; }
.kb-editable .selectedCell { background: var(--brand-soft); }
.kb-editable a { cursor: text; }
.kb-editable .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.kb-editable .ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--ink); }
.kb-editable.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; }
.ProseMirror pre { white-space: pre-wrap; }
.ProseMirror-hideselection *::selection { background: transparent; }
.kb-status { padding: .4rem .9rem; border-top: 1px solid var(--line); color: var(--ink-2); }
.kb-status:empty { display: none; }
.kb-status.is-error { color: var(--danger); }
@media (max-width: 640px) { .kb-toolbar { gap: .25rem .4rem; } .kb-toolbar button { padding: .4rem .45rem; } .kb-editable { padding: .75rem; } }
.kb-files { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.kb-files li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.kb-summary { font-size: 1.02rem; margin: 0 0 1rem; }
.kb-suggest { margin-bottom: 1rem; border-left: 3px solid var(--brand); }
.kb-link { user-select: all; background: var(--surface-2); padding: 0 .3rem; border-radius: 3px; }
.kb-mini-search { margin-top: .75rem; flex-wrap: nowrap; }
.kb-mini-search input { min-width: 0; flex: 1; }
/* Home page tiles */
.home-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.tile-wide { grid-column: 1 / -1; }
@media (max-width: 800px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.tile-pad { padding: 1rem 1.25rem; }
.tile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); }
.tile-stat { display: grid; padding: 1rem 1.25rem; color: inherit; background: var(--surface); }
a.tile-stat:hover { text-decoration: none; background: var(--surface-2); }
.tile-stats + .tile-list { border-top: 1px solid var(--line); }
.tile-list { list-style: none; margin: 0; padding: 0; }
.tile-list li { display: grid; gap: .1rem; padding: .7rem 1.25rem; border-top: 1px solid var(--line); }
.tile-list li:first-child { border-top: 0; }
.tile-more { margin: 0; padding: .6rem 1.25rem; border-top: 1px solid var(--line); }
.tile-pad .tile-more { border-top: 0; padding: .6rem 0 0; }
.tile-caption { margin: 0 0 .6rem; }
.tile-chart { height: 130px; margin-top: .6rem; }
.tile .report-table tr.total td { border-top: 2px solid var(--line-strong); }
.layout-list { list-style: none; margin: 0; padding: 0; }
.layout-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; padding: .85rem 1.25rem; border-top: 1px solid var(--line); }
.layout-list > li:first-child { border-top: 0; }
.layout-list .tile-name { font-weight: 600; }
.layout-list .tile-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.layout-list .tile-opts select { width: auto; max-width: 100%; }
.layout-list .tile-moves { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.layout-list form { margin: 0; }
@media (max-width: 640px) { .layout-list > li { grid-template-columns: minmax(0, 1fr); } .layout-list .tile-moves { justify-content: flex-start; } }
/* Resolved in grey, so it stands apart from the brand color whatever the scheme. */
.tile .col-bar2 { fill: var(--ink-3); }
.tile .legend i.second { background: var(--ink-3); }
.tile .col-hit:hover .col-bar, .tile .col-hit:hover .col-bar2 { opacity: .75; }
.tile .col-hit:hover .col-bar { fill: var(--brand); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.tile-kinds { margin-top: .9rem; }
/* Keep the footer at the bottom of the window on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main.page { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
/* Saved replies */
.reply-list { list-style: none; margin: 0; padding: 0; }
.reply-list li { padding: .85rem 1.25rem; border-top: 1px solid var(--line); display: grid; gap: .35rem; }
.reply-list li:first-child { border-top: 0; }
.reply-list-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.reply-list-head .btn-row { margin-left: auto; }
.reply-list .entry-body { max-height: 6.5em; overflow: hidden; }
/* Announcements */
.announcements { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.announce { padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 4px; background: var(--surface); }
.announce-info { border-left-color: var(--s-open); }
.announce-warning { border-left-color: var(--s-progress); background: var(--s-progress-bg); }
.announce-outage { border-left-color: var(--danger); background: var(--danger-soft); }
.announce .entry-body { margin-top: .2rem; }
.announce-from { color: var(--ink-3); margin-top: .2rem; }
.announce-pill.announce-info { color: var(--s-open); background: var(--s-open-bg); }
.announce-pill.announce-warning { color: var(--s-progress); background: var(--s-progress-bg); }
.announce-pill.announce-outage { color: var(--danger); background: var(--danger-soft); }
/* Ticket page: reply helpers, presence, tasks, time */
.reply-helpers { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-top: .5rem; }
.reply-helpers select { width: auto; max-width: 16rem; }
.reply-helpers [hidden] { display: none; }
.time-spent { display: inline-flex; gap: .4rem; align-items: center; }
.time-spent input { width: 6rem; }
.presence { margin-bottom: 1rem; }
.presence-reload { margin-left: .4rem; }
.merged-note { margin-bottom: 1rem; }
.task-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .6rem; }
.task-list li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; align-items: start; }
.task-list form { margin: 0; }
.task-check { width: 1.4rem; height: 1.4rem; border: 2px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--brand-ink);
    display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; line-height: 1; padding: 0; cursor: pointer; }
.task-done .task-check { background: var(--brand); border-color: var(--brand); }
.task-check-static { cursor: default; }
.task-done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-actions { margin-top: .25rem; }
.task-add { margin-top: .6rem; }
.time-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .35rem; }
.time-list li { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.time-list form { margin: 0; }
.link-button { background: none; border: 0; padding: 0 .2rem; color: var(--ink-3); cursor: pointer; font-size: 1rem; }
.link-button:hover { color: var(--danger); }
#tasks details, #time details, #related details { margin-top: .5rem; }
#tasks details > summary, #time details > summary, #related details > summary { cursor: pointer; color: var(--brand); }
/* Ticket list: views and changing several at once */
.saved-views { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; padding: .6rem 1.25rem 0; }
.saved-views:empty { display: none; }
.saved-views .chip a { color: inherit; }
.chip-on { border-color: var(--brand); color: var(--brand); }
.save-view summary { cursor: pointer; color: var(--brand); }
.save-view form { margin-top: .4rem; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.bulk-bar select { width: auto; }
.select-col { width: 2rem; }
/* Printing a ticket */
.print-page { background: #fff; color: #1c2420; max-width: 820px; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: block; min-height: 0; }
.print-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.print-head { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid #1c2420; padding-bottom: .75rem; margin-bottom: 1rem; }
.print-head h1 { margin: .1rem 0 0; font-size: 1.4rem; }
.print-logo { height: 48px; width: auto; }
.print-facts { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .25rem 1rem; margin: 0 0 1rem; }
.print-facts dt { color: #5c6661; }
.print-facts dd { margin: 0; }
.print-page h2 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; border-bottom: 1px solid #d4d9d5; padding-bottom: .25rem; }
.print-entry { margin: 0 0 .9rem; break-inside: avoid; }
.print-entry-head { font-size: .9rem; margin-bottom: .2rem; }
.print-event { font-size: .85rem; color: #5c6661; margin: 0 0 .35rem; }
.print-list { margin: 0; padding-left: 1.2rem; }
.print-foot { margin-top: 2rem; }
@media print {
    .print-tools { display: none; }
    .print-page { padding: 0; max-width: none; }
    a { color: inherit; text-decoration: none; }
}
.card-pad-x { padding: .75rem 1.25rem 0; margin: 0; }
/* API page */
.api-docs pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; overflow-x: auto; font-size: .85rem; margin: 0 0 1rem; }
.api-docs table code { white-space: nowrap; }
.api-docs .table td { vertical-align: top; }
/* AI help */
.ai-answer { background: var(--surface-2); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: .75rem; }
.ai-answer .facts { margin-bottom: .5rem; }
.ai-buttons form { margin: 0; }
/* Ticket sidebar: each card folds to one line, with what's in it, so the column stays short. */
details.side > summary { display: flex; align-items: baseline; gap: .6rem; }
details.side > summary h2 { margin: 0; font-size: 1rem; white-space: nowrap; flex: 1 0 auto; }
details.side > summary::after { float: none; margin-left: .25rem; }
.side-sum { flex: 0 1 auto; min-width: 0; color: var(--ink-3); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split > *, .split details.side, .split details.side > summary { min-width: 0; }
details.side[open] .side-sum { display: none; }
details.side:not([open]) { padding-top: .8rem; padding-bottom: .8rem; }
aside.stack:has(details.side) { gap: .75rem; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.field-pair select { min-width: 0; width: 100%; }
#side-details .form { gap: .7rem; }

/* Photos on a ticket: a small picture to tap, instead of just a file name. */
.file-photo { display: inline-flex; flex-direction: column; gap: .25rem; width: 9rem; padding: .3rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .78rem; color: var(--ink-2); }
.file-photo:hover { border-color: var(--brand); text-decoration: none; }
.file-photo img { display: block; width: 100%; height: 6.5rem; object-fit: cover; border-radius: 5px; background: var(--surface-2); }
.file-photo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=file]::file-selector-button { font: inherit; padding: .45rem .8rem; margin-right: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }

/* Ticket list filters: on a wide screen everything shows; on a phone the extras fold away. */
.more-filters { display: contents; }
.more-filters-toggle { display: none; }
@media (max-width: 720px) {
  .nav-link { white-space: nowrap; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tab { white-space: nowrap; }
  .filters input[type=search] { flex-basis: 100%; min-width: 0; }
  .filters select, .filters input { min-width: 0; }
  .filters select[name=status] { flex: 1 1 6rem; }
  .more-filters-toggle { display: inline-flex; }
  .more-filters { display: none; }
  .more-filters.open { display: flex; flex-wrap: wrap; gap: .5rem; flex-basis: 100%; }
  /* Changing tickets in bulk is a desk job; on a phone the ticket list comes first. */
  .bulk-bar, .select-col { display: none; }
}
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink-2); }
