/* CrewLink, styled to the BermudAir Brand Guidelines (February 2026).
   Colour: Deep Sea Blue and Ocean Blue (primary, with their tints and Sky Blue);
   Bermuda Pink and Swizzle Orange only to draw attention (urgent, waiting, delays).
   Type: Open Sauce Sans for everything; Kepler (Georgia fallback, per the guidelines)
   for display headlines. Icons: outlined, flat. */

@font-face { font-family: "Open Sauce Sans"; src: url("/fonts/open-sauce-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sauce Sans"; src: url("/fonts/open-sauce-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Open Sauce Sans"; src: url("/fonts/open-sauce-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Open Sauce Sans"; src: url("/fonts/open-sauce-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Brand palette */
  --deep-sea: #125891;
  --deep-sea-70: #5a8ab2;
  --deep-sea-50: #88abc8;
  --deep-sea-30: #b7cdde;
  --deep-sea-15: #dce6ef;
  --ocean: #12d4d9;
  --ocean-70: #5ae1e4;
  --ocean-30: #b7f2f4;
  --ocean-15: #dcf9f9;
  --sky: #d0f6f7;
  --pink: #ee3890;
  --pink-15: #fce1ee;
  --orange: #ff8500;
  --orange-30: #ffdab2;
  --orange-15: #ffedd9;

  --font: "Open Sauce Sans", Arial, sans-serif;
  --display: "Kepler Std", Kepler, Georgia, serif;

  /* Day theme roles */
  --brand: var(--deep-sea);          /* fills: header, primary buttons */
  --brand-ink: var(--deep-sea);      /* brand-coloured text */
  --accent: var(--ocean);            /* the 'A': active tab, online, highlights */
  --head-bg: var(--deep-sea);
  --bg: var(--deep-sea-15);
  --panel: #ffffff;
  --panel-2: #f2f6fa;
  --line: #d6e2ec;
  --ink: #0f2a44;
  --ink-2: #48657f;
  --ink-3: #7a91a6;
  --mine: var(--sky);
  --theirs: #ffffff;
  --chat-bg: var(--deep-sea-15);
  --chat-pattern: url("/brand/pattern-day.svg");
  --urgent: var(--pink);
  --urgent-bg: var(--pink-15);
  --warn: var(--orange);
  --warn-bg: var(--orange-15);
  --ok: #087a7e;                     /* Ocean Blue deepened for legible text on white */
  --read: var(--deep-sea);
  --sys: rgb(255 255 255 / 0.72);
  --shadow: 0 1px 2px rgb(18 88 145 / 0.10);
  --r: 14px;
  color-scheme: light;
}

/* Night: a dim Deep Sea palette for the flight deck. */
:root[data-theme="night"] {
  --brand: #1a6aa8;
  --brand-ink: var(--ocean-70);
  --accent: var(--ocean);
  --head-bg: #0b2138;
  --bg: #061526;
  --panel: #0b1f34;
  --panel-2: #091a2c;
  --line: #16324d;
  --ink: #d9e6f1;
  --ink-2: #8ea8bf;
  --ink-3: #5f7c96;
  --mine: #11436b;
  --theirs: #0f2a45;
  --chat-bg: #061526;
  --chat-pattern: url("/brand/pattern-night.svg");
  --urgent: #f05a9f;
  --urgent-bg: #3a1328;
  --warn: #ff9a33;
  --warn-bg: #3a2610;
  --ok: var(--ocean-70);
  --read: var(--ocean-70);
  --sys: rgb(15 42 69 / 0.85);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.note { font-size: 13px; color: var(--ink-3); }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ logo lockup
   BermudAir wordmark with the "CrewLink" qualifier left-aligned below in Ocean Blue,
   as the guidelines specify for internal efforts. */

.lockup { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.lockup .wordmark { display: block; height: 17px; width: auto; }
.lockup .qualifier { color: var(--ocean); font-weight: 600; font-size: 14px; letter-spacing: 0.01em; }
.lockup.large .wordmark { height: 30px; }
.lockup.large .qualifier { font-size: 24px; }

.tailfin { display: block; flex: none; height: 5px; background: url("/brand/tailfin-strip.jpg") left center / auto 36px repeat-x; }
:root[data-theme="night"] .tailfin { opacity: 0.55; }

/* ------------------------------------------------------------------ layout */

.app {
  display: grid;
  grid-template-columns: minmax(300px, 370px) 1fr;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background: var(--head-bg);
}
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chat-bg) var(--chat-pattern); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app.detail .sidebar { display: none; }
  .app:not(.detail) .main { display: none; }
}
@media (min-width: 761px) {
  .back { display: none !important; }
}

/* ------------------------------------------------------------------ sidebar */

.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; background: var(--head-bg); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; }
.conn { margin-left: auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgb(255 255 255 / 0.12); white-space: nowrap; }
.conn.online::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ocean); vertical-align: 1px; }
.conn.offline, .conn.reconnecting, .conn.connecting { background: var(--orange); color: #1d1300; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; }

.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel); }
.tab { flex: 1; border: 0; background: none; padding: 13px 8px 11px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--accent); }

