/* Hobe Inbox design system — brand kit 2.0 (26/10: the existing HI mark is the approved one; palette from
   06_Colors_And_Design_Tokens) on HOBE Technologies Brand System v1.0. Navy is the default product surface.
   Layers: 1 tokens · 2 base · 3 components · 4 shell · 5 inbox workspace · 6 chat per channel · 7 pages · 8 responsive.
   Text contrast: --ink/--ink-2/--muted all pass WCAG AA on --bg and --surface in both themes; brand purple
   #885CF6 carries large text and fills only, --brand-ink carries small text. */
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("fonts/Almarai-Regular.woff2") format("woff2"); }
@font-face { font-family: "Almarai"; font-weight: 700 800; font-display: swap; src: url("fonts/Almarai-Bold.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 200 1000; font-display: swap; src: url("fonts/Cairo-Variable.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/Inter-Variable.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+20AC, U+2190-2193; }

/* ---------------------------------------------------------------- 1 tokens */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #0A0F2E; --midnight: #10153E; --purple: #885CF6; --violet: #9E4BF3; --lavender: #C084FC;
  --lavender-pale: #E9D5FF; --soft-white: #F8FAFF; --ink-brand: #10132D;
  --bg: #0A0F2E; --bg-2: #0C1234; --surface: #10153E; --surface-2: #161C4B; --surface-3: #1D2459; --raised: #141A46;
  --line: rgba(233, 213, 255, .07); --border: rgba(233, 213, 255, .12); --border-strong: rgba(233, 213, 255, .22);
  --ink: #F8FAFF; --ink-2: #D6D9EF; --muted: #A4A9CD; --muted-2: #868CB6;
  --brand: #885CF6; --brand-hover: #9A72F8; --brand-ink: #C9A7FD; --on-brand: #FFFFFF;
  --brand-soft: rgba(136, 92, 246, .18); --brand-tint: rgba(136, 92, 246, .09); --brand-line: rgba(136, 92, 246, .5);
  --ok: #4ADE9D; --ok-soft: rgba(74, 222, 157, .13); --warn: #F7C365; --warn-soft: rgba(247, 195, 101, .13); --warn-line: rgba(247, 195, 101, .35);
  --bad: #FF8A9B; --bad-soft: rgba(255, 138, 155, .14); --bad-line: rgba(255, 138, 155, .38); --info: #8EC2FF; --info-soft: rgba(142, 194, 255, .13);
  --note: #2A2414; --note-line: rgba(247, 195, 101, .3); --note-ink: #F7D58F;
  --scrim: rgba(4, 6, 20, .62);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .25); --shadow-2: 0 8px 24px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .35);
  --focus: 0 0 0 3px rgba(136, 92, 246, .45);
  /* channels: solid (logo tile) and ink (readable text on --surface) */
  --c-wa: #25D366; --c-wa-ink: #5EE695; --c-tg: #229ED9; --c-tg-ink: #6FC3F0; --c-fb: #0A7CFF; --c-fb-ink: #7DB6FF;
  --c-mail: #EA4335; --c-mail-ink: #FF8A80; --c-web: #885CF6; --c-web-ink: #C9A7FD; --c-sms: #14B8A6; --c-sms-ink: #5EEAD4;
  --c-all: #885CF6; --c-all-ink: #C9A7FD;
  --fb-grad: linear-gradient(135deg, #0866FF 0%, #A033FF 70%, #FF5280 100%);
  --r-xs: 8px; --r-s: 12px; --r: 16px; --r-l: 20px;
  --f-display: "Almarai", "Cairo", system-ui, sans-serif;
  --f-body: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --f-latin: "Inter", "Cairo", system-ui, sans-serif;
  --ease: cubic-bezier(.2, 0, 0, 1); --fast: 160ms; --std: 220ms;
  --rail: 84px; --list: 372px; --details: 344px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F5FB; --bg-2: #FAFAFE; --surface: #FFFFFF; --surface-2: #F4F2FC; --surface-3: #EAE6F8; --raised: #FFFFFF;
  --line: rgba(16, 19, 45, .07); --border: rgba(16, 19, 45, .12); --border-strong: rgba(16, 19, 45, .22);
  --ink: #10132D; --ink-2: #2E3460; --muted: #565C84; --muted-2: #6E739A;
  --brand: #7C4DF4; --brand-hover: #6B3BEB; --brand-ink: #6233DB; --on-brand: #FFFFFF;
  --brand-soft: #EDE5FE; --brand-tint: #F6F2FF; --brand-line: #CDB8FB;
  --ok: #0B7A4F; --ok-soft: #E2F5EC; --warn: #8F5400; --warn-soft: #FDF0DA; --warn-line: #EDCF97;
  --bad: #B8233A; --bad-soft: #FCE8EB; --bad-line: #F0BCC5; --info: #1B5DB5; --info-soft: #E5EEFB;
  --note: #FFF8E1; --note-line: #EBD48C; --note-ink: #6E5100;
  --scrim: rgba(16, 19, 45, .38);
  --shadow-1: 0 1px 2px rgba(16, 19, 45, .06); --shadow-2: 0 8px 24px rgba(16, 19, 45, .08), 0 1px 3px rgba(16, 19, 45, .06);
  --shadow-pop: 0 18px 44px rgba(16, 19, 45, .16), 0 2px 8px rgba(16, 19, 45, .08);
  --c-wa-ink: #0B7A3E; --c-tg-ink: #0E6FA3; --c-fb-ink: #0659D6; --c-mail-ink: #C5221F; --c-web-ink: #6233DB;
  --c-sms-ink: #0C7C71; --c-all-ink: #6233DB;
}
.ch-wa { --ch: var(--c-wa); --ch-ink: var(--c-wa-ink); } .ch-tg { --ch: var(--c-tg); --ch-ink: var(--c-tg-ink); }
.ch-fb { --ch: var(--c-fb); --ch-ink: var(--c-fb-ink); } .ch-mail { --ch: var(--c-mail); --ch-ink: var(--c-mail-ink); }
.ch-web { --ch: var(--c-web); --ch-ink: var(--c-web-ink); } .ch-sms { --ch: var(--c-sms); --ch-ink: var(--c-sms-ink); }
.ch-all { --ch: var(--c-all); --ch-ink: var(--c-all-ink); }

