/* Tiqvero — agent workspace.
   Type: Schibsted Grotesk for the interface, Newsreader for anything a person wrote (subjects, messages).
   Colour: cool chalk and blue-slate ink; the only saturated colours are the status flags and one teal. */

@font-face { font-family: 'Schibsted Grotesk'; src: url(/fonts/schibsted-grotesk-latin.woff2) format('woff2'); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; src: url(/fonts/schibsted-grotesk-latin-ext.woff2) format('woff2'); font-weight: 400 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader-latin-normal.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader-latin-italic.woff2) format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --chalk: #f1f3f2; --paper: #ffffff; --sunk: #e8ecec;
  --ink: #17262e; --mist: #5d7078; --rule: #d6dddf; --rule-strong: #b9c5c8;
  --harbor: #0c6b63; --harbor-ink: #ffffff; --harbor-soft: #dcefec;
  --note: #fff4c9; --note-rule: #e3c869;
  --danger: #b3321f;
  --s-new: #2f6fde; --s-open: #cf3f2a; --s-pending: #c98a0b; --s-hold: #7157b3; --s-solved: #2b8a55; --s-closed: #7a878e; --s-deleted: #7a878e;
  --p-urgent: #cf3f2a; --p-high: #e08a1e; --p-normal: #9fb0b6; --p-low: #cdd7da;
  --ui: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --read: 'Newsreader', Georgia, 'Times New Roman', serif;
  --r-sm: 3px; --r-md: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --chalk: #0f181c; --paper: #162227; --sunk: #1c2b31;
    --ink: #e4ecee; --mist: #92a6ae; --rule: #263840; --rule-strong: #35505a;
    --harbor: #3cb5a8; --harbor-ink: #06201d; --harbor-soft: #173a3a;
    --note: #3a3414; --note-rule: #7a6a22;
    --danger: #ff8a75;
    --s-new: #6ea0ff; --s-open: #ff7a62; --s-pending: #e8b13c; --s-hold: #a58bf0; --s-solved: #5cc88a; --s-closed: #8fa3ab;
    --p-normal: #5d747d; --p-low: #3a4f57;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--chalk); color: var(--ink); font: 400 15px/1.45 var(--ui); }
/* Tabular figures only where columns of numbers must line up; in running text they widen punctuation ("1 , 000"). */
.num, .count, .when, .tablefoot, time { font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
a { color: var(--harbor); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--harbor); outline-offset: 2px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--mist); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: .6rem; }
.stack { display: flex; flex-direction: column; gap: .75rem; }

/* ---- shell ------------------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.tablewrap { overflow-x: auto; }
.rail { background: var(--paper); border-right: 1px solid var(--rule); padding: 1.1rem .85rem; display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .35rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand .mark { width: 22px; height: 22px; background: var(--harbor); clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 62%, 62% 100%, 0 100%); }
.privacy { margin: .4rem 0 .8rem; }
.privacy summary { cursor: pointer; font-weight: 600; }
.privacy p { margin: .5rem 0 0; max-width: 46rem; }
.translate-thread { margin: 0 0 .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.translate-reply { margin: 0; padding: .3rem .7rem .5rem; display: flex; flex-direction: column; gap: .5rem; }
.brand .logo { height: 26px; width: auto; max-width: 150px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: .78rem; color: var(--mist); letter-spacing: 0; }
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail .group-label { font-size: .8rem; color: var(--mist); padding: .6rem .6rem .25rem; }
.navlink { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .42rem .6rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.navlink:hover { background: var(--sunk); }
.navlink[aria-current='page'] { background: var(--harbor-soft); font-weight: 600; }
.navlink .count { color: var(--mist); font-size: .85rem; }
.navlink[aria-current='page'] .count { color: var(--ink); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .8rem; }
.rail .me { border-top: 1px solid var(--rule); padding-top: .8rem; display: flex; align-items: center; gap: .6rem; }
.langpick select { padding: .3rem 1.4rem .3rem .5rem; font-size: .9rem; }
.authcard .langpick { align-self: flex-start; }
.authcard .langpick select { width: auto; }
.main { min-width: 0; padding: 1.4rem 1.8rem 4rem; }
.pagehead { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.pagehead h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.015em; }

/* ---- controls --------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .48rem .95rem; border-radius: var(--r-md); border: 1px solid var(--rule-strong); background: var(--paper); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); line-height: 1.2; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--harbor); border-color: var(--harbor); color: var(--harbor-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--mist); font-weight: 500; }
.btn.quiet:hover { color: var(--ink); background: var(--sunk); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > label, .field > .label { font-size: .86rem; color: var(--mist); }
.input, select.input, textarea.input { width: 100%; padding: .5rem .65rem; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--paper); }
.input:hover { border-color: var(--mist); }
textarea.input { resize: vertical; min-height: 7rem; line-height: 1.5; }
select.input { padding-right: 1.6rem; }
.error { color: var(--danger); font-size: .92rem; }
.hint { color: var(--mist); font-size: .86rem; }

/* ---- status flags ----------------------------------------------------------------------- */
.flag { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.flag::before { content: ''; width: .62rem; height: .9rem; background: var(--c, var(--mist)); clip-path: polygon(0 0, 100% 0, 72% 50%, 100% 100%, 0 100%); }
.flag[data-s='new'] { --c: var(--s-new); } .flag[data-s='open'] { --c: var(--s-open); } .flag[data-s='pending'] { --c: var(--s-pending); }
.flag[data-s='hold'] { --c: var(--s-hold); } .flag[data-s='solved'] { --c: var(--s-solved); } .flag[data-s='closed'] { --c: var(--s-closed); } .flag[data-s='deleted'] { --c: var(--s-deleted); }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); color: var(--ink); display: grid; place-items: center; font-size: .78rem; font-weight: 700; border: 1px solid var(--rule); }
.avatar.agent { background: var(--harbor-soft); border-color: transparent; color: var(--harbor); }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .5rem; border: 1px solid var(--rule-strong); border-radius: 99px; font-size: .84rem; background: var(--paper); }
.chip button { all: unset; cursor: pointer; color: var(--mist); padding: 0 .1rem; }
.chip button:hover { color: var(--danger); }

