/* CHT Support: design system. Tokens match the CHT house style (CHT Enrol, TMS, Roster, Expenses). */
:root {
  --cht-deep: #072b31; --cht-turquoise: #89d0c5; --cht-aqua: #5efcdb; --cht-white: #ffffff;
  --teal-700: #164752; --teal-300: #aeddd5; --teal-100: #dff0ec; --teal-50: #f1f8f6;
  --neutral-800: #22393e; --neutral-600: #46605f; --neutral-400: #7d9295; --neutral-200: #cbd9db; --neutral-100: #e4edee; --neutral-50: #f4f8f8;
  --text-heading: var(--cht-deep); --text-muted: #5d7377; --text-accent: #4e9186; --text-inverse: #ffffff;
  --action-primary: var(--cht-turquoise); --action-primary-hover: #6fb8ab; --action-dark: var(--cht-deep); --action-dark-hover: #0c3e47;
  --status-success: #1b7d5e; --status-success-bg: #e3f2ec; --status-success-bd: #b9dccb;
  --status-warning: #b07817; --status-warning-bg: #f8efdc; --status-warning-bd: #e6cf9c; --status-warning-text: #7a520f;
  --status-error: #b3403b; --status-error-bg: #f6e3e2; --status-error-bd: #e3b3b0;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-card: 0 1px 3px rgba(7,43,49,.08), 0 4px 16px rgba(7,43,49,.06);
  --shadow-raised: 0 8px 32px rgba(7,43,49,.14);
  --shadow-focus: 0 0 0 3px rgba(137,208,197,.55);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --font-sans: 'Open Sans', -apple-system, 'Segoe UI', sans-serif; --tracking-label: 0.14em;
  --ease: cubic-bezier(.4,0,.2,1); --duration-fast: 120ms; --duration-base: 200ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--neutral-800); background: var(--neutral-50); }
a { color: var(--teal-700); }
h1, h2, h3, h4 { color: var(--text-heading); margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.spinner { padding: 40px; text-align: center; color: var(--text-muted); }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: #fff; border-right: 1px solid var(--neutral-100); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side-brand { padding: 20px 20px 14px; }
.side-brand img { height: 40px; display: block; }
.side-brand .app { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); font-weight: 700; margin-top: 10px; }
.side-search { padding: 0 14px 10px; }
.side-nav { flex: 1; overflow: auto; padding: 4px 12px 12px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--neutral-600); text-decoration: none; margin-bottom: 2px; }
.side-nav a:hover { background: var(--teal-50); }
.side-nav a.on { background: var(--teal-100); color: var(--cht-deep); }
.side-nav a svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a.sub { padding: 6px 12px 6px 38px; font-size: 13px; font-weight: 400; }
.side-nav a.sub.on { font-weight: 600; }
.side-nav a .cnt { margin-left: auto; font-size: 11px; color: var(--neutral-400); font-weight: 600; }
.side-nav .hr { height: 1px; background: var(--neutral-100); margin: 10px 4px; }
.side-nav .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--neutral-400); font-weight: 700; padding: 10px 12px 4px; }
.side-bottom { border-top: 1px solid var(--neutral-100); padding: 12px; position: relative; }
.side-quick { display: block; font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 3px 8px; }
.side-quick:hover { color: var(--cht-deep); }
.userchip { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 8px; border-radius: var(--radius-md); text-align: left; margin-top: 6px; }
.userchip:hover { background: var(--teal-50); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cht-deep); color: var(--cht-aqua); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.userchip .nm { font-size: 13px; font-weight: 700; color: var(--cht-deep); }
.userchip .rl { font-size: 11px; color: var(--text-muted); }
.user-menu { position: absolute; bottom: 62px; left: 12px; right: 12px; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); padding: 6px; display: none; }
.user-menu.open { display: block; }
.user-menu button { width: 100%; background: none; border: 0; padding: 8px 10px; text-align: left; border-radius: var(--radius-sm); font-weight: 600; }
.user-menu button:hover { background: var(--teal-50); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-head { background: var(--cht-deep); padding: 22px 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--cht-turquoise); font-weight: 700; }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
.page-head h1 { font-size: 26px; color: #fff; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.page-head .meta { font-size: 14px; color: var(--teal-300); margin-top: 2px; }
.page-head .right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { padding: 24px 32px 40px; flex: 1; max-width: 1180px; width: 100%; }
footer { text-align: center; font-size: 12px; color: var(--neutral-400); padding: 0 16px 24px; line-height: 1.7; }
.nav-toggle { display: none; }

/* components */
.c-card { background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 20px 24px; margin-bottom: 16px; }
.c-card.tight { padding: 0; overflow: hidden; }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.c-card.tight .c-head { padding: 16px 20px 0; }
.c-head h2 { font-size: 19px; font-weight: 700; }
h2.section { font-size: 12px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); font-weight: 700; margin: 24px 0 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-pill); padding: 10px 18px; font-size: 14px; font-weight: 600; border: 1px solid var(--action-dark); background: var(--action-dark); color: #fff; text-decoration: none; transition: transform var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease); white-space: nowrap; }
.btn:hover { background: var(--action-dark-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--action-primary); border-color: var(--action-primary); color: var(--cht-deep); }
.btn.primary:hover { background: var(--action-primary-hover); }
.btn.outline { background: #fff; color: var(--cht-deep); }
.btn.outline:hover, .btn.ghost:hover { background: var(--teal-50); }
.btn.white { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn.white:hover { background: rgba(255,255,255,.1); }
.btn.ghost { background: #fff; border-color: var(--neutral-200); color: var(--neutral-800); font-size: 13px; padding: 7px 14px; }
.btn.ghost.on { background: var(--teal-100); border-color: var(--cht-deep); color: var(--cht-deep); }
.btn.danger { background: #fff; border-color: var(--status-error); color: var(--status-error); }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal-700); font-weight: 600; text-decoration: underline; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--neutral-100); color: var(--neutral-600); white-space: nowrap; }
.pill.small { font-size: 11px; padding: 2px 9px; }
.pill.ok { background: var(--status-success-bg); color: var(--status-success); }
.pill.warn { background: var(--status-warning-bg); color: var(--status-warning-text); }
.pill.bad { background: var(--status-error-bg); color: var(--status-error); }
.pill.core { background: var(--teal-100); color: var(--cht-deep); }
.pill.dark { background: var(--cht-deep); color: #fff; }
.notice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--teal-300); background: var(--teal-50); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 16px; }
.notice .n-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-accent); margin-top: 7px; flex: none; }
.notice .n-body { flex: 1; }
.notice .n-title { font-weight: 700; color: var(--cht-deep); }
.notice.ok { background: var(--status-success-bg); border-color: var(--status-success-bd); } .notice.ok .n-dot { background: var(--status-success); }
.notice.warn { background: var(--status-warning-bg); border-color: var(--status-warning-bd); } .notice.warn .n-dot { background: var(--status-warning); }
.notice.err { background: var(--status-error-bg); border-color: var(--status-error-bd); } .notice.err .n-dot { background: var(--status-error); }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.in, select.in, textarea.in { width: 100%; padding: 9px 10px; border-radius: var(--radius-md); border: 1px solid var(--neutral-200); font-size: 13px; background: #fff; outline: none; }
.in:focus { border-color: var(--cht-turquoise); box-shadow: var(--shadow-focus); }
textarea.in { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 > *, .grid3 > *, .dash-grid > * { min-width: 0; }
.fld { margin-bottom: 14px; }
.table-scroll { border: 1px solid var(--neutral-200); border-radius: var(--radius-md); overflow-x: auto; background: #fff; box-shadow: var(--shadow-card); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); padding: 11px 12px; border-bottom: 1px solid var(--neutral-200); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--neutral-100); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--teal-50); }
td .t { font-weight: 600; color: var(--cht-deep); }
td .s { font-size: 12px; color: var(--text-muted); }
.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dash-grid.r1 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dash-grid.r2 { grid-template-columns: 1fr 1fr; }
.kpi-card { background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 16px 20px; text-decoration: none; display: block; }
.kpi-card.clickable:hover { border-color: var(--cht-deep); }
.kpi-n { font-size: 28px; font-weight: 700; color: var(--cht-deep); line-height: 1.15; }
.kpi-s { font-size: 12px; color: var(--text-muted); }
.rowlink { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--neutral-100); text-decoration: none; color: inherit; }
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover .t { text-decoration: underline; }
.rowlink .t { font-weight: 600; color: var(--cht-deep); }
.rowlink .s { font-size: 12px; color: var(--text-muted); }
.rowlink .r { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.dl > div { min-width: 0; }
.dl dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.dl dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--cht-deep); overflow-wrap: anywhere; }
.policy p { margin: 8px 0; }
.policy p.lv1 { margin-left: 44px; }
.policy p.lv2 { margin-left: 66px; }
.policy .clause { display: flex; gap: 12px; margin: 12px 0 4px; }
.policy .clause .cn { flex: none; width: 32px; font-weight: 700; color: var(--cht-deep); }
.policy ul.pb { margin: 4px 0 8px; padding-left: 20px; }
.policy ul.pb.lv1 { margin-left: 44px; }
.policy ul.pb.lv2 { margin-left: 66px; }
.policy ul.pb li { margin: 3px 0; }
table.stages td { vertical-align: top; }
table.stages td .t { margin-bottom: 4px; }
ul.steps { margin: 4px 0 2px; padding-left: 20px; }
ul.steps li { margin: 3px 0; font-weight: 400; }
ul.steps ul { margin: 3px 0; padding-left: 20px; list-style: circle; }
.in.big { font-size: 16px; padding: 13px 14px; }
.call .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.call .say { background: var(--teal-50); border: 1px solid var(--teal-300); border-left: 4px solid var(--cht-deep); border-radius: var(--radius-md); padding: 12px 16px; }
.call .say .txt { font-size: 15px; line-height: 1.6; color: var(--cht-deep); white-space: pre-line; }
.call ol.then { margin: 0; padding-left: 20px; }
.call ol.then li { margin: 4px 0; }
.modal.wide { max-width: 880px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* SOP and article content */
.prose { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.prose h1, .prose h2 { font-size: 19px; font-weight: 700; margin: 22px 0 8px; }
.prose h3, .prose h4 { font-size: 16px; font-weight: 700; margin: 18px 0 6px; }
.prose > :first-child { margin-top: 0; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); }
.prose iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: var(--radius-md); background: #000; }
.prose table { display: block; overflow: auto; max-width: 100%; width: auto; }
.prose td, .prose th { border: 1px solid var(--neutral-200); padding: 6px 10px; text-transform: none; letter-spacing: 0; font-size: 13px; color: inherit; }
.prose blockquote { margin: 14px 0; padding: 12px 16px; background: var(--teal-50); border: 1px solid var(--teal-300); border-left: 4px solid var(--cht-deep); border-radius: var(--radius-md); }
.prose code, .prose pre { background: var(--neutral-50); border: 1px solid var(--neutral-100); border-radius: var(--radius-sm); padding: 1px 5px; font-size: 13px; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border: 0; padding: 0; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; opacity: .85; display: block; }
.yt .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 68px; height: 68px; border-radius: 50%; background: var(--cht-deep); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-raised); }
.yt .play::after { content: ""; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 5px; }
.yt-link { font-size: 12px; margin: 4px 0 14px; }
.srchead { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--neutral-100); padding-bottom: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--neutral-200); border-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--neutral-50); }
.toolbar button { background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px; font-weight: 600; }
.toolbar button:hover { border-color: var(--cht-deep); }
.editor { border: 1px solid var(--neutral-200); border-radius: 0 0 var(--radius-md) var(--radius-md); min-height: 320px; padding: 16px 18px; background: #fff; outline: none; }
.editor:focus { border-color: var(--cht-turquoise); box-shadow: var(--shadow-focus); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--neutral-50); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: 5px 9px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; text-align: left; }
.chip:hover { border-color: var(--cht-deep); background: var(--teal-50); }
.chip small { display: block; font-family: var(--font-sans); color: var(--text-muted); font-size: 11px; }
.rel { display: inline-flex; align-items: center; gap: 6px; background: var(--teal-100); color: var(--cht-deep); border-radius: var(--radius-pill); padding: 4px 6px 4px 12px; font-size: 12px; font-weight: 600; margin: 0 6px 6px 0; }
.rel button { background: none; border: 0; font-weight: 700; color: var(--cht-deep); padding: 0 6px; }
.picker { border: 1px solid var(--neutral-200); border-radius: var(--radius-md); max-height: 200px; overflow: auto; margin-top: 6px; background: #fff; }
.picker button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--neutral-100); padding: 8px 10px; font-size: 13px; }
.picker button:hover { background: var(--teal-50); }

