/* MHS Billing Tickets — functional UI for the task pane, full-screen window and Power Pages.
   Dense, neutral, one accent. Color is reserved for state: status, SLA, severity. */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #111418;
  --ink-2: #333a42;
  --ink-3: #525a64;
  --line: #dde1e6;
  --line-2: #b9c0c8;
  --hover: #eceff3;
  --accent: #1a5680;
  --accent-2: #133f5e;
  --accent-bg: #e3eef7;
  --on-accent: #ffffff;
  --focus: #2b7bd3;
  --red: #a61b10;   --red-bg: #fdeceb;
  --amber: #8a4f00; --amber-bg: #fdf2df;
  --green: #05663d; --green-bg: #e6f5ec;
  --blue: #1a5680;  --blue-bg: #e3eef7;
  --violet: #52389a; --violet-bg: #efebfa;
  --gray: #4b535c;  --gray-bg: #e8ebef;
  --on-red: #ffffff;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 6px;
  --row-h: 32px;
}
/* Dark tokens: used when the viewer picks Dark, or picks Auto and the OS/Office theme is dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181b; --panel: #1f2226; --ink: #eef0f2; --ink-2: #ccd2d8; --ink-3: #a3abb4;
  --line: #30353b; --line-2: #48505a; --hover: #2a2e33; --accent: #7cb6e2; --accent-2: #a0cbec; --accent-bg: #1f3445; --on-accent: #0b1722;
  --red: #ff9a91; --red-bg: #3d201e; --amber: #f3be6d; --amber-bg: #3a2c16; --green: #7fd8a4; --green-bg: #183328;
  --blue: #7cb6e2; --blue-bg: #1f3445; --violet: #c3b2f5; --violet-bg: #2c2643; --gray: #b6bdc5; --gray-bg: #2c3035;
  --on-red: #1a0806;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #16181b; --panel: #1f2226; --ink: #eef0f2; --ink-2: #ccd2d8; --ink-3: #a3abb4;
    --line: #30353b; --line-2: #48505a; --hover: #2a2e33; --accent: #7cb6e2; --accent-2: #a0cbec; --accent-bg: #1f3445; --on-accent: #0b1722;
    --red: #ff9a91; --red-bg: #3d201e; --amber: #f3be6d; --amber-bg: #3a2c16; --green: #7fd8a4; --green-bg: #183328;
    --blue: #7cb6e2; --blue-bg: #1f3445; --violet: #c3b2f5; --violet-bg: #2c2643; --gray: #b6bdc5; --gray-bg: #2c3035;
    --on-red: #1a0806;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 13px/1.38 var(--sans); }
body { -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Native dropdown lists: never inherit light text onto a white menu. */
option, optgroup { background: var(--panel); color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.num, .tid, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sp { flex: 1; }
[hidden] { display: none !important; }

/* ---- shell ---- */
.app { display: flex; flex-direction: column; height: 100%; }
.top { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.logo { display: block; height: 34px; width: auto; flex: none; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}
@media (max-width: 480px) { .sync-state:not(.busy) { display: none; } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.sync-state { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.sync-state.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r); color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.me-chip { max-width: 110px; height: 26px; padding: 0 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 13px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip.unset { border-color: var(--amber); color: var(--amber); }

.tabs { display: flex; gap: 2px; padding: 0 6px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; flex: none; height: 36px; padding: 0 8px; border: 0; background: none; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
/* More menu: a dropdown in the narrow pane, an always-open group in the wide sidebar. */
.more { flex: none; display: flex; }
.more-btn { height: 36px; padding: 0 8px; border: 0; background: none; color: var(--ink-2); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.more-btn:hover, .more-btn[aria-expanded="true"] { color: var(--ink); }
.more-btn.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.more-btn .caret { font-size: 10px; }
.more-dots { display: none; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.more-menu { display: none; position: fixed; z-index: 25; min-width: 180px; padding: 4px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 6px 20px rgba(0,0,0,.18); flex-direction: column; }
.more-menu.open { display: flex; }
/* Anything that pops over the add-in blurs what's behind it. The scrim sits under the More menu; a click on it closes the menu. */
.scrim { position: fixed; inset: 0; z-index: 24; background: rgba(15, 18, 22, .12); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.scrim[hidden] { display: none; }
.more-menu button { height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--ink); text-align: left; display: flex; align-items: center; justify-content: space-between; white-space: nowrap; }
.more-menu button:hover { background: var(--hover); }
.more-menu button[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.more-menu button[aria-selected="true"]::after { display: none; }
.badge { display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px; border-radius: 9px; background: var(--gray-bg); color: var(--ink-2); font: 600 11px/18px var(--sans); text-align: center; }
.badge:empty { display: none; }
.badge.warn { background: var(--red-bg); color: var(--red); }

.banner { padding: 8px 12px; background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid var(--line); font-size: 12px; }
.banner button { margin-left: 6px; }
.view { flex: 1; overflow-y: auto; padding: 10px 10px 80px; }
.view:focus { outline: none; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--row-h); padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.seg button { height: 28px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.seg button .c { margin-left: 4px; color: var(--ink-3); font-weight: 400; }
select, input[type=text], input[type=search], input[type=date], input[type=email], textarea {
  height: var(--row-h); padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); min-width: 0;
}
textarea { height: auto; min-height: 64px; padding: 6px 8px; resize: vertical; }
select:hover, input:hover, textarea:hover { border-color: var(--ink-3); }
.search { width: 100%; height: 36px; font-size: 14px; }

/* ---- section headers ---- */
.sec { display: flex; align-items: baseline; gap: 6px; margin: 14px 2px 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.sec:first-child { margin-top: 2px; }
.sec .n { font-family: var(--mono); letter-spacing: 0; }
.sec .sp + * { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---- ticket rows ---- */
.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.trow { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--hover); }
.trow .tid { flex: none; width: 34px; font-weight: 600; font-size: 12.5px; }
.trow .subj { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow { height: 44px; }
.trow .pid { flex: none; width: 82px; display: flex; flex-direction: column; line-height: 1.25; font-family: var(--mono); font-size: 11.5px; overflow: hidden; }
.trow .pt { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .mrn { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.search.find { height: 32px; font-size: 13px; margin-bottom: 8px; }
.od { flex: none; display: inline-flex; align-items: baseline; gap: 3px; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--red-bg); color: var(--red); font-size: 11px; font-weight: 600; line-height: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.od b { font-size: 12.5px; }
.od-x { display: none; }
@media (min-width: 600px) { .od-x { display: inline; } }
.trow .due { flex: none; font-size: 11px; font-weight: 600; }
.due.bad { color: var(--red); } .due.warn { color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot.none { background: transparent; }
.sev-1 { background: var(--red); } .sev-2 { background: var(--amber); } .sev-3 { background: var(--ink-3); }
.empty { padding: 22px 12px; text-align: center; color: var(--ink-3); background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ---- chips ---- */
.chip { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st-await { background: var(--amber-bg); color: var(--amber); }
.st-with { background: var(--blue-bg); color: var(--blue); }
.st-call { background: var(--violet-bg); color: var(--violet); }
.st-closed { background: var(--green-bg); color: var(--green); }
.sla { font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla.bad { color: var(--red); } .sla.warn { color: var(--amber); } .sla.ok { color: var(--green); } .sla.neutral { color: var(--ink-3); font-weight: 500; }
.flag { display: inline-block; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px; font-size: 10.5px; font-weight: 600; line-height: 15px; }
.flag.red { color: var(--red); } .flag.amber { color: var(--amber); } .flag.gray { color: var(--ink-3); }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 10px; }
.kpi { background: var(--panel); padding: 8px 10px; }
.kpi .v { font: 600 19px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.kpi.bad .v { color: var(--red); } .kpi.warn .v { color: var(--amber); } .kpi.good .v { color: var(--green); }
button.kpi { border: 0; text-align: left; } button.kpi:hover { background: var(--hover); }

/* ---- data tables ---- */
.tbl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.grid th { position: sticky; top: 0; background: var(--panel); color: var(--ink-3); font-weight: 600; font-size: 11px; }
.grid th:first-child, .grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; } .grid tbody tr:hover td { background: var(--hover); }
.grid tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); }
.grid .bad { color: var(--red); font-weight: 600; } .grid .warn { color: var(--amber); } .grid .good { color: var(--green); }
.grid .zero { color: var(--line-2); }
.mix { display: flex; width: 64px; height: 8px; border-radius: 2px; overflow: hidden; background: var(--gray-bg); margin-left: auto; }
.mix i { display: block; height: 100%; }
.mix .a { background: var(--amber); } .mix .w { background: var(--blue); } .mix .c { background: var(--violet); } .mix .d { background: var(--green); opacity: .55; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 2px 0; font-size: 11px; color: var(--ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.bars { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 30px; align-items: center; gap: 8px; height: 24px; font-size: 12px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bar-row .track { height: 8px; background: var(--gray-bg); border-radius: 2px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); }
.bar-row .n { text-align: right; font-family: var(--mono); font-size: 11.5px; }
.two { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }

/* ---- detail ---- */
.detail-head { position: sticky; top: -10px; z-index: 3; margin: -10px -10px 10px; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.detail-head > .muted { white-space: nowrap; }
.detail-head .tid { font-size: 15px; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 10px; }
.card h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 4px 10px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.timeline .lab { color: var(--ink-3); }
.actions-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.actions-list li { display: flex; gap: 7px; align-items: baseline; font-size: 12.5px; }
.form { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 330px) { .form { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field .lab { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.field select, .field input, .field textarea { width: 100%; }
.field .checks input { width: auto; margin: 0; }
.field.dirty select, .field.dirty input, .field.dirty textarea, .field.dirty .checks { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field.req > label::after { content: " · to close"; color: var(--amber); font-weight: 500; }
.hint { font-size: 11px; color: var(--amber); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r); }
.checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400; color: var(--ink); }
.savebar { position: sticky; bottom: -80px; margin: 0 -10px; padding: 8px 10px; background: var(--panel); border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; z-index: 3; }
.history { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.history li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history .t { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.linkish { color: var(--accent); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.collapse > summary { cursor: pointer; list-style: none; }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary h4::after { content: "▸"; margin-left: auto; } .collapse[open] > summary h4::after { content: "▾"; }

/* ---- lookup ---- */
.pgroup { margin-bottom: 10px; }
.pgroup-h { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 5px; font-size: 12.5px; }
.pgroup-h b { font-family: var(--mono); }

/* ---- new ticket ---- */
.formframe { width: 100%; height: calc(100vh - 160px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }

/* ---- overlay / toast ---- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(15, 18, 22, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-height: 92vh; overflow: auto; background: var(--panel); border-radius: 10px 10px 0 0; padding: 12px; }
.sheet h3 { margin: 0 0 8px; font-size: 14px; }
.sheet iframe { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.toast { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; padding: 9px 12px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: 12.5px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.err { background: var(--red); color: var(--on-red); }
.skeleton { height: 52px; margin-bottom: 1px; background: linear-gradient(90deg, var(--panel), var(--hover), var(--panel)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.setup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.setup h3 { margin: 0 0 6px; font-size: 15px; }
.setup ul { margin: 8px 0 12px; padding-left: 18px; color: var(--ink-2); }
.kbd { font: 11px var(--mono); padding: 0 4px; border: 1px solid var(--line-2); border-radius: 3px; }

/* ---- ops escalation review ---- */
.review-bar { position: sticky; top: -10px; z-index: 3; margin: -10px -10px 0; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.share-note { margin: 0 -10px 10px; padding: 5px 10px; background: var(--green-bg); color: var(--green); font-size: 11.5px; }
.review-card .review-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.review-card .review-title .tid { font-size: 17px; font-weight: 700; }
.review-card .kv { grid-template-columns: 128px 1fr; font-size: 13px; gap: 6px 10px; }
.ops-card { border-color: var(--amber); }
.ops-card h4 .sp { flex: 1; }

/* ---- Power Pages (full browser window) ---- */
body.web { background: var(--bg); }
.web .app { max-width: 1040px; margin: 0 auto; background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.web .top { height: 48px; padding: 0 16px; }
.web .tabs { padding: 0 12px; }
.web .tabs button { height: 40px; padding: 0 12px; font-size: 13.5px; }
.web .view { padding: 14px 16px 80px; }
.web .detail-head, .web .review-bar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; top: -14px; }
.web .savebar { margin: 0 -16px; padding: 10px 16px; }
.web .share-note { margin-left: -16px; margin-right: -16px; padding-left: 16px; }
@media (min-width: 900px) {
  .web .trow .pid { width: 120px; flex-direction: row; gap: 10px; }
  .web .trow .tid { width: 44px; }
  .web .formframe { height: calc(100vh - 190px); }
}

/* ---- activity + recaps ---- */
.arow { display: grid; grid-template-columns: 82px 40px 1fr; gap: 2px 8px; width: 100%; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 12px; }
.arow:last-child { border-bottom: 0; }
.arow:hover:not([disabled]) { background: var(--hover); }
.arow .t { color: var(--ink-3); }
.arow .tid { font-weight: 600; }
.arow .what { min-width: 0; overflow-wrap: anywhere; }
.arow .who { grid-column: 3; font-size: 11px; }
.recapframe { width: 100%; height: 62vh; min-height: 360px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }

/* ---- wide layouts (full-screen window, Power Pages): left navigation like the Portal ---- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 196px 1fr; grid-template-rows: auto auto 1fr; height: 100%; }
  .top { grid-column: 1 / -1; }
  .banner { grid-column: 2; grid-row: 2; }
  .tabs { grid-row: 2 / 4; flex-direction: column; gap: 2px; padding: 10px 8px; border-bottom: 0; border-right: 1px solid var(--line); overflow: visible; }
  .tabs button { height: 34px; text-align: left; border-radius: var(--r); display: flex; align-items: center; justify-content: space-between; }
  .tabs button[aria-selected="true"] { background: var(--accent-bg); }
  .tabs button[aria-selected="true"]::after { display: none; }
  .view { grid-column: 2; grid-row: 3; min-height: 0; }
  .more { flex-direction: column; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .more-btn { height: 26px; padding: 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); cursor: default; pointer-events: none; box-shadow: none !important; }
  .more-btn .caret, .more-btn .badge { display: none; }
  .more-menu, .more-menu.open { display: flex; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; gap: 2px; }
  .more-menu button { color: var(--ink-2); font-weight: 500; }
  #moreScrim { display: none; } /* the menu is an always-open sidebar group here */
  .web .app { max-width: 1240px; }
}

/* Narrow task pane: keep My Tickets, Clinic Dashboard, Stats, Ops and More on one line. */
@media (max-width: 899px) {
  .tabs { gap: 0; padding: 0 2px; }
  .tabs > button, .more-btn { padding: 0 5px; font-size: 12px; letter-spacing: -.1px; }
  .tabs > button[aria-selected="true"]::after { left: 5px; right: 5px; }
  .tabs .badge { min-width: 16px; margin-left: 3px; padding: 0 4px; font-size: 10.5px; line-height: 16px; }
  .more-btn .badge { min-width: 8px; width: 8px; height: 8px; padding: 0; margin-left: 2px; font-size: 0; border-radius: 50%; background: var(--red); }
}
@media (max-width: 899px) {
  .more-label, .more-btn .caret { display: none; }
  .more-dots { display: inline; }
  .more-btn.active .more-dots { color: var(--accent); }
}
@media (max-width: 345px) { .xs-hide { display: none; } }

/* Queue layout and readable controls at both pane and browser widths. */
.top { height:auto; min-height:46px; flex-wrap:wrap; padding-top:6px; padding-bottom:6px; }
.top-actions { flex-wrap:wrap; min-width:0; }
.header-search { width:clamp(120px,20vw,280px); height:32px; }
.queue-banner { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:14px; background:var(--panel); border:1px solid var(--line); border-radius:8px; margin-bottom:12px; }
.submit-ticket { height:44px; padding:0 20px; font-size:14px; font-weight:600; }
.ticket-line { display:flex; align-items:center; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.ticket-line:last-child { border-bottom:0; }
.ticket-line .trow { flex:1; width:auto; min-width:0; border-bottom:0; }
.row-actions { display:flex; gap:6px; padding:6px 8px; }
.grid .zero { color:var(--ink-3); }
.seg { overflow-x:auto; flex-shrink:0; }
@media(max-width:600px) { .top-actions { width:100%; } .header-search { flex:1; } .ticket-line .trow { flex-basis:100%; flex-wrap:wrap; height:auto; row-gap:2px; padding-top:6px; padding-bottom:2px; } .ticket-line .trow .pid { flex:1; } .ticket-line .trow .subj { order:9; flex-basis:100%; padding-left:57px; color:var(--ink-2); } .row-actions { padding-top:2px; } .row-actions { margin-left:auto; } .queue-banner .seg { width:100%; } .queue-banner .submit-ticket { flex:1; } .timeline { grid-template-columns:1fr; gap:4px; } }

.view { min-width:0; }
@media(min-width:900px) { .app { grid-template-rows:auto auto minmax(0,1fr); } .banner[hidden] { height:0; } }