/* ---------------------------------------------------------------- 2 base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; font-family: var(--f-body); font-size: .9375rem; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "kern"; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: 0; color: var(--ink); }
h1 { font-size: 1.32rem; margin: 0; font-weight: 800; line-height: 1.35; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 700; line-height: 1.4; }
h3 { font-size: .9rem; margin: 0 0 .6rem; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
p { margin: .25rem 0 .7rem; }
small, .muted { color: var(--muted); }
code, .mono, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84em; direction: ltr; unicode-bidi: isolate; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; padding: 0 6px; border-radius: 6px; color: var(--ink-2); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num, time, .when { font-family: var(--f-latin); font-variant-numeric: tabular-nums; }
.ico { width: 20px; height: 20px; flex: none; }
.ch-glyph { width: 18px; height: 18px; flex: none; color: var(--ch-ink, var(--brand-ink)); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
::selection { background: rgba(136, 92, 246, .35); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.spacer { flex: 1; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 160px; }
.block { display: flex; width: 100%; justify-content: center; }
.plain { list-style: none; margin: 0; padding: 0; }
.eyebrow { font-family: var(--f-latin); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lede { color: var(--ink-2); font-size: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 3 components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-s); border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  font: 700 .88rem/1 var(--f-body); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: transparent; color: var(--on-brand); box-shadow: 0 6px 18px rgba(136, 92, 246, .3); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; position: relative; transition: background var(--fast) var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-btn.on { background: var(--brand-soft); color: var(--brand-ink); }
.icon-btn b { position: absolute; top: 3px; inset-inline-end: 3px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--brand);
  color: #fff; font: 700 .62rem/16px var(--f-latin); text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; border: 0; font-family: var(--f-body); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.grey { background: var(--surface-3); color: var(--muted); }
.pill.channel { background: color-mix(in srgb, var(--ch, var(--brand)) 16%, transparent); color: var(--ch-ink, var(--brand-ink)); }
button.pill { cursor: pointer; }
.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: .7rem; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.flag.bad { background: var(--bad-soft); color: var(--bad); } .flag.warn { background: var(--warn-soft); color: var(--warn); }
.flag.ok { background: var(--ok-soft); color: var(--ok); } .flag.late { background: transparent; color: var(--bad); padding: 0 2px; }
.flag.tag { background: transparent; color: var(--muted); padding: 0 2px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--brand-tint);
  border: 1px solid var(--brand-soft); color: var(--brand-ink); font: 700 .76rem/1 var(--f-body); cursor: pointer; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.state.s-live { color: var(--ok); } .state.s-testing { color: var(--info); } .state.s-manual { color: var(--muted); }
.state.s-down { color: var(--bad); } .state.s-setup { color: var(--warn); } .state.s-none { color: var(--muted-2); }
.state.s-manual i, .state.s-none i { background: transparent; border: 1.5px solid currentColor; }
.state.s-live i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-1); }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.notice { padding: 12px 16px; border-radius: var(--r-s); background: var(--brand-tint); border: 1px solid var(--brand-soft); color: var(--ink-2); font-size: .88rem; }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--ink); }
.notice.slim { padding: 8px 14px; margin: 0; border-radius: 10px; font-size: .84rem; }
.flash { padding: 11px 16px; border-radius: var(--r-s); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ink); margin-bottom: 16px; font-weight: 600; }
.flash.bad { background: var(--bad-soft); border-color: var(--bad-line); }

input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=url], input[type=tel],
input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 13px; border-radius: var(--r-s); border: 1px solid var(--border); background: var(--bg-2);
  color: var(--ink); font: 500 .92rem/1.45 var(--f-body); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
:root[data-theme="light"] :is(input, select, textarea) { background: #fff; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
:is(input, select, textarea):hover { border-color: var(--border-strong); }
:is(input, select, textarea):focus { outline: none; border-color: var(--brand-line); box-shadow: var(--focus); }
select { appearance: none; padding-inline-end: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: 18px 52%, 13px 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 84px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; }
input[type=file] { font: inherit; color: var(--muted); }
.field { margin-bottom: 14px; }
.field > label, .field > .lbl { display: block; font-size: .84rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
form.inline, .inline-form { display: inline-flex; margin: 0; }
.row > input, .row > select { width: auto; flex: 1; min-width: 140px; }

.chips, .views { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chips a, .views a { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 99px; font-size: .82rem; font-weight: 700;
  color: var(--ink-2); background: transparent; border: 1px solid var(--border); white-space: nowrap; }
.chips a:hover, .views a:hover { background: var(--surface-2); text-decoration: none; }
.chips a.on { background: var(--ink); color: var(--bg); border-color: transparent; }
.tabs { display: flex; gap: 4px; }
.tabs button, .composer-tabs button { height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted);
  font: 700 .82rem/1 var(--f-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.on, .composer-tabs button.on { background: var(--surface-3); color: var(--ink); }
.composer-tabs button .ico { width: 15px; height: 15px; }

.table-wrap { overflow-x: auto; padding: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
.t th { font-size: .74rem; font-weight: 700; color: var(--muted); text-align: center; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); white-space: nowrap; }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
/* every column: its header centred over its content (owner rule), titles included */
.t tbody tr { transition: background var(--fast) var(--ease); }
.t tbody tr:hover { background: var(--brand-tint); }
.t tr:last-child td { border-bottom: 0; }
.t td.title { font-weight: 700; }

.avatar { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--ch, var(--brand)) 22%, var(--surface-3)); color: var(--ink);
  font: 800 1rem/1 var(--f-display); }
.avatar.sm { width: 34px; height: 34px; font-size: .85rem; } .avatar.lg { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar .ch { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ch, var(--brand)); border: 2px solid var(--bg-2); }
.ch-fb .avatar .ch { background: var(--fb-grad); }
.avatar .ch .ch-glyph { width: 12px; height: 12px; color: #fff; }

.stat { display: block; color: var(--ink); position: relative; overflow: hidden; }
.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat .n { font: 800 2rem/1.1 var(--f-latin); letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .86rem; font-weight: 600; margin-top: 4px; }
.stat.alert .n { color: var(--bad); }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 10px; }
pre, .pre { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; overflow-x: auto;
  font-size: .8rem; direction: ltr; text-align: left; }
details > summary { cursor: pointer; }

/* ---------------------------------------------------------------- 4 shell */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.rail { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 30; width: var(--rail); display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 14px 8px 12px; background: var(--bg-2); border-inline-end: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--navy); flex: none;
  box-shadow: 0 0 0 1px var(--border), 0 8px 20px rgba(136, 92, 246, .22); margin-bottom: 8px; }