/* modal, toasts, login */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,43,49,.4); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); max-width: 560px; width: 100%; padding: 28px 30px; position: relative; max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 19px; margin-bottom: 14px; }
.mclose { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 22px; color: var(--text-muted); }
.toasts { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--status-success); color: #fff; padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 600; box-shadow: var(--shadow-raised); pointer-events: auto; cursor: pointer; max-width: 80vw; }
.toast.err { background: var(--status-error); }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #072b31 0%, #146a72 100%); }
.login-card { background: #fff; border-radius: var(--radius-lg); max-width: 420px; width: 100%; padding: 32px; box-shadow: var(--shadow-raised); }
.login-card img { height: 52px; display: block; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--text-muted); margin: 4px 0 18px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-help { color: var(--teal-300); font-size: 13px; margin-top: 18px; text-align: center; max-width: 420px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform var(--duration-base) var(--ease); box-shadow: var(--shadow-raised); }
  .sidebar.open { transform: none; }
  .nav-toggle { display: inline-flex; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--cht-deep); color: #fff; border: 1px solid rgba(255,255,255,.4); align-items: center; justify-content: center; font-size: 18px; }
  .page-head { padding: 16px; }
  .content { padding: 16px; }
  .dash-grid.r2, .grid2, .grid3, .dl { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .page-head .right, footer, .noprint, .toasts { display: none !important; }
  .page-head { background: #fff; padding: 0 0 12px; }
  .page-head h1 { color: #000; } .page-head .meta, .page-head .eyebrow { color: #444; }
  .content { padding: 0; max-width: none; }
  .c-card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; }
}

/* v1.7: Who to ask, decision guides, Ask box, caller pop-up */
.who .whoper { font-size: 15px; color: var(--cht-deep); }
.who .whoways { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; font-size: 14px; }
.lead { font-size: 15px; color: var(--neutral-600); margin: 0 0 14px; }
.guide .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.guide .gq h2 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; color: var(--cht-deep); }
.gopts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn.gopt { font-size: 16px; padding: 14px 22px; min-width: 120px; background: var(--cht-deep); color: #fff; border-color: var(--cht-deep); }
.btn.gopt:hover { background: var(--action-dark-hover); }
.gtrail { border-left: 3px solid var(--teal-300); padding-left: 14px; margin-bottom: 18px; }
.gtrail div { font-size: 13px; color: var(--text-muted); margin: 4px 0; }
.gtrail strong { color: var(--cht-deep); margin-left: 8px; }
.gend { border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--status-success-bd); background: var(--status-success-bg); }
.gend h2 { margin: 0; font-size: 20px; color: var(--status-success); }
.gend.warn { border-color: var(--status-warning-bd); background: var(--status-warning-bg); } .gend.warn h2 { color: var(--status-warning-text); }
.gend.stop { border-color: var(--status-error-bd); background: var(--status-error-bg); } .gend.stop h2 { color: var(--status-error); }
.gstep { border: 1px solid var(--neutral-200); border-left: 4px solid var(--cht-turquoise); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.gstep.end { border-left-color: var(--neutral-400); }
.gstep .gshead { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-muted); } .gstep .gshead strong { color: var(--cht-deep); } .gstep .gshead .link-btn { margin-left: auto; }
.gstep textarea.in { min-height: 64px; }
.askbar { display: flex; gap: 10px; } .askbar .in { flex: 1; }
#rings { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.ring { background: var(--cht-deep); color: #f0fffe; border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 10px 30px rgba(7,43,49,.35); border-left: 5px solid var(--cht-turquoise); }
.ring-top { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-300); font-weight: 700; }
.ring-x { margin-left: auto; background: none; border: 0; color: var(--teal-300); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.ring-name { font-size: 19px; font-weight: 700; margin-top: 6px; line-height: 1.25; }
.ring-num { font-size: 15px; color: var(--teal-300); margin-top: 2px; }
.ring-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ring .btn { background: var(--cht-turquoise); color: var(--cht-deep); border-color: var(--cht-turquoise); text-decoration: none; }
.ring .btn.ghost-d { background: transparent; color: #f0fffe; border-color: var(--teal-300); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--cht-aqua); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94,252,219,.6); } 100% { box-shadow: 0 0 0 10px rgba(94,252,219,0); } }
@media (max-width: 640px) { .askbar { flex-direction: column; } .btn.gopt { flex: 1; } }

/* v1.8: calls made prominent */
.cdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--neutral-400); }
.cdot.ok { background: var(--status-success); box-shadow: 0 0 0 4px var(--status-success-bg); }
.cdot.warn { background: var(--status-warning); box-shadow: 0 0 0 4px var(--status-warning-bg); }
.cdot.bad { background: var(--status-error); box-shadow: 0 0 0 4px var(--status-error-bg); }
.cdot.big { width: 16px; height: 16px; }
.callchip { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 8px 12px; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); font-size: 13px; font-weight: 600; color: var(--cht-deep); text-decoration: none; background: #fff; }
.callchip:hover { background: var(--teal-50); }
.callchip:empty { display: none; }
.callstrip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; margin-bottom: 16px; border: 1px solid var(--neutral-200); border-left: 4px solid var(--neutral-400); border-radius: var(--radius-md); background: #fff; font-size: 14px; color: var(--cht-deep); text-decoration: none; }
.callstrip.on { border-left-color: var(--status-success); } .callstrip.wait { border-left-color: var(--status-warning); } .callstrip.off { border-left-color: var(--status-error); }
.callstrip.fresh { background: var(--teal-50); border-color: var(--teal-300); border-left-color: var(--cht-deep); }
.callstrip .go { margin-left: auto; font-weight: 600; color: var(--teal-700); text-decoration: underline; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.callhero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-md); margin-bottom: 16px; border: 1px solid var(--status-success-bd); background: var(--status-success-bg); }
.callhero.wait { border-color: var(--status-warning-bd); background: var(--status-warning-bg); } .callhero.off { border-color: var(--status-error-bd); background: var(--status-error-bg); }
.callhero .ch-t { font-size: 20px; font-weight: 700; color: var(--cht-deep); } .callhero .ch-s { font-size: 14px; color: var(--neutral-800); margin-top: 2px; }
.hsteps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hstep { display: flex; gap: 12px; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-card); }
.hstep .hn { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--neutral-100); color: var(--neutral-600); }
.hstep.ok .hn { background: var(--status-success); color: #fff; } .hstep.bad .hn { background: var(--status-error); color: #fff; }
.hstep .ht { font-weight: 700; color: var(--cht-deep); } .hstep .hs { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.optrow { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; } .optrow input { margin-top: 4px; width: 16px; height: 16px; }
#rings { width: min(420px, calc(100vw - 40px)); }
.ring { padding: 18px 20px; } .ring-name { font-size: 24px; } .ring-num { font-size: 16px; } .ring .btn { padding: 10px 18px; font-size: 15px; }
.ring.unknown { border-left-color: var(--status-warning); }
@media (max-width: 1100px) { .hsteps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .hsteps { grid-template-columns: 1fr; } }

/* v1.8: decision guides, from the new page designs */
.gsec h2 { margin: 22px 0 14px; font-size: 19px; color: var(--cht-deep); }
.gcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gcard { text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-card); }
.gcard:hover { border-color: var(--cht-turquoise); }
.gc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gc-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--teal-100); display: flex; align-items: center; justify-content: center; }
.gc-t { font-weight: 700; font-size: 17px; color: var(--cht-deep); line-height: 1.35; } .gc-s { font-size: 13px; color: var(--text-muted); } .gc-go { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--cht-deep); }
.gdark { background: var(--cht-deep); color: #fff; border-radius: var(--radius-lg); padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; }
.gdark > div { flex: 1 1 400px; } .gdark .t { font-weight: 700; font-size: 17px; } .gdark .s { color: var(--neutral-200); font-size: 14px; }
.gdark .btn { background: var(--cht-turquoise); color: var(--cht-deep); border-color: var(--cht-turquoise); text-decoration: none; }
.gwrap { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.gprog { display: flex; align-items: center; gap: 14px; } .gprog span { font-size: 13px; font-weight: 700; color: var(--cht-deep); }
.gprog .bar { flex: 1; height: 6px; background: var(--neutral-100); border-radius: 999px; overflow: hidden; } .gprog .bar div { height: 100%; background: var(--cht-turquoise); }
.gq { padding: 30px; } .gq h2 { margin: 0; font-size: 24px; color: var(--cht-deep); font-weight: 700; line-height: 1.3; } .gq p { margin: 6px 0 0; font-size: 14px; }
.gopts { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; margin-top: 22px; }
.gopt { font: inherit; text-align: left; color: var(--cht-deep); border: 1px solid var(--neutral-200); background: #fff; border-radius: var(--radius-md); padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; min-height: 44px; }
.gopt:hover, .gopt:focus-visible { border-color: var(--cht-deep); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--cht-deep); }
.gopt .rad { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--neutral-400); flex: none; } .gopt:hover .rad { border: 6px solid var(--cht-deep); }
.gopt .ol { flex: 1; } .gopt .ol strong { display: block; } .gopt .ol span { font-size: 13.5px; color: var(--neutral-600); } .gopt svg { color: var(--neutral-400); flex: none; }
.gtrail { margin: 0; } .gtrail .link-btn { margin-left: 10px; font-size: 12px; }
.gfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; } .gfoot > a { font-weight: 600; }
.gout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.gout .lbl, .ptoc .lbl, .paside .lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.ga { flex: 1 1 220px; max-width: 280px; display: flex; flex-direction: column; gap: 14px; } .gm { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; } .gr { flex: 1 1 240px; max-width: 320px; display: flex; flex-direction: column; gap: 16px; }
.gsteps2 { list-style: none; margin: 0; padding: 0; }
.gsteps2 li { position: relative; margin-left: 11px; padding: 0 0 18px 20px; border-left: 2px solid var(--cht-turquoise); }
.gsteps2 li.done { border-left-color: transparent; padding-bottom: 0; }
.gsteps2 .n { position: absolute; left: -13px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--cht-deep); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gsteps2 .q { font-size: 13px; color: var(--text-muted); } .gsteps2 .a { font-weight: 700; color: var(--cht-deep); } .gsteps2 .link-btn { font-size: 13px; }
.gsteps2 li.done .n { background: var(--status-success); } .gsteps2 li.done .a { color: var(--status-success); }
.gsteps2 li.done.warn .n { background: var(--status-warning); } .gsteps2 li.done.warn .a { color: var(--status-warning-text); } .gsteps2 li.done.stop .n { background: var(--status-error); } .gsteps2 li.done.stop .a { color: var(--status-error); }
.gres { padding: 0; overflow: hidden; }
.gres .gend { border: 0; border-radius: 0; margin: 0; padding: 26px 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; border-bottom: 1px solid var(--status-success-bd); }
.gres .gend .gi { width: 56px; height: 56px; border-radius: 50%; background: var(--status-success); display: flex; align-items: center; justify-content: center; flex: none; }
.gres .gend.warn .gi { background: var(--status-warning); } .gres .gend.stop .gi { background: var(--status-error); }
.gres .gend .lbl { color: inherit; margin: 0; } .gres .gend h2 { font-size: 30px; line-height: 1.2; }
.gres .gend.ok, .gres .gend.ok .lbl { color: #145c45; } .gres .gend.warn .lbl { color: var(--status-warning-text); } .gres .gend.stop .lbl { color: var(--status-error); }
.gbody { padding: 26px 30px; display: flex; flex-direction: column; gap: 24px; }
.grow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; } .grow .lbl { margin: 0; }
.gsay { margin: 0; background: var(--teal-50); border-radius: var(--radius-md); padding: 18px 22px; font-size: 17px; line-height: 1.6; color: var(--cht-deep); white-space: pre-line; }
.gchecks { display: flex; flex-direction: column; gap: 10px; }
.gcheck { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--neutral-100); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; }
.gcheck input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--cht-deep); flex: none; } .gcheck input:checked + span { color: var(--text-muted); text-decoration: line-through; }
.gacts { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--neutral-100); }
.gfb { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 24px; } .gfb span { font-weight: 600; color: var(--cht-deep); flex: 1 1 260px; }
.gwhy { margin: 0 0 6px; font-size: 14px; border-left: 3px solid var(--cht-turquoise); padding-left: 12px; }
.gdraft { background: var(--status-warning-bg); border: 1px solid var(--status-warning-bd); border-radius: var(--radius-lg); padding: 18px 20px; font-size: 14px; color: var(--status-warning-text); } .gdraft strong { display: block; margin-bottom: 4px; }
.gmeta { background: var(--cht-deep); color: var(--neutral-200); border-radius: var(--radius-lg); padding: 18px 20px; font-size: 13px; } .gmeta strong { display: block; color: #fff; font-size: 14px; margin-bottom: 4px; }
@media (max-width: 900px) { .gcards { grid-template-columns: 1fr; } .ga, .gr { max-width: none; } }

/* v1.8: policy library and policy reader, from the new page designs */
.ptry { margin: -4px 0 14px; align-items: center; } .pfil { align-items: center; margin-bottom: 20px; } #pser { display: contents; }
.plbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 12px; }
.pbest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.pmatch { text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.pmatch:hover { border-color: var(--cht-turquoise); }
.pm-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; } .pm-t { font-weight: 700; color: var(--cht-deep); font-size: 17px; }
.pm-s { margin: 0; font-size: 14px; background: var(--teal-50); border-radius: var(--radius-md); padding: 10px 12px; } .pm-p { font-size: 13px; color: var(--text-accent); font-weight: 600; }
.sercols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sercol { background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-lg); overflow: hidden; }
.sercol .sh { background: var(--cht-deep); color: #fff; padding: 14px 18px; } .sercol .sk { font-size: 12px; letter-spacing: .14em; color: var(--cht-aqua); font-weight: 700; } .sercol .sn { font-weight: 700; }
.sercol a { display: flex; justify-content: space-between; gap: 8px; align-items: center; text-decoration: none; color: var(--neutral-800); padding: 10px 18px; border-bottom: 1px solid var(--neutral-100); font-size: 14px; }
.sercol a:last-child { border-bottom: 0; } .sercol a:hover { background: var(--teal-50); } .sercol a strong { color: var(--cht-deep); }
.reader { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.ptoc { flex: 1 1 180px; max-width: 220px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.ptoc button { font: inherit; font-size: 14px; text-align: left; background: none; border: 0; color: var(--neutral-600); padding: 6px 12px; border-radius: var(--radius-md); cursor: pointer; }
.ptoc button:hover { background: var(--teal-50); } .ptoc button.on { color: var(--cht-deep); font-weight: 700; background: var(--teal-100); }
.pmain { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.psec { padding: 28px; border-radius: var(--radius-lg); } .psec h2 { margin: 0 0 14px; font-size: 22px; color: var(--cht-deep); }
.reader .policy .clause { border: 1px solid var(--neutral-100); border-radius: var(--radius-md); padding: 14px 18px; margin: 10px 0; gap: 16px; }
.reader .policy .clause .cn { width: 40px; color: var(--text-accent); }
.paside { flex: 1 1 250px; max-width: 320px; display: flex; flex-direction: column; gap: 16px; } .paside .c-card { border-radius: var(--radius-lg); padding: 20px; margin: 0; }
.pdl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 14px; } .pdl dt { color: var(--text-muted); } .pdl dd { margin: 0; font-weight: 600; }
.pplist { display: flex; flex-direction: column; gap: 8px; font-size: 14px; } .psec .pplist { margin-top: 14px; }
.pplist a { text-decoration: none; color: var(--cht-deep); font-weight: 600; padding: 10px 12px; border-radius: var(--radius-md); background: var(--teal-50); } .pplist a:hover { background: var(--teal-100); }
.pack:empty { display: none; } .pack { background: var(--cht-deep); color: #fff; border-radius: var(--radius-lg); padding: 20px; } .pack .t { font-weight: 700; } .pack p { margin: 6px 0 14px; font-size: 14px; color: var(--neutral-200); } .pack p:last-child { margin-bottom: 0; }
.pack .btn { background: var(--cht-turquoise); color: var(--cht-deep); border-color: var(--cht-turquoise); font-weight: 700; min-height: 44px; } .pack .who { font-size: 12.5px; border-top: 1px solid var(--teal-700); padding-top: 12px; }
@media (max-width: 1250px) { .sercols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ptoc { display: none; } }
@media (max-width: 760px) { .sercols, .pbest { grid-template-columns: 1fr; } .paside { max-width: none; } }

/* v1.9: website leads */
pre.code { background: var(--neutral-50); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.pill.muted { background: var(--neutral-100); color: var(--neutral-600); }
.ring-lead { margin-top: 8px; font-size: 13.5px; background: rgba(137,208,197,.16); border-radius: var(--radius-md); padding: 8px 10px; color: #f0fffe; }

/* v2.1: live chat */
.side-nav a .cnt.hot { background: var(--status-warning); color: #fff; border-radius: var(--radius-pill); padding: 1px 8px; font-size: 11px; }
#chatpops { position: fixed; right: 20px; top: 20px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.chatpop { border-left-color: var(--status-warning); }
.chatstate { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--neutral-600); margin: 0 0 14px 4px; }
.chatwrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.chatside h2.section:first-child { margin-top: 0; }
.chat-item { display: block; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--neutral-800); }
.chat-item:hover { border-color: var(--cht-deep); }
.chat-item.on { border-color: var(--cht-deep); background: var(--teal-50); box-shadow: inset 3px 0 0 var(--cht-deep); }
.chat-item.hot { border-color: var(--status-warning-bd); background: var(--status-warning-bg); }
.chat-item.hot.on { box-shadow: inset 3px 0 0 var(--status-warning); }
.ci-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-name { font-weight: 700; color: var(--cht-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ci-sub strong { color: var(--status-warning-text); }
.ci-empty { font-size: 13px; margin: 0 0 8px 2px; }
.chatpane.c-card { padding: 0; margin: 0; display: flex; flex-direction: column; min-height: 520px; height: calc(100vh - 250px); overflow: hidden; }
#chathead { padding: 16px 20px 0; border-bottom: 1px solid var(--neutral-100); }
#chathead .notice { margin: 0 0 12px; }
.ch-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.ch-name { font-size: 19px; font-weight: 700; color: var(--cht-deep); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-sub { font-size: 13.5px; margin-top: 3px; }
.ch-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--neutral-600); margin: 12px 0; }
.ch-facts strong { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.chatmsgs { flex: 1; overflow-y: auto; padding: 18px 20px; background: var(--neutral-50); display: flex; flex-direction: column; gap: 10px; }
.cm { max-width: 76%; }
.cm-b { padding: 9px 13px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-t { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.cm.them { align-self: flex-start; } .cm.them .cm-b { background: #fff; border: 1px solid var(--neutral-200); border-bottom-left-radius: 4px; }
.cm.me { align-self: flex-end; } .cm.me .cm-b { background: var(--cht-deep); color: #fff; border-bottom-right-radius: 4px; } .cm.me .cm-t { text-align: right; }
.cm.sys { align-self: center; max-width: 92%; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.chatfoot { padding: 12px 20px 16px; border-top: 1px solid var(--neutral-100); background: #fff; }
.chatfoot textarea.in { min-height: 64px; font-size: 14.5px; }
.cf-acts { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.chat-empty { margin: auto; text-align: center; padding: 40px 24px; max-width: 420px; }
.chat-empty h2 { font-size: 19px; margin-bottom: 6px; }
.anslist { margin-top: 12px; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.ans { text-align: left; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; font: inherit; }
.ans:hover { border-color: var(--cht-deep); background: var(--teal-50); }
.ans strong { display: block; color: var(--cht-deep); font-size: 14px; } .ans span { display: block; font-size: 13px; color: var(--neutral-600); margin-top: 3px; }
.cks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; } .ck.big { font-weight: 700; color: var(--cht-deep); font-size: 15px; }
.ck input { width: 17px; height: 17px; accent-color: var(--cht-deep); }
@media (max-width: 900px) { .chatwrap { grid-template-columns: 1fr; } .chatpane.c-card { height: auto; min-height: 460px; } .chatmsgs { max-height: 50vh; } .cm { max-width: 88%; } }

/* v2.2: faster, friendlier chat */
.ch-av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-size: 15px; font-weight: 700; flex: none; }
.cm { display: flex; align-items: flex-end; gap: 8px; }
.cm.me { flex-direction: row-reverse; }
.cm-c { min-width: 0; display: flex; flex-direction: column; } .cm.me .cm-c { align-items: flex-end; }
.cm-a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-size: 12px; font-weight: 700; flex: none; margin-bottom: 18px; }
.cm.me .cm-a { background: var(--cht-deep); color: #c9efe8; } .cm-a.ghost { visibility: hidden; margin-bottom: 0; }
.cm-b { border-radius: 18px; box-shadow: 0 1px 2px rgba(7,43,49,.05); }
.cm.pend .cm-b { opacity: .7; }
.cm.sys { background: var(--neutral-100); border-radius: var(--radius-pill); padding: 3px 12px; display: block; }
.cm.typing .cm-a { margin-bottom: 0; }
.cm-b.dots { display: flex; gap: 4px; padding: 13px 14px; }
.cm-b.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral-400); }
.chatmsgs { scroll-behavior: smooth; }
@media (prefers-reduced-motion: no-preference) {
  .cm.new, .cm.typing { animation: cmin .22s ease-out; }
  .cm-b.dots i { animation: cmbob 1.2s infinite ease-in-out; } .cm-b.dots i:nth-child(2) { animation-delay: .15s; } .cm-b.dots i:nth-child(3) { animation-delay: .3s; }
  @keyframes cmin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes cmbob { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
}

/* v2.2: compact layout. A slim title bar instead of the tall banner, a narrower menu and tighter rows, so more fits on one screen. */
.page-head { background: #fff; border-bottom: 1px solid var(--neutral-200); padding: 9px 24px; align-items: center; position: sticky; top: 0; z-index: 30; min-height: 52px; }
.page-head > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.page-head .eyebrow { display: none; }
.page-head h1 { font-size: 18px; color: var(--cht-deep); margin: 0; line-height: 1.3; }
.page-head .meta { font-size: 13px; color: var(--text-muted); margin: 0; }
.page-head .btn { padding: 6px 13px; font-size: 13px; }
.page-head .btn.white { background: #fff; border-color: var(--neutral-200); color: var(--neutral-800); }
.page-head .btn.white:hover { background: var(--teal-50); }
.page-head .btn.primary { background: var(--cht-deep); border-color: var(--cht-deep); color: #fff; }
.content { max-width: none; padding: 16px 24px 28px; }
.sidebar { width: 216px; }
.side-brand { padding: 12px 14px 8px; display: flex; align-items: center; gap: 10px; }
.side-brand img { height: 26px; }
.side-brand .app { margin: 0; font-size: 10px; }
.side-search { padding: 0 10px 8px; } .side-search .in { padding: 6px 9px; font-size: 12.5px; }
.callchip { margin: 0 10px 8px; padding: 5px 10px; font-size: 12.5px; }
.side-nav { padding: 0 8px; overflow-y: auto; flex: 1; }
.side-nav a { padding: 6px 10px; font-size: 13.5px; gap: 9px; margin-bottom: 1px; border-radius: var(--radius-md); }
.side-nav a.sub { padding: 4px 10px 4px 35px; font-size: 12.5px; }
.side-bottom { padding: 8px; } .side-quick { padding: 2px 8px; } .userchip { padding: 6px; margin-top: 4px; }
th { padding: 7px 10px; } td { padding: 7px 10px; }
.c-card { padding: 16px 18px; margin-bottom: 12px; }
.dash-grid { gap: 12px; margin-bottom: 12px; } .kpi-card { padding: 11px 14px; } .kpi-n { font-size: 22px; }
h2.section { margin: 16px 0 8px; }
footer { font-size: 11px; padding: 0 16px 12px; line-height: 1.5; }
.chatwrap { grid-template-columns: 288px minmax(0, 1fr); gap: 14px; }
.chatpane.c-card { height: calc(100vh - 128px); min-height: 440px; }
.chatstate { margin: 0 0 10px 2px; font-size: 12.5px; }
#chathead { padding: 12px 16px 0; } .ch-name { font-size: 17px; } .ch-facts { margin: 8px 0 10px; }
.chatmsgs { padding: 14px 16px; } .chatfoot { padding: 10px 16px 12px; } .chatfoot textarea.in { min-height: 52px; }
.chat-item { padding: 8px 10px; margin-bottom: 6px; }
@media (max-width: 900px) { .page-head { padding: 8px 12px; } .content { padding: 12px; } .sidebar { width: 260px; } .nav-toggle { width: 34px; height: 34px; } .chatpane.c-card { height: auto; } }

/* v3.0: workspaces across the top, a short menu down the side, and the CRM pages */
.topbar { position: sticky; top: 0; z-index: 45; height: 46px; background: var(--cht-deep); display: flex; align-items: center; gap: 14px; padding: 0 14px; }
.tb-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--teal-300); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; flex: none; }
.tb-brand img { height: 24px; display: block; }
.tb-ws { display: flex; align-items: stretch; height: 100%; gap: 2px; margin-left: 6px; overflow-x: auto; }
.tb-ws a { display: flex; align-items: center; gap: 7px; padding: 0 14px; color: #c9dedb; text-decoration: none; font-size: 13.5px; font-weight: 600; border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap; }
.tb-ws a:hover { color: #fff; background: rgba(255,255,255,.06); }
.tb-ws a.on { color: #fff; border-bottom-color: var(--cht-turquoise); }
.tb-ws .cnt { font-size: 11px; } .tb-ws .cnt.hot { background: var(--status-warning); color: #fff; border-radius: var(--radius-pill); padding: 1px 7px; } .tb-ws .cnt:empty { display: none; }
.tb-search { flex: 1; max-width: 420px; margin-left: auto; } .tb-search .in { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-pill); border-color: transparent; background: rgba(255,255,255,.12); color: #fff; }
.tb-search .in::placeholder { color: #a9c4c1; } .tb-search .in:focus { background: #fff; color: var(--neutral-800); }
.topbar .callchip { margin: 0; padding: 4px 10px; font-size: 12px; background: rgba(255,255,255,.1); border-color: transparent; color: #e6f3f1; flex: none; } .topbar .callchip:hover { background: rgba(255,255,255,.18); }
.tb-user { position: relative; flex: none; } .tb-user .userchip { padding: 0; margin: 0; width: auto; } .tb-user .userchip:hover { background: none; }
.tb-user .avatar { width: 30px; height: 30px; font-size: 12px; background: var(--cht-turquoise); color: var(--cht-deep); }
.tb-user .user-menu { top: 40px; bottom: auto; left: auto; right: 0; width: 220px; z-index: 50; }
.user-menu a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--neutral-800); font-size: 13px; } .user-menu a:hover { background: var(--teal-50); }
.shell { min-height: calc(100vh - 46px); }
.sidebar { width: 196px; top: 46px; height: calc(100vh - 46px); }
.side-ws { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--text-muted); padding: 14px 18px 8px; }
.page-head { top: 46px; }
#chatpops { top: 58px; }
.chatpane.c-card { height: calc(100vh - 174px); }
footer { padding-top: 4px; }
/* insights */
.igrid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi-d { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; } .chg.up { color: var(--status-success); font-weight: 600; } .chg.down { color: var(--status-error); font-weight: 600; }
.ihead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; } .ihead h2 { font-size: 14.5px; } .ihead a, .ihead .muted { font-size: 12.5px; }
.ichart { width: 100%; height: 200px; display: block; } .ichart text { font-size: 11px; fill: #5d7377; }
.ilegend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; margin-bottom: 6px; } .ilegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.icols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .icols.three { grid-template-columns: repeat(3, 1fr); } .icols .c-card { margin-bottom: 12px; }
.itable { font-size: 13px; } .itable th { padding: 4px 8px; } .itable td { padding: 5px 8px; border-bottom: 1px solid var(--neutral-100); } .itable tr:last-child td { border-bottom: 0; } .itable td:nth-child(2) { width: 34%; }
.ibar { display: block; height: 8px; background: var(--neutral-100); border-radius: 4px; overflow: hidden; } .ibar i { display: block; height: 100%; background: var(--text-accent); border-radius: 4px; }
.istats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 14px; font-size: 12px; color: var(--text-muted); } .istats strong { display: block; font-size: 19px; color: var(--cht-deep); line-height: 1.2; } .istats a { color: inherit; text-decoration: none; } .istats a:hover strong { text-decoration: underline; }
/* people */
.ptools { align-items: center; margin-bottom: 10px; } .ptools .in { flex: 1 1 260px; max-width: 380px; } .ptip { font-size: 12px; margin-left: auto; }
.ptable table { font-size: 13px; } .ptable th, .ptable td { padding: 5px 10px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ptable th.sortable { cursor: pointer; user-select: none; } .ptable th.sortable:hover, .ptable th.on { color: var(--cht-deep); }
.ptable td.n { text-align: right; font-variant-numeric: tabular-nums; } .ptable th:nth-child(n+6):nth-child(-n+9) { text-align: right; }
.pav { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-size: 11px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
#ptable.loading { opacity: .55; }
.pfoot { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-muted); } .pnav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* one person */
.pwrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.pcard { text-align: center; } .pcard h2 { font-size: 18px; margin: 8px 0 6px; overflow-wrap: anywhere; }
.pbig { width: 62px; height: 62px; border-radius: 50%; background: var(--cht-deep); color: #c9efe8; display: grid; place-items: center; font-size: 26px; font-weight: 700; margin: 0 auto; }
.pfacts { text-align: left; margin: 14px 0 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 10px; font-size: 13px; } .pfacts dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; } .pfacts dd { margin: 0; overflow-wrap: anywhere; }
.plinks { display: grid; gap: 6px; } .plinks a { display: block; padding: 7px 10px; border: 1px solid var(--neutral-200); border-radius: var(--radius-md); text-decoration: none; font-weight: 600; font-size: 13px; color: var(--cht-deep); } .plinks a:hover { background: var(--teal-50); border-color: var(--cht-deep); }
.prow { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.tday { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text-muted); margin: 14px 0 6px; } .tday:first-of-type { margin-top: 0; }
.tl { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--neutral-100); }
.tl-i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--neutral-100); color: var(--neutral-600); } .tl-i svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tl-i.ok { background: var(--status-success-bg); color: var(--status-success); } .tl-i.warn { background: var(--status-warning-bg); color: var(--status-warning-text); } .tl-i.core { background: var(--teal-100); color: var(--cht-deep); }
.tl-b { min-width: 0; flex: 1; } .tl-t { font-size: 13.5px; } .tl-w { float: right; font-size: 12px; color: var(--text-muted); } .tl-d { font-size: 13px; color: var(--neutral-600); margin-top: 2px; } .tl-m { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.page-head .btn.white.on { background: var(--teal-100); border-color: var(--cht-deep); color: var(--cht-deep); }
@media (max-width: 1100px) { .icols.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .icols, .icols.three, .pwrap { grid-template-columns: 1fr; } .sidebar { width: 240px; top: 46px; } .tb-search { display: none; } .topbar .callchip { display: none; } .tb-brand span { display: none; } .tb-ws a { padding: 0 10px; } .ptip { display: none; } }

/* ================= v3.1: a bolder look =================
   Stronger contrast and more colour so new things stand out: a near-black top bar, a cool grey page with white cards,
   one bright action colour (violet), and a clear colour for each state (coral = needs you now, violet = in progress, amber = message left, green = online).
   Everything below overrides the earlier rules, so removing this block puts the old look back. */
:root {
  --ink: #0e1420; --ink-2: #1a2233; --violet: #6c5ce7; --violet-d: #5443d6; --violet-50: #f1efff; --violet-100: #e2deff;
  --coral: #ff5a3c; --coral-50: #fff1ed; --coral-100: #ffd9cf; --amber: #f5a524; --amber-50: #fff6e3; --green: #12b76a; --green-50: #e6f9f0; --sky: #2e90fa;
  --neutral-50: #f2f4f8; --neutral-100: #e9ecf2; --neutral-200: #d9dee8; --neutral-400: #8a94a6; --neutral-600: #4a5568; --neutral-800: #1c2433; --text-muted: #667085;
  --status-success: #0e9f5b; --status-success-bg: #e6f9f0; --status-success-bd: #a6e9c8;
  --status-warning: #f5a524; --status-warning-bg: #fff6e3; --status-warning-bd: #ffdf9e; --status-warning-text: #93590a;
  --status-error: #e5484d; --status-error-bg: #ffecec; --status-error-bd: #ffc4c6;
  --radius-md: 12px; --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(14,20,32,.06), 0 6px 20px rgba(14,20,32,.06); --shadow-raised: 0 16px 48px rgba(14,20,32,.22); --shadow-focus: 0 0 0 3px rgba(108,92,231,.3);
}
body { background: var(--neutral-50); color: var(--neutral-800); }
a { color: var(--violet-d); }

/* top bar */
.topbar { background: var(--ink); height: 52px; gap: 12px; padding: 0 16px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 18px rgba(14,20,32,.25); }
.tb-ws { gap: 4px; align-items: center; }
.tb-ws a { height: 34px; border: 0; border-radius: 10px; padding: 0 14px; color: #aab4c6; }
.tb-ws a:hover { background: rgba(255,255,255,.08); color: #fff; }
.tb-ws a.on { background: linear-gradient(135deg, var(--violet) 0%, #8f6bff 100%); color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.5); }
.tb-ws .cnt.hot { background: var(--coral); box-shadow: 0 0 0 3px rgba(255,90,60,.3); animation: hotpulse 1.6s infinite; }
.tb-search .in { background: rgba(255,255,255,.08); color: #fff; border-radius: 10px; }
.tb-search .in::placeholder { color: #8490a5; }
.topbar .callchip { border-radius: 10px; background: rgba(255,255,255,.08); color: #d5dbe6; padding: 6px 10px; }
.tb-user .avatar { background: linear-gradient(135deg, var(--cht-aqua), #89d0c5); color: var(--ink); width: 32px; height: 32px; }
.avatar.ph, .bigface.ph { background-size: cover !important; background-position: center !important; color: transparent !important; }
.page-head { top: 52px; border-bottom: 1px solid var(--neutral-200); background: rgba(255,255,255,.86); backdrop-filter: blur(10px); }
.page-head h1 { color: var(--ink); font-size: 19px; letter-spacing: -.01em; }
.sidebar { top: 52px; }

/* availability switches */
.tb-avail { display: flex; gap: 6px; flex: none; }
.av { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 5px 10px 5px 6px; background: rgba(255,255,255,.08); color: #aab4c6; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s; }
.av:hover { background: rgba(255,255,255,.14); }
.av b { color: #fff; font-weight: 700; }
.av .sw { width: 30px; height: 18px; border-radius: 999px; background: #4a5568; position: relative; flex: none; transition: background .15s; }
.av .sw i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.av.on .sw { background: var(--green); box-shadow: 0 0 0 3px rgba(18,183,106,.25); } .av.on .sw i { transform: translateX(12px); }
.av.on b { color: #7df0b8; }
.av.light { background: var(--neutral-100); color: var(--neutral-600); padding: 4px 10px 4px 5px; } .av.light:hover { background: var(--neutral-200); }
.av.light b { color: var(--neutral-600); } .av.light.on b { color: var(--status-success); } .av.light .sw { background: #b8c0cf; } .av.light.on .sw { background: var(--green); }
.av:disabled { opacity: .45; cursor: default; }
.awaybar { display: flex; align-items: center; gap: 12px; background: var(--amber-50); border: 1px solid var(--status-warning-bd); border-left: 4px solid var(--amber); border-radius: var(--radius-md); padding: 9px 14px; margin-bottom: 10px; font-size: 13px; }
.uname { display: flex; align-items: center; gap: 9px; } .avatar.sm { width: 28px; height: 28px; font-size: 11px; background: var(--violet-100); color: var(--violet-d); }
.facepick { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; } .facepick.small { margin: 0; gap: 12px; }
.bigface { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--violet-100); color: var(--violet-d); font-size: 26px; font-weight: 700; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--violet-100); }
.logoshow { display: block; width: 46px; height: 46px; border-radius: 50%; background: var(--ink) center / 72% no-repeat; flex: none; }
.cks.col { display: flex; flex-direction: column; gap: 6px; }

/* side menu */
.sidebar { background: #fff; border-right: 1px solid var(--neutral-200); }
.side-ws { color: var(--violet-d); }
.side-nav a { border-radius: 10px; color: var(--neutral-600); }
.side-nav a:hover { background: var(--neutral-50); color: var(--ink); }
.side-nav a.on { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(14,20,32,.18); }
.side-nav a.on svg { color: var(--cht-aqua); }
.side-nav a.sub.on { background: var(--violet-50); color: var(--violet-d); box-shadow: none; }

/* cards, tables, buttons */
.c-card, .kpi-card, .table-scroll { border: 1px solid transparent; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.kpi-card.clickable:hover { border-color: var(--violet); transform: translateY(-1px); } .kpi-card { transition: transform .15s, border-color .15s; }
.kpi-n { color: var(--ink); letter-spacing: -.02em; }
h2.section { color: var(--neutral-600); display: flex; align-items: center; gap: 8px; }
th { background: #fafbfd; color: var(--neutral-600); } tbody tr:hover td { background: #fafaff; } td .t { color: var(--ink); }
.btn { background: var(--ink); border-color: var(--ink); border-radius: 10px; } .btn:hover { background: var(--ink-2); }
.btn.primary, .page-head .btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.35); } .btn.primary:hover, .page-head .btn.primary:hover { background: var(--violet-d); }
.btn.ghost, .btn.outline, .page-head .btn.white { border-radius: 10px; } .btn.ghost:hover, .btn.outline:hover, .page-head .btn.white:hover { background: var(--violet-50); border-color: var(--violet); color: var(--violet-d); }
.btn.ghost.on, .page-head .btn.white.on { background: var(--violet-50); border-color: var(--violet); color: var(--violet-d); }
.in:focus { border-color: var(--violet); }
.pill { letter-spacing: .01em; }
.pill.ok { background: var(--green-50); color: #0a7d47; } .pill.warn { background: var(--coral); color: #fff; } .pill.core { background: var(--amber-50); color: var(--status-warning-text); } .pill.dark { background: var(--ink); }
.notice { border-radius: var(--radius-md); border-left-width: 4px; }
.cdot.ok { background: var(--green); } .cdot.warn { background: var(--amber); } .cdot.bad { background: var(--status-error); }
.user-menu { border-radius: var(--radius-md); }

/* pop-ups: impossible to miss */
.ring { background: var(--ink); border-left: 0; border-radius: var(--radius-lg); box-shadow: 0 0 0 2px var(--cht-aqua), 0 18px 50px rgba(14,20,32,.45); }
.ring.chatpop { box-shadow: 0 0 0 2px var(--coral), 0 18px 50px rgba(255,90,60,.35); }
.ring.chatpop .ring-top { color: #ffb5a5; } .ring.chatpop .btn { background: var(--coral); border-color: var(--coral); color: #fff; }
.ring .btn { background: var(--cht-aqua); border-color: var(--cht-aqua); color: var(--ink); }

/* chat page */
.chatstate { background: #fff; border-radius: 999px; padding: 6px 14px 6px 12px; display: inline-flex; box-shadow: var(--shadow-card); }
.chatside h2.section { margin: 18px 2px 8px; }
.sec-n { background: var(--neutral-200); color: var(--neutral-600); border-radius: 999px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }
.sec-waiting .sec-n { background: var(--coral); color: #fff; } .sec-open .sec-n { background: var(--violet); color: #fff; } .sec-missed .sec-n { background: var(--amber); color: #fff; }
.chat-item { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-card); position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.chat-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--neutral-200); }
.chat-item.st-waiting::before { background: var(--coral); } .chat-item.st-open::before { background: var(--violet); } .chat-item.st-missed::before { background: var(--amber); }
.chat-item:hover { border-color: transparent; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14,20,32,.12); }
.chat-item.on, .chat-item.hot.on { background: #fff; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 8px 24px rgba(14,20,32,.14); }
.chat-item.hot { background: var(--coral-50); border-color: var(--coral-100); }
.chat-item.needs { background: var(--violet-50); }
.chat-item.st-closed { box-shadow: none; background: transparent; border-color: var(--neutral-200); } .chat-item.st-closed .ci-av { filter: grayscale(1); opacity: .7; }
.ci-av, .ch-av, .cm.them .cm-a { background: hsl(var(--h, 250) 85% 92%); color: hsl(var(--h, 250) 60% 32%); }
.ci-av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; font-weight: 700; font-size: 14px; flex: none; }
.ci-main { min-width: 0; flex: 1; display: block; } .ci-name { color: var(--ink); }
.chat-item.hot .ci-name::after, .chat-item.needs .ci-name::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-left: 7px; vertical-align: middle; animation: hotpulse 1.6s infinite; }
.ci-flag { display: inline-block; margin-top: 5px; background: var(--coral); color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 6px; padding: 2px 7px; }
.chatpane.c-card { border-radius: var(--radius-lg); }
#chathead { background: #fff; } .ch-name { color: var(--ink); } .ch-av { border-radius: 12px; width: 38px; height: 38px; }
.ch-facts span { background: var(--neutral-50); border-radius: 8px; padding: 3px 9px; } .ch-facts { gap: 6px; }
.chatmsgs { background: #f6f7fb radial-gradient(rgba(108,92,231,.07) 1px, transparent 1px) 0 0 / 18px 18px; }
.cm.them .cm-b { border: 0; box-shadow: 0 1px 2px rgba(14,20,32,.08), 0 4px 12px rgba(14,20,32,.05); }
.cm.me .cm-b { background: linear-gradient(135deg, var(--violet) 0%, #8f6bff 100%); color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.3); }
.cm.me .cm-a { background: var(--ink); color: var(--cht-aqua); }
.cm.sys { background: #fff; color: var(--neutral-600); box-shadow: 0 1px 2px rgba(14,20,32,.06); font-weight: 600; }
.chatfoot textarea.in { border-radius: 14px; border-color: var(--neutral-200); background: var(--neutral-50); } .chatfoot textarea.in:focus { background: #fff; }
@keyframes hotpulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,60,.55); } 70% { box-shadow: 0 0 0 7px rgba(255,90,60,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,60,0); } }
@media (prefers-reduced-motion: reduce) { .tb-ws .cnt.hot, .ci-name::after { animation: none !important; } }
@media (max-width: 1100px) { .av .avl { font-size: 11px; } .tb-search { max-width: 220px; } }
@media (max-width: 900px) { .page-head, .sidebar { top: 52px; } .av { padding: 5px 6px; } .av.chat .avl, .av.calls .avl { display: none; } }
.sidebar { height: calc(100vh - 52px); } .chatpane.c-card { height: calc(100vh - 186px); } .tb-user .user-menu { top: 44px; }
#chatpops { top: 66px; } .tb-user .user-menu { z-index: 70; } .topbar { z-index: 65; }
.ibar i { background: linear-gradient(90deg, var(--violet), #8f6bff); } .ibar { background: var(--violet-50); }
.kpi-card { position: relative; overflow: hidden; } .kpi-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--violet); }
.kpi-card:nth-child(6n+2)::before { background: var(--sky); } .kpi-card:nth-child(6n+3)::before { background: var(--amber); } .kpi-card:nth-child(6n+4)::before { background: var(--green); } .kpi-card:nth-child(6n+5)::before { background: var(--coral); } .kpi-card:nth-child(6n+6)::before { background: var(--ink); }
/* v3.2: your own photo beside your replies */
.cm.me .cm-a.ph { background-size: cover; background-position: center; color: transparent; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(14,20,32,.25); }

/* v3.4: emailing a reply to someone who has left */
.mailbar { display: flex; align-items: center; gap: 10px; background: var(--neutral-50); border: 1px solid var(--neutral-200); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; color: var(--neutral-600); cursor: default; }
label.mailbar { cursor: pointer; } .mailbar.on { background: var(--violet-50); border-color: var(--violet-100); color: var(--ink); } .mailbar.off { background: var(--amber-50); border-color: var(--status-warning-bd); }
.mailbar input { width: 16px; height: 16px; accent-color: var(--violet); flex: none; } .mb-i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.cm-mail { color: var(--violet-d); font-weight: 600; }

/* ================= v4.0: tickets ================= */
.cnt.tix { display: none; } .cnt.tix.on { display: inline-block; background: var(--violet); color: #fff; margin-left: 5px; }
.tb-ws a.on .cnt.tix.on { background: #fff; color: var(--violet-d); } .side-nav a .cnt.tix.on { margin-left: auto; } .side-nav a { display: flex; align-items: center; }
.tkwrap { grid-template-columns: 340px minmax(0, 1fr); }
.tk-search { margin-bottom: 8px; border-radius: 12px; }
.tk-tabs, .tk-modes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; align-items: center; }
.tk-tab { border: 0; background: transparent; color: var(--neutral-600); font-weight: 600; font-size: 12.5px; padding: 6px 10px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tk-tab:hover { background: var(--neutral-100); } .tk-tab.on { background: var(--ink); color: #fff; } .tk-tab.on .sec-n { background: var(--coral); color: #fff; }
#tklist { max-height: calc(100vh - 250px); overflow-y: auto; padding: 2px 4px 12px 2px; margin: 0 -4px 0 -2px; }
.chat-item.tk { align-items: flex-start; margin-bottom: 8px; } .chat-item.tk.st-new::before { background: var(--coral); } .chat-item.tk.st-open::before { background: var(--violet); } .chat-item.tk.st-waiting::before { background: var(--green); }
.tk-sub { display: block; font-size: 13px; color: var(--neutral-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 2px; } .chat-item.tk.needs .tk-sub { font-weight: 700; }
.tkpane.c-card { height: calc(100vh - 150px); }
.tk-head { padding: 14px 18px; border-bottom: 1px solid var(--neutral-200); background: #fff; }
.tk-head-top { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.tk-title { margin: 0 0 6px; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.tk-facts { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--neutral-600); }
.tk-ref { font-weight: 700; color: var(--violet-d); background: var(--violet-50); border-radius: 6px; padding: 2px 7px; }
.tk-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .tk-assign { width: auto; min-width: 150px; padding-top: 7px; padding-bottom: 7px; }
.tk-thread { flex: 1; overflow-y: auto; padding: 16px 18px; background: #f6f7fb; display: flex; flex-direction: column; gap: 12px; }
.tk-msg { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(14,20,32,.06), 0 4px 12px rgba(14,20,32,.04); max-width: 860px; width: 100%; border-left: 4px solid var(--neutral-200); }
.tk-msg.me { border-left-color: var(--violet); align-self: flex-end; background: #fbfaff; } .tk-msg.auto { border-left-color: var(--neutral-400); background: #fafbfd; align-self: flex-end; }
.tk-msg-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; } .tk-msg-h strong { color: var(--ink); display: block; }
.tk-when { color: var(--text-muted); font-size: 12px; } .tk-file { margin-left: auto; font-size: 12px; white-space: nowrap; }
.ci-av.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; } .tk-msg.me .ci-av.sm { background: var(--ink); color: var(--cht-aqua); } .tk-msg.auto .ci-av.sm { background: var(--neutral-200); color: var(--neutral-600); }
.tk-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--neutral-800); } .tk-body.old { color: var(--text-muted); font-size: 13px; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--neutral-200); }
.tk-more summary { cursor: pointer; font-size: 12.5px; color: var(--violet-d); margin-top: 8px; }
.tk-note { background: var(--amber-50); border: 1px dashed var(--status-warning-bd); border-radius: 12px; padding: 10px 14px; max-width: 860px; } .tk-note-h { font-size: 12px; font-weight: 700; color: var(--status-warning-text); margin-bottom: 4px; }
.tk-foot { border-top: 1px solid var(--neutral-200); padding: 10px 18px 14px; background: #fff; } .tk-foot textarea { min-height: 96px; border-radius: 14px; } .tk-foot textarea.note { background: var(--amber-50); border-color: var(--status-warning-bd); }
.tk-hint { font-size: 12px; color: var(--text-muted); margin-left: 6px; } .tk-import { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .tkwrap { grid-template-columns: 1fr; } #tklist { max-height: 40vh; } .tkpane.c-card { height: auto; } .tk-thread { max-height: 55vh; } }
.cnt.tix.on { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; width: auto; }
.tk-head-top { flex-wrap: nowrap; } .tk-head-top > div:first-child { min-width: 0; flex: 1; } .tk-acts { flex-wrap: nowrap; flex: none; } select.in.tk-assign { width: 170px; flex: none; }
@media (max-width: 1200px) { .tk-head-top { flex-wrap: wrap; } .tk-acts { flex-wrap: wrap; } }

/* v4.1: save a ticket reply or note to aXcelerate */
.tk-ax { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 2px; font-size: 13px; } .tk-ax .ck { margin: 0; } .tk-ax select.in.tk-assign { padding-top: 5px; padding-bottom: 5px; }

/* ================= v4.1: denser ticket page =================
   Three columns on a wide screen (list, conversation, details). Smaller type, tighter rows, older emails folded to one line,
   and a reply box that stays shut until it is needed, so far more of the conversation is on screen. */
.tkwrap { grid-template-columns: 300px minmax(0, 1fr) 250px; gap: 12px; align-items: start; }
.tkwrap .chatside { min-width: 0; }
.tk-search { font-size: 13px; padding: 7px 11px; margin-bottom: 6px; }
.tk-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; margin-bottom: 8px; scrollbar-width: none; } .tk-tabs::-webkit-scrollbar { display: none; }
.tk-tab { font-size: 12px; padding: 5px 9px; white-space: nowrap; flex: none; }
#tklist { max-height: calc(100vh - 196px); padding: 0; margin: 0; background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); }
.tki { display: flex; gap: 9px; padding: 9px 11px 9px 13px; border-bottom: 1px solid var(--neutral-100); position: relative; text-decoration: none; color: inherit; }
.tki:last-child { border-bottom: 0; } .tki:hover { background: #fafaff; } .tki.on { background: var(--violet-50); }
.tki::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; } .tki.st-new::before { background: var(--coral); } .tki.st-open::before { background: var(--violet); } .tki.st-waiting::before { background: var(--green); }
.tki-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-weight: 700; font-size: 12px; flex: none; background: hsl(var(--h, 250) 85% 92%); color: hsl(var(--h, 250) 60% 32%); }
.tki-main { min-width: 0; flex: 1; display: block; } .tki-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tki-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tki-time { font-size: 11px; color: var(--text-muted); flex: none; }
.tki-sub { display: block; font-size: 12.5px; color: var(--neutral-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 3px; }
.tki.unread .tki-name, .tki.unread .tki-sub { font-weight: 700; color: var(--ink); } .tki.unread .tki-time { color: var(--coral); font-weight: 700; }
.tki-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); align-items: center; }
.tki-st { font-weight: 700; border-radius: 5px; padding: 0 5px; background: var(--neutral-100); color: var(--neutral-600); } .tki-st.warn { background: var(--coral); color: #fff; } .tki-st.core { background: var(--violet-100); color: var(--violet-d); } .tki-st.ok { background: var(--green-50); color: #0a7d47; }
.tkpane.c-card { height: calc(100vh - 148px); border-radius: 14px; }
.tk-bar { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--neutral-200); background: #fbfcfe; flex-wrap: wrap; }
.tkb { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--neutral-200); background: #fff; color: var(--neutral-800); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.tkb:hover { border-color: var(--violet); color: var(--violet-d); background: var(--violet-50); } .tkb.pri { background: var(--ink); border-color: var(--ink); color: #fff; } .tkb.pri:hover { background: var(--ink-2); color: #fff; }
.tkb svg, .tk-fake svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tk-head { padding: 10px 16px; border-bottom: 1px solid var(--neutral-200); } .tk-title { font-size: 15.5px; margin: 0 0 5px; line-height: 1.3; }
.tk-facts { font-size: 12px; gap: 4px 10px; } .tk-ref { font-size: 11.5px; padding: 1px 6px; }
.tk-thread { padding: 12px 14px; gap: 8px; }
.tkm { background: #fff; border-radius: 12px; border: 1px solid var(--neutral-200); max-width: none; width: 100%; border-left: 3px solid var(--neutral-200); }
.tkm.me { border-left-color: var(--violet); background: #fbfaff; } .tkm.auto { border-left-color: var(--neutral-400); background: #fafbfd; }
.tkm-h { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 8px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tkm-av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 11px; font-weight: 700; flex: none; background: hsl(var(--h, 250) 85% 92%); color: hsl(var(--h, 250) 60% 32%); } .tkm.me .tkm-av { background: var(--ink); color: var(--cht-aqua); } .tkm.auto .tkm-av { background: var(--neutral-200); color: var(--neutral-600); }
.tkm-who { min-width: 0; flex: 1; display: flex; gap: 8px; align-items: baseline; font-size: 13px; white-space: nowrap; overflow: hidden; } .tkm-who strong { color: var(--ink); flex: none; }
.tkm-em { color: var(--text-muted); font-size: 12px; flex: none; } .tkm-prev { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; } .tkm-when { font-size: 11.5px; color: var(--text-muted); flex: none; }
.tkm.shut:hover { border-color: var(--violet-100); background: #fafaff; }
.tkm-to { font-size: 11.5px; color: var(--text-muted); padding: 0 12px 6px 47px; margin-top: -4px; overflow-wrap: anywhere; }
.tkm .tk-body { padding: 2px 14px 12px 47px; font-size: 13.5px; line-height: 1.5; } .tkm .tk-more { padding: 0 14px 10px 47px; } .tkm .tk-more .tk-body { padding: 0 0 0 10px; }
.tk-body a { color: var(--violet-d); } .tk-note { max-width: none; padding: 8px 12px; border-radius: 10px; } .tk-note .tk-body { font-size: 13px; line-height: 1.45; } .tk-note-h { font-size: 11.5px; margin-bottom: 2px; }
.tk-foot { padding: 8px 12px; display: flex; gap: 8px; align-items: center; } .tk-foot.open { display: block; padding: 8px 14px 12px; }
.tk-fake { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--neutral-200); background: var(--neutral-50); color: var(--text-muted); border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: text; text-align: left; } .tk-fake:hover { border-color: var(--violet); background: #fff; }
.tk-foot textarea { min-height: 110px; max-height: 38vh; font-size: 13.5px; border-radius: 10px; } .tk-modes { margin-bottom: 6px; } .tk-hint { font-size: 11.5px; flex: 1; }
.tk-x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0 4px; } .tk-x:hover { color: var(--ink); }
.tk-send { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; } .tk-send .cf-acts { margin: 0; gap: 8px; display: flex; } .tk-send .btn { padding: 7px 14px; font-size: 13px; } .tk-ax { margin: 0; font-size: 12.5px; }
.tkside { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 148px); overflow-y: auto; } .tkside[hidden] { display: none; }
.tks { background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); padding: 12px 14px; font-size: 12.5px; }
.tks h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tks-l { display: block; font-size: 11.5px; font-weight: 600; color: var(--neutral-600); margin: 6px 0 3px; } .tks select.in { padding: 6px 9px; font-size: 13px; border-radius: 8px; }
.tks-d { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0 0; } .tks-d dt { color: var(--text-muted); } .tks-d dd { margin: 0; text-align: right; color: var(--neutral-800); overflow-wrap: anywhere; }
.tks-who { display: flex; gap: 9px; align-items: center; } .tks-who strong { display: block; color: var(--ink); font-size: 13px; } .tks-who a { overflow-wrap: anywhere; }
.tks-ax { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--neutral-100); color: var(--neutral-600); }
.tks-t { display: block; padding: 6px 0; border-top: 1px solid var(--neutral-100); text-decoration: none; color: var(--ink); } .tks-t:first-of-type { border-top: 0; padding-top: 0; }
.tks-t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; } .tks-t small { color: var(--text-muted); } .tks-t:hover span { color: var(--violet-d); }
@media (max-width: 1280px) { .tkwrap { grid-template-columns: 270px minmax(0, 1fr); } .tkside { grid-column: 1 / -1; flex-direction: row; max-height: none; flex-wrap: wrap; } .tks { flex: 1; min-width: 220px; } }
@media (max-width: 900px) { .tkwrap { grid-template-columns: 1fr; } #tklist { max-height: 36vh; } .tkpane.c-card { height: 70vh; } }

/* v4.2: the permissions box */
.pm-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 10px 0 16px; align-items: start; } @media (max-width: 760px) { .pm-wrap { grid-template-columns: 1fr; } }
.pm { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border: 1px solid var(--neutral-200); border-radius: 10px; overflow: hidden; }
.pm th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 7px 10px; background: var(--neutral-50); color: var(--neutral-600); } .pm th:first-child { color: var(--violet-d); }
.pm td { padding: 6px 10px; border-top: 1px solid var(--neutral-100); vertical-align: middle; } .pm td:first-child { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pm-ck { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--neutral-600); white-space: nowrap; } .pm-ck input { width: 16px; height: 16px; accent-color: var(--violet); }
.pm { table-layout: fixed; } .pm th:nth-child(2), .pm td:nth-child(2) { width: 72px; } .pm th:nth-child(3), .pm td:nth-child(3) { width: 168px; } .pm-ck span { white-space: normal; }
.pm-quick { display: flex; gap: 16px; }

/* v4.2: attachments on a ticket email */
.tk-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; } .tk-files:empty { display: none; }
.tk-file { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--neutral-200); background: #fff; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.tk-file:hover { border-color: var(--violet); color: var(--violet-d); } .tk-file.busy { opacity: .55; cursor: progress; } .tk-file.wait { cursor: default; color: var(--neutral-600); border-style: dashed; }
.tk-file-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .tk-file-s { color: var(--neutral-600); white-space: nowrap; }
.tk-hint { font-size: 12px; color: var(--neutral-600); padding: 4px 2px; }
.tkm .tk-files { padding: 0 14px 8px 47px; margin: 0; justify-content: flex-start; } .tkm .tk-file { margin: 0; flex: 0 0 auto; width: auto; } .tkm .tk-file svg { flex: 0 0 auto; margin: 0; }