.side-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.side-tools .search {
  flex: 1 1 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 99px;
  padding: 9px 16px;
  font: inherit;
}
.side-tools .search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.list-section { padding: 16px 16px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.row:hover { background: var(--panel-2); }
.row.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); box-shadow: inset 3px 0 0 var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-top, .row-bottom { display: flex; align-items: baseline; gap: 8px; }
.row-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-preview { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread .row-time { color: var(--brand-ink); font-weight: 700; }
.row.unread .row-preview { color: var(--ink); }

.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.badge.urgent { background: var(--urgent); }
.tab .badge { margin-left: 4px; }

.notify-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--warn-bg); border-bottom: 1px solid var(--line); font-size: 14px; }
.notify-banner .nb-icon { color: var(--warn); display: grid; }
.notify-banner .nb-icon svg { width: 22px; height: 22px; }
.head-link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; }
.head-link:hover { background: rgb(255 255 255 / 0.14); }
.head-link svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ avatars */

.avatar { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--deep-sea); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.xs { width: 28px; height: 28px; font-size: 11px; }
.avatar svg { width: 52%; height: 52%; }
.avatar.role-CC { background: var(--ocean); color: var(--deep-sea); }
.avatar.role-OCC, .avatar.kind-desk-OCC { background: var(--orange); color: #1d1300; }
.avatar.role-MCC, .avatar.kind-desk-MCC { background: var(--pink); color: #fff; }
.avatar.role-MGMT, .avatar.kind-broadcast { background: var(--deep-sea-70); color: #fff; }
.avatar.role-ENG { background: var(--pink-15); color: #9b1457; box-shadow: inset 0 0 0 2px var(--pink); }
.avatar.kind-flight { background: var(--deep-sea); color: var(--ocean); }
.avatar.kind-group { background: var(--deep-sea-30); color: var(--deep-sea); }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--panel); background: var(--ocean); }
.side-head .avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / 0.8); }

.role-tag { display: inline-block; padding: 0 6px; border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; line-height: 18px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); vertical-align: 1px; }

/* ------------------------------------------------------------------ buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); color: var(--brand-ink); font-weight: 600; }
.btn:hover { border-color: var(--deep-sea-50); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.occ { border-color: var(--orange); color: var(--ink); }
.btn.occ::before, .btn.mcc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.btn.mcc { border-color: var(--pink); color: var(--ink); }
.btn.mcc::before { background: var(--pink); }
.btn .btn-icon { display: grid; }
.btn .btn-icon svg { width: 18px; height: 18px; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.side-tools .btn { flex: 1 1 auto; padding: 8px 10px; font-size: 14px; white-space: nowrap; }

.icon-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--brand-ink); }
.icon-btn svg { width: 24px; height: 24px; }

.chip { border: 1.5px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 99px; padding: 5px 13px; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
#urgentBtn[aria-pressed="true"] { background: var(--urgent); border-color: var(--urgent); }

/* ------------------------------------------------------------------ conversation */