.rail-mark img { width: 30px; height: 30px; }
.rail-head { display: none; }
.rail-group { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rail-group:last-of-type { border-bottom: 0; }
.rail-group a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 12px; color: var(--muted);
  font-size: .68rem; font-weight: 700; line-height: 1.2; text-align: center; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.rail-group a .ico { width: 22px; height: 22px; }
.rail-group a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.rail-group a.on { background: var(--brand-soft); color: var(--ink); }
.rail-group a.on .ico { color: var(--brand-ink); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 10px; }
.rail-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; }
.rail-btn:hover { background: var(--surface-2); }
.th-light { display: none; } :root[data-theme="light"] .th-light { display: inline; } :root[data-theme="light"] .th-dark { display: none; }
.me { position: relative; }
.me summary { list-style: none; } .me summary::-webkit-details-marker { display: none; }
.me .avatar { background: var(--brand); color: #fff; }
.me-menu { position: fixed; bottom: 14px; inset-inline-start: calc(var(--rail) + 10px); width: 250px; padding: 14px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.me-menu small { color: var(--muted); }
.made-by { font-size: .7rem; color: var(--muted-2); line-height: 1.5; }
.env-badge { font-size: .66rem; padding: 2px 9px; border-radius: 99px; font-weight: 800; color: var(--warn); background: var(--warn-soft); }
.brand-name { font-family: var(--f-latin); font-weight: 700; letter-spacing: -.01em; }
.main { flex: 1; min-width: 0; margin-inline-start: var(--rail); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.28rem; }
.content { padding: 26px 32px 48px; width: 100%; max-width: 1360px; margin-inline: auto; }
.menu-btn { display: none; }
.scrim { display: none; }
.bottom-nav { display: none; }

/* auth: the HOBE door (docs/LOGIN_STANDARD.md) - navy brand half + form half, one column on a phone */
.door { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--bg); }
.door-side { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 48px 40px; color: #F8FAFF; background: linear-gradient(180deg, #0E1538 0%, #120F35 100%); }
.door-glow { position: absolute; inset-inline: 0; bottom: 0; height: 75%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 100%, rgba(166, 91, 250, .38) 0%, rgba(166, 91, 250, 0) 70%); }
.door-grid { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
  background-image: linear-gradient(#F8FAFF 1px, transparent 1px), linear-gradient(90deg, #F8FAFF 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%); mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.door-lockup { display: inline-flex; align-items: center; gap: 10px; direction: ltr; align-self: flex-start; font-family: var(--f-latin, Inter, system-ui, sans-serif); }
[dir="rtl"] .door-lockup { align-self: flex-start; }
.door-lockup img { width: 36px; height: 36px; }
.door-lockup span { display: flex; flex-direction: column; line-height: 1.05; }
.door-lockup b { font-size: 1.12rem; font-weight: 800; letter-spacing: .14em; }
.door-lockup small { font-size: .66rem; font-weight: 700; letter-spacing: .42em; color: #BF89FB; }
.door-copy { display: flex; flex-direction: column; gap: 16px; max-width: 28rem; }
.door-eyebrow { margin: 0; font-size: .86rem; font-weight: 600; color: #BF89FB; }
.door-side h1 { margin: 0; color: #F8FAFF; font-size: 2.4rem; font-weight: 800; line-height: 1.35; }
.door-side h1 span { background: linear-gradient(135deg, #BF89FB 0%, #A65BFA 45%, #8646EB 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.door-lead { margin: 0; color: #9AA2C6; font-size: .95rem; line-height: 1.75; }
.door-mark { display: flex; justify-content: center; }
.door-mark img { width: 220px; height: 220px; filter: drop-shadow(0 24px 60px rgba(134, 70, 235, .45)); }
.door-family { margin: 0; font-size: .8rem; color: #9AA2C6; }
.door-family b { color: #F8FAFF; letter-spacing: .2em; } .door-family bdi { letter-spacing: .2em; }
.door-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.door-form { width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 6px; }
.door-head { margin-bottom: 14px; } .door-head h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; }
.door-head p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.door-form .field input { min-height: 44px; background: var(--surface); }
.door-form .btn.primary { width: 100%; min-height: 44px; margin-top: 6px; }
.door-note { margin: 14px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.pw { position: relative; display: block; } .pw input { width: 100%; } [dir="rtl"] .pw input { padding-left: 44px; } [dir="ltr"] .pw input { padding-right: 44px; }
.pw-eye { position: absolute; inset-block: 0; inset-inline-end: 0; width: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--ink); } .pw-eye .ico { width: 18px; height: 18px; }
@media (max-width: 1023px) {
  .door { grid-template-columns: minmax(0, 1fr); }
  .door-side { padding: 28px 22px; gap: 22px; } .door-mark { display: none; }
  .door-side h1 { font-size: 1.75rem; } .door-main { padding: 32px 20px 40px; align-items: flex-start; }
}

/* ---------------------------------------------------------------- 5 inbox workspace */
.ws-page .main { height: 100vh; height: 100dvh; overflow: hidden; }
.workspace { display: grid; grid-template-columns: var(--list) minmax(0, 1fr); height: 100%; min-height: 0; position: relative; }
.details-open .has-conv .workspace, .has-conv.details-open .workspace { grid-template-columns: var(--list) minmax(0, 1fr) var(--details); }
.inbox-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-2); border-inline-end: 1px solid var(--line); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.col-head h1 { font-size: 1.22rem; flex: 1; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.live.on { color: var(--ok); } .live.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

.switcher { display: flex; gap: 2px; padding: 8px 10px 10px; overflow-x: auto; scrollbar-width: none; }
.switcher::-webkit-scrollbar { display: none; }
.sw { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 3px 6px;
  border-radius: 14px; color: var(--muted); font-size: .66rem; font-weight: 700; line-height: 1.15; text-align: center;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.sw:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sw-logo { position: relative; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2);
  border: 1px solid var(--line); transition: transform var(--fast) var(--ease), background var(--fast) var(--ease); }
.sw-logo .ch-glyph { width: 21px; height: 21px; color: var(--ch-ink); }
.sw.on { color: var(--ink); background: color-mix(in srgb, var(--ch) 12%, transparent); }
.sw.on .sw-logo { background: var(--ch); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--ch) 40%, transparent); }
.sw.on.ch-fb .sw-logo { background: var(--fb-grad); }
.sw.on .sw-logo .ch-glyph { color: #fff; }
.sw:active .sw-logo { transform: scale(.94); }
.sw-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-count { position: absolute; top: 1px; inset-inline-end: calc(50% - 29px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font: 800 .66rem/15px var(--f-latin); border: 2px solid var(--bg-2); }
.sw-add { position: absolute; top: 2px; inset-inline-end: calc(50% - 27px); width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); }
.sw-add .ico { width: 11px; height: 11px; }
.sw-state { position: absolute; bottom: -2px; inset-inline-start: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-2); background: var(--muted-2); }
.sw.st-live .sw-state { background: var(--ok); } .sw.st-testing .sw-state { background: var(--info); } .sw.st-down .sw-state { background: var(--bad); }
.sw.st-setup .sw-state { background: var(--warn); } .sw.st-manual .sw-state { background: var(--surface-3); }
.sw.ch-all .sw-state { display: none; }
.sw.st-none { opacity: .6; } .sw.st-none .sw-state { display: none; } .sw.st-none .sw-logo { border-style: dashed; border-color: var(--border-strong); }
.sw.st-none:hover { opacity: 1; }
.accounts { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
.acct { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: .76rem; font-weight: 700; white-space: nowrap; max-width: 220px; }
.acct .nm { overflow: hidden; text-overflow: ellipsis; }
.acct small { color: var(--muted); font-weight: 600; }
.acct b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 800 .64rem/18px var(--f-latin); text-align: center; }
.acct:hover { text-decoration: none; border-color: var(--border-strong); }
.acct.on { border-color: color-mix(in srgb, var(--ch, var(--brand)) 60%, var(--line)); background: color-mix(in srgb, var(--ch, var(--brand)) 14%, var(--surface)); color: var(--ink); }
.acct.on::before { content: "✓"; font-size: .7rem; color: var(--ch-ink, var(--brand-ink)); }
.inbox-col .accounts { --ch: inherit; }
.views-wrap { position: relative; border-bottom: 1px solid var(--line); }
.views-wrap::before, .views-wrap::after { content: ""; position: absolute; top: 0; bottom: 10px; width: 28px; pointer-events: none; opacity: 0;
  transition: opacity var(--fast) var(--ease); z-index: 1; }
.views-wrap::before { inset-inline-start: 0; background: linear-gradient(to left, var(--bg-2), transparent); }
.views-wrap::after { inset-inline-end: 0; background: linear-gradient(to right, var(--bg-2), transparent); }
.views-wrap.more-start::before, .views-wrap.more-end::after { opacity: 1; }
.views a.on { font-weight: 800; box-shadow: inset 0 -2px 0 var(--brand-ink); border-radius: 10px 10px 4px 4px; }
.find { display: flex; gap: 6px; padding: 2px 12px 8px; align-items: center; position: relative; }
.search { flex: 1; position: relative; display: block; }
.search .ico { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-inline-start: 38px; min-height: 40px; background: var(--surface); border-color: var(--line); }
.more-filters > summary { list-style: none; border: 1px solid var(--line); background: var(--surface); }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters .pop { position: absolute; top: calc(100% + 4px); inset-inline: 12px; z-index: 20; display: grid; gap: 10px; padding: 14px;
  border-radius: var(--r); background: var(--raised); border: 1px solid var(--border); box-shadow: var(--shadow-pop); }
.more-filters .pop label { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.views { flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 10px; margin: 0; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views a { height: 30px; padding: 0 12px; font-size: .78rem; border-color: transparent; color: var(--muted); }
.views a.on { background: var(--brand-soft); color: var(--ink); }
.conv-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.conv-list { list-style: none; margin: 0; padding: 6px 8px 16px; }
.conv { position: relative; display: flex; gap: 12px; padding: 11px 12px; border-radius: 14px; color: var(--ink); margin-bottom: 1px;
  transition: background var(--fast) var(--ease); }
.conv::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--ch); opacity: .55; }
.conv:hover { background: var(--surface); text-decoration: none; }
.conv.on { background: color-mix(in srgb, var(--ch) 13%, var(--surface)); }
.conv.on::before, .conv.unread::before { opacity: 1; width: 4px; }
.conv .avatar { background: color-mix(in srgb, var(--ch) 30%, var(--surface-2)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ch) 55%, transparent); }
.conv.ch-fb .avatar { background: color-mix(in srgb, #0866FF 26%, var(--surface-2)); }
.conv.on .avatar .ch { border-color: var(--surface); }
.conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.who { flex: 1; min-width: 0; font-weight: 700; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .when { font-size: .72rem; color: var(--muted); flex: none; }
.conv.unread .when { color: var(--ch-ink); font-weight: 700; }
.snippet { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.snippet b { color: var(--ink-2); font-weight: 600; }
.snippet mark { background: var(--brand-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.hit-count { display: block; color: var(--brand-ink); font-size: .76rem; font-weight: 600; }
.conv.unread .who { font-weight: 800; } .conv.unread .snippet { color: var(--ink-2); }
.conv-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; min-height: 20px; }
.src { display: inline-flex; align-items: center; gap: 5px; max-width: 190px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: .72rem; font-weight: 800;
  color: var(--ch-ink); background: color-mix(in srgb, var(--ch) 15%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src .ch-glyph { width: 13px; height: 13px; }
.who-owns { margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3);
  color: var(--ink-2); font: 800 .66rem/1 var(--f-display); }
.unread-dot { display: none; }
.list-empty { padding: 48px 26px; text-align: center; color: var(--muted); }
.more-btn { display: block; margin: 4px 16px 18px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-strong); text-align: center;
  font-weight: 700; font-size: .84rem; color: var(--ink-2); }
.more-btn:hover { text-decoration: none; background: var(--surface); }
.more-btn.loading { opacity: .6; pointer-events: none; }
.inbox-col.loading .conv-scroll { opacity: .55; transition: opacity var(--fast) var(--ease); }
.demo-ribbon { position: fixed; z-index: 90; top: 0; inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 24px); padding: 3px 14px;
  border-radius: 0 0 10px 10px; background: #F7C365; color: #2A1E00; font: 800 .72rem/1.5 var(--f-body); letter-spacing: .02em; text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); pointer-events: none; }
.list-empty b { display: block; color: var(--ink); font-family: var(--f-display); margin-bottom: 4px; }
.empty-art { display: block; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--brand-soft) no-repeat center / 28px
  url("brand/empty-inbox.svg"); }

.conv-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.pane-empty { display: grid; place-items: center; padding: 24px; background:
  radial-gradient(70% 55% at 50% 100%, rgba(136, 92, 246, .12), transparent 70%), var(--bg); }
.pick { text-align: center; max-width: 560px; width: 100%; color: var(--muted); }
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; text-align: start; }
.work-item { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.work-item b { font: 800 1.5rem/1.1 var(--f-latin); }
.work-item span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.work-item.hot b { color: var(--bad); }
.work-item:hover { text-decoration: none; border-color: var(--border-strong); }
.resume { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 8px 14px; border-radius: 12px; background: var(--brand-tint);
  border: 1px solid var(--brand-soft); color: var(--ink); font-weight: 700; font-size: .86rem; max-width: 100%; }
.resume span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume .ico { width: 17px; height: 17px; color: var(--brand-ink); }
.resume:hover { text-decoration: none; }
.pick-art { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; background: var(--navy);
  box-shadow: 0 0 0 1px var(--border), 0 18px 44px rgba(136, 92, 246, .3); margin-bottom: 18px; }
.pick h2 { font-size: 1.25rem; }
.pick-keys { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: .8rem; margin-top: 14px; }
.chat-head { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.chat-head::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--ch); opacity: .9; }
.conv-pane.ch-fb .chat-head::after { background: var(--fb-grad); }
.chat-head .avatar .ch { border-color: var(--surface); }
.who-block { min-width: 0; }
.who-block h1 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .78rem; }
.channel-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 7px; font-weight: 800; font-size: .72rem;
  background: color-mix(in srgb, var(--ch) 16%, transparent); color: var(--ch-ink); }
.channel-badge .ch-glyph { width: 13px; height: 13px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.back-btn { display: none; }
.conv-pane > .notice, .conv-pane > .flash { margin: 10px 20px 0; }
.subject-line { margin: 0; padding: 14px 5% 0; font-size: 1.1rem; background: var(--chat-bg-mail, transparent); }

.composer { padding: 10px 20px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.composer-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.via { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .74rem; }
.via .ch-glyph { width: 13px; height: 13px; }
.compose-form { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 4px 6px 6px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.compose-form:focus-within { border-color: color-mix(in srgb, var(--ch, var(--brand)) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch, var(--brand)) 18%, transparent); }
.compose-form.note { background: var(--note); border-color: var(--note-line); }
.compose-form textarea { border: 0; background: transparent !important; box-shadow: none !important; min-height: 40px; max-height: 220px; resize: none; padding: 9px 10px 2px; }
.compose-bar { display: flex; align-items: center; gap: 4px; }
.att-pick { position: relative; overflow: hidden; }
.att-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.att-name { font-size: .76rem; color: var(--brand-ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.saved-pick { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px; border-radius: 11px; color: var(--ink-2); cursor: pointer; }
.saved-pick:hover { background: var(--surface-2); }
.saved-pick select { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; padding: 0; }
.saved-pick::after { content: "ردود محفوظة"; font-size: .78rem; font-weight: 700; }
.saved-pick .ico { width: 17px; height: 17px; }
.btn.primary.send { min-height: 40px; border-radius: 12px; background: var(--ch, var(--brand)); box-shadow: 0 6px 16px color-mix(in srgb, var(--ch, var(--brand)) 35%, transparent); }
.conv-pane.ch-fb .btn.send { background: var(--fb-grad); }
.conv-pane.ch-wa .btn.send { color: #05301C; }
.btn.primary.send:hover { filter: brightness(1.06); background: var(--ch, var(--brand)); }

.details { display: none; flex-direction: column; min-height: 0; background: var(--bg-2); border-inline-start: 1px solid var(--line); }
.details-open .details { display: flex; }
.details-head { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.details-head h2 { margin: 0; }
.details-body { overflow-y: auto; padding: 6px 18px 28px; }
.d-sec { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.d-sec:last-child { border-bottom: 0; }
.d-sec h3 { margin: 0; }
.d-sec h3 .ico, .d-sec h3 .ch-glyph { width: 16px; height: 16px; color: var(--muted); }
.d-sec p { margin: 0; font-size: .86rem; }
.person { display: flex; align-items: center; gap: 12px; }
.person b { display: block; } .person small { font-size: .8rem; }
.inline-row { display: flex; gap: 6px; }
.inline-row > :is(input, select) { flex: 1; min-width: 0; min-height: 36px; padding-block: 6px; font-size: .86rem; }
.js [data-autosubmit] button { display: none; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: .86rem; }
.mini-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row:hover { text-decoration: none; background: var(--surface-2); }
.draft { padding: 10px 12px; border-radius: 12px; background: var(--brand-tint); border: 1px dashed var(--brand-line); font-size: .88rem; white-space: pre-wrap; }
.tpl { display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface); }

/* ---------------------------------------------------------------- 6 chat, styled like each channel's own app */
.timeline { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 6%;
  --chat-bg: var(--bg); --bub-in: var(--surface-2); --bub-in-ink: var(--ink); --bub-out: var(--brand); --bub-out-ink: #fff;
  --bub-meta: var(--muted); --bub-out-meta: rgba(255, 255, 255, .78); --bub-shadow: 0 1px 1px rgba(0, 0, 0, .18); --chat-wall: none;
  background: var(--chat-wall), var(--chat-bg); }
.day-sep { display: flex; justify-content: center; margin: 14px 0 10px; position: sticky; top: 4px; z-index: 1; }
.day-sep span { padding: 3px 12px; border-radius: 9px; font-size: .72rem; font-weight: 700; background: var(--day-bg, var(--surface-3)); color: var(--day-ink, var(--ink-2));
  box-shadow: var(--bub-shadow); }
.bubble-row { display: flex; margin: 3px 0; }
.bubble-row.out { justify-content: flex-end; }
.bubble-row.in + .bubble-row.out, .bubble-row.out + .bubble-row.in { margin-top: 10px; }
.bubble { max-width: min(68%, 560px); padding: 7px 12px 5px; border-radius: 16px; background: var(--bub-in); color: var(--bub-in-ink);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.55; box-shadow: var(--bub-shadow); }
.bubble-row.in .bubble { border-start-start-radius: 5px; }
.bubble-row.out .bubble { border-start-end-radius: 5px; }
.bubble-row.out .bubble.sent { background: var(--bub-out); color: var(--bub-out-ink); }
.bubble-row.out .bubble.sent a { color: inherit; text-decoration: underline; }
.bubble-row.out .bubble.sent .meta { color: var(--bub-out-meta); }
.bubble.pending { border: 1px dashed var(--brand-line); background: var(--brand-tint); color: var(--ink); box-shadow: none; }
.bubble.problem { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); box-shadow: none; }
.bubble.bad { background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--ink); box-shadow: none; }
.bubble .meta { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 2px; font-size: .68rem; color: var(--bub-meta); white-space: normal; }
.bubble .meta .pill { height: 18px; padding: 0 7px; font-size: .64rem; background: rgba(0, 0, 0, .16); color: inherit; }
.bubble .meta .pill.bad { background: var(--bad-soft); color: var(--bad); }
.bubble-row.in .bubble .meta { justify-content: flex-start; }
.att { display: block; margin: 2px 0 6px; white-space: normal; }
.att-img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 12px; object-fit: cover; background: rgba(0, 0, 0, .2); }
.att-file { display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .16); color: inherit; max-width: 100%; }
:root[data-theme="light"] .att-file { background: rgba(16, 19, 45, .06); }
.att-file:hover { text-decoration: none; filter: brightness(1.08); }
.att-file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: isolate; font-family: var(--f-latin); font-size: .84rem; font-weight: 600; }
.att-file small { flex: none; color: inherit; opacity: .7; font-family: var(--f-latin); }
.note-row { margin: 12px auto; max-width: 78%; padding: 9px 14px; border-radius: 12px; background: var(--note); border: 1px dashed var(--note-line);
  color: var(--ink); font-size: .88rem; white-space: pre-wrap; }
.note-tag { display: inline-block; font-size: .68rem; font-weight: 800; color: var(--note-ink); margin-inline-end: 8px; }
.note-row .meta { font-size: .7rem; color: var(--note-ink); margin-top: 3px; }
.timeline > .empty { margin-top: 18%; }

/* WhatsApp: deep green-grey wall with a doodle texture, teal-green outgoing */
.timeline.ch-wa { --chat-bg: #0B141A; --bub-in: #202C33; --bub-in-ink: #E9EDEF; --bub-out: #005C4B; --bub-out-ink: #E9EDEF;
  --bub-meta: #8696A0; --bub-out-meta: rgba(233, 237, 239, .62); --day-bg: #182229; --day-ink: #8696A0; --bub-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  --chat-wall: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .028) 0 1.5px, transparent 2px) 0 0 / 26px 26px; }
:root[data-theme="light"] .timeline.ch-wa { --chat-bg: #EFEAE2; --bub-in: #FFFFFF; --bub-in-ink: #111B21; --bub-out: #D9FDD3; --bub-out-ink: #111B21;
  --bub-meta: #667781; --bub-out-meta: #667781; --day-bg: #FFFFFF; --day-ink: #54656F;
  --chat-wall: radial-gradient(circle at 20% 30%, rgba(17, 27, 33, .05) 0 1.5px, transparent 2px) 0 0 / 26px 26px; }
/* Telegram: night-blue wall, steel-blue outgoing; light = soft blue-green wall, pale green outgoing */
.timeline.ch-tg { --chat-bg: #0E1621; --bub-in: #182533; --bub-in-ink: #F5F5F5; --bub-out: #2B5278; --bub-out-ink: #F5F5F5;
  --bub-meta: #6D7F8F; --bub-out-meta: #7DA8D3; --day-bg: rgba(24, 37, 51, .9); --day-ink: #CFD8DC;
  --chat-wall: linear-gradient(160deg, rgba(34, 158, 217, .07), transparent 45%, rgba(34, 158, 217, .05)); }
:root[data-theme="light"] .timeline.ch-tg { --chat-bg: #CFE3EE; --bub-in: #FFFFFF; --bub-in-ink: #000; --bub-out: #EFFDDE; --bub-out-ink: #000;
  --bub-meta: #8C99A3; --bub-out-meta: #4FA052; --day-bg: rgba(83, 122, 98, .5); --day-ink: #fff;
  --chat-wall: linear-gradient(160deg, #D6E9D2 0%, #CFE3EE 50%, #D8E3F4 100%); }
.timeline.ch-tg .bubble { border-radius: 14px; }
/* Messenger: plain wall, round bubbles, the blue-violet gradient outgoing */
.timeline.ch-fb { --chat-bg: #101114; --bub-in: #303030; --bub-in-ink: #E4E6EB; --bub-out: var(--fb-grad); --bub-out-ink: #fff;
  --bub-meta: #8A8D91; --bub-out-meta: rgba(255, 255, 255, .82); --bub-shadow: none; --day-bg: transparent; --day-ink: #8A8D91; }
:root[data-theme="light"] .timeline.ch-fb { --chat-bg: #FFFFFF; --bub-in: #F0F0F0; --bub-in-ink: #050505; --bub-meta: #65676B; --day-ink: #65676B; }
.timeline.ch-fb .bubble { border-radius: 20px; }
/* SMS: the phone-messages look, rounded and flat */
.timeline.ch-sms { --chat-bg: #0B0F14; --bub-in: #26292F; --bub-in-ink: #ECEFF4; --bub-out: #0D9488; --bub-out-ink: #F0FDFA; --bub-meta: #8B93A1;
  --bub-shadow: none; --day-bg: transparent; --day-ink: #8B93A1; }
:root[data-theme="light"] .timeline.ch-sms { --chat-bg: #FFFFFF; --bub-in: #E9E9EB; --bub-in-ink: #111; --bub-out: #0F9D8E; --bub-out-ink: #fff; --bub-meta: #6B7280; }
.timeline.ch-sms .bubble { border-radius: 20px; }
/* Web chat: the Hobe Inbox look itself */
.timeline.ch-web { --chat-wall: radial-gradient(90% 60% at 50% 115%, rgba(136, 92, 246, .14), transparent 70%); --bub-out: linear-gradient(135deg, #9A72F8, #7444EE); }
:root[data-theme="light"] .timeline.ch-web { --chat-bg: #F7F5FE; --bub-in: #FFFFFF; --bub-in-ink: var(--ink); --bub-shadow: 0 1px 2px rgba(16, 19, 45, .08); }
/* E-mail: letters on a desk, not bubbles */
.timeline.ch-mail { --chat-bg: var(--bg); padding: 16px 5%; }
:root[data-theme="light"] .timeline.ch-mail { --chat-bg: #F1F2F7; }
.timeline.ch-mail .bubble-row { display: block; margin: 0 0 12px; }
.timeline.ch-mail .bubble { max-width: none; width: 100%; border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.timeline.ch-mail .bubble-row.out .bubble.sent { background: var(--surface); color: var(--ink); border-inline-start: 3px solid var(--c-mail); }
.timeline.ch-mail .bubble-row.out .bubble.sent .meta, .timeline.ch-mail .bubble .meta { color: var(--muted); padding: 0 18px 10px; }
.timeline.ch-mail .bubble-row.out .bubble.sent a { color: var(--brand-ink); }
.letter-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.letter-head .from { font-weight: 800; }
.letter-head .addr { color: var(--muted); font-size: .8rem; direction: ltr; unicode-bidi: isolate; font-family: var(--f-latin); }
.letter-head .when { margin-inline-start: auto; color: var(--muted); font-size: .76rem; }
.letter-body { padding: 14px 18px 10px; font-size: .93rem; line-height: 1.8; }
.timeline.ch-mail .att { margin: 0 18px 10px; display: inline-flex; }
.timeline.ch-mail .att-file { background: var(--surface-2); }
.timeline.ch-mail .day-sep { display: none; }

/* ---------------------------------------------------------------- 7 pages */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--brand); }
.welcome h1 { font-size: 1.2rem; }
.welcome p { margin: 2px 0 0; color: var(--ink-2); }
.dlg { width: min(480px, calc(100% - 32px)); padding: 0; border-radius: var(--r-l); border: 1px solid var(--border); background: var(--raised); color: var(--ink);
  box-shadow: var(--shadow-pop); }
.dlg::backdrop, .lightbox::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.dlg form { padding: 18px 20px 20px; }
.dlg header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dlg header h2 { margin: 0; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.lightbox { max-width: min(92vw, 1100px); max-height: 92vh; padding: 12px; border: 0; border-radius: 16px; background: #05070F; display: none; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(92vh - 80px); border-radius: 10px; object-fit: contain; }
.lb-x { position: absolute; top: 8px; inset-inline-end: 8px; color: #fff; background: rgba(0, 0, 0, .5); font-size: 1.3rem; }
.low-density { margin: 14px 4px 0; color: var(--muted); font-size: .84rem; }
.grid { align-items: stretch; } .grid > .card, .grid > section, .grid > a { height: 100%; margin: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.pick-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 118px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-align: center; }
.pick-tile .lg { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ch); }
.pick-tile.ch-fb .lg { background: var(--fb-grad); }
.pick-tile .lg .ch-glyph { width: 26px; height: 26px; color: #fff; }
.pick-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--ch) 50%, var(--line)); }
.pick-tile.on { border-color: var(--ch); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ch) 35%, transparent); background: color-mix(in srgb, var(--ch) 10%, var(--surface)); }
.pick-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: stretch; }
.pick-opt { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.pick-opt.off { opacity: .62; }
.po-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-opt p { margin: 0; color: var(--muted); font-size: .86rem; }
.po-req summary { font-size: .8rem; font-weight: 700; color: var(--brand-ink); }
.po-req ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: .8rem; color: var(--muted); }
.po-act { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.hero { position: relative; overflow: hidden; border-radius: var(--r-l); padding: 26px 28px; margin-bottom: 18px; border: 1px solid var(--border);
  background: radial-gradient(120% 120% at 0% 120%, rgba(136, 92, 246, .30), transparent 55%), linear-gradient(160deg, #161D52 0%, var(--surface) 60%); }
:root[data-theme="light"] .hero { background: radial-gradient(120% 120% at 0% 120%, rgba(136, 92, 246, .16), transparent 55%), linear-gradient(160deg, #FFFFFF 0%, #F3EEFE 100%); }
.hero h1 { font-size: 1.65rem; margin: 6px 0 4px; }
.hero .row { margin-top: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.kpi:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.kpi .n { font: 800 1.9rem/1.1 var(--f-latin); }
.kpi .l { color: var(--muted); font-size: .84rem; font-weight: 700; }
.kpi.hot .n { color: var(--bad); }
.dash { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; }
.sec-head.pad { padding: 12px 12px 4px; }
.views.bare { border: 0; padding: 0; }
.t td .sub { color: var(--muted); font-weight: 500; font-size: .8rem; }
.card.flush { padding: 8px; }
.card.flush .conv-list { padding: 0; }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fam-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.fam-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--ch) 45%, var(--line)); }
.fam-tile .top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fam-tile .lg { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ch); }
.fam-tile.ch-fb .lg { background: var(--fb-grad); }
.fam-tile .lg .ch-glyph { width: 20px; height: 20px; color: #fff; }
.fam-tile .nm { font-weight: 800; }
.fam-tile .n { font: 800 1.2rem/1 var(--f-latin); }
.fam-tile.st-none { opacity: .72; } .fam-tile.st-none .lg { background: var(--surface-3); } .fam-tile.st-none .lg .ch-glyph { color: var(--muted); }

.chan-groups { display: grid; gap: 22px; }
.chan-fam { display: grid; gap: 10px; }
.chan-fam-head { display: flex; align-items: center; gap: 12px; }
.chan-fam-head .lg { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ch); flex: none; }
.chan-fam-head.ch-fb .lg { background: var(--fb-grad); }
.chan-fam-head .lg .ch-glyph { width: 22px; height: 22px; color: #fff; }
.chan-fam-head h2 { margin: 0; }
.chan-fam-head.st-none .lg { background: var(--surface-3); } .chan-fam-head.st-none .lg .ch-glyph { color: var(--muted); }
.chan-rows { display: grid; gap: 8px; }
.chan-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, .8fr) minmax(0, .8fr) auto; align-items: center; gap: 16px; padding: 14px 18px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chan-row:hover { text-decoration: none; border-color: color-mix(in srgb, var(--ch) 40%, var(--line)); }
.chan-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-row small { color: var(--muted); font-size: .8rem; }
.chan-row .metric { text-align: center; font-size: .78rem; color: var(--muted); }
.chan-row .metric b { font: 800 1rem/1.3 var(--f-latin); color: var(--ink); }
.chan-row .go { color: var(--muted); }
.chan-empty { padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: .86rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; }
.prio i { width: 8px; height: 8px; border-radius: 2px; background: var(--muted-2); }
.prio.urgent { color: var(--bad); } .prio.urgent i { background: var(--bad); } .prio.high { color: var(--warn); } .prio.high i { background: var(--warn); }
.prio.normal i { background: var(--info); } .prio.low { color: var(--muted); }
.new-ticket { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.new-ticket input { flex: 1; min-width: 200px; }
.new-ticket select { width: auto; min-width: 130px; }

/* shared page components: tiles (equal height numbers), panels (titled box, table flush), master-detail (one item at a time) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; align-items: stretch; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 96px; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--tile, var(--border-strong)); color: var(--ink); }
a.tile:hover { text-decoration: none; border-color: var(--border-strong); }
.tile .t-l { color: var(--muted); font-size: .8rem; font-weight: 700; }
.tile .t-v { font: 800 1.45rem/1.15 var(--f-latin); overflow-wrap: anywhere; }
.tile .t-v.txt { font: 800 1.05rem/1.35 var(--f-display); }
.tile small { color: var(--muted); font-size: .76rem; }
.tile.ok { --tile: var(--ok); } .tile.warn { --tile: var(--warn); } .tile.bad { --tile: var(--bad); } .tile.info { --tile: var(--info); }
.tile.ok .t-v.txt { color: var(--ok); } .tile.bad .t-v.txt, .tile.bad .t-v { color: var(--bad); } .tile.warn .t-v.txt { color: var(--warn); }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.panels.one { grid-template-columns: minmax(0, 1fr); }
.panel { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.panel + .panel { margin-top: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); }
.panel-h h2 { margin: 0; font-size: .98rem; }
.panel-h .meta { color: var(--muted); font-size: .78rem; }
.panel-b { padding: 16px; }
.panel .t th { background: transparent; }
.panel .empty { padding: 22px 16px; }
.stack-16 > * + * { margin-top: 16px; }
.dot-st { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; }
.dot-st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot-st.ok { color: var(--ok); } .dot-st.bad { color: var(--bad); } .dot-st.warn { color: var(--warn); } .dot-st.grey { color: var(--muted); }
.md-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.md-item { flex: none; display: flex; flex-direction: column; gap: 4px; min-width: 150px; padding: 10px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .86rem; cursor: pointer; text-align: start; font-family: var(--f-body); }
.md-item small { font-weight: 700; font-size: .72rem; }
.md-item:hover { border-color: var(--border-strong); text-decoration: none; }
.md-item.on { border-color: var(--brand-line); background: var(--brand-tint); box-shadow: inset 0 -3px 0 var(--brand); }
.md-item .s-ok { color: var(--ok); } .md-item .s-off { color: var(--muted); } .md-item .s-warn { color: var(--warn); }
.js .md-pane { display: none; } .js .md-pane.on { display: block; }
.md-body { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.md-form { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.md-form .field:last-of-type { margin-bottom: 12px; }
.howto { padding: 16px; border-radius: var(--r); background: var(--bg-2); border: 1px dashed var(--border); font-size: .86rem; color: var(--ink-2); }
.howto h3 { margin: 0 0 8px; }
.howto ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.copy-row span { font-size: .76rem; color: var(--muted); flex: none; }
.copy-row code { flex: 1; min-width: 0; background: none; padding: 0; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: .82rem; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.form-row .field { margin: 0; }
.form-narrow { max-width: 640px; }

.meter { width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-3); appearance: none; }
.meter::-webkit-progress-bar { background: var(--surface-3); border-radius: 8px; }
.meter::-webkit-progress-value { background: var(--brand); border-radius: 8px; }
.meter::-moz-progress-bar { background: var(--brand); border-radius: 8px; }
.checklist { list-style: none; margin: 0; padding: 6px 0; }
.ck { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.ck:last-child { border-bottom: 0; }
.ck-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-3); color: var(--muted); }
.ck.ok .ck-mark { background: var(--ok-soft); color: var(--ok); } .ck.warn .ck-mark { background: var(--warn-soft); color: var(--warn); }
.ck.bad .ck-mark { background: var(--bad-soft); color: var(--bad); }
.ck b { display: block; font-size: .9rem; } .ck small { display: block; color: var(--muted); font-size: .78rem; }
.steps { margin: 0; padding: 14px 16px 14px 16px; padding-inline-start: 36px; display: grid; gap: 10px; }
.steps li b { display: block; font-size: .9rem; } .steps li span { color: var(--muted); font-size: .82rem; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }

/* customers */
.cust-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 90px 110px minmax(0, 2fr) 80px; gap: 12px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid var(--line); text-align: center; }
.cust-row:last-child { border-bottom: 0; }
.cust-row.head { background: var(--bg-2); font-size: .74rem; font-weight: 700; color: var(--muted); padding-block: 12px; }
.cust-row input { min-height: 36px; padding-block: 6px; font-size: .86rem; text-align: center; }
.link-form { min-width: 260px; }
.lk-who { justify-content: center; }
.page-find { padding: 0; max-width: 560px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.lk-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1.2; }
.lk-who .avatar { background: var(--ch); } .lk-who .avatar .ch-glyph { color: #fff; width: 17px; height: 17px; }
.link-row.ch-fb .lk-who .avatar { background: var(--fb-grad); }
.lk-who bdi { display: block; font-weight: 700; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-who small { display: block; font-size: .74rem; }
.lk-who > span:last-child { min-width: 0; }
.link-row input { flex: 1; min-width: 0; min-height: 36px; }

/* ---------------------------------------------------------------- 8 responsive */
@media (max-width: 1440px) {
  :root { --list: 360px; --details: 330px; }
  .has-conv.details-open .workspace { grid-template-columns: var(--list) minmax(0, 1fr); }
  .details { position: absolute; inset-block: 0; inset-inline-end: 0; width: var(--details); z-index: 15; box-shadow: var(--shadow-pop); }
}
@media (max-width: 1100px) {
  :root { --list: 300px; --rail: 76px; }
  .timeline { padding: 14px 3%; }
  .grid-4, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .head-actions .btn span, .head-actions .pill, .who-sub .muted, .composer-tabs .via { display: none; }
  .chan-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .chan-row .metric { display: none; }
}
@media (max-width: 760px) {
  .rail { width: 280px; transform: translateX(100%); transition: transform var(--std) var(--ease); align-items: stretch; padding: 18px 14px;
    box-shadow: var(--shadow-pop); z-index: 50; }
  .nav-open .rail { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 45; }
  .rail-mark { margin: 0 0 6px; }
  .rail-head { display: flex; flex-direction: column; padding: 0 4px 10px; }
  .rail-head small { color: var(--muted); }
  .rail-head .env-badge { align-self: flex-start; margin-top: 6px; }
  .rail-group a { flex-direction: row; gap: 12px; padding: 10px 12px; font-size: .9rem; text-align: start; }
  .rail-foot { flex-direction: row; justify-content: space-between; }
  .me-menu { inset-inline-start: auto; inset-inline-end: 14px; bottom: 70px; }
  .main { margin-inline-start: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; min-height: 60px; }
  .topbar h1 { font-size: 1.12rem; }
  .content { padding: 16px 16px 32px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pick-tile { height: 96px; }
  .panels, .md-body { grid-template-columns: minmax(0, 1fr); }
  .cust-row { grid-template-columns: minmax(0, 1fr) 70px; } .cust-row > :nth-child(n+3):not(button):not(input[name=csrf]) { display: none; }
  .cust-row.head > :nth-child(n+3) { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; } .kpi .n { font-size: 1.6rem; }
  .hero { padding: 20px; } .hero h1 { font-size: 1.3rem; }
  .card { padding: 16px; }
  .hide-m { display: none; }
  .bottom-nav { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 40; height: calc(62px + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    font-size: .68rem; font-weight: 700; border-radius: 12px; }
  .bottom-nav a.on { color: var(--brand-ink); }
  .bottom-nav a .ico { width: 22px; height: 22px; }
  .views a { height: 40px; } .acct { height: 40px; } .icon-btn { width: 44px; height: 44px; }
  .demo-ribbon { font-size: .64rem; }
  .bottom-nav a:hover { text-decoration: none; }
  .ws-page .main { padding-bottom: 0; }
  .ws-page.no-conv .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .workspace, .has-conv.details-open .workspace { grid-template-columns: minmax(0, 1fr); }
  .ws-page.no-conv .conv-pane { display: none; }
  .ws-page.has-conv .inbox-col { display: none; }
  .ws-page.has-conv .bottom-nav { display: none; }
  .inbox-col { border: 0; background: var(--bg); }
  .col-head { padding: 12px 14px 4px; }
  .switcher { padding: 6px 8px 10px; gap: 2px; }
  .conv { padding: 12px 10px; }
  .back-btn { display: inline-grid; margin-inline-start: -8px; }
  .chat-head { padding: 8px 12px; min-height: 62px; gap: 10px; }
  .chat-head .avatar.lg { width: 40px; height: 40px; }
  .head-actions .pill { display: none; }
  .who-sub .muted { display: none; }
  .timeline { padding: 12px 10px; }
  .bubble { max-width: 84%; }
  .composer { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
  .composer-tabs .via, .compose-bar .muted { display: none; }
  .details { position: fixed; inset: 0; width: auto; z-index: 60; }
  .chan-row { padding: 12px 14px; gap: 10px; }
  .t th, .t td { padding: 10px 8px; }
}
@media (min-width: 761px) { .ws-page .bottom-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }
