/* =====================================================================
   KSTU App — main stylesheet (mobile-first)
   ===================================================================== */

:root {
  /* Straight from the KSTU crest: navy #1D143F, gold #B29B1B, flame #D2251E */
  --navy-900:  #120C28;    /* darkest: management sidebar, call screen */
  --navy-800:  #17102F;
  --navy-700:  #1D143F;    /* THE brand navy — buttons, headings, top bars */
  --navy-500:  #342765;
  --navy-300:  #948DAD;
  --navy-200:  #D3D0DF;    /* wave fill — a cool tint of the crest navy */
  --navy-100:  #EAE8F1;
  --navy-50:   #F7F6FA;
  --gold:      #B29B1B;    /* THE brand gold — PROCEED / Activate */
  --gold-600:  #8E7B14;
  --gold-300:  #D8C866;
  --gold-100:  #F7F2DA;
  --flame:     #D2251E;    /* the torch, used for alerts and live dots */
  --paper:     #FFFDF8;
  --ink:       #1A1630;
  --muted:     #6B6486;
  --line:      #E2DFEC;
  --danger:    #C0261E;
  --danger-bg: #FBEBEA;
  --success:   #2E7D32;
  --success-bg:#E8F5E9;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(29, 20, 63, .12);
  --topbar-h:  128px;
  --navbar-h:  68px;
  --app-width: 480px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: #E7E4EF;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); }
button, input, select, textarea { font: inherit; }
.icon { width: 22px; height: 22px; flex: none; }
.icon-lg { width: 28px; height: 28px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phone-width column, centred on tablets/desktops */
.shell {
  position: relative;
  max-width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow-x: hidden;
}
@media (min-width: 520px) {
  .shell { box-shadow: 0 0 40px rgba(46, 15, 92, .12); }
}

/* ---------------------------------------------------------------------
   Auth screens
   --------------------------------------------------------------------- */
.auth-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.auth-bg .fill   { fill: var(--navy-700); }
.auth-bg .edge   { fill: none; stroke: var(--gold); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.auth-landing .auth-bg .fill { fill: var(--navy-500); }
.auth-bg .edge-b { fill: none; stroke: var(--gold); stroke-width: 6; vector-effect: non-scaling-stroke; }

.auth {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 28px;
}
.auth--logo { justify-content: flex-start; padding-top: 0; }

.auth-brand {
  text-align: center;
  font-weight: 800; letter-spacing: .08em;
  color: var(--navy-900);
  font-size: 30px;
  margin: 0 0 4px;
}
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 26px; font-size: 14px; }

/* Header band + round logo (activate / login) */
.logo-band {
  position: relative;
  height: 120px;
  margin: 0 -28px 70px;
  background: var(--navy-700);
  border-radius: 0 0 44px 44px;
}
.logo-circle {
  position: absolute; left: 50%; bottom: -56px;
  transform: translateX(-50%);
  width: 112px; height: 112px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--paper);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
  overflow: hidden;
}
.logo-circle img { width: 100%; height: 100%; object-fit: contain; }
.logo-circle .logo-text { font-weight: 800; font-size: 26px; color: var(--navy-900); letter-spacing: .06em; }

/* Role tabs: STAFF | STUDENT | NON-STAFF */
.role-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 0 22px;
}
.role-tab {
  position: relative;
  display: block;
  cursor: pointer;
}
.role-tab input { position: absolute; opacity: 0; pointer-events: none; }
.role-tab span {
  display: block;
  padding: 10px 4px;
  text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--navy-900);
  background: rgba(255, 255, 255, .85);
  border: 2px solid var(--navy-700);
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.role-tab input:checked + span { background: var(--navy-700); color: #fff; }
.role-tab input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Fields */
.field { margin: 0 0 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy-900); margin: 0 0 6px; }
.input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within { border-color: var(--navy-500); box-shadow: 0 0 0 3px var(--navy-100); }
.input-wrap .icon { color: var(--muted); width: 20px; height: 20px; }
.input-wrap input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  padding: 14px 0;
  color: var(--ink);
}
.eye-btn {
  border: 0; background: none; padding: 6px; margin-right: -6px;
  color: var(--muted); cursor: pointer; border-radius: 8px;
  display: grid; place-items: center;
}
.eye-btn:hover { color: var(--navy-700); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }

/* Password checklist */
.pw-rules { list-style: none; padding: 0; margin: 4px 2px 18px; font-size: 13px; color: var(--muted); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.pw-rules li::before { content: "○"; margin-right: 6px; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before { content: "●"; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px;
  padding: 14px 22px;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 15px;
  cursor: pointer; text-decoration: none;
  transition: transform .05s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy-900); box-shadow: 0 4px 14px rgba(217, 168, 22, .35); }
.btn-gold:hover { background: var(--gold-600); }
.btn-violet { background: var(--navy-700); color: #fff; }
.btn-violet:hover { background: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--navy-700); border: 1.5px solid var(--navy-300); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-center { display: flex; margin: 6px auto 0; min-width: 190px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 10px; }

.auth-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 34px;
  font-weight: 600; color: var(--navy-900);
  text-decoration: underline; text-underline-offset: 4px;
}
.auth-link .icon { width: 18px; height: 18px; }
.auth-foot { text-align: center; }
.greeting { text-align: center; margin: 0 0 22px; }
.greeting strong { display: block; font-size: 20px; color: var(--navy-900); }
.greeting span { color: var(--muted); font-size: 14px; }

/* Flash messages */
.flash { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 14px; }
.flash-error   { background: var(--danger-bg);  color: var(--danger); }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-info    { background: var(--navy-100); color: var(--navy-900); }

/* ---------------------------------------------------------------------
   Main app (dashboard) — wireframe 3
   --------------------------------------------------------------------- */
.topbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-width);
  z-index: 20;
  background: var(--navy-700);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  padding: 10px 14px 8px;
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-weight: 900; font-size: 24px; letter-spacing: .06em; color: #fff; text-decoration: none; }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%; border: 0; background: transparent;
  color: var(--navy-900); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(75, 31, 140, .08); }
/* the bars are deep navy, so the buttons on them are white */
.topbar .icon-btn, .navbar .icon-btn, .chat-head .icon-btn,
.pagebar .icon-btn, .composer .icon-btn { color: #fff; }
.topbar .icon-btn:hover, .navbar .icon-btn:hover, .chat-head .icon-btn:hover,
.pagebar .icon-btn:hover, .composer .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
}
.feature-row { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.feature {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--navy-200);
  font-size: 10.5px; font-weight: 600;
}
.feature .bubble {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy-500); color: #fff; border: 1.5px solid var(--gold);
}
.feature .num { font-size: 9px; font-weight: 800; color: var(--gold-300); margin-left: 1px; }
.feature.is-active .bubble { background: var(--gold); color: var(--navy-900); border-color: var(--gold); }
.feature.is-active { color: #fff; }

.app-main {
  padding: calc(var(--topbar-h) + 6px) 0 calc(var(--navbar-h) + 18px);
  min-height: 100vh; min-height: 100dvh;
}

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line);
}
.list-item:hover { background: var(--navy-50); }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--navy-700); color: #fff;
  font-weight: 700; border: 1.5px solid var(--navy-500);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.list-text { min-width: 0; flex: 1; display: block; }
.list-title, .list-sub { display: block; }
.list-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 12px; color: var(--muted); text-align: right; }

.navbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-width);
  height: var(--navbar-h);
  z-index: 20;
  display: flex;
  background: var(--navy-700);
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--navy-300);
  font-size: 10.5px; font-weight: 600; text-align: center; line-height: 1.15;
}
.nav-item.is-active { color: var(--gold); }
.nav-item.is-active .icon { stroke-width: 2.3; }

.fab {
  position: fixed;
  bottom: calc(var(--navbar-h) + 16px);
  right: max(16px, calc(50% - var(--app-width) / 2 + 16px));
  z-index: 25;
  width: 56px; height: 56px; border-radius: 50%;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--gold); color: var(--navy-900);
  box-shadow: 0 6px 18px rgba(46, 15, 92, .25);
}
.fab:hover { background: var(--gold-600); }
.fab-mascot {
  bottom: calc(var(--navbar-h) + 84px);
  width: 48px; height: 48px;
  margin-right: 4px;
  background: var(--navy-700); color: #fff;
  text-decoration: none;
}
.fab-mascot:hover { background: var(--navy-900); }
.fab-mascot .icon-lg { width: 26px; height: 26px; }

/* Search sheet */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(30, 26, 43, .45);
  display: none;
}
.sheet.is-open { display: block; }
.sheet-panel {
  max-width: var(--app-width); margin: 0 auto;
  background: var(--paper);
  padding: 14px 14px 18px;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
}
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-head .input-wrap { flex: 1; }
.search-scope { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip {
  border: 1.5px solid var(--navy-300); background: #fff; color: var(--navy-900);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.is-active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

/* Inner pages (back arrow + title) */
.pagebar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 8px;
  background: var(--navy-700);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.pagebar h1 { font-size: 18px; margin: 0; color: #fff; }
.page { padding: 18px 16px 40px; }

.empty {
  text-align: center;
  padding: 56px 28px;
  color: var(--muted);
}
.empty .icon { width: 54px; height: 54px; color: var(--navy-300); }
.empty h2 { color: var(--navy-900); font-size: 18px; margin: 14px 0 6px; }
.empty p { margin: 0; font-size: 14.5px; }

/* Cards (settings, dashboards) */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card .avatar { width: 60px; height: 60px; font-size: 20px; }
.profile-card h2 { margin: 0; font-size: 18px; color: var(--navy-900); }
.profile-card p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.menu { list-style: none; margin: 0 0 14px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 0; background: none; text-align: left;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.menu li + li { border-top: 1px solid var(--line); }
.menu a:hover, .menu button:hover { background: var(--navy-50); }
.menu .icon { color: var(--navy-700); }
.menu .chev { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }
.menu .danger, .menu .danger .icon { color: var(--danger); }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 8px; }
.tag { display: inline-block; background: var(--gold-100); color: #6B5C10; border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; }

/* ---------------------------------------------------------------------
   Lists: chats + directory
   --------------------------------------------------------------------- */
.nav-icon { position: relative; display: inline-grid; }
.nav-icon .badge { top: -6px; right: -12px; }
.avatar { position: relative; overflow: visible; }
.avatar-group { background: var(--navy-700); color: #fff; border-color: var(--gold); }
.avatar-group .icon { width: 24px; height: 24px; }
.dot-online {
  position: absolute; right: 0; bottom: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #2EB872; border: 2px solid var(--paper);
}
.list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 44px; }
.list-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--navy-700); color: #fff; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
}
.list-item.is-unread .list-title { color: var(--navy-900); }
.list-item.is-unread .list-sub { color: var(--ink); font-weight: 600; }
.list-item.is-unread .list-time { color: var(--navy-700); font-weight: 700; }
.tag-muted { background: #EEEDF1; color: var(--muted); font-weight: 600; font-size: 11px; }

.list-search { padding: 12px 16px 4px; }
.list-search .input-wrap input { padding: 10px 0; }
.list-filter { padding: 6px 16px 0; margin: 0; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.list-count { padding: 6px 16px 4px; margin: 0; font-size: 12.5px; color: var(--muted); }
.list-more { text-align: center; padding: 16px; color: var(--muted); font-size: 13px; }

.search-hint { color: var(--muted); font-size: 14px; padding: 16px 4px; margin: 0; }
.search-group { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 2px; }
#search-results { max-height: calc(100vh - 150px); overflow-y: auto; margin: 0 -14px; }
#search-results .search-hint, #search-results .search-group { padding-left: 18px; padding-right: 18px; }

/* ---------------------------------------------------------------------
   Conversation screen
   --------------------------------------------------------------------- */
.chat-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; background: var(--navy-700); border-bottom: 1px solid rgba(255, 255, 255, .18);
  flex: none; position: relative;
}
.chat-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.chat-head-text { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.chat-head-text strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-text span { display: block; font-size: 12.5px; color: var(--navy-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-menu {
  position: absolute; right: 8px; top: 52px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 190px; padding: 6px 0;
}
.chat-menu a, .chat-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  border: 0; background: none; color: var(--ink); text-decoration: none; cursor: pointer;
}
.chat-menu a:hover, .chat-menu button:hover { background: var(--navy-50); }
.chat-menu .danger { color: var(--danger); }

.chat-scroll {
  flex: 1; overflow-y: auto; padding: 10px 12px 14px;
  background: #F7F5FB;
  background-image: radial-gradient(rgba(75, 31, 140, .05) 1px, transparent 1px);
  background-size: 18px 18px;
}
.chat-older { display: block; margin: 4px auto 10px; }
.day-sep { text-align: center; margin: 12px 0 8px; }
.day-sep span { background: #fff; color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg { display: flex; margin: 2px 0; }
.msg.mine { justify-content: flex-end; }
.msg.gap { margin-top: 8px; }
.bubble {
  max-width: 80%;
  padding: 6px 10px 5px;
  border-radius: 12px;
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 15px; line-height: 1.38;
}
.msg.mine .bubble { background: var(--navy-700); color: #fff; }
.msg:not(.mine).gap .bubble { border-top-left-radius: 4px; }
.msg.mine.gap .bubble { border-top-right-radius: 4px; }
.bubble .who { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy-500); margin-bottom: 1px; }
.bubble .meta { float: right; margin: 6px 0 -3px 10px; font-size: 11px; opacity: .7; white-space: nowrap; }
.bubble .tick { margin-left: 3px; letter-spacing: -3px; }
.bubble .tick.read { color: var(--gold); opacity: 1; }
.msg.pending .bubble { opacity: .65; }
.msg.failed .bubble { background: var(--danger-bg); color: var(--danger); cursor: pointer; }

.composer {
  flex: none; display: block;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--navy-700); border-top: 1px solid rgba(255, 255, 255, .18);
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.attach-btn { flex: none; color: #fff; cursor: pointer; margin-bottom: 4px; }

/* chosen photo / file, before sending */
.attach-preview {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  padding: 8px 10px; background: #fff; border: 1.5px solid var(--navy-300); border-radius: 12px;
}
.attach-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.attach-text { flex: 1; min-width: 0; display: block; font-size: 13px; }
.attach-text > span { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-text small { color: var(--muted); }

/* attachments inside a bubble */
.bubble.has-att { padding-top: 6px; }
.att-photo { display: block; margin: 0 -6px 6px; }
.att-photo img {
  display: block; width: 100%; max-width: 260px; max-height: 320px;
  object-fit: cover; border-radius: 10px; background: var(--navy-100);
}
.att-file {
  display: flex; align-items: center; gap: 10px; margin: 0 -2px 6px;
  padding: 8px 10px; border-radius: 10px; text-decoration: none;
  background: rgba(255, 255, 255, .6); color: inherit;
}
.msg.mine .att-file { background: rgba(255, 255, 255, .22); }
.att-icon { font-size: 20px; flex: none; }
.att-text { min-width: 0; font-size: 13px; line-height: 1.3; }
.att-name { display: block; font-weight: 600; word-break: break-word; }
.att-text small { opacity: .8; }
.composer textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 44px;
  border: 1.5px solid var(--navy-500); border-radius: 22px;
  padding: 11px 16px; background: #fff; color: var(--ink); outline: none; line-height: 1.35;
}
.composer textarea:focus { border-color: var(--navy-500); }
.send-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none;
  background: var(--gold); color: var(--navy-900); display: grid; place-items: center; cursor: pointer;
}
.send-btn:disabled { opacity: .5; cursor: default; }
.chat-notice { flex: none; padding: 12px 16px; text-align: center; font-size: 14px; background: var(--navy-700); border-top: 1px solid rgba(255, 255, 255, .18); color: var(--navy-200); }
.chat-error { flex: none; padding: 6px 12px; font-size: 13px; background: var(--danger-bg); color: var(--danger); text-align: center; }

/* Profile */
.profile-hero { text-align: center; padding: 10px 0 6px; }
.profile-hero .avatar { width: 96px; height: 96px; font-size: 32px; margin: 0 auto 10px; }
.profile-hero h2 { margin: 0; color: var(--navy-900); }
.profile-hero p { margin: 4px 0 0; color: var(--muted); }
.profile-actions { display: flex; gap: 10px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.report-form select, .report-form textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px;
}

/* ---------------------------------------------------------------------
   Notice boards + notifications
   --------------------------------------------------------------------- */
.feature .bubble { position: relative; }
.feature .badge { top: -4px; right: -4px; }
.board-tabs { display: flex; gap: 8px; padding: 12px 16px 4px; }
.board-tab {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 10px;
  border: 1.5px solid var(--navy-300); background: #fff;
  color: var(--navy-900); text-decoration: none; font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.board-tab.is-active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.board-tab .count { background: var(--gold); color: var(--navy-900); }
.notice-list .list-title { white-space: normal; }
.notice-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.notice-meta .icon { width: 13px; height: 13px; vertical-align: -2px; }
.pin { font-size: 13px; }
.dot-unread { width: 10px; height: 10px; border-radius: 50%; background: var(--navy-700); display: block; }
.notification-list .avatar { background: var(--navy-100); color: var(--navy-700); }

.notice h1 { font-size: 21px; color: var(--navy-900); margin: 6px 0 4px; }
.notice-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.notice-by { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.notice-body { font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.attachment {
  display: flex; align-items: center; gap: 12px; margin-top: 20px;
  padding: 14px; border: 1.5px solid var(--navy-300); border-radius: var(--radius);
  background: var(--navy-50); color: var(--navy-900); text-decoration: none; font-weight: 600;
}
.attachment small { font-weight: 400; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-green  { background: var(--success-bg); color: var(--success); }
.pill-red    { background: var(--danger-bg); color: var(--danger); }
.pill-gold   { background: var(--gold-100); color: #6B5C10; }
.pill-violet { background: var(--navy-100); color: var(--navy-700); }
.pill-grey   { background: #EEEDF1; color: #555; }

/* ---------------------------------------------------------------------
   Timetable screen
   --------------------------------------------------------------------- */
.tt-head { padding: 14px 16px 6px; }
.tt-head h1 { font-size: 20px; margin: 0; color: var(--navy-900); }
.tt-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tt-day { margin-top: 14px; }
.tt-day h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0; padding: 6px 16px;
  background: var(--navy-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.tt-day.is-today h2 { color: var(--navy-900); background: var(--navy-100); }
.tt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
}
.tt-row.is-now { background: var(--gold-100); }
.tt-time { flex: none; width: 56px; text-align: center; line-height: 1.2; }
.tt-time strong { display: block; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.tt-time span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-info { flex: 1; min-width: 0; }
.tt-subject { display: block; font-weight: 600; }
.tt-meta { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   E-library
   --------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.section-head {
  margin: 14px 0 4px; padding: 0 16px;
  font-size: 13px; font-weight: 600; color: var(--navy-900);
}

.book-cover {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; background: var(--navy-100);
  box-shadow: 0 3px 10px rgba(46, 15, 92, .16);
}
.book-cover-blank {
  display: flex; align-items: center; justify-content: center; padding: 8px;
  text-align: center; font-size: 12px; font-weight: 600; line-height: 1.25;
  color: #fff; background: hsl(var(--h, 265) 42% 38%);
  overflow: hidden;
}
.book-cover-blank span { display: block; }

.book-grid {
  display: grid; gap: 14px 12px; padding: 8px 16px 4px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.book-card { display: block; color: inherit; text-decoration: none; }
.book-card:active { opacity: .7; }
.book-title {
  display: block; margin-top: 6px; font-size: 13px; font-weight: 600;
  line-height: 1.25; color: var(--ink);
}
.book-author { display: block; font-size: 12px; color: var(--muted); }

.book-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.book-row::-webkit-scrollbar { display: none; }
.book-card-sm { flex: 0 0 96px; scroll-snap-align: start; }

/* Book page */
.book-page { padding: 4px 16px 24px; }
.book-hero { display: flex; gap: 14px; align-items: flex-start; }
.book-hero .book-cover { width: 108px; flex: none; }
.book-hero-text { min-width: 0; }
.book-hero-text h1 { font-size: 19px; margin: 2px 0 2px; color: var(--navy-900); line-height: 1.25; }
.book-hero-text .book-author { font-size: 14px; margin: 0 0 8px; }
.book-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.book-progress { margin: 8px 0 0; font-size: 13px; color: var(--navy-700); font-weight: 600; }
.book-actions { display: grid; gap: 8px; margin-top: 18px; }
.book-about { margin-top: 20px; }
.book-about h2 { font-size: 15px; color: var(--navy-900); margin: 0 0 4px; }
.book-about p { margin: 0; font-size: 14px; line-height: 1.55; }
.book-facts { margin: 18px 0 0; border-top: 1px solid var(--line); }
.book-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.book-facts dt { margin: 0; font-size: 13px; color: var(--muted); }
.book-facts dd { margin: 0; font-size: 13px; font-weight: 600; }

/* Reader */
.reader {
  position: fixed; inset: 0; max-width: var(--app-width); margin-inline: auto;
  display: flex; flex-direction: column; background: #1B1530;
}
.reader-bar {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: var(--navy-900); color: #fff;
  padding-top: calc(6px + env(safe-area-inset-top));
}
.reader-bar .icon-btn { color: #fff; }
.reader-bar h1 {
  flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reader-jump { display: flex; align-items: center; gap: 4px; }
.reader-jump input {
  width: 58px; padding: 5px 6px; text-align: center; font-size: 13px;
  border: 1px solid var(--navy-500); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.reader-jump .of { font-size: 12px; color: var(--navy-300); }
.reader-frame { flex: 1; width: 100%; border: 0; background: #1B1530; }
.reader-pages {
  position: relative; flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 8px; -webkit-overflow-scrolling: touch; scroll-behavior: auto;
}
.reader-pages:focus { outline: none; }
.reader-page {
  position: relative; margin: 0 auto 10px; max-width: 100%;
  background: #2A2247; border-radius: 4px; overflow: hidden;
}
.reader-page.is-ready { background: #fff; }
.reader-page canvas { display: block; }
.reader-loading { color: #D3CDE4; text-align: center; font-size: 13px; padding: 24px 0; }
.reader-note {
  margin: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  font-size: 12px; color: #D3CDE4; background: #15102A; text-align: center;
}
.reader-note a { color: var(--gold); }

@media (min-width: 560px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
}

/* ---------------------------------------------------------------------
   Mascot (offline assistant)
   --------------------------------------------------------------------- */
.mascot-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px 6px;
}
.mascot-face {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy-700); color: #fff;
}
.mascot-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.mascot-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 8px; }
.mascot-suggestions .chip { text-decoration: none; }

.mascot-card {
  margin: 12px 16px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mascot-card h2 { margin: 0 0 6px; font-size: 15px; color: var(--navy-900); }
.mascot-card > p { margin: 0; font-size: 14px; line-height: 1.55; }
.mascot-card .tt-row { padding: 9px 0; }
.mascot-card .tt-row:last-of-type { border-bottom: 0; }
.mascot-card .list { margin: 0 -14px; }
.mascot-card .book-row { padding: 4px 0 0; }
.mascot-more {
  display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600;
  color: var(--navy-700); text-decoration: none;
}
.mascot-empty { background: var(--gold-100); border-color: var(--gold); }
.mascot-empty .mascot-suggestions { padding: 10px 0 0; }
.mascot-foot {
  margin: 4px 16px 24px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.role-tabs-line { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.role-tabs-line .chip { text-decoration: none; }

/* ---------------------------------------------------------------------
   Video classes
   --------------------------------------------------------------------- */
.tag-ok   { background: var(--success-bg); color: var(--success); }
.tag-warn { background: var(--danger-bg);  color: var(--danger); }
.tag-live { background: var(--danger); color: #fff; }

.vc-card {
  margin: 8px 16px 14px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.vc-card.is-live { border-color: var(--danger); }
.vc-top { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.vc-card h2 { margin: 0; font-size: 16px; color: var(--navy-900); }
.vc-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.vc-dot {
  flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 0 rgba(179, 38, 30, .6);
  animation: vc-pulse 1.8s infinite;
}
@keyframes vc-pulse {
  70%  { box-shadow: 0 0 0 10px rgba(179, 38, 30, 0); }
  100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); }
}
@media (prefers-reduced-motion: reduce) { .vc-dot { animation: none; } }
.vc-card .field { margin-bottom: 12px; }
.vc-card select {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
}
.vc-end { margin-top: 8px; }

/* Room */
.vc-room {
  position: fixed; inset: 0; max-width: var(--app-width); margin-inline: auto;
  display: flex; flex-direction: column; background: #150F2A;
}
.vc-frame { flex: 1; min-height: 0; }
.vc-frame iframe { width: 100%; height: 100%; border: 0; }
.vc-note {
  margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  font-size: 13px; color: #D3CDE4; background: #15102A; text-align: center;
}
.vc-note.is-error { background: var(--danger); color: #fff; }
.vc-note a { color: var(--gold); }
.vc-note.is-error a { color: #fff; }
.vc-over { flex: 1; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; color: #EDEAF5; }
.vc-over h2 { margin: 0; font-size: 18px; }
.vc-over p { margin: 0; font-size: 14px; color: #C9C2DA; line-height: 1.5; }
.vc-flash:not(:empty) { padding: 8px 12px 0; }
.vc-flash .flash { margin: 0; font-size: 13px; }

.vc-row .list-sub { white-space: normal; font-size: 13px; line-height: 1.4; }

/* ---------------------------------------------------------------------
   Profile photos
   --------------------------------------------------------------------- */
.avatar.has-photo { background: var(--navy-100); }
.avatar.has-photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.photo-form h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy-900); }
.photo-form .hint { margin-top: 0; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.photo-actions .btn { cursor: pointer; }

/* ---------------------------------------------------------------------
   Calls (KSTU's own voice / video)
   --------------------------------------------------------------------- */
.call {
  position: fixed; inset: 0; max-width: var(--app-width); margin-inline: auto;
  display: flex; flex-direction: column; background: #120C28; color: #fff;
}
.call-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
}
.call-head h1 { margin: 0; font-size: 17px; font-weight: 700; }
.call-head p { margin: 2px 0 0; font-size: 13px; color: #B8AFD0; }
.call-timer { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--gold); }

.call-stage {
  flex: 1; min-height: 0; display: grid; gap: 6px; padding: 6px;
  grid-template-columns: 1fr;
}
.call-stage.count-2 { grid-template-columns: 1fr 1fr; }
.call-stage.count-3, .call-stage.count-4 { grid-template-columns: 1fr 1fr; }
.call-stage.count-5, .call-stage.count-6 { grid-template-columns: 1fr 1fr 1fr; }
.call-tile {
  position: relative; background: #241C40; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; min-height: 120px;
}
.call-tile video { width: 100%; height: 100%; object-fit: cover; background: #241C40; }
.call-tile.is-audio video, .call-tile.is-live.is-audio video { display: none; }
.call-tile:not(.is-live)::after {
  content: "connecting…"; position: absolute; font-size: 12px; color: #9A90B8;
}
.call-tile.is-live::after { content: none; }
.call-name {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
}
.call-tile.call-mine { border: 2px solid var(--navy-500); }
.call-tile.call-mine::after { content: none; }

.call-note {
  margin: 0; padding: 8px 14px; font-size: 13px; text-align: center;
  background: var(--danger); color: #fff;
}
.call-bar, .call-answer {
  flex: none; display: flex; justify-content: center; gap: 18px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: #0D0920;
}
.call-btn {
  border: 0; background: none; color: #EDEAF5; cursor: pointer;
  display: grid; justify-items: center; gap: 4px; font-size: 11px; min-width: 64px;
}
.call-btn .icon { width: 26px; height: 26px; padding: 12px; border-radius: 50%; background: #2A2247; box-sizing: content-box; }
.call-btn.is-off .icon { background: #fff; color: #120C28; }
.call-hang .icon { background: var(--danger); color: #fff; }
.call-accept .icon { background: #2EB872; color: #fff; }

/* the ringing panel, on any screen */
.ring {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(22, 18, 31, .75); padding: 24px;
}
.ring-panel {
  width: 100%; max-width: 320px; background: var(--paper); border-radius: 20px;
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow);
}
.ring-who { margin: 0; font-size: 19px; font-weight: 700; color: var(--navy-900); }
.ring-what { margin: 4px 0 18px; font-size: 13px; color: var(--muted); }
.ring-actions { display: flex; gap: 10px; }
.ring-actions .btn { flex: 1; padding: 12px 8px; font-size: 13px; }

/* in the conversation */
.call-live {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 10px 14px; background: #2EB872; color: #fff; font-size: 13.5px; font-weight: 600;
}
.call-history { padding: 4px 0 2px; }
.call-row {
  display: flex; align-items: center; gap: 8px; margin: 0;
  padding: 7px 14px; font-size: 13px; color: var(--muted);
}
.call-row .icon { width: 18px; height: 18px; }
.call-row small { margin-left: auto; font-size: 11.5px; }
.call-row.is-missed { color: var(--danger); }

/* ---------------------------------------------------------------------
   Opening screen (splash) and the crest on the landing page
   --------------------------------------------------------------------- */
.splash {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: radial-gradient(120% 90% at 50% 40%, #2A1E5A 0%, var(--navy-700) 45%, var(--navy-900) 100%);
  animation: splash-out .55s ease-in 1.55s forwards;
}
.splash-ring {
  display: grid; place-items: center;
  width: 232px; height: 232px; border-radius: 50%;
  border: 2px solid rgba(178, 155, 27, .45);
  animation: ring-in .9s cubic-bezier(.2, .8, .25, 1) both, ring-pulse 2.4s ease-out .9s infinite;
}
.splash-circle {
  display: grid; place-items: center;
  width: 188px; height: 188px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 10px rgba(255, 255, 255, .06);
  animation: logo-in 1s cubic-bezier(.2, .9, .2, 1) .1s both;
}
.splash-circle img { width: 78%; height: auto; display: block; }
.splash-name {
  margin: 26px 0 0; color: #fff; font-size: 17px; font-weight: 700; letter-spacing: .01em;
  animation: rise-in .7s ease-out .5s both;
}
.splash-motto {
  margin: 4px 0 0; color: var(--gold); font-size: 12px; letter-spacing: .34em;
  animation: rise-in .7s ease-out .68s both;
}
.splash-bar {
  margin-top: 26px; width: 120px; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, .16); overflow: hidden;
  animation: rise-in .6s ease-out .8s both;
}
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--gold); animation: bar 1.4s ease-in-out .8s infinite; }

@keyframes ring-in   { from { opacity: 0; transform: scale(.72) } to { opacity: 1; transform: scale(1) } }
@keyframes ring-pulse{ 0% { box-shadow: 0 0 0 0 rgba(178,155,27,.35) } 70% { box-shadow: 0 0 0 26px rgba(178,155,27,0) } 100% { box-shadow: 0 0 0 0 rgba(178,155,27,0) } }
@keyframes logo-in   { 0% { opacity: 0; transform: scale(.6) rotate(-8deg) } 60% { opacity: 1 } 100% { opacity: 1; transform: scale(1) rotate(0) } }
@keyframes rise-in   { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes bar       { 0% { transform: translateX(-110%) } 100% { transform: translateX(320%) } }
@keyframes splash-out{ to { opacity: 0; visibility: hidden; transform: scale(1.06) } }

@media (prefers-reduced-motion: reduce) {
  .splash, .splash-ring, .splash-circle, .splash-name, .splash-motto, .splash-bar, .splash-bar i {
    animation-duration: .01ms; animation-iteration-count: 1;
  }
  .splash { animation: splash-out .3s linear 1.2s forwards; }
}

/* the crest on the landing page, where the plain wordmark used to be */
.auth-mark { display: flex; justify-content: center; margin: 0 0 16px; }
.logo-circle-lg {
  position: static; transform: none;
  width: 132px; height: 132px;
  border: 3px solid #fff;
  background: #fff;
}
.logo-circle-lg img { width: 86%; height: 86%; object-fit: contain; }
.auth-brand { font-size: 21px; letter-spacing: .01em; }

/* ---------------------------------------------------------------------
   Desktop window (like the Telegram / WhatsApp desktop app)
   Below 1000px nothing changes — the phone layout stays exactly as it is.
   --------------------------------------------------------------------- */
.side { display: none; }

@media (min-width: 1000px) {
  body { background: var(--navy-900); }

  .shell {
    display: flex; align-items: stretch;
    max-width: 1340px; width: 100%;
    height: 100vh; height: 100dvh; min-height: 0;
    margin: 0 auto; overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 0, 0, .45);
  }

  /* left column */
  .side {
    display: flex; flex-direction: column;
    width: 360px; flex: none; min-height: 0;
    background: var(--navy-50); border-right: 1px solid var(--line);
  }
  .side-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px 12px; background: var(--navy-700); color: #fff;
  }
  .side-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
  .side-head div { flex: 1; min-width: 0; display: grid; }
  .side-head strong { font-size: 15px; letter-spacing: .04em; }
  .side-head span { font-size: 12px; color: var(--navy-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-head .icon-btn { color: #fff; }

  .side-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); }
  .side-link {
    position: relative; flex: 1 1 30%;
    display: grid; justify-items: center; gap: 3px;
    padding: 8px 4px; border-radius: 10px;
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  }
  .side-link .icon { width: 20px; height: 20px; }
  .side-link:hover { background: var(--navy-100); color: var(--navy-700); }
  .side-link.is-active { background: var(--navy-700); color: #fff; }
  .side-link .count {
    position: absolute; top: 4px; right: 18px;
    background: var(--flame); color: #fff; font-style: normal;
    font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px;
    display: grid; place-items: center; padding: 0 4px;
  }
  .side-list { flex: 1; min-height: 0; overflow-y: auto; }
  .side-list .list-item { padding-left: 12px; padding-right: 12px; }

  /* right column: whatever page is open */
  .app-pane {
    position: relative; display: flex; flex-direction: column;
    flex: 1; min-width: 0; height: 100%; overflow: hidden; background: var(--paper);
  }
  .app-pane > .topbar,
  .app-pane > .pagebar { position: static; transform: none; width: auto; max-width: none; border-radius: 0; }
  .app-pane > .app-main,
  .app-pane > .page {
    flex: 1; min-height: 0; overflow-y: auto;
    padding-top: 8px; padding-bottom: 28px;
  }
  .shell > .chat-page,
  .shell > .reader,
  .shell > .call,
  .shell > .vc-room {
    position: static; inset: auto; flex: 1; min-width: 0;
    height: 100%; max-width: none; margin: 0;
  }

  .navbar { display: none; }                   /* the left column replaces the bottom tabs */
  .fab { position: absolute; bottom: 24px; right: 28px; }
  .fab-mascot { position: absolute; bottom: 96px; right: 28px; }
  .chat-head .icon-btn[aria-label="Back to chats"] { display: none; }

  /* the phone-only search sheet becomes a normal centred dialog */
  .sheet-panel { max-width: 520px; margin: 0 auto; border-radius: 20px; }
}

@media (min-width: 1000px) and (display-mode: standalone) {
  .shell { height: 100vh; box-shadow: none; }
}

/* switches in Settings */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.switch-row label { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-weight: 600; color: var(--ink); cursor: pointer; }
.switch-row label .icon { color: var(--navy-700); }
.switch {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 27px; border-radius: 999px; flex: none;
  background: var(--line); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s;
}
.switch:checked { background: var(--navy-700); }
.switch:checked::after { transform: translateX(19px); }
.switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }


/* ---------------------------------------------------------------------
   Deep-colour landing card
   The shapes behind the first screen are the crest navy now, so the form
   sits on paper instead of straight on top of them.
   --------------------------------------------------------------------- */
.shell.auth-landing { background: var(--navy-700); }
.auth-card {
  background: var(--paper);
  border-radius: 24px;
  padding: 24px 22px 26px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .30);
}
.auth-landing .auth-brand { font-size: 21px; }
.auth-landing .auth-foot .auth-link { color: #fff; }
.auth-landing .auth-foot .auth-link .icon { color: #fff; }