.conv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.conv-title { flex: 1; min-width: 0; }
.conv-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub .typing { color: var(--ok); font-weight: 600; }

.flight-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.flight-strip b { color: var(--brand-ink); }

.messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 4% 16px; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: center; margin: 12px 0 6px; padding: 3px 12px; border-radius: 99px; background: var(--sys); color: var(--ink-2); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.sys-msg { align-self: center; max-width: 80%; margin: 6px 0; padding: 7px 14px; border-radius: 12px; background: var(--sys); color: var(--ink-2); font-size: 13px; text-align: center; box-shadow: var(--shadow); }
.sys-msg time { display: block; font-size: 11px; color: var(--ink-3); }
.load-more { align-self: center; margin-bottom: 8px; }

.msg { max-width: min(78%, 620px); display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg.gap { margin-top: 8px; }
.bubble { position: relative; padding: 8px 11px 6px; border-radius: var(--r); background: var(--theirs); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.theirs.gap .bubble { border-top-left-radius: 4px; }
.mine .bubble { background: var(--mine); }
.mine.gap .bubble { border-top-right-radius: 4px; }
.sender { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.sender .role-tag { margin-left: 4px; }
.sender.role-CAPT, .sender.role-FO { color: var(--deep-sea); }
.sender.role-CC { color: var(--ok); }
.sender.role-OCC { color: #b35d00; }
.sender.role-MCC { color: #c21e6e; }
.sender.role-MGMT { color: var(--deep-sea-70); }
.sender.role-ENG { color: #9b1457; }
:root[data-theme="night"] .sender { color: var(--ocean-70) !important; }
.text { white-space: pre-wrap; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ticks { display: inline-flex; background: none; border: 0; padding: 0 0 0 2px; color: var(--ink-3); }
.ticks svg { width: 17px; height: 12px; }
.ticks.read { color: var(--read); }
.ticks.failed { color: var(--urgent); }

.msg.urgent .bubble { border-left: 4px solid var(--urgent); background: var(--urgent-bg); }
.flag { display: inline-block; margin-bottom: 3px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #fff; background: var(--urgent); }
.flag.ack { background: var(--warn); color: #1d1300; }
.ack-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13px; }
.ack-row .done { color: var(--ok); font-weight: 700; }
.ack-row .count { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 600; text-decoration: underline; }

.photo { display: block; margin: 2px -4px 4px; border-radius: 10px; max-width: 100%; max-height: 360px; object-fit: cover; cursor: zoom-in; background: var(--panel-2); }
.photo.pending { opacity: 0.6; }
.failed-note { font-size: 12px; color: var(--urgent); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.compose-opts { display: flex; gap: 8px; padding: 0 4px 8px; }
.compose-row { display: flex; align-items: flex-end; gap: 6px; }
#input { flex: 1; min-height: 44px; max-height: 180px; resize: none; padding: 11px 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--ink); font: inherit; line-height: 1.35; overflow-y: hidden; }
#input:focus { outline: none; border-color: var(--accent); }
.send-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; }
.send-btn svg { width: 21px; height: 21px; margin-left: -2px; }
.attach svg { width: 25px; height: 25px; }
.attach-preview { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px; font-size: 14px; color: var(--ink-2); }
.attach-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.read-only { padding: 14px; text-align: center; font-size: 14px; color: var(--ink-2); background: var(--panel); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ ops board */

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; border-radius: 99px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.side-tools .seg { flex: 1 1 45%; }
.ops-meta { flex: 1 1 100%; font-size: 12px; color: var(--ink-3); }
.ops-meta.err { color: var(--urgent); font-weight: 600; }

.route { font-weight: 700; }
.times { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.status { flex: none; display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--deep-sea-15); color: var(--deep-sea); }
.status.Boarding { background: var(--orange-30); color: #1d1300; }
.status.Airborne { background: var(--ocean-30); color: var(--deep-sea); }
.status.Landed { background: var(--panel-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.status.Delayed { background: var(--orange); color: #1d1300; }
.status.Cancelled { background: var(--pink); color: #fff; }
:root[data-theme="night"] .status:not(.Cancelled):not(.Delayed) { background: var(--panel-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="night"] .status.Airborne { color: var(--ocean-70); }
:root[data-theme="night"] .status.Boarding { color: var(--warn); }

.flight-view { flex: 1; overflow-y: auto; padding: 20px 4%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.fv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fv-head h2 { font-family: var(--display); font-weight: 500; font-size: 32px; color: var(--brand-ink); }
.fv-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.fv-route .apt { font-size: 36px; font-weight: 700; letter-spacing: 0.04em; color: var(--brand-ink); }
.fv-route .t { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fv-route .line { color: var(--accent); }
.fv-route .line svg { width: 34px; height: 34px; transform: rotate(45deg); }
.fv-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.fv-facts span { color: var(--ink-3); margin-right: 4px; }
.crew-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.crew-row:first-of-type { border-top: 0; }
.crew-row .grow { flex: 1; min-width: 0; }
.crew-row .note { font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ sign-in */

.login { height: 100dvh; overflow-y: auto; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; align-items: start; background: var(--panel); }
.login-hero { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: calc(40px + env(safe-area-inset-top)) 44px 60px; background: var(--deep-sea); color: #fff; }
.login-hero h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.08; color: var(--ocean); }
.login-hero p { margin: 18px 0 0; max-width: 420px; font-size: 17px; color: rgb(255 255 255 / 0.86); }
.login-hero .tailfin { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background-size: auto 36px; }
.login-body { padding: calc(36px + env(safe-area-inset-top)) 40px 40px; max-width: 760px; }
.login-body h2 { font-family: var(--display); font-weight: 500; font-size: 28px; color: var(--brand-ink); margin-bottom: 6px; }
.login-body > p { color: var(--ink-2); margin: 0 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; margin: 8px 0 24px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input { padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink); font: 16px var(--font); }
.field input:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.form-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--urgent-bg); color: var(--ink); font-size: 14px; border-left: 4px solid var(--urgent); }
.btn.wide { width: 100%; min-height: 48px; font-size: 16px; }
.link-btn { align-self: flex-start; text-align: left; border: 0; background: none; padding: 4px 0; color: var(--brand-ink); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.login-form .note { margin: -4px 0 0; }
details.demo { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
details.demo summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.demo-note { padding: 10px 14px; border-radius: 12px; background: var(--orange-15); color: #4a2a00; font-size: 14px; }
:root[data-theme="night"] .demo-note { background: var(--warn-bg); color: #ffd9ad; }
.login-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.login-grid .row { border: 1px solid var(--line); border-radius: 14px; min-height: 60px; }
.login-grid .row:hover { border-color: var(--accent); }
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { position: relative; height: auto; padding: calc(28px + env(safe-area-inset-top)) 24px 44px; gap: 24px; }
  .login-body { padding: 24px 16px 40px; }
}

/* ------------------------------------------------------------------ dialogs, toast, empty */

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgb(6 21 38 / 0.5); }
.dialog { width: min(520px, 100%); max-height: 85dvh; display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.3); overflow: hidden; }
.dialog > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.dialog > header h2 { flex: 1; font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--brand-ink); }
.dialog .body { padding: 12px 20px; overflow-y: auto; }
.dialog > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.dialog input[type="text"], .dialog input[type="search"] { width: 100%; margin-bottom: 8px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--panel-2); color: var(--ink); font: inherit; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--deep-sea); }
.pick .grow { flex: 1; }
.info-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-row .grow { flex: 1; }
.info-row .st { font-size: 13px; color: var(--ink-3); }
.info-row .st.read { color: var(--read); font-weight: 600; }
.info-row .st.ack { color: var(--ok); font-weight: 700; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lightbox { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgb(6 21 38 / 0.92); }
.lightbox img { max-width: 96vw; max-height: 92dvh; border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%); max-width: 90vw; padding: 11px 18px; border-radius: 99px; background: var(--deep-sea); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgb(6 21 38 / 0.3); }

/* ------------------------------------------------------------------ video calls */

.call-layer { position: fixed; inset: 0; z-index: 50; background: #061526; color: #fff; }
.avatar.xl { width: 104px; height: 104px; font-size: 36px; }
.call-incoming { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 35%, #125891 0%, #061526 70%); }
.call-card { text-align: center; }
.call-card h2 { margin: 22px 0 4px; font-family: var(--display); font-weight: 500; font-size: 34px; }
.call-card p { margin: 0; color: var(--ocean-70); font-size: 17px; }
.call-pulse { display: inline-grid; place-items: center; border-radius: 50%; animation: call-pulse 1.6s ease-out infinite; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 rgb(18 212 217 / 0.55); } 100% { box-shadow: 0 0 0 36px rgb(18 212 217 / 0); } }
.call-actions { display: flex; justify-content: center; gap: 56px; margin-top: 48px; }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; background: none; color: #fff; font-weight: 600; }
.call-btn span { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; }
.call-btn span svg { width: 32px; height: 32px; }
.call-btn.decline span { background: var(--pink); }
.call-btn.accept span { background: var(--ocean); color: var(--deep-sea); }

.call-view { position: absolute; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.call-view.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0.6; pointer-events: none; }
.call-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: calc(14px + env(safe-area-inset-top)) 20px 30px; background: linear-gradient(rgb(6 21 38 / 0.8), transparent); }
.call-title { font-size: 18px; }
.call-status { font-size: 14px; color: var(--ocean-70); font-variant-numeric: tabular-nums; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 4px; grid-template-columns: 1fr; }
.call-grid[data-count="2"], .call-grid[data-count="3"] { grid-template-columns: 1fr 1fr; }
.call-tile { position: relative; min-height: 0; background: #0b2138; overflow: hidden; }
.call-tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.call-name, .call-state { position: absolute; left: 12px; padding: 3px 10px; border-radius: 99px; background: rgb(6 21 38 / 0.7); font-size: 13px; font-weight: 600; }
.call-name { bottom: 110px; }
.call-state { top: 70px; color: var(--orange); }
.call-state:empty { display: none; }
.call-waiting { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-size: 17px; color: var(--ocean-70); }
.call-self { position: absolute; right: 16px; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 3; width: min(26vw, 220px); aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #0b2138; box-shadow: 0 6px 24px rgb(0 0 0 / 0.4); border: 2px solid rgb(255 255 255 / 0.25); }
.call-self video { width: 100%; height: 100%; object-fit: cover; }
.call-self.mirror video { transform: scaleX(-1); }
.call-self.off video { visibility: hidden; }
.call-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: center; gap: 14px; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgb(6 21 38 / 0.85)); }
.call-ctrl { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; }
.call-ctrl span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgb(255 255 255 / 0.16); backdrop-filter: blur(8px); }
.call-ctrl span svg { width: 26px; height: 26px; }
.call-ctrl small { font-size: 12px; font-weight: 600; opacity: 0.9; }
.call-ctrl[aria-pressed="true"] span { background: #fff; color: var(--deep-sea); }
.call-ctrl.end span { background: var(--pink); }
.call-launch { color: var(--brand-ink); }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--ink-2); }
.empty .a-mark { width: 84px; height: auto; }
.empty h2 { font-family: var(--display); font-weight: 500; font-size: 32px; color: var(--brand-ink); }
.empty p { max-width: 400px; margin: 0; }
.list-empty { padding: 24px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Sign in with Microsoft (Microsoft's button guidelines: logo + "Sign in with Microsoft") */
.ms-btn { gap: 10px; background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c; border-radius: 12px; text-decoration: none; font-weight: 600; }
.ms-btn:hover { background: #f3f3f3; border-color: #8c8c8c; }
.ms-logo { display: grid; }
.ms-logo svg { width: 20px; height: 20px; }
.login-form .or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.login-form .or::before, .login-form .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