/* ---- queue ------------------------------------------------------------------------------ */
.queue { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.queue th { text-align: left; font-weight: 500; font-size: .84rem; color: var(--mist); padding: .55rem .65rem; border-bottom: 1px solid var(--rule); background: var(--paper); white-space: nowrap; }
.queue td { padding: .62rem .65rem; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.queue tr:last-child td { border-bottom: 0; }
.queue tbody tr { cursor: pointer; }
.queue tbody tr:hover td { background: color-mix(in srgb, var(--harbor-soft) 55%, transparent); }
.queue td:first-child { box-shadow: inset 3px 0 var(--pc, transparent); }
.queue tr[data-p='urgent'] { --pc: var(--p-urgent); } .queue tr[data-p='high'] { --pc: var(--p-high); }
.queue .num { color: var(--mist); width: 4.2rem; }
.queue .subject { font-family: var(--read); font-size: 1.04rem; font-weight: 500; width: 42%; min-width: 11rem; }
.queue .subject a { color: var(--ink); text-decoration: none; }
.queue .subject a:hover { text-decoration: underline; }
.queue .when { color: var(--mist); min-width: 6.5rem; }
.tablefoot { display: flex; align-items: center; justify-content: space-between; padding: .7rem .2rem; color: var(--mist); font-size: .9rem; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--mist); background: var(--paper); border: 1px dashed var(--rule-strong); border-radius: var(--r-md); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; }

/* ---- ticket ----------------------------------------------------------------------------- */
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.ticket-title { font-family: var(--read); font-size: 1.7rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; max-width: 34ch; }
.ticket-meta { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1.4rem; color: var(--mist); font-size: .92rem; }
.tabs { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.2rem; }
.tab { all: unset; cursor: pointer; padding: .35rem 0 .6rem; color: var(--mist); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected='true'] { color: var(--ink); font-weight: 600; border-color: var(--harbor); }
.thread { display: flex; flex-direction: column; gap: 1.3rem; }
.turn { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .8rem; }
.turn .who { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .25rem; }
.turn .who strong { font-weight: 650; }
.turn .who time { color: var(--mist); font-size: .86rem; }
.turn .body { font-family: var(--read); font-size: 1.1rem; line-height: 1.6; max-width: 66ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn.agent .body { padding-left: .9rem; border-left: 3px solid var(--harbor); }
.turn.note .body { background: var(--note); border: 1px solid var(--note-rule); border-radius: var(--r-sm); padding: .65rem .85rem; font-size: 1.04rem; }
.turn.note .who::after { content: attr(data-note-label); font-size: .8rem; color: var(--ink); background: var(--note); border: 1px solid var(--note-rule); padding: 0 .4rem; border-radius: var(--r-sm); }
.composer { margin-top: 2rem; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--paper); }
.composer.is-note { background: var(--note); border-color: var(--note-rule); }
.composer .mode { display: flex; gap: .2rem; padding: .4rem .5rem 0; border-bottom: 1px solid var(--rule); }
.composer.is-note .mode { border-color: var(--note-rule); }
.composer .mode button { all: unset; cursor: pointer; padding: .4rem .75rem; border-radius: var(--r-sm) var(--r-sm) 0 0; color: var(--mist); }
.composer .mode button[aria-pressed='true'] { color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px var(--harbor); }
.composer textarea { width: 100%; border: 0; background: transparent; padding: .8rem .9rem; min-height: 8.5rem; resize: vertical; font-family: var(--read); font-size: 1.08rem; line-height: 1.55; }
.composer textarea:focus-visible { outline: none; }
.composer footer { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.composer.is-note footer { border-color: var(--note-rule); }
/* Files: what waits to be sent, and the files on a message. */
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .2rem .8rem .5rem; }
.attach-add { padding-left: 0; }
.attach-list { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1 1 100%; margin: 0; padding: 0; list-style: none; }
.attach-list li { display: inline-flex; align-items: center; gap: .45rem; max-width: 100%; padding: .15rem .25rem .15rem .6rem; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sunk); font-size: .9rem; }
.attach-list li.uploading { opacity: .65; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.attach-remove { padding: 0 .4rem; line-height: 1.3; }
.attach .error { flex: 1 1 100%; margin: 0; }
.files { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; margin: .55rem 0 0; padding: 0; list-style: none; }
.files li { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; }
.files .file { overflow-wrap: anywhere; }
.files .thumb img { display: block; max-width: 7rem; max-height: 4.5rem; border: 1px solid var(--rule); border-radius: var(--r-sm); }
.tpl-picker { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--sunk); }
.tpl-picker h3 { margin: 0 0 .2rem; }
.tpl-list > li { align-items: flex-start; }
.tpl-targets { margin-top: .5rem; font-size: .85rem; }
.tpl-targets th, .tpl-targets td { padding: .15rem .6rem .15rem 0; text-align: left; font-weight: 500; white-space: nowrap; }
.tpl-targets thead th { color: var(--mist); font-weight: 600; }
.tpl-hours { margin-top: .7rem; max-width: 34rem; }
.hc-tools { display: flex; align-items: center; gap: .6rem; margin: .1rem 0 .4rem; }
.zdi-done { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--sunk); }
.zdi-done h3 { margin: .9rem 0 .2rem; font-size: .95rem; }
.zdi-result { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.4rem; margin: .5rem 0 0; }
.zdi-result dt { color: var(--mist); }
.zdi-result dd { margin: 0; font-weight: 560; }
.zdi-done > div:last-child:has(> button) { margin-top: .8rem; }
.zdt-bar { width: 100%; max-width: 32rem; height: .6rem; accent-color: var(--harbor); }
.zdi-list { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .92rem; overflow-wrap: anywhere; }
.side { display: flex; flex-direction: column; gap: 1.15rem; position: sticky; top: 1.2rem; }
.side section { display: flex; flex-direction: column; gap: .7rem; }
.side h2 { font-size: .92rem; font-weight: 650; }
.side .person { display: flex; gap: .65rem; align-items: center; }
.side .person a { font-weight: 600; }
.unsaved { background: var(--harbor-soft); border-radius: var(--r-md); padding: .6rem .75rem; display: flex; align-items: center; gap: .6rem; font-size: .92rem; }

.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.events li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.events time { color: var(--mist); font-size: .88rem; }
.events .from { color: var(--mist); text-decoration: line-through; }

/* ---- auth ------------------------------------------------------------------------------- */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.authcard { width: min(26rem, 100%); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.authcard h1 { font-size: 1.5rem; letter-spacing: -.015em; }

.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 20; }
.toast { background: var(--ink); color: var(--chalk); padding: .6rem .9rem; border-radius: var(--r-md); max-width: 24rem; }
.toast.bad { background: var(--danger); color: #fff; }
.skeleton { background: linear-gradient(90deg, var(--sunk), var(--rule), var(--sunk)); background-size: 200% 100%; border-radius: var(--r-sm); min-height: 1rem; animation: sheen 1.4s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

@media (max-width: 1180px) { .queue .hide-m { display: none; } }
@media (max-width: 1100px) { .queue .hide-s { display: none; } }
@media (max-width: 960px) {
  .main { padding: 1rem 1rem 4rem; }
  .ticket { grid-template-columns: 1fr; } .side { position: static; }
  .queue .hide-s { display: none; }
}

/* ---- AI assist and settings ---- */
.ai { display: flex; flex-direction: column; gap: .6rem; }
.ai-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.ai-actions .btn { padding: .35rem .65rem; font-weight: 500; font-size: .92rem; }
.ai-card { border: 1px solid var(--rule-strong); border-left: 3px solid var(--harbor); border-radius: var(--r-md); background: var(--paper); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .5rem; }
.ai-text { font-family: var(--read); font-size: 1.02rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-btn { border: 1px dashed var(--harbor); background: var(--harbor-soft); color: var(--ink); border-radius: 99px; padding: .15rem .6rem; cursor: pointer; font-size: .86rem; }
.chip-btn:hover { background: var(--paper); }
.translate { margin-top: .2rem; }
.translate .btn.quiet { padding-left: 0; font-size: .86rem; }
.settings { max-width: 46rem; display: flex; flex-direction: column; gap: 2.2rem; }
.settings-block { display: flex; flex-direction: column; gap: .8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.settings-block h2 { font-size: 1.15rem; } .settings-block h3 { font-size: .95rem; margin-top: .6rem; }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; } .check input { width: 1.05rem; height: 1.05rem; accent-color: var(--harbor); }
.stats { display: flex; gap: 2rem; margin: 0; } .stats dt { color: var(--mist); font-size: .86rem; } .stats dd { margin: 0; font-size: 1.4rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; } .problems code { font-size: .84rem; color: var(--danger); overflow-wrap: anywhere; }

.ai-buttons { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }

/* ---- custom fields ---- */
.fieldlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.fieldlist > li { display: flex; align-items: center; gap: .3rem; padding: .6rem .8rem; border-bottom: 1px solid var(--rule); }
.fieldlist > li:last-child { border-bottom: 0; }
.fieldlist > li.is-off strong { color: var(--mist); }
.fieldlist code { font-size: .82rem; color: var(--mist); margin-left: .35rem; }
.fieldlist .fieldform { flex: 1; }
.slagrid { border-collapse: collapse; width: 100%; }
.slagrid th, .slagrid td { padding: .25rem .4rem; text-align: left; font-weight: 500; font-size: .88rem; }
.slagrid thead th { color: var(--mist); }
.slagrid td .input { width: 5.5rem; min-width: 0; }
.slapanel { display: flex; flex-direction: column; gap: .45rem; }
.slapanel .sla-row { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; font-size: .9rem; }
.slapanel .sla-miss { color: var(--danger); font-weight: 600; }
.slapanel .sla-ok { color: var(--mist); }
.rulerow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.rulerow .input { width: auto; max-width: 100%; }
.rulerow .stack { flex: 1; }
.rulerow .stack .input { width: 100%; }
.searchbox { display: flex; gap: .5rem; margin-bottom: .6rem; }
.searchbox .input { flex: 1; min-width: 0; }
.searchhelp { margin-bottom: .9rem; font-size: .9rem; }
.searchhelp summary { cursor: pointer; color: var(--mist); }
.searchhelp ul { margin: .4rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.queue td.pick, .queue th.pick { width: 2.2rem; padding-right: 0; }
.queue tr[data-picked] td { background: var(--harbor-soft); }
.bulkbar { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .6rem .8rem; margin-bottom: .6rem; background: var(--paper); border: 1px solid var(--harbor); border-radius: var(--r-md); }
.bulkform { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.bulkform .input { width: auto; max-width: 100%; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.queue tbody tr.group-row { cursor: default; }
.queue .group-row th { background: var(--sunk); color: var(--ink); font-weight: 600; font-size: .86rem; padding: .4rem .65rem; text-align: left; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; }
.audit-filters label { display: flex; flex-direction: column; gap: .15rem; font-size: .86rem; color: var(--mist); }
.auditlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.auditlist > li { padding: .6rem .8rem; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: .15rem; overflow-wrap: anywhere; }
.auditlist > li:last-child { border-bottom: 0; }
.audit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; }
.audit-action[data-a="destroy"] { border-color: var(--danger); color: var(--danger); }
.audit-label { color: var(--ink); }
.auditlist details { font-size: .88rem; }
.auditlist summary { cursor: pointer; color: var(--mist); }
.audit-changes { margin: .3rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .1rem; }
.audit-changes code { margin-left: 0; }
.deliveries { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.deliveries .chip[data-s="failed"] { border-color: var(--danger); color: var(--danger); }
.fieldform { padding: .4rem 0; }
.fieldform h3 { margin-top: 0; }
/* a checkbox field has no label row above it, so on a row of inputs it drops down to line up with them */
.row > div > .field > .check:first-child { margin-top: 1.4rem; }
/* ---- ticket forms ---- */
.fieldpick { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.fieldpick > li { display: flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-bottom: 1px solid var(--rule); }
.fieldpick > li:last-child { border-bottom: 0; }
.conditions { border: 1px solid var(--rule); border-radius: var(--r-md); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .7rem; margin: 0; }
.conditions legend { padding: 0 .4rem; font-weight: 600; font-size: .92rem; }
.condition { padding: .7rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
/* ---- merge and incidents ---- */
.notice { padding: .6rem .8rem; background: var(--sunk); border-radius: var(--r-md); margin: .9rem 0 0; }
.incidents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; }
.incidents li { display: flex; gap: .5rem; align-items: baseline; overflow-wrap: anywhere; }
/* ---- suspended tickets ---- */
.suspended tbody tr.detail { cursor: default; background: var(--sunk); }
.suspended tbody tr.detail:hover { background: var(--sunk); }
.suspended .plain { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--read); margin: 0; max-height: 18rem; overflow: auto; }
.cause { display: inline-block; padding: .08rem .5rem; border-radius: 99px; border: 1px solid var(--rule-strong); font-size: .84rem; background: var(--paper); white-space: nowrap; }
.cause[data-cause='detected_as_spam'] { border-color: var(--danger); color: var(--danger); }
/* ---- customer satisfaction ---- */
.cause[data-score='good'] { border-color: var(--s-solved, #3a8f6a); color: var(--s-solved, #3a8f6a); }
.cause[data-score='bad'] { border-color: var(--danger); color: var(--danger); }
.rating-comment { margin: .5rem 0 0; font-family: var(--read); font-style: italic; overflow-wrap: anywhere; }
.rate { max-width: 34rem; width: 100%; }
.rate-choices { display: flex; gap: .7rem; flex-wrap: wrap; }
.rate-choice { flex: 1 1 12rem; padding: .9rem 1rem; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; font-weight: 600; font-size: 1rem; }
.rate-choice:hover { border-color: var(--mist); }
.rate-choice[aria-pressed='true'] { border-color: var(--harbor); background: var(--harbor-soft); }
/* ---- side conversations ---- */
.sidecs { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: .8rem; }
.sidecs h2 { font-size: 1.05rem; margin: 0; }
.sc-card { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.sc-card.is-closed { opacity: .8; }
.sc-head { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: .15rem; width: 100%; padding: .65rem .85rem; cursor: pointer; }
.sc-head:hover { background: var(--sunk); }
.sc-body { padding: .2rem .85rem .85rem; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: .8rem; }
.sc-msg { padding-top: .6rem; }
.sc-msg .who { display: flex; gap: .6rem; align-items: baseline; font-size: .9rem; }
.sc-msg .body { font-family: var(--read); white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-msg.out .who strong { color: var(--harbor); }
.sc-new { padding: .8rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
/* ---- API tokens ---- */
.secret { border: 1px solid var(--harbor); background: var(--harbor-soft); border-radius: var(--r-md); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.secret code { overflow-wrap: anywhere; font-size: .95rem; }
.secret .plain { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; color: var(--mist); }
/* ---- OAuth consent ---- */
.consent { max-width: 34rem; }
.consent .scopes { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .25rem; }

/* ---- phones and small tablets -------------------------------------------------------------------
   Below 900px the navigation is a drawer behind a slim top bar, so the page gets the whole screen. */
.topbar, .scrim, .jump { display: none; }
@media (max-width: 900px) {
  .app { display: block; }
  .topbar { display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 30; padding: .5rem .8rem; padding-top: calc(.5rem + env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--rule); }
  .topbar .brand { flex: 1 1 auto; min-width: 0; padding: 0; }
  .topbar .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn { min-width: 44px; min-height: 44px; font-size: 1.4rem; line-height: 1; padding: 0; }
  .iconbtn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; }
  .burger, .burger::before, .burger::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 1px; position: relative; content: ''; }
  .burger::before { position: absolute; top: -6px; } .burger::after { position: absolute; top: 6px; }
  .rail { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(21rem, 86vw); height: 100vh; height: 100dvh; transform: translateX(-100%); visibility: hidden;
    transition: transform .2s ease, visibility 0s .2s; padding-top: calc(1.1rem + env(safe-area-inset-top)); padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); border-right: 1px solid var(--rule); }
  .menu-open .rail { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 16, 20, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .navlink { min-height: 44px; }
  /* the properties sit below the conversation on a small screen: one tap takes you there */
  .jump { display: inline-flex; padding-inline: 0; margin-left: auto; }
  .side { scroll-margin-top: 4.5rem; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .rail, .scrim { transition: none; } }

@media (max-width: 640px) {
  body { font-size: 16px; }
  /* 16px or more, or iOS zooms the page when a field is focused */
  input, select, textarea, .input { font-size: 16px; }
  .btn, .input, select.input { min-height: 44px; }
  .btn { padding-inline: 1rem; }
  .check input { width: 1.3rem; height: 1.3rem; }
  .tab { padding: .65rem 0; }
  .tabs { overflow-x: auto; white-space: nowrap; gap: 1.2rem; scrollbar-width: none; }
  .main { padding: .9rem .85rem calc(4rem + env(safe-area-inset-bottom)); }
  .pagehead h1 { font-size: 1.28rem; }
  .authwrap { min-height: 100vh; min-height: 100dvh; padding: 1rem; }
  .authcard { padding: 1.3rem; }
  .toasts { left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .stats { flex-wrap: wrap; gap: 1rem 1.6rem; }
  .settings { gap: 1.6rem; }
  .fieldlist > li { flex-wrap: wrap; row-gap: .2rem; }
  .fieldlist > li > .grow { flex: 1 0 100%; }
  .fieldlist > li { padding-inline: .6rem; gap: .15rem; }
  .fieldlist .btn.quiet { padding-inline: .4rem; min-width: 40px; }
  .fieldform .row, .conditions .row { flex-wrap: wrap; }
  .rate-choice { flex-basis: 100%; }

  /* a ticket: one column, a title that fits, a composer that is comfortable to type in */
  .ticket { gap: 1.4rem; }
  .ticket-title { font-size: 1.4rem; max-width: none; overflow-wrap: anywhere; }
  .ticket-meta { gap: .3rem .9rem; margin-bottom: 1rem; }
  .thread .body, .sc-msg .body { overflow-wrap: anywhere; }
  .composer { margin-top: 1.4rem; }
  .composer .mode button { padding: .6rem .9rem; }
  .composer textarea { min-height: 7rem; font-size: 1rem; padding: .7rem; }
  .composer footer { gap: .6rem; }
  .composer footer .btn { flex: 1 1 8rem; }
  .side { gap: 1.4rem; }
  .sidecs { margin-top: 1.6rem; }

  /* lists of tickets become cards: the subject first, then who, status and when */
  .tablewrap { overflow: visible; }
  .queue, .queue tbody { display: block; background: transparent; border: 0; border-radius: 0; }
  .queue thead { display: none; }
  .queue tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'subject subject' 'who status' 'num when'; gap: .2rem .8rem; align-items: baseline;
    padding: .75rem .9rem; margin-bottom: .6rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: inset 3px 0 var(--pc, transparent); }
  .queue td, .queue td:first-child { display: block; padding: 0; border: 0; width: auto; min-width: 0; box-shadow: none; }
  .queue tbody tr:hover td { background: transparent; }
  .queue tr:active { background: var(--sunk); }
  .queue .subject { grid-area: subject; width: auto; min-width: 0; font-size: 1.08rem; overflow-wrap: anywhere; padding-bottom: .15rem; }
  .queue .who { grid-area: who; min-width: 0; overflow-wrap: anywhere; }
  .queue .status { grid-area: status; justify-self: end; }
  .queue .num { grid-area: num; width: auto; font-size: .88rem; }
  .queue .when { grid-area: when; justify-self: end; min-width: 0; font-size: .88rem; }
  .queue .hide-m, .queue .hide-s { display: none; }
  .queue tr { position: relative; }
  .queue tr[data-picked] { background: var(--harbor-soft); }
  .queue tr[data-picked] td { background: transparent; }
  .bulkbar { position: static; }
  .selecting .queue tr { padding-right: 2.8rem; }
  .queue td.pick { position: absolute; top: .7rem; right: .8rem; width: auto; }
  .queue tr.group-row { display: block; background: transparent; border: 0; padding: .7rem .2rem .1rem; }
  .queue .group-row th { display: block; background: transparent; padding: 0; color: var(--mist); font-size: .84rem; letter-spacing: .02em; }
  .tablefoot { flex-wrap: wrap; gap: .6rem; }

  /* the same for held messages: a tick box beside what it is */
  .suspended tr { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'pick from' 'pick subj' 'pick why' 'pick recv'; column-gap: .75rem; row-gap: .25rem; }
  .suspended .pick { grid-area: pick; align-self: start; padding-top: .15rem; }
  .suspended .pick input { width: 1.3rem; height: 1.3rem; }
  .suspended .from { grid-area: from; } .suspended .subj { grid-area: subj; font-family: var(--read); font-size: 1.05rem; overflow-wrap: anywhere; }
  .suspended .why { grid-area: why; } .suspended .recv { grid-area: recv; font-size: .88rem; color: var(--mist); justify-self: start; }
  .suspended tr.detail { display: block; margin-top: -.3rem; }
  .suspended tr.detail td:first-child { display: none; }
  .suspended tr.detail td { grid-area: auto; }
  .bulkbar { flex-wrap: wrap; } .bulkbar .grow { display: none; } .bulkbar .btn { flex: 1 1 9rem; }
}
.routing-agents { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.routing-agents li { display: flex; align-items: baseline; gap: .4rem; }

/* The customer portal: their own requests, in a plain page rather than the agents' workspace. */
.portal { min-height: 100vh; }
.portal-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.4rem; padding: .8rem 1.4rem; border-bottom: 1px solid var(--rule); background: var(--paper); }
.portal-nav { display: flex; gap: 1.2rem; flex: 1 1 auto; }
.portal-nav a { color: var(--mist); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.portal-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; border-color: var(--harbor); }
.portal-me { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.portal-main { max-width: 52rem; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }
.requests { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.requests li { display: flex; flex-direction: column; gap: .25rem; padding: .8rem 1rem; border-bottom: 1px solid var(--rule); }
.requests li:last-child { border-bottom: 0; }
.requests .subject { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.requests .subject:hover { text-decoration: underline; }
.meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .9rem; }
.portal-fields { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: 0 0 1.4rem; font-size: .92rem; }
.portal-fields dt { color: var(--mist); }
.portal-fields dd { margin: 0; }
.portal-rate { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.portal-rate h2 { font-size: 1.1rem; margin-bottom: .7rem; }
.authlinks { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 0; font-size: .92rem; }
@media (max-width: 640px) { .portal-head { padding: .7rem 1rem; } .portal-main { padding: 1.1rem 1rem 3rem; } }

/* The help center editor. */
.hc-manage { display: grid; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.hc-tree { display: flex; flex-direction: column; gap: 1rem; }
.hc-cat { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); padding: .7rem .8rem; }
.hc-name.strong { font-weight: 650; }
.hc-mini { padding: .1rem .45rem; font-size: .85rem; }
.hc-secs { list-style: none; margin: .5rem 0; padding: 0; display: flex; flex-direction: column; }
.hc-secs li { display: flex; align-items: center; gap: .3rem; padding: .2rem .3rem; border-radius: var(--r-sm); }
.hc-secs li.on { background: var(--harbor-soft); }
.hc-secs li a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.hc-acts { display: flex; }
.hc-add { padding-left: 0; align-self: flex-start; }
.hc-articles { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.hc-articles li { display: flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border-bottom: 1px solid var(--rule); }
.hc-articles li:last-child { border-bottom: 0; }
.hc-articles a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.chip[data-s='live'] { border-color: var(--s-solved); color: var(--s-solved); }
.chip[data-s='draft'] { border-color: var(--s-pending); color: var(--s-pending); }
.hc-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); gap: 1.6rem; align-items: start; margin-top: 1rem; }
textarea.input.hc-body { min-height: 22rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; line-height: 1.5; resize: vertical; }
.hc-frame { width: 100%; min-height: 22rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.hc-cheat { margin: .4rem 0 0; padding: .6rem .8rem; background: var(--sunk); border-radius: var(--r-sm); font-size: .85rem; overflow-x: auto; }
@media (max-width: 860px) { .hc-manage, .hc-form { grid-template-columns: 1fr; } }
.portal-suggest { border: 1px solid var(--rule); border-left: 3px solid var(--harbor); border-radius: var(--r-md); background: var(--paper); padding: .7rem .9rem; }
.portal-suggest ul { margin: .4rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.hc-search-report { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); max-width: 46rem; }
.hc-search-report h2 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
.chn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.chn-card { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.chn-card .row { width: 100%; } .chn-card .hint { margin: 0; }
.chn-card[data-state="attention"] { border-color: var(--warn, #b7791f); } .chn-card[data-state="off"], .chn-card[data-state="unavailable"] { opacity: .8; }
.chn-reason { color: var(--warn, #b7791f); }
.chip[data-s="on"] { background: var(--harbor-soft); } .chip[data-s="attention"] { background: rgba(183,121,31,.2); }
.seg-list, .seg-found { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.seg-list:empty { display: none; }
.seg-list > li, .seg-found > li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem .8rem; border-bottom: 1px solid var(--rule); }
.seg-list > li:last-child, .seg-found > li:last-child { border-bottom: 0; }
.seg-list > li > form { flex: 1 1 100%; }
.seg-orgs { display: flex; flex-direction: column; gap: .3rem; max-height: 12rem; overflow-y: auto; }
.seg-find { display: flex; flex-direction: column; gap: .4rem; }
select.hc-mini { padding: .1rem .3rem; max-width: 12rem; }
.hc-gaps { list-style: none; margin: .4rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.hc-gaps li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .8rem; border-bottom: 1px solid var(--rule); }
.hc-gaps li:last-child { border-bottom: 0; }
.hc-history { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); max-width: 46rem; }
.hc-history h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.hc-history ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.hc-history li { padding: .5rem .8rem; border-bottom: 1px solid var(--rule); }
.hc-history li:last-child { border-bottom: 0; }
.hc-history .hc-frame { margin-top: .5rem; min-height: 12rem; }

/* People. */
.people > li { align-items: center; gap: .6rem; }
.people-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .3rem 1rem; padding: .5rem .2rem; }

/* Related help articles and tickets, in the ticket's sidebar. */
.related { display: flex; flex-direction: column; gap: .5rem; }
.related h3 { font-size: .84rem; font-weight: 600; color: var(--mist); margin: 0 0 .25rem; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.related li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; font-size: .9rem; overflow-wrap: anywhere; }
.related li .btn { padding: 0 .3rem; font-size: .82rem; }
.orders ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.orders li { display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; overflow-wrap: anywhere; border-top: 1px solid var(--rule); padding-top: .55rem; }
.orders li:first-child { border-top: 0; padding-top: 0; }
.orders h2 .btn { padding: 0 .3rem; font-size: .8rem; font-weight: 400; }
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.order-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .8rem; }
.order-actions .btn { padding: 0 .3rem; font-size: .82rem; }
.related-meta { display: inline-flex; align-items: center; gap: .3rem; }

/* A person's or an organization's own page. */
.who-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.who-head .avatar { width: 44px; height: 44px; font-size: 1rem; }
.who-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .7rem 1.4rem; margin: 0 0 1.2rem; }
.who-facts dt, .who-fields dt { color: var(--mist); font-size: .84rem; }
.who-facts dd, .who-fields dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.who-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem 1.4rem; margin: .6rem 0 0; }
.who-notes, .who-context { margin-bottom: 1.2rem; }
.who-notes h2, .who-context h2 { font-size: 1rem; margin-bottom: .3rem; }
.who-notes p, .who-details { white-space: pre-wrap; overflow-wrap: anywhere; margin: .2rem 0; }
.who-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 0; }
.who-tickets .tab { font: inherit; }

/* Reports. */
.reports { max-width: 62rem; }
.rp-controls { margin-bottom: .8rem; gap: .6rem; }
.rp-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.rp-head h2 { margin: 0; }
.rp-csv { font-size: .86rem; }
.rp-controls .field select { width: auto; }
.rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.rp-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: .8rem .9rem; }
.rp-label { color: var(--mist); font-size: .86rem; }
.rp-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: .15rem 0; }
.rp-sub { color: var(--mist); font-size: .82rem; }
.rp-block { margin-top: 1.8rem; }
.rp-block h2 { font-size: 1.1rem; margin-bottom: .6rem; }
.rp-chart { margin: 0; }
.rp-chart svg { width: 100%; height: auto; display: block; }
.rp-grid { stroke: var(--rule); stroke-width: 1; }
.rp-axis { fill: var(--mist); font-size: 11px; }
rect.rp-created, i.rp-created { fill: var(--harbor); background: var(--harbor); }
rect.rp-solved, i.rp-solved { fill: var(--s-solved); background: var(--s-solved); }
.rp-backlog { stroke: var(--s-pending); stroke-width: 2; stroke-linejoin: round; }
i.rp-line { background: var(--s-pending); height: 3px; }
.rp-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .86rem; margin: .4rem 0; }
.rp-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rp-table th, .rp-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; }
.rp-table th { color: var(--mist); font-weight: 600; }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.rp-axis-line { fill: var(--s-pending); }
.rp-controls .tabs { flex-wrap: wrap; gap: .3rem 1.1rem; border-bottom: 0; }
.reports .tablewrap { overflow-x: auto; }

/* The command palette, the shortcut list and the search button that opens them. */
.navsearch { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .45rem .6rem; font: inherit; font-size: .9rem; color: var(--mist); background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-md); cursor: pointer; text-align: left; }
.navsearch span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navsearch kbd { flex: none; }
.navsearch:hover { border-color: var(--rule-strong); color: var(--ink); }
kbd { font: inherit; font-size: .78rem; padding: .05rem .38rem; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--paper); color: var(--ink); white-space: nowrap; }
.keycaps { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; }
.palette-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(8, 16, 20, .55); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; }
.palette { width: min(38rem, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r-md); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); overflow: hidden; }
.palette-input { font: inherit; font-size: 1.05rem; padding: .85rem 1rem; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); outline: none; }
.palette-input:focus-visible { box-shadow: inset 0 -2px 0 var(--harbor); }
.palette-list { list-style: none; margin: 0; padding: .3rem 0; overflow-y: auto; }
.pal-group { padding: .5rem 1rem .2rem; font-size: .78rem; color: var(--mist); text-transform: none; }
.pal-item { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .45rem 1rem; cursor: pointer; }
.pal-item[aria-selected='true'] { background: var(--harbor-soft); }
.pal-text { overflow-wrap: anywhere; }
.pal-hint { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pal-none { padding: 1rem; color: var(--mist); }
.palette-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .4rem .8rem; border-top: 1px solid var(--rule); font-size: .82rem; }
.palette.help { padding: 1rem 1.2rem; overflow-y: auto; }
.keylist { display: grid; gap: .5rem; margin: .6rem 0 0; }
.keylist > div { display: flex; align-items: baseline; gap: 1rem; }
.keylist dt { min-width: 8rem; }
.keylist dd { margin: 0; }
@media (max-width: 900px) { .palette-scrim { padding-top: 4vh; } }

/* The tickets open as tabs, above the page. */
.tabstrip { margin: -.4rem 0 1rem; }
.tabstrip ul { list-style: none; margin: 0; padding: 0 0 .2rem; display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: thin; }
.tabstrip li { flex: none; display: flex; align-items: stretch; max-width: 16rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.tabstrip li.is-current { border-color: var(--harbor); background: var(--harbor-soft); }
.tabstrip a { display: flex; align-items: center; gap: .4rem; min-width: 0; padding: .3rem .2rem .3rem .6rem; color: inherit; text-decoration: none; font-size: .88rem; }
.tabstrip .tabid { color: var(--mist); flex: none; }
.tabstrip .tabsubj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tabstrip .tabdot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--harbor); }
.tabstrip .tabx { all: unset; cursor: pointer; padding: 0 .55rem; color: var(--mist); font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.tabstrip .tabx:hover { color: var(--danger); }
.tabstrip .tabx:focus-visible, .tabstrip a:focus-visible { outline: 2px solid var(--harbor); outline-offset: 1px; border-radius: 4px; }

/* Choosing a colleague to @mention in a note. */
.mention-wrap { position: relative; }
.mention-list { position: absolute; left: .4rem; top: 100%; z-index: 20; min-width: 15rem; max-width: calc(100% - .8rem); margin: .2rem 0 0; padding: .25rem 0; list-style: none; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.mention-list li { padding: .35rem .75rem; cursor: pointer; display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; }
.mention-list li .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-list li[aria-selected='true'] { background: var(--harbor-soft); }

/* The notifications page. */
.notif { max-width: 46rem; }
.notif-list { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.notif-list li { border-bottom: 1px solid var(--rule); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: block; padding: .7rem .9rem .7rem 1.4rem; color: inherit; text-decoration: none; position: relative; }
.notif-list a:hover { background: var(--sunk); }
.notif-list .unread a::before { content: ''; position: absolute; left: .55rem; top: 1.1rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--harbor); }
.notif-list .unread .notif-line { font-weight: 600; }
.notif-excerpt { color: var(--mist); font-size: .9rem; margin-top: .15rem; overflow-wrap: anywhere; }
.notif-when { color: var(--mist); font-size: .82rem; margin-top: .15rem; }

/* Two-step sign-in. */
.recovery-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem .8rem; }
.recovery-codes code, .mfa-key { font-size: 1rem; letter-spacing: .04em; background: var(--sunk); border: 1px solid var(--rule); border-radius: 4px; padding: .25rem .5rem; user-select: all; overflow-wrap: anywhere; }
