/* ─────────────────────────────────────────────────────────────────────────
   V.Study Space — student dashboard
   A light, card-based app shell: fixed sidebar + topbar, scrolling content.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Paper & Ink — the same tokens the public site uses, mapped onto the
     names this shell already reads from. */
  --bg:          #F4EADA;   /* the app ground: the alternating paper band */
  --surface:     #FBF6EE;   /* unbleached cotton: cards, sheets, panels */
  --paper-light: #FBF6EE;   /* inputs */
  --paper-2:     #F4EADA;
  --paper-3:     #EADCC6;   /* a panel set into the cloth */
  --paper-4:     #E0CEB0;
  --line:        #E0CEB0;   /* the default hairline */
  --line-strong: #CBB391;   /* a border that needs to be seen */
  --wood:        #EADCC6;   /* chrome is paper now, not wood */
  --wood-deep:   #E0CEB0;
  --wood-edge:   #E0CEB0;
  --text:        #241A14;   /* warm near-black */
  --text-2:      #5E4B3D;   /* secondary text, captions */
  --text-3:      #8A7260;   /* metadata */
  --blue:        #7A3B32;   /* the single accent: maroon */
  --blue-dark:   #5E2C25;
  --blue-soft:   #F0E2D8;
  --green:       #7A5A14;   /* "done" reads gold, not a second accent */
  --green-soft:  #EFE3C8;
  --amber:       #A8812C;   /* gold */
  --amber-soft:  #EFE3C8;
  --red:         #B6402C;   /* sindoor: alerts and destructive actions */
  --red-soft:    #F3DED7;
  --purple:      #5E4B3D;
  --purple-soft: #EADCC6;
  --gold:        #A8812C;
  --gold-text:   #7A5A14;
  --gold-lift:   #C9A24B;
  --radius:      3px;       /* nearly square — pills are for badges only */
  --radius-sm:   2px;
  --shadow:      0 14px 28px -18px rgba(36, 26, 20, 0.4);
  --sidebar-w:   248px;
  --topbar-h:    72px;
  --sans:        'Mukta', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; /* headings: clean system sans, like Facebook */
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

/* ── Shell layout ────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  z-index: 50;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: var(--blue-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.side-link:hover { background: var(--paper-2); color: var(--text); }
.side-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-link .side-icon { width: 20px; display: grid; place-items: center; flex: 0 0 20px; }
.side-link.active .side-icon svg { stroke: var(--blue); }
.side-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main-col {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.search-wrap {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.search-wrap svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; stroke: var(--text-3); fill: none; stroke-width: 2;
}
#global-search {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  font-size: 14px;
  color: var(--text);
}
#global-search:focus { outline: none; border-color: var(--blue); background: var(--paper-light); }
.search-results {
  position: absolute;
  top: 48px; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(20,25,45,0.12);
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}
.search-results:empty, .search-results.hidden { display: none; }
.search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}
.search-result:hover { background: var(--paper-2); }
.search-result .sr-kind { margin-left: auto; font-size: 11px; color: var(--text-3); }

.topbar-spacer { flex: 1; }

/* Music widget */
.music-widget {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  min-width: 215px;
}
.music-art {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  background: #1db954;
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
}
.music-meta { min-width: 0; flex: 1; }
.music-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-btn {
  border: none; background: none; cursor: pointer; color: var(--text-2);
  padding: 4px; display: grid; place-items: center; border-radius: 6px;
}
.music-btn:hover { background: var(--paper-4); color: var(--text); }
.music-btn svg { width: 15px; height: 15px; fill: currentColor; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--paper-4); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--surface);
}
.icon-btn .dot.hidden { display: none; }

.avatar-btn {
  display: flex; align-items: center; gap: 7px;
  border: none; background: none; cursor: pointer; padding: 2px;
}
.avatar-btn .avatar-img {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-soft);
  display: grid; place-items: center; font-size: 19px;
  overflow: hidden;
}
.avatar-btn svg { width: 14px; height: 14px; stroke: var(--text-3); fill: none; stroke-width: 2; }

.account-menu {
  position: absolute;
  top: 62px; right: 22px;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 44px rgba(20,25,45,0.14);
  padding: 7px;
  z-index: 70;
}
.account-menu.hidden { display: none; }
.account-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-menu-name { font-weight: 600; }
.account-menu-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.account-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: none; background: none;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
}
.account-menu-item:hover { background: var(--paper-2); color: var(--text); }

/* ── Page content ────────────────────────────────────────────────────── */
.page-wrap { padding: 24px 26px 48px; }
.page { display: none; }
.page.active { display: block; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 23px; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 3px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.card-head h3 { font-size: 15.5px; font-weight: 700; flex: 1; }
.card-head .card-icon { font-size: 17px; }
.card-link {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--paper-3); cursor: pointer;
  display: grid; place-items: center; color: var(--text-2);
}
.card-link:hover { background: var(--paper-4); color: var(--text); }
.card-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; }

.grid { display: grid; gap: 18px; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.row-main { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
/* Bottom row: the chart can be tighter, the action buttons and activity
   list both need the extra room. */
.row-bottom { grid-template-columns: 0.92fr 1fr 1.28fr; }

/* ── Hero banner ─────────────────────────────────────────────────────── */
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  align-items: stretch;
  /* Fixed height so the banner art is cropped to a strip rather than
     letting the image's own proportions stretch the whole card. */
  height: 200px;
  margin-bottom: 18px;
}
.hero-text {
  flex: 0 0 34%;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  position: relative;
  z-index: 2;
}
.hero-greeting { font-size: 17px; color: var(--text-2); }
.hero-name { font-size: 31px; font-weight: 700; line-height: 1.15; }
.hero-quote { color: var(--text-2); font-style: italic; font-size: 13.5px; max-width: 260px; }
.hero-art {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-art::before {
  content: '';
  position: absolute; inset: 0;
  /* Soft fade so the art reads as continuing behind the greeting text
     rather than being cut off by a hard edge. */
  background: linear-gradient(90deg, var(--surface) 0%, rgba(248,239,214,0.92) 4%, rgba(248,239,214,0) 13%);
  z-index: 1;
}
.hero-cta {
  position: absolute;
  right: 26px; top: 50%; transform: translateY(-50%);
  z-index: 3;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px 22px;
  font-weight: 650;
  font-size: 15.5px;
  box-shadow: 0 10px 34px rgba(20,25,45,0.16);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.hero-cta:hover { transform: translateY(-51%) scale(1.015); box-shadow: 0 14px 40px rgba(20,25,45,0.2); }
.hero-cta .cta-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--blue-soft); display: grid; place-items: center; font-size: 17px;
}

/* ── Stat cards ──────────────────────────────────────────────────────── */
.stat-top { display: flex; align-items: flex-start; gap: 13px; }
.stat-badge {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
}
.stat-badge.amber { background: var(--amber-soft); }
.stat-badge.blue  { background: var(--blue-soft); }
.stat-badge.red   { background: var(--red-soft); }
.stat-main { flex: 1; min-width: 0; }
.stat-value { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-label { display: block; color: var(--text-2); font-size: 13px; }
.stat-delta { font-size: 12.5px; color: var(--green); margin-top: 6px; font-weight: 600; }
.stat-delta.down { color: var(--red); }
.stat-delta.flat { color: var(--text-3); }

.day-dots { display: flex; justify-content: space-between; margin-top: 16px; }
.day-dot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-dot .dot-circle {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.8px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent; font-size: 13px;
}
.day-dot.done .dot-circle { background: var(--green); border-color: var(--green); color: #fff; }
.day-dot.today .dot-circle { border-color: var(--blue); border-width: 2.2px; }
.day-dot .dot-label { font-size: 10.5px; color: var(--text-3); }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 52px; }
.spark-bar { flex: 1; background: #dcc28a; border-radius: 3px 3px 2px 2px; min-height: 3px; }
.spark-bar.strong { background: var(--blue); }

.progress-track { height: 8px; background: var(--paper-3); border-radius: 999px; overflow: hidden; margin-top: 16px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.3s ease; }

/* ── Continue studying ───────────────────────────────────────────────── */
.continue-body { display: flex; gap: 15px; }
.continue-thumb {
  width: 120px; height: 86px; flex: 0 0 120px;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-3);
}
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.continue-meta { flex: 1; min-width: 0; }
.continue-title { font-weight: 650; font-size: 15px; }
.continue-sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.continue-progress-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.continue-progress-row .progress-track { flex: 1; margin-top: 0; }
.continue-pct { font-size: 12.5px; font-weight: 650; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: scale(0.985); }
.btn-block { width: 100%; }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn-soft:hover { background: #ead5a3; }
.btn-ghost { background: var(--paper-3); color: var(--text-2); }
.btn-ghost:hover { background: var(--paper-4); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 8px; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #ebc6bd; }

/* ── Goals list ──────────────────────────────────────────────────────── */
.goal-list { display: flex; flex-direction: column; }
.goal-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 2px;
}
.goal-check {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 6px; border: 1.8px solid var(--line-strong);
  background: var(--paper-light); cursor: pointer;
  display: grid; place-items: center;
  color: transparent; font-size: 12px;
}
.goal-item.done .goal-check { background: var(--blue); border-color: var(--blue); color: #fff; }
.goal-text { flex: 1; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-item.done .goal-text { color: var(--text-3); text-decoration: line-through; }
.goal-remove {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  padding: 3px 6px; border-radius: 6px; font-size: 15px; line-height: 1;
}
.goal-remove:hover { background: var(--paper-3); color: var(--red); }
.goal-add-row { display: flex; gap: 8px; margin-top: 10px; }
.goal-add-row input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.goal-add-row input:focus { outline: none; border-color: var(--blue); }

.add-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: none; background: var(--blue); color: #fff;
  cursor: pointer; font-size: 17px; line-height: 1;
  display: grid; place-items: center;
}
.add-btn:hover { background: var(--blue-dark); }

/* ── Who's online ────────────────────────────────────────────────────── */
.online-count { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.avatar-stack { display: flex; margin-bottom: 16px; padding-left: 7px; }
.avatar-chip {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid var(--surface);
  margin-left: -7px;
  background: var(--blue-soft);
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--blue);
}
.avatar-chip img { width: 150%; height: 150%; object-fit: cover; object-position: center 20%; image-rendering: pixelated; }
.avatar-more { background: var(--paper-4); color: var(--text-2); font-size: 11px; }

.online-room {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.online-room:first-of-type { border-top: none; }
.online-room-thumb {
  width: 54px; height: 40px; flex: 0 0 54px;
  border-radius: 8px; overflow: hidden; background: var(--paper-3);
}
.online-room-thumb img { width: 100%; height: 100%; object-fit: cover; }
.online-room-thumb.private-room-thumb { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.room-share-btn { flex: 0 0 auto; padding: 0 10px; }
.online-room-meta { flex: 1; min-width: 0; }
.online-room-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-room-count { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.live-dot.idle { background: var(--text-3); }

/* ── Bar chart ───────────────────────────────────────────────────────── */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 130px; margin-top: 18px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 40px;
  background: #dcc28a; border-radius: 6px 6px 3px 3px;
  min-height: 4px;
  transition: height 0.3s ease;
  position: relative;
}
.chart-col.peak .chart-bar { background: var(--blue); }
.chart-label { font-size: 11px; color: var(--text-3); }
.chart-select {
  border: 1px solid var(--line-strong); background: var(--paper-2);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-family: inherit; color: var(--text-2);
  cursor: pointer;
}

/* ── Quick actions ───────────────────────────────────────────────────── */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.qa-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3;
  transition: transform 0.1s;
}
.qa-btn:hover { transform: translateY(-2px); }
.qa-btn .qa-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; background: rgba(255,255,255,0.75); display: grid; place-items: center; font-size: 15px; }
.qa-green  { background: var(--green-soft); }
.qa-blue   { background: var(--blue-soft); }
.qa-amber  { background: var(--amber-soft); }
.qa-red    { background: var(--red-soft); }

/* ── Activity feed ───────────────────────────────────────────────────── */
.activity-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; font-size: 13px; }
.activity-icon { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; background: var(--paper-3); }
.activity-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* ── Lists / tables shared by inner pages ────────────────────────────── */
.list-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-card { padding: 0; overflow: hidden; }
.rank-badge {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  background: var(--paper-3); color: var(--text-2);
}
.rank-badge.gold   { background: #fdf3d8; color: #b7881c; }
.rank-badge.silver { background: var(--paper-3); color: #8a7f6a; }
.rank-badge.bronze { background: #fbeadd; color: #a76a3b; }

.empty {
  padding: 30px 20px; text-align: center; color: var(--text-3); font-size: 13.5px;
}

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.badge-card {
  text-align: center; padding: 22px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.badge-card.locked { opacity: 0.45; filter: grayscale(1); }
.badge-emoji { font-size: 32px; }
.badge-name { font-weight: 650; margin-top: 8px; font-size: 14px; }
.badge-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: var(--paper-light); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.form-status { font-size: 12.5px; margin-top: 8px; min-height: 16px; color: var(--red); }
.form-status.info { color: var(--text-2); }
.form-status.ok { color: var(--green); }

.subject-card { margin-bottom: 14px; }
.chapter-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.chapter-row.done .chapter-title { color: var(--text-3); text-decoration: line-through; }
.chapter-title { flex: 1; min-width: 0; }

/* ── Auth gate / modals ──────────────────────────────────────────────── */
.auth-gate { max-width: 420px; margin: 70px auto; text-align: center; }
.auth-gate h2 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.auth-gate p { color: var(--text-2); margin-bottom: 20px; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 25, 45, 0.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 300;
}
.overlay.hidden { display: none; }
.modal {
  position: relative;
  width: 100%; max-width: 390px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  box-shadow: 0 24px 70px rgba(20,25,45,0.28);
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 15px; right: 15px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--paper-3); cursor: pointer; color: var(--text-2);
}
.modal-close:hover { background: var(--paper-4); }

.provider-list { display: flex; flex-direction: column; gap: 9px; }
.provider-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper-light); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.provider-btn:hover:not(:disabled) { background: var(--paper-2); }
.provider-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.provider-btn.hidden { display: none; }
.provider-icon { width: 20px; display: grid; place-items: center; font-weight: 700; }
.provider-soon { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-3); background: var(--paper-3); padding: 3px 7px; border-radius: 999px; }
.modal-form { display: flex; flex-direction: column; gap: 9px; margin-top: 13px; }
.modal-form.hidden { display: none; }
.modal-form input, .modal-form textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
}
.modal-form input:focus, .modal-form textarea:focus { outline: none; border-color: var(--blue); }
.modal-switch { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 15px; }
.modal-switch.hidden { display: none; }
.modal-switch a { color: var(--blue); font-weight: 600; cursor: pointer; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1150px) {
  .row-main, .row-bottom { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: 1fr; }
  .row-main, .row-bottom { grid-template-columns: 1fr; }
  .hero-text { flex: 0 0 50%; }
  .hero-cta { position: static; transform: none; margin: 0 20px 20px auto; }
  .hero-banner { flex-direction: column; height: auto; }
  .hero-art { min-height: 150px; }
  .hero-art::before { background: linear-gradient(180deg, var(--surface) 0%, rgba(248,239,214,0) 55%); }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 248px; flex-basis: 248px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(20,25,45,0.2); }
  .main-col { margin-left: 0; }
  .sidebar-toggle { display: grid !important; }
  .music-widget { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-wrap { padding: 18px 16px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
}
.sidebar-toggle { display: none; }

/* ── Admin ───────────────────────────────────────────────────────────── */
.admin-banner {
  background: var(--amber-soft); border: 1px solid #e8c98a; color: #7a5413;
  border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 18px; font-size: 13px;
}
.admin-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.admin-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 4px; }
.admin-tab { border: none; background: none; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.admin-tab.active { background: var(--blue-soft); color: var(--blue); }
.admin-tab span { font-weight: 500; opacity: 0.7; }
#admin-search { margin-left: auto; width: 240px; max-width: 100%; height: 36px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-family: inherit; }
#admin-search:focus { outline: none; border-color: var(--blue); }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.admin-table th { text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover { background: var(--paper-2); }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table th.num { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-green { background: var(--green-soft); color: #1d8a56; }
.pill-amber { background: var(--amber-soft); color: #8a5a10; }
.pill-grey  { background: var(--paper-3); color: var(--text-2); }
.au-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.au-stat { background: var(--paper-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.au-stat b { display: block; font-size: 16px; }
.au-stat span { font-size: 11px; color: var(--text-3); }

.stepper-btn {
  user-select: none;
  border: 1px solid var(--line-strong) !important;
  border-radius: 6px !important;
  background: var(--paper-light) !important;
  color: var(--text-1) !important;
  line-height: 1 !important;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.stepper-btn:hover {
  background: var(--paper-3) !important;
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}
/* ── Complete-your-profile ───────────────────────────────────────────── */
.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field .gender-card, .gender-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px 10px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--paper-light); font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
}
.gender-card input { position: absolute; opacity: 0; pointer-events: none; }
.gender-card img { width: 64px; height: 64px; image-rendering: pixelated; }
.gender-card:hover { background: var(--paper-2); }
.gender-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.goal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.goal-chip {
  border: 1px solid var(--line-strong); background: var(--paper-light); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.goal-chip:hover { background: var(--blue-soft); color: var(--blue); border-color: #d9bd7e; }
.hero-goal { font-size: 13px; color: var(--blue); font-weight: 600; }

/* ── Launch banner ───────────────────────────────────────────────────── */
.launch-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  margin-bottom: 18px; padding: 28px 32px;
  border-radius: var(--radius); color: #fff;
  background: linear-gradient(120deg, #2b3a8f 0%, #4c7dfd 55%, #7b6cf6 100%);
  box-shadow: 0 10px 34px rgba(76, 125, 253, 0.28);
  flex-wrap: wrap;
}
.launch-left { flex: 1 1 380px; min-width: 0; }
.launch-tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
  background: rgba(255,255,255,0.18); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.launch-title { font-size: 40px; font-weight: 800; line-height: 1.08; letter-spacing: -0.5px; }
.launch-title b { display: block; font-weight: 800; color: #ffe08a; font-size: 1.16em; }
.launch-sub { margin-top: 10px; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,0.9); max-width: 480px; }
.launch-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.launch-btn-main { background: var(--paper-light); color: #2b3a8f; }
.launch-btn-main:hover { background: #fff3d6; }
.launch-btn-main.done { background: var(--green-soft); color: #1f5a3a; cursor: default; }
.launch-btn-ghost { background: rgba(255,255,255,0.16); color: #fff; }
.launch-btn-ghost:hover { background: rgba(255,255,255,0.28); }
.launch-timer { display: flex; gap: 12px; }
.lt-box {
  min-width: 82px; padding: 16px 8px 12px; text-align: center;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px; backdrop-filter: blur(4px);
}
.lt-box b { display: block; font-size: 38px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.lt-box span { display: block; margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.8); }
.launch-live { font-size: 30px; font-weight: 800; }
@media (max-width: 640px) {
  .launch-banner { padding: 22px 18px; gap: 18px; }
  .launch-title { font-size: 30px; }
  .launch-timer { width: 100%; gap: 8px; }
  .lt-box { flex: 1; min-width: 0; padding: 12px 4px 9px; }
  .lt-box b { font-size: 26px; }
}

/* Confirmed state, wherever the interest button appears */
.btn.done, .btn.done:hover { background: var(--green-soft); color: #1f5a3a; cursor: default; }


/* ═══════════════════════════════════════════════════════════════════════
   PAPER & INK — three paper grounds, warm ink, one maroon accent against
   gold hairlines. Depth comes from the paper tones and 1px rules, never
   from drop shadows or dark chrome.
   ═══════════════════════════════════════════════════════════════════════ */

body { background-color: var(--bg); background-image: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
.page-head h1 { font-size: 30px; font-weight: 400; }
.card-head h3 { font-size: 18px; font-weight: 400; }

/* ── Chrome: paper with hairlines ───────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.sidebar-brand { color: var(--text); font-family: var(--serif); font-size: 17px; font-weight: 400; }
.sidebar-brand-icon {
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--blue);
}
.side-link {
  color: var(--text-2);
  font-family: var(--serif); font-size: 16px; font-weight: 400;
  border-radius: var(--radius-sm);
}
.side-link:hover { background: var(--paper-2); color: var(--blue); }
.side-link.active {
  background: var(--paper-3);
  color: var(--blue);
  box-shadow: inset 2px 0 0 var(--blue);
}
.side-link.active .side-icon svg { stroke: var(--blue); }

.topbar {
  background: rgba(251, 246, 238, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
@supports (backdrop-filter: blur(8px)) {
  .topbar { background: rgba(251, 246, 238, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
#global-search { background: var(--paper-light); border-color: var(--line-strong); color: var(--text); border-radius: var(--radius-sm); }
#global-search::placeholder { color: #A38F7C; }   /* light — it is a hint, not content */
.search-wrap svg { stroke: var(--text-3); }
.music-widget { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.music-title { color: var(--text); }
.music-sub { color: var(--text-3); }
.music-btn { color: var(--text-2); }
.music-btn:hover { background: var(--paper-3); color: var(--blue); }
.music-art { background: var(--blue); color: var(--surface); }
.icon-btn { background: var(--paper-2); border: 1px solid var(--line); color: var(--text-2); border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--paper-3); color: var(--blue); }
.icon-btn .dot { border-color: var(--surface); background: var(--red); }
.avatar-btn svg { stroke: var(--text-3); }
.avatar-btn .avatar-img {
  background: var(--paper-3); color: var(--blue) !important;
  border: 1px solid var(--line-strong);
  font-family: var(--serif);
}

.account-menu { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.search-results { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Cards: a hairline, and a lift only on hover ────────────────────── */
.card, .hero-banner, .badge-card, .leaderboard-list, .community-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.card:hover, .badge-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-link, .icon-btn { box-shadow: none; }
.card-link { color: var(--blue); }
.stat-value { font-family: var(--serif); font-weight: 400; }
.stat-label, .card-kicker { color: var(--gold-text); letter-spacing: .13em; text-transform: uppercase; font-size: 11px; }
.hero-name { font-family: var(--serif); font-weight: 400; }
.hero-greeting, .hero-quote { color: var(--text-2); }
.hero-cta {
  background: var(--blue); color: var(--surface);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-family: var(--serif); font-weight: 400;
}
.hero-cta:hover { background: #93473C; border-color: #93473C; }
.hero-cta .cta-icon { background: rgba(251, 246, 238, 0.18); }

.progress-track { background: var(--paper-3); border: 1px solid var(--line); height: 8px; border-radius: 99px; }
.progress-fill { background: var(--blue); }
.spark-bar { background: var(--paper-4); }
.spark-bar.strong, .chart-col.peak .chart-bar { background: var(--blue); }
.chart-bar { background: var(--paper-4); }
.stat-delta { color: var(--gold-text); }
.chart-select { background: var(--paper-light); border-color: var(--line-strong); color: var(--text-2); border-radius: var(--radius-sm); }

.day-dot .dot-circle { border-color: var(--line-strong); background: var(--paper-light); }
.day-dot.done .dot-circle { background: var(--gold); border-color: var(--gold); }
.day-dot.today .dot-circle { border-color: var(--blue); }

/* ── Buttons: nearly square, one maroon, no gradients ───────────────── */
.btn {
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--surface); text-shadow: none;
  font-family: var(--serif); font-weight: 400; font-size: 15px;
}
.btn:hover { background: #93473C; border-color: #93473C; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-soft { background: var(--paper-3); color: var(--blue-dark); border: 1px solid var(--line-strong); }
.btn-soft:hover { background: var(--paper-3); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--line-strong); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.add-btn { background: var(--blue); border: 1px solid var(--blue); box-shadow: none; border-radius: var(--radius-sm); }

.qa-btn { border: 1px solid var(--line); box-shadow: none; border-radius: var(--radius-sm); background: var(--paper-2); }
.qa-btn:hover { border-color: var(--line-strong); }
.qa-green, .qa-blue, .qa-amber, .qa-red { background: var(--paper-2); }

.goal-check, .field input, .field select, .field textarea,
.modal-form input, .modal-form textarea, .goal-add-row input, #admin-search {
  background: var(--paper-light); border-color: var(--line-strong); color: var(--text);
  border-radius: var(--radius-sm);
}
.field input:hover, .modal-form input:hover { border-color: var(--gold); }
.goal-item.done .goal-check { background: var(--gold); border-color: var(--gold); }
.field label { color: var(--blue); }
.field input:focus, .field select:focus, .field textarea:focus,
.modal-form input:focus, .goal-add-row input:focus, #admin-search:focus, #global-search:focus {
  border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(122, 59, 50, .14);
}

/* ── Modals: a paper sheet behind an ink veil ───────────────────────── */
.overlay { background: rgba(36, 26, 20, 0.52); }
.modal {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 32px 70px -30px rgba(36, 26, 20, 0.6);
}
.modal-close { background: transparent; color: var(--text-2); border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--paper-3); color: var(--blue); }
.provider-btn { background: var(--paper-light); border-color: var(--line-strong); color: var(--text); border-radius: var(--radius-sm); }
.provider-btn:hover:not(:disabled) { background: var(--paper-2); border-color: var(--gold); }
.modal-switch a, .card-link:hover { color: var(--blue-dark); }

.gender-card { background: var(--paper-light); border-color: var(--line-strong); border-radius: var(--radius-sm); }
.gender-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.goal-chip { background: var(--paper-light); border-radius: var(--radius-sm); }
.goal-chip:hover { background: var(--paper-3); color: var(--blue); border-color: var(--gold); }
.hero-goal { color: var(--blue-dark); }

/* ── Lists & tables ─────────────────────────────────────────────────── */
.list-row, .leaderboard-row, .community-row { border-bottom-color: var(--line); }
.admin-table tbody tr:hover { background: var(--paper-2); }
.admin-table th { color: var(--gold-text); letter-spacing: .13em; text-transform: uppercase; font-size: 11px; }
.admin-toolbar { border-bottom-color: var(--line); }
.admin-tab.active { background: var(--paper-3); color: var(--blue); }
.admin-banner { background: var(--amber-soft); border: 1px solid var(--line-strong); color: var(--gold-text); }
.rank-badge.gold   { background: var(--paper-3); color: var(--gold-text); }
.rank-badge.silver { background: var(--paper-2); color: var(--text-2); }
.rank-badge.bronze { background: var(--paper-4); color: var(--text-2); }
.pill-green { background: var(--green-soft); color: var(--gold-text); }
.pill-amber { background: var(--amber-soft); color: var(--gold-text); }
.pill-grey  { background: var(--paper-3); color: var(--text-2); }
.au-stat { background: var(--paper-2); }
.badge-card.locked { opacity: 0.5; filter: grayscale(0.7) sepia(0.2); }
.avatar-chip { border-color: var(--surface); background: var(--paper-3); color: var(--blue); }
.avatar-more { background: var(--paper-3); color: var(--text-2); }
.empty { color: var(--text-3); }
.live-dot { background: var(--gold); }

::selection { background: var(--gold-lift); color: var(--text); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Card headings stay on one line; the range picker gives way instead */
.card-head h3 { white-space: nowrap; }
.card-head { min-width: 0; }
.chart-select { padding: 5px 8px; font-size: 12px; max-width: 112px; }

/* Admin → Feedback */
.fb-item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fb-item.fb-new { background: var(--paper-2); box-shadow: inset 2px 0 0 var(--gold); }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; }
.fb-head a { color: inherit; opacity: .8; }
.fb-date { margin-left: auto; opacity: .6; font-size: 12px; }
.fb-phone { opacity: .75; }
.fb-msg { margin: 8px 0 10px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.fb-actions { display: flex; gap: 8px; }

/* Library → featured Private Room card */
.private-feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-bottom: 18px; padding: 22px 24px; }
.private-feature .pf-text { color: var(--text-2); margin: 0 0 14px; line-height: 1.5; }
.pf-sizes { display: flex; gap: 12px; flex-wrap: wrap; }
.pf-size { min-width: 92px; padding: 12px 18px; cursor: pointer; font: inherit; color: inherit; text-align: center;
  background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; }
.pf-size b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; }
.pf-size span { font-size: 12px; opacity: .7; }
.pf-size:hover, .pf-size.selected { background: var(--paper-3); border-color: var(--blue); }
.pf-ready { font-weight: 600; margin-bottom: 8px; }
.pf-join { border-left: 1px solid var(--line); padding-left: 24px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.pf-join-title { font-weight: 600; }
@media (max-width: 760px) { .private-feature { grid-template-columns: 1fr; } .pf-join { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; } }

/* The Private Room card is the standout on the Library page — it earns it
   with the inset paper tone and a maroon rule, not a gradient. */
.private-feature {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
}
.private-feature h3 { font-size: 22px; }
.pf-badge {
  margin-left: auto; padding: 5px 11px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--surface); background: var(--blue); box-shadow: none;
}
.private-feature .pf-text { color: var(--text-2); }
.private-feature .pf-size {
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none;
  transition: border-color .18s ease, transform .18s ease;
}
.private-feature .pf-size:hover { transform: translateY(-2px); border-color: var(--gold); background: var(--surface); }
.private-feature .pf-size.selected {
  background: var(--surface); border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.private-feature .pf-size.selected b, .private-feature .pf-size.selected span { color: var(--blue); opacity: 1; }
.private-feature .pf-join { border-left-color: var(--line-strong); }

/* ── Admin: online-by-room list ─────────────────────────────────────── */
.ao-room { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.ao-head { display: flex; align-items: center; gap: 10px; }
.ao-title { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ao-meta { font-size: 12px; color: var(--text-3); margin: 2px 0 8px; }
.ao-people { display: flex; flex-wrap: wrap; gap: 6px; }
.ao-person { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: var(--paper-2); border-radius: 999px; padding: 3px 4px 3px 4px; }
.ao-person img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: top; image-rendering: pixelated; }
.ao-remove { border: none; background: none; color: var(--text-3); font-size: 11px; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ao-remove:hover { background: var(--red-soft); color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════════
   HOME — greeting band, room cards, sidebar quote
   ═══════════════════════════════════════════════════════════════════════ */

.dicon{
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.dicon-sm{ width: 15px; height: 15px; }
.dicon-lg{ width: 24px; height: 24px; }

/* ── Greeting band ──────────────────────────────────────────────────── */
.home-hero{
  position: relative; isolation: isolate; overflow: hidden;
  margin-bottom: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.home-hero-art{ position: absolute; inset: 0 0 0 34%; z-index: -1; }
.home-hero-art img{ width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
/* the art fades into the paper so the type never sits on busy pixels */
.home-hero-art::after{
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(251,246,238,0.72) 0%, rgba(251,246,238,0.12) 42%),
    linear-gradient(90deg, var(--surface) 0%, rgba(251,246,238,0.92) 26%, rgba(251,246,238,0.38) 64%, rgba(251,246,238,0.14) 100%);
}
.home-hero-body{ position: relative; padding: 26px 28px 20px; }
.home-hero-greeting{ font-size: 15px; color: var(--text-2); margin-bottom: 2px; }
.home-hero-name{
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(26px, 3vw, 38px); line-height: 1.1; color: var(--text);
}
.home-hero-quote{
  margin-top: 6px; font-family: var(--serif); font-size: 17px;
  color: var(--text-2); font-style: italic;
}
.home-hero-goal{
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--blue);
}

.home-stats{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.home-stat{
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  background: rgba(251, 246, 238, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
@supports (backdrop-filter: blur(6px)){
  .home-stat{ background: rgba(251, 246, 238, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}
.home-stat-icon{
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: var(--paper-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); color: var(--blue);
}
.home-stat-text{ display: flex; flex-direction: column; min-width: 0; }
.home-stat .stat-value{ font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; }
.home-stat .stat-label{ font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); }

/* ── Section heading above the room cards ───────────────────────────── */
.section-head-row{
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.section-head-row .dicon{ color: var(--blue); }
.section-head-row h3{ font-family: var(--serif); font-weight: 400; font-size: 22px; }
.section-head-row p{ font-size: 14px; color: var(--text-2); }
.section-head-link{
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; cursor: pointer; padding: 4px 0;
  font-family: var(--serif); font-size: 15px; color: var(--blue);
  border-bottom: 1px solid transparent;
}
.section-head-link:hover{ border-bottom-color: var(--gold); }

/* ── Room cards ─────────────────────────────────────────────────────── */
.room-cards{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.room-card{
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.room-card:hover{ border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.room-art{ position: relative; aspect-ratio: 2.45 / 1; overflow: hidden; background: var(--paper-3); }
.room-art img{ width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.room-card:hover .room-art img{ transform: scale(1.035); }
.room-online{
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(251, 246, 238, 0.94);
  border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 600; color: var(--text);
}
.room-online .live-dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.room-online .live-dot.idle{ background: var(--line-strong); }

/* the panel: three tones of the one palette, so the halls stay distinct
   without introducing a second accent */
.room-body{
  flex: 1; display: flex; flex-direction: column;
  padding: 18px 18px 16px; color: var(--surface);
}
.room-maroon{ background: #7A3B32; }
.room-ink{    background: #3A2A20; }
.room-gold{   background: #6B5412; }
.room-title-row{ display: flex; align-items: flex-start; gap: 12px; }
.room-badge{
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(251, 246, 238, 0.16);
  border: 1px solid rgba(251, 246, 238, 0.3);
}
.room-badge .dicon{ color: var(--surface); }
.room-title-row h4{
  margin: 0; flex: 1; min-width: 0;
  font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.2;
}
.room-go{
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 50%; cursor: pointer; color: var(--surface);
  background: rgba(251, 246, 238, 0.16);
  border: 1px solid rgba(251, 246, 238, 0.3);
  transition: background .18s ease;
}
.room-go:hover{ background: rgba(251, 246, 238, 0.3); }
.room-blurb{ margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: rgba(251, 246, 238, 0.84); }
.room-chips{ display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.room-chip{
  padding: 4px 11px; border-radius: 999px;
  background: rgba(251, 246, 238, 0.14);
  border: 1px solid rgba(251, 246, 238, 0.22);
  font-size: 11.5px; color: rgba(251, 246, 238, 0.92);
}

/* ── Sidebar quote ──────────────────────────────────────────────────── */
.side-quote{
  margin-top: auto; padding: 16px 15px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.side-quote .dicon{ color: var(--gold); margin-bottom: 8px; }
.side-quote p{
  font-family: var(--serif); font-weight: 400; font-size: 15px;
  line-height: 1.35; color: var(--text-2);
}

@media (max-width: 1150px){
  .room-cards{ grid-template-columns: repeat(2, 1fr); }
  .home-stats{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px){
  .home-hero-art{ inset: 0 0 0 48%; }
  .home-hero-art::after{
    background: linear-gradient(90deg, var(--surface) 0%, rgba(251,246,238,0.9) 34%, rgba(251,246,238,0.3) 100%);
  }
}
@media (max-width: 760px){
  .room-cards{ grid-template-columns: 1fr; }
  .home-hero-art{ inset: 0; }
  .home-hero-art::after{
    background: linear-gradient(180deg, rgba(251,246,238,0.94) 0%, rgba(251,246,238,0.88) 58%, rgba(251,246,238,0.94) 100%);
  }
  .home-hero-body{ padding: 22px 18px 18px; }
  .section-head-row p{ display: none; }
  .section-head-link{ margin-left: 0; }
}
@media (max-width: 560px){
  .home-stats{ grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce){
  .room-card:hover{ transform: none; }
  .room-card:hover .room-art img{ transform: none; }
}

.card-head .dicon, .qa-btn .dicon{ color: var(--blue); }
.qa-btn{ display: flex; align-items: center; gap: 10px; }

/* ── Library tabs ───────────────────────────────────────────────────── */
.lib-tabs{
  display: flex; gap: 6px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.lib-tab{
  background: none; border: 0; cursor: pointer;
  padding: 9px 16px 11px; margin-bottom: -1px;
  font-family: var(--serif); font-size: 16px; color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.lib-tab:hover{ color: var(--blue); }
.lib-tab.is-on{ color: var(--blue); border-bottom-color: var(--blue); }
.lib-panel.hidden{ display: none; }
.card-note{ font-size: 13px; color: var(--text-2); margin: -2px 0 14px; }

/* a quiet chip for time logged against a subject or subtopic */
.time-chip{
  flex: none; padding: 2px 9px; border-radius: 999px;
  background: var(--paper-3); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--gold-text);
  font-variant-numeric: tabular-nums;
}
.chapter-row .time-chip{ margin-left: auto; }

/* ── Focus: what this session counts towards ────────────────────────── */
.focus-pick{
  max-width: 360px; margin: 0 auto 18px; padding: 14px 16px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-align: left;
}
.focus-pick-label{
  display: block; margin-bottom: 7px;
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--gold-text);
}
.focus-pick-row{ display: flex; gap: 8px; }
.focus-pick-row select{ flex: 1; min-width: 0; max-width: none; }
.focus-pick-note{ margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.focus-pick.is-empty .focus-pick-row{ display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   COMMUNITY — directory, requirements board, messages
   ═══════════════════════════════════════════════════════════════════════ */
.com-panel.hidden{ display: none; }
.com-total{ margin-left: auto; font-size: 12px; color: var(--gold-text); letter-spacing: .1em; text-transform: uppercase; }

/* field tiles */
.field-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.field-tile{
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 12px 14px; cursor: pointer; text-align: left;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: inherit; font: inherit;
  transition: border-color .18s ease, background .18s ease;
}
.field-tile:hover{ border-color: var(--line-strong); }
.field-tile.is-on{ border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: var(--surface); }
.field-tile b{ font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.1; }
.field-tile span{ font-size: 12px; color: var(--text-2); }

/* filter bar */
.com-filters{
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 0 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.com-filters input[type="text"]{
  flex: 1; min-width: 180px; padding: 9px 12px;
  background: var(--paper-light); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: inherit; color: var(--text);
}
.com-filters input[type="time"]{
  padding: 7px 9px; background: var(--paper-light);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit;
}
.com-check{ display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.com-window{ display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-2); }

/* student rows */
.student-row{ cursor: pointer; align-items: flex-start; gap: 11px; }
.student-row:hover{ background: var(--paper-2); }
.student-dot{
  width: 8px; height: 8px; margin-top: 7px; flex: none;
  border-radius: 50%; background: var(--line-strong);
}
.student-dot.is-online{ background: var(--gold); box-shadow: 0 0 0 3px rgba(168,129,44,.18); }
.student-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.student-name{ font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.student-meta{ font-size: 12.5px; color: var(--text-2); }
.student-figs{ text-align: right; display: flex; flex-direction: column; }
.student-figs b{ color: var(--blue); }
.student-figs span{ font-size: 11.5px; color: var(--text-3); }

/* the profile sheet */
.student-stats{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 14px; }
.student-stat{
  padding: 11px; text-align: center;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.student-stat b{ display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; }
.student-stat span{ font-size: 11px; color: var(--text-2); }
.student-avail{ font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.student-actions{ display: grid; gap: 8px; }

/* the board */
.post-form{ display: grid; gap: 10px; }
.post-form select{ max-width: none; }
.post-form textarea{
  width: 100%; padding: 11px 13px; font: inherit; resize: vertical;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.post-form-foot{ display: flex; align-items: center; gap: 12px; }
.post-form-foot .form-status{ flex: 1; }
.post-row{ padding: 16px 0; border-bottom: 1px solid var(--line); }
.post-row:last-child{ border-bottom: 0; }
.post-head{ display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 7px; }
.post-kind{ font-weight: 600; }
.post-field{
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  background: var(--paper-3); color: var(--gold-text);
}
.post-when{ margin-left: auto; font-size: 12px; color: var(--text-3); }
.post-body{ color: var(--text-2); line-height: 1.55; white-space: pre-wrap; }
.post-foot{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.post-author{
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--text);
  font-weight: 600; text-align: left;
}
.post-author:hover{ color: var(--blue); }
.post-author span{ font-weight: 400; font-size: 12px; color: var(--text-2); }

/* messages */
.msg-layout{ display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.msg-threads{ max-height: 560px; overflow-y: auto; }
.thread-row{ cursor: pointer; }
.thread-row:hover{ background: var(--paper-2); }
.thread-row.is-on{ background: var(--paper-3); }
.unread-dot{
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--blue); color: var(--surface);
  font-size: 11px; display: inline-grid; place-items: center;
}
.side-badge{
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--blue); color: var(--surface); font-size: 11px;
  display: inline-grid; place-items: center;
}
.msg-pane{ display: flex; flex-direction: column; min-height: 420px; }
.msg-pane-head{
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.msg-pane-head h3{ flex: 1; font-family: var(--serif); font-weight: 400; font-size: 19px; }
.msg-pane-head .hidden{ display: none; }
.msg-compose{ display: flex; gap: 9px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.msg-compose.hidden{ display: none; }
.msg-compose textarea{
  flex: 1; padding: 10px 12px; font: inherit; resize: none;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}

/* settings: the study window */
.avail-days{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.day-pick{ display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.avail-times{ display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.avail-times input[type="time"]{
  padding: 9px 11px; background: var(--paper-light);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit;
}

@media (max-width: 900px){
  .msg-layout{ grid-template-columns: 1fr; }
  .msg-threads{ max-height: 240px; }
  .student-stats{ grid-template-columns: repeat(2, 1fr); }
}

/* ── Day pills, replacing raw checkboxes ────────────────────────────── */
.avail-days{ display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.day-pick{
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; padding: 7px 12px; cursor: pointer;
  background: var(--paper-light); border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: 13px; color: var(--text-2);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.day-pick:hover{ border-color: var(--gold); }
.day-pick input{ position: absolute; opacity: 0; pointer-events: none; }
.day-pick:has(input:checked){ background: var(--blue); border-color: var(--blue); color: var(--surface); }
.day-pick:has(input:focus-visible){ outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Two-handle window slider ───────────────────────────────────────── */
.window-slider{ max-width: 420px; }
.ws-readout{ margin-bottom: 10px; }
.ws-readout b{
  font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ws-rail{
  position: relative; height: 26px;
  display: flex; align-items: center;
  cursor: pointer; touch-action: none;
}
.ws-rail::before{
  content: ""; position: absolute; left: 0; right: 0; height: 5px;
  background: var(--paper-3); border: 1px solid var(--line); border-radius: 999px;
}
.ws-fill{
  position: absolute; height: 5px; border-radius: 999px;
  background: var(--blue);
}
.ws-rail input[type="range"]{
  position: absolute; left: 0; width: 100%; margin: 0;
  height: 26px; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.ws-rail input[type="range"]:focus{ outline: none; }
.ws-rail input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--blue);
  box-shadow: 0 1px 3px rgba(36,26,20,.3);
  cursor: grab; pointer-events: auto;
}
.ws-rail input[type="range"]::-webkit-slider-thumb:active{ cursor: grabbing; background: var(--blue); }
.ws-rail input[type="range"]::-moz-range-thumb{
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--blue);
  cursor: grab; pointer-events: auto;
}
.ws-rail input[type="range"]:focus-visible::-webkit-slider-thumb{ outline: 2px solid var(--blue); outline-offset: 2px; }
.ws-scale{
  display: flex; justify-content: space-between; margin-top: 7px;
  font-size: 11px; color: var(--text-3);
}
.window-slider.is-compact{ width: 270px; max-width: none; flex: none; }
.window-slider.is-compact .ws-readout{ margin-bottom: 4px; }
.window-slider.is-compact .ws-readout b{ font-size: 14px; }

/* ── "Set what you are studying for" ────────────────────────────────── */
.field-prompt{
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 16px 18px; margin-bottom: 18px;
  background: var(--paper-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.field-prompt.hidden{ display: none; }
.field-prompt-text{ flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.field-prompt-text b{ font-family: var(--serif); font-weight: 400; font-size: 17px; }
.field-prompt-text span{ font-size: 13px; color: var(--text-2); }

/* any checkbox still on screen takes the accent, not the browser's blue */
input[type="checkbox"], input[type="radio"]{ accent-color: var(--blue); }

/* ═══════════════════════════════════════════════════════════════════════
   COMMUNITY FEED
   ═══════════════════════════════════════════════════════════════════════ */
.com-hero{
  position: relative; isolation: isolate; overflow: hidden;
  margin-bottom: 20px; padding: 26px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.com-hero-art{ position: absolute; inset: 0 0 0 44%; z-index: -1; }
.com-hero-art img{ width: 100%; height: 100%; object-fit: cover; }
.com-hero-art::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(251,246,238,.92) 30%, rgba(251,246,238,.4) 70%, rgba(251,246,238,.15) 100%);
}
.eyebrow-sm{ font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 4px; }
.com-hero h1{ font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.com-hero p{ color: var(--text-2); margin-top: 4px; }

.com-layout{ display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.com-rail{ display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; position: sticky; top: 88px; min-width: 0; }
.com-rail > *, .com-main{ min-width: 0; }

/* composer */
.composer{ margin-bottom: 18px; }
.composer-top{ display: flex; align-items: center; gap: 12px; }
.composer-avatar, .post-avatar{
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--paper-3); border: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: 16px; color: var(--blue); cursor: default;
}
.post-avatar[data-student]{ cursor: pointer; }
.post-avatar.sm{ width: 28px; height: 28px; font-size: 13px; }
.composer-top input{
  flex: 1; min-width: 0; padding: 11px 14px; font: inherit; color: var(--text);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
}
.composer-rest{ margin-top: 12px; display: grid; gap: 10px; }
.composer-rest.hidden{ display: none; }
.composer-rest textarea{
  width: 100%; padding: 11px 13px; font: inherit; resize: vertical;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.composer-meta{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.composer-meta.hidden{ display: none; }
.composer-meta input{
  padding: 9px 11px; font: inherit; font-size: 13px;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.composer-foot{ display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 12px; }
.composer-foot .chart-select{ margin-left: auto; }
.kind-chips{ display: flex; flex-wrap: wrap; gap: 7px; }
.kind-chip{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; cursor: pointer; font: inherit; font-size: 13px;
  background: var(--paper-light); border: 1px solid var(--line-strong);
  border-radius: 999px; color: var(--text-2);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.kind-chip:hover{ border-color: var(--gold); }
.kind-chip.is-on{ background: var(--blue); border-color: var(--blue); color: var(--surface); }

/* feed */
.feed-filter{ display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.feed-tab{
  padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13.5px;
  background: transparent; border: 1px solid transparent; border-radius: 999px; color: var(--text-2);
}
.feed-tab:hover{ color: var(--blue); }
.feed-tab.is-on{ background: var(--paper-3); border-color: var(--line-strong); color: var(--blue); }

.post-card-top{ display: flex; align-items: center; gap: 10px; }
.post-menu{
  background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  color: var(--text-3); padding: 0 4px;
}
.post-menu:hover{ color: var(--red); }
.tag{
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
  background: var(--paper-3); color: var(--text-2); border: 1px solid var(--line);
}
.tag.sm{ font-size: 11px; padding: 2px 8px; }
.tag.tone-violet{ background: #EDE4F0; color: #5E4B6B; border-color: #DCCDE2; }
.tag.tone-blue{   background: #DFE7EE; color: #3C5568; border-color: #C9D6E1; }
.tag.tone-green{  background: #DFE9DC; color: #40583B; border-color: #CBDBC6; }
.tag.tone-amber{  background: var(--amber-soft); color: var(--gold-text); border-color: var(--line-strong); }
.post-comments{ margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.post-comments.hidden{ display: none; }
.comment{ display: flex; gap: 9px; }
.comment b{ font-size: 13px; }
.comment span{ font-size: 11.5px; color: var(--text-3); }
.comment p{ font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin-top: 2px; }
.comment-add{ display: flex; gap: 8px; }
.comment-add input{
  flex: 1; min-width: 0; padding: 8px 11px; font: inherit; font-size: 13px;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}

/* rail */
.com-rail .card-head{ margin-bottom: 12px; }
.com-rail input[type="text"]{
  width: 100%; padding: 9px 12px; font: inherit; font-size: 13px;
  background: var(--paper-light); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.rail-filters{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 9px 0 6px; }
.rail-filters .chart-select{ max-width: none; width: 100%; }
.student-state{ font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.student-state.is-online{ color: var(--gold-text); }
.student-state.is-online::before,
.student-state.is-free::before{
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px;
  border-radius: 50%; background: var(--gold);
}
.student-state.is-free{ color: var(--text-2); }
.student-row{ gap: 9px; align-items: center; min-width: 0; }
.student-row .btn{ flex: none; }
.student-row .face{ --face: 40px; }
.student-main{ background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; }

.trend-row{
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 0; cursor: pointer; font: inherit; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
}
.trend-row:last-child{ border-bottom: 0; }
.trend-row:hover .trend-label{ color: var(--blue); }
.trend-rank{
  width: 24px; height: 24px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--paper-3);
  font-family: var(--serif); font-size: 13px; color: var(--gold-text);
}
.trend-label{ flex: 1; min-width: 0; font-size: 13.5px; }
.trend-count{ font-size: 12px; color: var(--text-3); }

@media (max-width: 1200px){
  .com-layout{ grid-template-columns: 1fr; }
  .com-rail{ position: static; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px){
  .feed{ grid-template-columns: 1fr; }
  .com-rail{ grid-template-columns: 1fr; }
  .com-hero-art{ inset: 0; }
  .com-hero-art::after{ background: linear-gradient(180deg, rgba(251,246,238,.93), rgba(251,246,238,.86)); }
}
@media (max-width: 560px){
  .composer-meta{ grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   HOME WELCOME BANNER, FRIENDS, PHONE TAB BAR
   ═══════════════════════════════════════════════════════════════════════ */
.welcome{
  position: relative; isolation: isolate; overflow: hidden;
  margin-bottom: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  min-height: 280px; display: grid; place-items: center; text-align: center;
  padding: 44px 24px;
}
.welcome-art{ position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.welcome-veil{
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(36,26,20,.52) 0%, rgba(36,26,20,.3) 45%, rgba(36,26,20,.62) 100%);
}
.welcome-body h1{
  font-family: var(--serif); font-weight: 400; color: var(--surface);
  font-size: clamp(28px, 4vw, 44px); line-height: 1.1;
}
.welcome-body > p{ color: rgba(251,246,238,.9); margin-top: 6px; }
.welcome-goal{
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  background: rgba(251,246,238,.16); border: 1px solid rgba(251,246,238,.3);
  color: var(--surface); font-size: 13px;
}
.welcome-actions{ display: flex; flex-wrap: wrap; gap: 11px; justify-content: center; margin-top: 22px; }
.welcome-actions .btn{ display: inline-flex; align-items: center; gap: 9px; }
.btn-onart{
  background: rgba(251,246,238,.12); color: var(--surface);
  border: 1px solid rgba(251,246,238,.55);
}
.btn-onart:hover{ background: var(--surface); color: var(--text); border-color: var(--surface); }

.home-row{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.prog-figs{ display: flex; gap: 18px; flex-wrap: wrap; }
.prog-figs > div{ display: flex; flex-direction: column; }
.prog-figs .stat-value{ font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; }
.prog-figs span{ font-size: 11.5px; color: var(--text-2); }

.week-bars{ display: flex; align-items: flex-end; gap: 7px; height: 104px; margin-top: 16px; }
.week-bar{ flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.week-bar span{ width: 100%; background: var(--paper-3); border-radius: 3px 3px 0 0; min-height: 6px; }
.week-bar.is-today span{ background: var(--blue); }
.week-bar b{ font-weight: 400; font-size: 11px; color: var(--text-3); margin-top: 6px; }

.room-mini{
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--line); color: inherit;
}
.room-mini:last-child{ border-bottom: 0; }
.room-mini img{
  width: 86px; height: 52px; flex: none; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.room-mini-text{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-mini-text b{ font-weight: 600; font-size: 14px; }
.room-mini-text span{ font-size: 12px; color: var(--text-2); }
.room-mini-go{
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-strong); color: var(--blue);
}
.room-mini:hover .room-mini-go{ background: var(--blue); color: var(--surface); border-color: var(--blue); }
.room-mini:hover .room-mini-text b{ color: var(--blue); }

/* friends */
.friend-row{ gap: 10px; align-items: center; }
.pres-dot{
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-strong); margin-left: 2px;
}
.pres-dot.is-online{ background: #4C8A52; }
.pres-dot.is-free{ background: var(--gold); }
.page-head{ position: relative; }
.page-head .btn{ position: absolute; right: 0; top: 0; }

/* phone tab bar */
.tabbar{ display: none; }
@media (max-width: 820px){
  .tabbar{
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(251,246,238,.96); border-top: 1px solid var(--line-strong);
  }
  .tabbar button{
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px calc(9px + env(safe-area-inset-bottom, 0px));
    background: none; border: 0; cursor: pointer; font: inherit; font-size: 11px; color: var(--text-2);
  }
  .tabbar button.is-on{ color: var(--blue); }
  .tab-dot{
    position: absolute; top: 6px; right: 50%; margin-right: -16px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  }
  .tab-dot.hidden{ display: none; }
  .page-wrap{ padding-bottom: 86px; }
}
@media (max-width: 760px){
  .home-row{ grid-template-columns: 1fr; }
  .page-head .btn{ position: static; margin-top: 12px; }
}

/* Telegram invite popup */
.tg-popup{ position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000;
  width: min(420px, calc(100vw - 32px)); padding: 16px 18px; border-radius: 14px;
  background: #fff; color: #1a1a2e; box-shadow: 0 10px 40px rgba(0,0,0,.25); animation: tg-in .35s ease-out; }
.tg-popup .tg-title{ font-weight: 700; margin-bottom: 4px; padding-right: 22px; }
.tg-popup .tg-text{ font-size: 14px; opacity: .8; margin-bottom: 12px; }
.tg-popup .tg-join{ display: inline-block; background: #229ed9; color: #fff; text-decoration: none; }
.tg-popup .tg-close{ position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 22px; cursor: pointer; color: inherit; opacity: .6; }
@keyframes tg-in{ from{ opacity: 0; transform: translate(-50%, 20px); } to{ opacity: 1; transform: translate(-50%, 0); } }

/* ── Messenger-style messages ───────────────────────────────────────── */
.msg-layout{ grid-template-columns: 340px 1fr; }
.msg-threads{ max-height: none; height: calc(100vh - var(--topbar-h) - 170px); min-height: 460px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.msg-threads-head{ padding: 16px 18px 6px; }
.msg-threads-head h3, .chats-panel-head h3{ font-family: var(--sans); font-size: 24px; font-weight: 800; }
.msg-search{ position: relative; margin: 8px 14px; }
.msg-search svg{ position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-2); fill: none; stroke-width: 2; }
.msg-search input{ width: 100%; padding: 9px 14px 9px 36px; border: 0; border-radius: 999px; background: var(--paper-3); font: inherit; font-size: 14px; }
.msg-search input:focus{ outline: 2px solid var(--blue-soft); }
.msg-tabs{ display: flex; gap: 6px; padding: 4px 14px 8px; }
.msg-tab{ border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.msg-tab:hover{ background: var(--paper-3); }
.msg-tab.on{ background: var(--blue-soft); color: var(--blue); }
.msg-thread-list{ overflow-y: auto; flex: 1; padding: 0 8px 8px; }

.av{ flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; }
.av-md{ width: 40px; height: 40px; font-size: 17px; }
.av-lg{ width: 52px; height: 52px; font-size: 21px; }
.av.hidden{ display: none; }

.chat-row{ display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.chat-row:hover{ background: var(--paper-3); }
.chat-row.is-on{ background: var(--blue-soft); }
.chat-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-name{ font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last{ font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.is-unread .chat-name, .chat-row.is-unread .chat-last{ font-weight: 700; color: var(--text); }
.chat-dot{ flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }

.msg-pane{ height: calc(100vh - var(--topbar-h) - 170px); min-height: 460px; padding: 0; overflow: hidden; }
.msg-pane-head{ display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.msg-with-wrap{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-pane-head h3{ font-family: var(--sans); font-size: 17px; font-weight: 700; }
.msg-with-sub{ font-size: 12px; color: var(--text-2); }
.msg-with-sub.hidden{ display: none; }
.msg-scroll{ flex: 1; overflow-y: auto; max-height: none; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.msg-time{ align-self: center; font-size: 12px; color: var(--text-2); margin: 12px 0 6px; }
.bubble{ max-width: 68%; padding: 8px 13px; border-radius: 18px; background: var(--paper-3); border: 0; align-self: flex-start; margin-top: 8px; animation: bub-in .16s ease-out; }
.bubble.mine{ align-self: flex-end; background: var(--blue); color: var(--surface); }
.bubble.g-mid{ margin-top: 0; }
.bubble.g-mid:not(.mine){ border-top-left-radius: 5px; }
.bubble.g-next:not(.mine){ border-bottom-left-radius: 5px; }
.bubble.mine.g-mid{ border-top-right-radius: 5px; }
.bubble.mine.g-next{ border-bottom-right-radius: 5px; }
.bubble p{ line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.bubble.pending{ opacity: .6; }
.bubble.failed{ background: var(--red); cursor: pointer; }
.msg-status{ align-self: flex-end; font-size: 11px; color: var(--text-2); margin: 2px 4px 0; }
@keyframes bub-in{ from{ opacity: 0; transform: translateY(6px) scale(.97); } to{ opacity: 1; transform: none; } }

.msg-typing{ display: flex; align-items: center; gap: 8px; padding: 2px 18px 6px; font-size: 12px; color: var(--text-2); }
.msg-typing.hidden{ display: none; }
.typing-dots{ display: inline-flex; gap: 3px; padding: 8px 11px; border-radius: 16px; background: var(--paper-3); }
.typing-dots i{ width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); animation: typing 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2){ animation-delay: .15s; }
.typing-dots i:nth-child(3){ animation-delay: .3s; }
@keyframes typing{ 0%,60%,100%{ transform: translateY(0); opacity: .45; } 30%{ transform: translateY(-4px); opacity: 1; } }

.msg-compose{ display: flex; gap: 10px; align-items: flex-end; padding: 10px 14px 14px; border-top: 0; }
.msg-compose textarea{ flex: 1; padding: 9px 16px; font: inherit; resize: none; max-height: 120px; background: var(--paper-3); border: 0; border-radius: 20px; line-height: 1.4; }
.msg-compose textarea:focus{ outline: 2px solid var(--blue-soft); }
.msg-send{ flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--blue); cursor: pointer; display: grid; place-items: center; }
.msg-send:hover{ background: var(--blue-dark); }
.msg-send svg{ width: 18px; height: 18px; stroke: var(--surface); fill: var(--surface); stroke-width: 1.5; stroke-linejoin: round; }

/* topbar Chats dropdown */
.chats-wrap{ position: relative; }
#chats-btn{ position: relative; }
.dot-count{ position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dot-count.hidden{ display: none; }
.chats-panel{ position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-height: 520px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 60; }
.chats-panel.hidden{ display: none; }
.chats-panel-head{ display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.chats-expand{ border: 0; background: none; color: var(--blue); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chats-panel .msg-thread-list{ max-height: 360px; }

@media (max-width: 900px){
  .msg-layout{ grid-template-columns: 1fr; }
  .msg-threads{ height: 280px; min-height: 0; }
  .msg-pane{ height: 70vh; }
  .chats-panel{ position: fixed; left: 8px; right: 8px; top: var(--topbar-h); width: auto; }
}

/* ── Facebook-style top bar ─────────────────────────────────────────── */
.topbar{ gap: 12px; padding: 0 16px; box-shadow: 0 1px 2px rgba(36,26,20,.12); }
.top-logo{ flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.top-logo .dicon{ width: 24px; height: 24px; stroke: var(--surface); }
.search-wrap{ flex: 0 1 280px; }
.search-wrap input{ border: 0; border-radius: 999px; background: var(--paper-3); }

.top-tabs{ position: absolute; left: 50%; top: 0; bottom: 0; transform: translateX(-50%); display: flex; align-items: stretch; gap: 4px; }
.top-tab{ position: relative; width: 96px; display: grid; place-items: center; color: var(--text-2); text-decoration: none; border-radius: 8px; margin: 6px 0; }
.top-tab svg{ width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-tab:hover{ background: var(--paper-3); }
.top-tab.active{ color: var(--blue); border-radius: 0; }
.top-tab.active:hover{ background: none; }
.top-tab.active::after{ content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; background: var(--blue); border-radius: 3px 3px 0 0; }

.topbar .icon-btn{ width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper-3); color: var(--text); display: grid; place-items: center; }
.topbar .icon-btn:hover{ background: var(--wood-deep); color: var(--text); }
.topbar .icon-btn svg{ width: 20px; height: 20px; }
.topbar .icon-btn .dot{ top: -3px; right: -3px; }
.avatar-btn{ padding: 0; position: relative; }
.avatar-btn .avatar-img{ border: 0; }
.avatar-btn > svg{ position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; padding: 1px; border-radius: 50%; background: var(--paper-3); stroke: var(--text); }

@media (max-width: 1600px){ .top-tab{ width: 72px; } }
@media (max-width: 1400px){ .top-tabs{ display: none; } }
@media (max-width: 760px){ .search-wrap{ display: none; } }

/* ── Cozy Library Redesign Workspace ─────────────────────────────────── */
:root {
  --terracotta: #8B2E28;
  --terracotta-hover: #752520;
  --terracotta-soft: #F4E2DE;
  --terracotta-tint: #FAF2F0;
  --live-green: #22C55E;
}

/* Sidebar user card & quote styling matching mockup */
.side-user-card {
  margin: auto 12px 10px 12px;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(36,26,20,0.04);
}
.side-user-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper-3);
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.side-user-avatar-wrap img {
  position: absolute;
  max-width: none;
  width: 260%;
  height: auto;
  left: -80%;
  top: -31%;
  image-rendering: pixelated;
}
.side-user-avatar-wrap.has-photo img {
  max-width: 100%;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: cover;
  image-rendering: auto;
}
.side-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.side-user-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.2;
}
.side-user-level {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}
.side-user-xp-bar {
  width: 100%;
  height: 4px;
  background: var(--paper-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.side-user-xp-fill {
  height: 100%;
  background: var(--terracotta);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.side-user-xp-text {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 3px;
  text-align: right;
  font-weight: 500;
}

.side-quote-card {
  margin: 0 12px 14px 12px;
  background: var(--terracotta-tint);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 8px;
  border: 1px solid var(--terracotta-soft);
}
.side-quote-icon {
  width: 16px;
  height: 16px;
  stroke: var(--terracotta);
  flex-shrink: 0;
  margin-top: 2px;
}
.side-quote-text {
  font-size: 12px;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

/* Sidebar active link terracotta pill */
.sidebar-nav .side-link.active {
  background: var(--terracotta-soft);
  color: var(--terracotta);
  font-weight: 700;
  border-radius: 10px;
}
.sidebar-nav .side-link.active .side-icon svg {
  stroke: var(--terracotta);
}

/* Topbar music ambience player pill */
.music-widget.music-pill-active {
  background: var(--terracotta);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(139, 46, 40, 0.28);
}
.music-widget.music-pill-active .music-art {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.music-widget.music-pill-active .music-title {
  color: #FFFFFF;
  font-weight: 600;
  font-size: 12.5px;
}
.music-widget.music-pill-active .music-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}
.music-widget.music-pill-active .music-btn {
  background: transparent;
  color: #FFFFFF;
  border: 0;
  padding: 2px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.music-widget.music-pill-active .music-btn svg {
  width: 16px;
  height: 16px;
  fill: #FFFFFF;
}

/* Messages Popover Dropdown */
.messages-popover {
  position: absolute;
  top: calc(var(--topbar-h) - 4px);
  right: 64px;
  width: 320px;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(36,26,20,0.18), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--line);
  z-index: 1000;
  overflow: hidden;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--paper-2);
}
.popover-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.popover-link {
  font-size: 12px;
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: none;
}
.popover-link:hover {
  text-decoration: underline;
}
.popover-list {
  max-height: 380px;
  overflow-y: auto;
}
.popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}
.popover-item:hover {
  background: var(--paper-3);
}
.popover-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  image-rendering: pixelated;
  flex-shrink: 0;
}
.popover-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.popover-icon-circle.group-blue {
  background: #E6F0FA;
  color: #1D6FB8;
}
.popover-icon-circle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.popover-info {
  flex: 1;
  min-width: 0;
}
.popover-name-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.popover-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.popover-time {
  font-size: 11px;
  color: var(--text-3);
}
.popover-msg {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.popover-badge {
  background: var(--terracotta);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}
.popover-muted {
  font-size: 13px;
  opacity: 0.6;
}
.popover-divider {
  height: 1px;
  background: var(--paper-2);
  margin: 4px 16px;
}

/* ── The 2D Library Viewport Frame ────────────────────────────────────── */
.library-viewport {
  position: relative;
  width: 100%;
  height: 500px;
  background: #18110b;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(36, 26, 20, 0.08);
  overflow: hidden;
}
@media (max-width: 1024px) {
  .library-viewport { height: 420px; }
}
@media (max-width: 768px) {
  .library-viewport { height: 340px; }
}
.library-viewport #canvas-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.library-viewport #game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Floating HUD Overlays inside Canvas */
.hud-pill {
  position: absolute;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  font-weight: 600;
  color: #2C1F16;
  font-size: 13.5px;
  user-select: none;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.hud-pill:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
}
.hud-room-pill {
  top: 16px;
  left: 18px;
}
.hud-room-pill svg {
  width: 17px;
  height: 17px;
  stroke: var(--terracotta);
}
.hud-chevron {
  font-size: 10px;
  opacity: 0.6;
}
.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}
.hud-count {
  font-weight: 500;
  color: var(--text-2);
  font-size: 12.5px;
}

/* Room dropdown menu */
.hud-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid var(--line);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  z-index: 100;
}
.hud-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  font-family: inherit;
}
.hud-drop-item:hover {
  background: var(--paper-3);
  color: var(--terracotta);
}
.hud-drop-item.active {
  background: var(--terracotta-soft);
  color: var(--terracotta);
  font-weight: 700;
}

/* Floor Badge */
.hud-floor-pill {
  top: 16px;
  right: 140px;
  font-size: 13px;
  padding: 8px 14px;
}

/* Minimap Overlay */
.hud-minimap-wrap {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 20;
  width: 108px;
  height: 76px;
  background: rgba(20, 14, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  overflow: hidden;
  cursor: pointer;
}
#minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.minimap-radar-sweep {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(34, 197, 94, 0.25) 30deg, transparent 35deg);
  border-radius: 50%;
  pointer-events: none;
  animation: radarSpin 4s linear infinite;
}
@keyframes radarSpin {
  100% { transform: rotate(360deg); }
}

/* Left Floating Toolstrip */
.hud-toolstrip {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 6px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.14);
  border: 1px solid rgba(0,0,0,0.06);
}
.hud-tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #4A3A2C;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
}
.hud-tool-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hud-tool-btn:hover {
  background: var(--paper-3);
  color: var(--terracotta);
  transform: scale(1.08);
}
.hud-tool-btn.active {
  background: var(--terracotta);
  color: #FFFFFF;
}
.hud-tool-btn.active svg {
  stroke: #FFFFFF;
}

/* ── 4 Companion Study Panels Grid ───────────────────────────────────── */
.study-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 28px;
}
@media (max-width: 1200px) {
  .study-panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .study-panel-grid {
    grid-template-columns: 1fr;
  }
}

.study-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(36,26,20,0.04);
  min-height: 310px;
}
.card-head-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-head-between h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.view-all-link {
  font-size: 12.5px;
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: none;
}
.view-all-link:hover {
  text-decoration: underline;
}

/* Subtabs row in cards */
.subtabs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--paper-2);
  margin-bottom: 14px;
}
.subtab {
  background: transparent;
  border: 0;
  padding: 6px 2px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  font-family: inherit;
}
.subtab.is-active {
  color: var(--terracotta);
}
.subtab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  background: var(--terracotta);
  border-radius: 2px 2px 0 0;
}

/* Card 1: Circular Progress Timer */
.circular-timer-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 8px auto 14px;
  display: grid;
  place-items: center;
}
.circular-timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-circle-bg {
  fill: none;
  stroke: var(--paper-3);
  stroke-width: 8;
}
.timer-circle-prog {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 80;
  transition: stroke-dashoffset 0.4s ease;
}
.timer-inner-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-digits {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.timer-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
}
.timer-label svg {
  width: 12px;
  height: 12px;
  stroke: var(--terracotta);
}

.timer-actions-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.btn-terracotta {
  flex: 1;
  background: var(--terracotta);
  color: #FFFFFF;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-terracotta:hover {
  background: var(--terracotta-hover);
}
.btn-terracotta svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.btn-outline-preset {
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-outline-preset:hover {
  background: var(--paper-3);
}
.btn-outline-preset svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-2);
}

/* Card 2: Room Chat */
.chat-stream {
  flex: 1;
  max-height: 185px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 12px;
}
.chat-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  image-rendering: pixelated;
  flex-shrink: 0;
}
.chat-msg-body {
  flex: 1;
  min-width: 0;
}
.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.chat-msg-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.chat-msg-time {
  font-size: 10.5px;
  color: var(--text-3);
}
.chat-msg-text {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--paper-3);
  padding: 6px 10px;
  border-radius: 10px;
  border-top-left-radius: 2px;
  margin-top: 3px;
  line-height: 1.35;
  word-break: break-word;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-3);
  border-radius: 10px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
}
.chat-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.chat-input-row button {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.chat-emoji-btn {
  font-size: 16px;
  padding: 4px;
}
.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--terracotta);
  color: #FFFFFF;
}
.chat-send-btn svg {
  width: 15px;
  height: 15px;
  fill: #FFFFFF;
}

/* Card 3: People Here Roster */
.people-roster {
  flex: 1;
  max-height: 245px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}
.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.roster-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper-2);
  overflow: hidden;
  flex-shrink: 0;
}
.roster-avatar-wrap img {
  position: absolute;
  max-width: none;
  width: 260%;
  height: auto;
  left: -80%;
  top: -31%;
  image-rendering: pixelated;
}
.roster-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live-green);
  border: 1.5px solid #FFFFFF;
}
.roster-info {
  flex: 1;
  min-width: 0;
}
.roster-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.roster-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-crown {
  font-size: 12px;
}
.roster-tag {
  font-size: 11.5px;
  color: var(--text-3);
}
.roster-time {
  color: var(--live-green);
  font-weight: 600;
}
.roster-more {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.roster-more:hover {
  background: var(--paper-3);
  color: var(--text);
}

/* Card 4: Study Together Rooms */
.study-together-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-3);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  transition: transform 0.12s, box-shadow 0.12s;
}
.room-card-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(36,26,20,0.06);
}
.room-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.room-card-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--terracotta);
}
.room-card-meta {
  flex: 1;
  min-width: 0;
}
.room-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-card-count {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.room-card-join {
  background: var(--terracotta-soft);
  color: var(--terracotta);
  border: 0;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.room-card-join:hover {
  background: var(--terracotta);
  color: #FFFFFF;
}

/* Round avatar: the uploaded photo, or just the head from the character sprite */
.face { position: relative; display: inline-block; flex: 0 0 auto; width: var(--face, 34px); height: var(--face, 34px);
  border-radius: 50%; overflow: hidden; background: rgba(190, 145, 65, 0.25); vertical-align: middle; }
.face img { position: absolute; width: 260%; max-width: none; height: auto; left: -80%; top: -31%; image-rendering: pixelated; }
.face.face-photo img { width: 100%; max-width: 100%; height: 100%; left: 0; top: 0; object-fit: cover; image-rendering: auto; }

.pf-avatar-row { display: flex; align-items: center; gap: 18px; }
.pf-avatar-row > span { display: flex; flex: none; }
.pf-avatar-row > div { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.pf-avatar-row .face { --face: 72px; border: 2px solid var(--line, rgba(190,145,65,.45)); }
.pf-avatar-remove { background: none; border: 0; padding: 0; color: var(--text-3); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.pf-avatar-row .btn { padding: 8px 16px; font-size: 14px; }
.pf-avatar-hint { font-size: 12px; color: var(--text-3); }

/* Chat computer (bottom-right) */
#dchat-toggle { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; padding: 4px; border-radius: 14px;
  border: 1.5px solid rgba(190,145,65,.55); background: var(--paper, #fbf6ee); box-shadow: 0 4px 18px rgba(60,35,10,.25);
  cursor: pointer; z-index: 400; transition: transform .1s; }
#dchat-toggle:hover { transform: translateY(-2px); }
#dchat-toggle img { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: pixelated; }
#dchat-panel { position: fixed; right: 20px; bottom: 90px; width: min(340px, calc(100vw - 32px)); height: 420px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; background: var(--paper, #fbf6ee); border: 1px solid rgba(190,145,65,.5);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(60,35,10,.28); z-index: 400; overflow: hidden; }
#dchat-panel.dchat-hidden { display: none; }
.dchat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 700;
  border-bottom: 1px solid rgba(190,145,65,.3); }
.dchat-head button { background: none; border: 0; cursor: pointer; color: var(--text-3); font-size: 15px; }
.dchat-stream { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.dchat-row { display: flex; gap: 8px; align-items: flex-start; }
.dchat-row .face { --face: 30px; }
.dchat-row b { font-size: 13px; }
.dchat-row small { color: var(--text-3); margin-left: 6px; font-size: 11px; }
.dchat-text { background: rgba(190,145,65,.2); padding: 6px 10px; border-radius: 10px; margin-top: 3px; font-size: 13.5px; word-break: break-word; }
.dchat-join { display: block; text-align: center; padding: 11px; font-weight: 600; text-decoration: none;
  background: var(--terracotta, #7a3328); color: #fff; padding: 9px; font-size: 13.5px; }
.dchat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(190,145,65,.3); }
.dchat-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(190,145,65,.45);
  background: rgba(190,145,65,.12); font: inherit; font-size: 13.5px; color: var(--text); }
.dchat-form button { width: 38px; border: 0; border-radius: 10px; background: var(--terracotta, #7a3328); cursor: pointer; display: grid; place-items: center; }

.home-feed { margin-bottom: 18px; }
.home-feed .card-head .btn { margin-left: auto; }
.home-feed .card-head .section-head-link { margin-left: 8px; }

/* ── Posts: a single column of LinkedIn / Facebook-style cards ───────────── */
.feed { display: flex; flex-direction: column; gap: 12px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; }
.post-card-top { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 0; }
.post-card-top .face { --face: 48px; margin-top: 2px; }
.post-who { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; color: var(--text); }
.post-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; line-height: 1.3; }
.post-name b { font-weight: 600; font-size: 15px; }
.post-who:hover .post-name b { color: var(--blue); text-decoration: underline; }
.post-country { font-size: 12.5px; color: var(--text-2); font-weight: 400; white-space: nowrap; }
.post-headline { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.post-when { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.post-menu { background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1; color: var(--text-3); padding: 0 4px; }
.post-menu:hover { color: var(--red); }
.tag { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; background: var(--paper-3); color: var(--text-2); border: 1px solid var(--line); }
.tag.sm { font-size: 11px; padding: 1px 8px; }
.tag.tone-violet { background: #EDE4F0; color: #5E4B6B; border-color: #DCCDE2; }
.tag.tone-blue   { background: #DFE7EE; color: #3C5568; border-color: #C9D6E1; }
.tag.tone-green  { background: #DFE9DC; color: #40583B; border-color: #CBDBC6; }
.tag.tone-amber  { background: var(--amber-soft); color: var(--gold-text); border-color: var(--line-strong); }
.post-content { padding: 12px 16px 4px; }
.post-title { font-family: inherit; font-weight: 600; font-size: 15.5px; line-height: 1.35; margin: 0 0 6px; }
.post-body { color: var(--text-2); line-height: 1.55; white-space: pre-wrap; font-size: 14px; margin: 0; }
.post-details { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding: 9px 12px;
  background: var(--paper-2); border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.post-details > span { display: inline-flex; align-items: center; gap: 6px; }
.post-details .dicon { color: var(--gold-text); }
.post-time { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.pt-note { font-weight: 400; color: var(--text-3); }
.pt-toggle { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500;
  color: var(--blue); text-decoration: underline; }
.post-reacts { padding: 8px 16px 0; font-size: 12px; color: var(--text-3); }
.post-actions { display: flex; align-items: stretch; margin: 10px 8px 0; padding: 4px 0; border-top: 1px solid var(--line); }
.post-act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 6px;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; background: none; border: 0; border-radius: 8px; color: var(--text-2); }
.post-act:hover { background: var(--paper-2); color: var(--blue); }
.post-act.is-on { color: var(--red); }
.post-act.is-on .dicon { fill: currentColor; }
.post-comments { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.post-comments.hidden { display: none; }
.post-tz-note { font-size: 12px; color: var(--text-3); }
.post-time-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.post-time-pick input { padding: 7px 9px; font: inherit; font-size: 13px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-light); }
@media (max-width: 560px) { .post-act span { display: none; } }

/* "Start a post" box */
.composer-top { display: flex; align-items: center; gap: 12px; }
.composer-avatar .face { --face: 48px; }
.composer-avatar { background: none; border: 0; width: auto; height: auto; }
.composer-start { flex: 1; text-align: left; padding: 14px 20px; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.composer-start:hover { background: var(--paper-2); }
.composer-actions { display: flex; justify-content: space-around; gap: 6px; margin-top: 10px; }
.composer-act { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 9px 8px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.composer-act:hover { background: var(--paper-2); }
.composer-act .dicon { width: 20px; height: 20px; }
.composer-act.tone-green .dicon { color: #4a7a43; }
.composer-act.tone-blue .dicon { color: #3f6fa8; }
.composer-act.tone-amber .dicon { color: #b0743a; }
.pm-who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pm-who b { font-size: 15px; }
.pm-sub { font-size: 12px; color: var(--text-3); }
.pm-text { width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); resize: vertical;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; }
.pm-text:focus { outline: none; border-color: var(--blue); }
.pm-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.pm-foot .form-status { flex: 1; margin: 0; }
@media (max-width: 560px) { .composer-act { font-size: 12px; flex-direction: column; gap: 3px; } }

/* Home: the feed scrolls down the left, "Join library" stays on the right */
.home-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-bottom: 18px; }
.home-feed .card-head { margin-bottom: 12px; }
.home-rail { position: sticky; top: 88px; }
.join-search { width: 100%; box-sizing: border-box; margin: 4px 0 10px; padding: 10px 14px; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; }
.join-search:focus { outline: none; border-color: var(--blue); }
.join-list { max-height: 440px; overflow-y: auto; margin-bottom: 10px; }
.join-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.join-row:last-child { border-bottom: 0; }
.join-ico { font-size: 18px; width: 26px; text-align: center; flex: none; }
.join-meta { flex: 1; min-width: 0; }
.join-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-sub { font-size: 12px; color: var(--text-3); }
.join-full { font-size: 12px; color: var(--text-3); padding: 0 6px; }
@media (max-width: 1000px) { .home-split { grid-template-columns: 1fr; } .home-rail { position: static; } }

/* Headings were set in a light display serif; in a sans they need some weight */
h1, h2, h3, h4, .sidebar-brand, .stat-value, .hero-name, .pf-size b, .student-stat b, .field-tile b,
.home-stat .stat-value, .section-head-row h3, .msg-pane-head h3, .card-head h3 { font-weight: 700; }
.card-head h3 { font-size: 17px; letter-spacing: -0.01em; }

/* Room invitations + create-room window */
.invite-banner { margin: 0 0 16px; display: grid; gap: 8px; }
.invite-banner.hidden { display: none; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
  background: var(--amber-soft); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 14px; }
.pr-codebox { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.join-note { font-size: 12px; color: var(--text-3); text-align: center; margin: 8px 0 0; }
.modal textarea { width: 100%; box-sizing: border-box; padding: 10px 13px; font: inherit; font-size: 13.5px; border: 1px solid var(--line-strong); border-radius: 10px; }

/* Create-room window: Yes / No toggle */
.pr-yesno { display: flex; gap: 8px; }
.pr-yn { flex: 1; padding: 10px; font: inherit; font-weight: 600; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.pr-yn.selected { background: var(--paper-3); border-color: var(--blue); color: var(--blue); }

/* Invitation popup */
.invite-modal { padding-bottom: 24px; }
.invite-art { display: block; width: calc(100% + 48px); max-width: none; margin: 0 -24px 18px; height: 150px; object-fit: cover; }
.invite-eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; }
.invite-modal h2 { margin: 6px 0 8px; font-size: 22px; line-height: 1.3; }

/* Find study buddies (Friends page): controls on top, people scroll below */
.buddies-card { margin-top: 18px; }
.buddies-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 4px 0 12px; }
.buddies-controls input[type="text"] { width: 100%; box-sizing: border-box; padding: 10px 14px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; }
.buddies-controls .chart-select { max-width: none; width: 100%; }
.buddy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 24px;
  max-height: 640px; overflow-y: auto; padding-right: 4px; align-content: start; }
@media (max-width: 700px) { .buddies-controls { grid-template-columns: 1fr; } .buddy-grid { grid-template-columns: 1fr; } }

/* People list: name, country, then the field on one line each */
.student-name { display: flex; flex-direction: column; align-items: flex-start; gap: 0; max-width: 100%; }
.student-name .post-country { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.student-main .tag { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.buddy-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
@media (max-width: 780px) { .buddy-grid { grid-template-columns: 1fr; } }

.welcome-body h1, .welcome-body > p, .welcome-goal { text-shadow: 0 1px 14px rgba(20, 12, 6, 0.5); }

/* Banner text stays readable on the bright daytime picture */
.welcome.is-day .welcome-veil { background: linear-gradient(180deg, rgba(22, 15, 10, .64) 0%, rgba(22, 15, 10, .5) 45%, rgba(22, 15, 10, .72) 100%); }
.welcome.is-day .welcome-goal { background: rgba(22, 15, 10, .5); border-color: rgba(251, 246, 238, .45); }
.welcome.is-day .btn-onart { background: rgba(22, 15, 10, .45); border-color: rgba(251, 246, 238, .7); }
.welcome.is-day .btn-onart:hover { background: var(--surface); }
.welcome-body > p { color: #fbf6ee; font-weight: 500; }
.welcome-body h1, .welcome-body > p, .welcome-goal { text-shadow: 0 1px 4px rgba(10, 6, 3, .6), 0 2px 18px rgba(10, 6, 3, .5); }

.join-section { margin: 14px 0 2px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

.guest-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 16px;
  background: var(--paper-3); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 13.5px; color: var(--text-2); }
.guest-strip.hidden { display: none; }

/* ── Hero focus: bigger banner, spotlight on the two main actions ───────── */
.welcome { min-height: 380px; padding: 64px 24px; }
.welcome-body h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 700; letter-spacing: -.02em; }
.welcome-body > p { font-size: 18px; }
.welcome-actions { gap: 14px; margin-top: 30px; align-items: center; }
.welcome-actions .btn-lg { padding: 16px 30px; font-size: 18px; font-weight: 700; border-radius: 12px; }
#welcome-enter, #welcome-private, #welcome-friends { min-width: 210px; justify-content: center; }
#welcome-enter:hover, #welcome-private:hover, #welcome-friends:hover { transform: translateY(-2px); }
.welcome-actions .btn { transition: transform .15s ease, background .15s ease; }
@media (max-width: 640px) {
  .welcome { min-height: 320px; padding: 40px 16px; }
  .welcome-actions .btn-lg { width: 100%; justify-content: center; }
}

/* ── Profile setup: one step at a time ─────────────────────────────────── */
.pf-step.hidden { display: none; }
.pf-dots { display: flex; gap: 6px; margin: 2px 0 12px; }
.pf-dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.pf-dots i.on { background: var(--accent, #7a3b32); }
.pf-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; }
.pf-nav .btn { min-width: 110px; }
.pf-nav #pf-next { margin-left: auto; }
.pf-nav .hidden { display: none; }
.pf-step .field { margin-bottom: 0; }

/* ── Welcome flow ──────────────────────────────────────────────────── */
.welcome-only{ display: none; }
.welcome-post .welcome-only{ display: inline-flex; }
.welcome-post .modal-close{ display: none; }
body.welcome-interact .sidebar,
body.welcome-interact .topbar,
body.welcome-interact .tabbar,
body.welcome-interact .hs-top,
body.welcome-interact .hs-rail,
body.welcome-interact #home-progress-row{
  opacity: .32; filter: grayscale(.6); pointer-events: none; user-select: none; transition: opacity .3s;
}
body.welcome-interact #home-feed-card{ position: relative; z-index: 2; }
.welcome-bar{
  margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; font-size: .95rem;
  background: var(--accent-soft, #F4EADA); border: 1px solid var(--accent, #A8812C);
}

/* ── Your posts ────────────────────────────────────────────────────── */
.my-posts{ margin-bottom: 16px; }
.my-post{ display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule, #E0CEB0); }
.my-post:first-child{ border-top: 0; }
.my-post-text{ flex: 1; min-width: 0; overflow-wrap: anywhere; }
.my-post-when{ color: var(--text-2); font-size: .82rem; margin-left: 6px; }
.my-post-del:hover{ color: #B6402C; }

/* ── Profile page ──────────────────────────────────────────────────── */
.side-profile{ gap: 12px; padding-top: 8px; padding-bottom: 8px; font-weight: 600; margin-bottom: 6px; }
.side-profile-name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-layout{ display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; max-width: 1040px; margin: 0 auto; }
.pr-banner{ position: relative; height: 230px; border-radius: 22px; background: var(--blue-soft); display: grid; place-items: end center; overflow: hidden; }
.pr-banner-face{ transform: translateY(14px); }
.pr-edit{ position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 12px; font-size: 1.2rem;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.pr-edit:hover{ background: var(--paper-2); }
.pr-id{ display: flex; justify-content: space-between; align-items: flex-start; margin-top: 22px; }
.pr-id h1{ font-size: 1.9rem; font-weight: 700; }
.pr-handle, .pr-joined{ color: var(--text-3); margin-top: 2px; }
.pr-joined{ color: var(--text-2); margin-top: 8px; }
.pr-follow{ margin-top: 12px; }
.pr-follow button{ background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; }
.pr-flag{ font-size: 2rem; }
.pr-rule{ border: 0; border-top: 2px solid var(--line); margin: 22px 0; }
.pr-promo{ display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: 18px;
  background: var(--paper-3); position: relative; margin-bottom: 30px; }
.pr-promo h3{ font-size: 1.25rem; font-weight: 700; margin-bottom: 14px; max-width: 24ch; }
.pr-promo-x{ background: none; border: 0; font-size: 1.5rem; color: var(--text-3); cursor: pointer; align-self: flex-start; }
.pr-btn{ font: inherit; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  background: var(--blue); color: #fff; border: 0; border-radius: 14px; padding: 13px 40px; box-shadow: 0 4px 0 var(--blue-dark); }
.pr-btn:active{ transform: translateY(2px); box-shadow: 0 2px 0 var(--blue-dark); }
.pr-h{ font-size: 1.45rem; font-weight: 700; margin-bottom: 14px; }
.pr-h-row{ display: flex; justify-content: space-between; align-items: baseline; margin-top: 30px; }
.pr-link{ background: none; border: 0; font: inherit; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); cursor: pointer; }
.pr-stats{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pr-stat{ display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.pr-stat-ic{ font-size: 1.6rem; }
.pr-stat b{ display: block; font-size: 1.3rem; }
.pr-stat span:not(.pr-stat-ic){ color: var(--text-2); font-size: .95rem; }
.pr-ach{ display: grid; gap: 12px; }
.pr-badge{ display: flex; gap: 16px; align-items: center; padding: 16px 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.pr-badge > span{ font-size: 2rem; }
.pr-badge small{ display: block; color: var(--text-2); }
.pr-empty{ padding: 18px; color: var(--text-2); border: 2px dashed var(--line); border-radius: 16px; }
.pr-side{ display: grid; gap: 18px; align-content: start; }
.pr-chips{ display: flex; justify-content: space-between; padding: 6px 4px; font-size: 1.05rem; }
.pr-chip b{ margin-left: 4px; }
.pr-panel{ border: 2px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.pr-tabs{ display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--line); }
.pr-tabs button{ padding: 16px 0; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; font: inherit;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); cursor: pointer; }
.pr-tabs button.on{ color: var(--blue); border-bottom-color: var(--blue); }
.pr-panel-body{ padding: 18px; min-height: 180px; }
.pr-panel-empty{ text-align: center; color: var(--text-2); padding: 18px 8px; }
.pr-panel-emoji{ font-size: 3.4rem; margin-bottom: 10px; }
.pr-person{ display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 4px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.pr-person:hover{ background: var(--paper-2); }
.pr-add{ padding: 18px 20px 8px; }
.pr-add h3{ font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.pr-add-row{ display: flex; justify-content: space-between; width: 100%; padding: 14px 0; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.pr-add-row i{ font-style: normal; color: var(--text-3); font-size: 1.3rem; }
@media (max-width: 920px){ .pr-layout{ grid-template-columns: 1fr; gap: 24px; } .pr-side{ order: 2; } .pr-stats{ grid-template-columns: 1fr; } }

.pr-level{ margin-top: 14px; max-width: 360px; }
.pr-level-name{ font-weight: 600; color: var(--text-2); }
.pr-xp-bar{ height: 9px; border-radius: 9px; background: var(--paper-3); margin: 8px 0 6px; overflow: hidden; }
.pr-xp-fill{ height: 100%; background: var(--blue); border-radius: 9px; transition: width .6s; }
.pr-xp-text{ display: block; text-align: right; color: var(--text-3); font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════════════════
   HOME — playful, chunky "learning game" look. Scoped to #page-home so the
   rest of the app keeps its parchment feel. Colour carries meaning:
   orange = today/streak/goal · gold = XP · blue = time / secondary action
   · green = the one main action.
   ═══════════════════════════════════════════════════════════════════════ */
#page-home{
  --d-green:#58cc02; --d-green-dk:#58a700;
  --d-blue:#1cb0f6;  --d-blue-dk:#1899d6;
  --d-orange:#ff9600;
  --d-gold:#ffc800;  --d-gold-ink:#cd7900;
  --d-sky:#ddf4ff;   --d-sky-line:#84d8ff;
  --d-snow:#f7f7f7;  --d-line:#e5e5e5;
  --d-ink:#4b4b4b;   --d-muted:#777; --d-faint:#afafaf;
  font-family:'Nunito',var(--sans); color:var(--d-ink);
  background:#fff; border-radius:24px; padding:32px;
}
#page-home h1,#page-home h2{ font-family:'Nunito',var(--sans); font-weight:900; color:var(--d-ink); letter-spacing:0; text-transform:none; margin:0; }
.hs{ display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:48px; max-width:1100px; margin:0 auto; align-items:start; }
.hs-main{ display:flex; flex-direction:column; gap:36px; min-width:0; }
.hs-top{ display:flex; flex-direction:column; gap:24px; }
.hs-rail{ display:flex; flex-direction:column; gap:24px; position:sticky; top:88px; }

/* hero */
.hs-hero{ width:100%; height:240px; object-fit:cover; object-position:70% 50%; border-radius:16px; background:#e8f1e0; display:block; }
.hs-greet h1{ font-size:30px; line-height:1.2; }
.hs-status{ margin:6px 0 0; font-size:17px; font-weight:700; color:var(--d-muted); }
.hs-goal{ margin:6px 0 0; font-size:15px; font-weight:800; color:var(--d-orange); }
.hs-ctas{ display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
.hs-rule{ border:0; border-top:2px solid var(--d-line); margin:0; width:100%; }

/* pressable buttons */
.dbtn{
  display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; cursor:pointer;
  min-height:48px; padding:0 24px; border-radius:16px; font:900 15px/1 'Nunito',var(--sans);
  letter-spacing:.06em; text-transform:uppercase; text-decoration:none;
  color:#fff; background:var(--d-green); border:2px solid var(--d-green); border-bottom-width:4px; border-bottom-color:var(--d-green-dk);
  transition:filter .12s ease, transform .12s ease, border-bottom-width .12s ease, background-color .12s ease;
}
.dbtn:hover{ filter:brightness(1.05); }
.dbtn:active{ transform:translateY(2px); border-bottom-width:2px; }
.dbtn:focus-visible,.hs-row:focus-visible,.hs-link:focus-visible,.hs-promo-x:focus-visible{ outline:2px solid var(--d-blue); outline-offset:2px; }
.dbtn-green{ min-width:256px; }
.dbtn-blue{ background:var(--d-blue); border-color:var(--d-blue); border-bottom-color:var(--d-blue-dk); min-width:288px; }
.dbtn-white{ background:#fff; color:var(--d-blue); border-color:var(--d-line); }
.dbtn-white:hover{ background:var(--d-snow); filter:none; }
.dbtn-block{ width:100%; min-width:0; }

/* cards */
.hs-card{ background:#fff; border:2px solid var(--d-line); border-radius:16px; padding:24px; }
.hs-progress{ display:flex; flex-direction:column; gap:24px; }
.hs-h2{ font-size:22px; margin-bottom:14px !important; }
.hs-goalhead{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; }
.hs-goalhead h2{ font-size:22px; }
.hs-pct{ color:var(--d-orange); font-size:22px; font-weight:900; }
.hs-bar{ height:16px; border-radius:999px; background:var(--d-line); overflow:hidden; }
.hs-bar-fill{ display:block; height:100%; width:0; border-radius:999px; background:var(--d-orange); position:relative; transition:width .3s ease; }
.hs-bar.has-shine .hs-bar-fill::after{ content:""; position:absolute; left:8px; right:8px; top:3px; height:3px; border-radius:3px; background:rgba(255,255,255,.35); }

/* week chart */
#page-home .week-bars{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; height:96px; margin-top:24px; align-items:end; }
#page-home .week-bar{ display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:6px; }
#page-home .week-bar span{ display:block; width:100%; max-width:44px; min-height:8px; border-radius:8px 8px 4px 4px; background:var(--d-green); flex:0 0 auto; }
#page-home .week-bar.is-zero span{ height:8px !important; background:var(--d-line); }
#page-home .week-bar.is-today span{ background:var(--d-orange); }
#page-home .week-bar b{ font:800 12px/1 'Nunito',var(--sans); letter-spacing:.06em; text-transform:uppercase; color:var(--d-faint); }
#page-home .week-bar.is-today b{ color:var(--d-orange); }

/* promo */
.hs-promo{ position:relative; background:var(--d-sky); border-radius:16px; padding:24px; }
.hs-promo h2{ font-size:22px; max-width:22ch; margin-bottom:8px; }
.hs-promo p{ margin:0 0 18px; max-width:46ch; font-weight:700; color:var(--d-ink); font-size:15px; }
.hs-promo-x{ position:absolute; top:12px; right:14px; border:0; background:none; font-size:18px; font-weight:900; color:var(--d-faint); cursor:pointer; }
.hs-promo-x:hover{ color:var(--d-muted); }

/* stats */
.hs-stats{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.hs-stat{ display:flex; align-items:center; gap:14px; padding:16px 18px; border:2px solid var(--d-line); border-radius:16px; }
.hs-stat .dicon{ width:28px; height:28px; stroke-width:2; flex:none; }
.hs-stat b{ display:block; font-size:22px; font-weight:900; line-height:1.1; }
.hs-stat span{ font-size:15px; font-weight:700; color:var(--d-muted); }
.st-orange .dicon,.st-orange b{ color:var(--d-orange); }
.st-gold .dicon,.st-gold b{ color:var(--d-gold-ink); }
.st-blue .dicon,.st-blue b{ color:var(--d-blue); }
.st-ink .dicon,.st-ink b{ color:var(--d-ink); }
.hs-stats.is-new .dicon{ color:var(--d-faint); opacity:.4; }
.hs-stats.is-new b{ color:var(--d-faint); }

/* community */
.hs-comhead{ display:flex; align-items:baseline; gap:16px; margin-bottom:14px; }
.hs-comhead .hs-h2{ margin:0 auto 0 0 !important; }
.hs-link{ border:0; background:none; cursor:pointer; padding:0; font:900 13px/1 'Nunito',var(--sans); letter-spacing:.08em; text-transform:uppercase; color:var(--d-blue); }
.hs-link:hover{ color:var(--d-blue-dk); }
#page-home .feed{ font-family:'Nunito',var(--sans); }
#page-home .feed > *{ border:2px solid var(--d-line) !important; border-radius:16px !important; box-shadow:none !important; background:#fff !important; }
#page-home .feed > *:hover{ background:var(--d-snow) !important; }

/* rail */
.hs-rail h2{ font-size:20px; }
.hs-railhead{ margin-bottom:14px; }
#page-home .join-search{ border:2px solid var(--d-line); border-radius:12px; background:var(--d-snow); font-family:'Nunito',var(--sans); font-weight:700; padding:10px 14px; }
#page-home .join-search:focus{ border-color:var(--d-blue); background:#fff; }
#page-home .join-row{ padding:12px 0; border-bottom:2px solid var(--d-line); gap:12px; }
#page-home .join-ico{ width:44px; height:44px; line-height:44px; border-radius:12px; background:var(--d-sky); font-size:18px; }
#page-home .join-name{ font:800 16px/1.2 'Nunito',var(--sans); color:var(--d-ink); }
#page-home .join-sub{ font:700 13px 'Nunito',var(--sans); color:var(--d-muted); }
#page-home .join-full{ font:900 12px 'Nunito',var(--sans); letter-spacing:.08em; color:var(--d-faint); text-transform:uppercase; }
#page-home .join-section{ font:900 12px 'Nunito',var(--sans); letter-spacing:.08em; text-transform:uppercase; color:var(--d-faint); margin:14px 0 2px; }
#page-home .join-row .btn{
  min-height:36px; padding:0 16px; border-radius:12px; font:900 13px/1 'Nunito',var(--sans); letter-spacing:.06em; text-transform:uppercase;
  background:var(--d-blue); color:#fff; border:2px solid var(--d-blue); border-bottom:3px solid var(--d-blue-dk); box-shadow:none;
  transition:filter .12s ease, transform .12s ease, border-bottom-width .12s ease;
}
#page-home .join-row .btn:hover{ filter:brightness(1.05); }
#page-home .join-row .btn:active{ transform:translateY(2px); border-bottom-width:1px; }
#page-home .join-card .dbtn-block{ margin-top:16px; }
#page-home .join-note{ font:700 14px/1.4 'Nunito',var(--sans); color:var(--d-muted); margin:14px 0 0; }
.hs-friends h2{ margin-bottom:8px; }
.hs-row{
  display:flex; align-items:center; gap:14px; width:calc(100% + 16px); margin:0 -8px; padding:12px 8px; border:0; border-radius:12px;
  background:none; cursor:pointer; font:800 16px 'Nunito',var(--sans); color:var(--d-ink); text-align:left;
  transition:background-color .12s ease;
}
.hs-row:hover{ background:var(--d-snow); }
.hs-row .dicon{ width:24px; height:24px; stroke-width:2; }
.hs-row .c-blue{ color:var(--d-blue); } .hs-row .c-green{ color:var(--d-green); }
.hs-chev{ margin-left:auto; color:var(--d-faint); }

@media (max-width:1279px){
  .hs{ grid-template-columns:minmax(0,1fr); gap:40px; }
  .hs-rail{ position:static; }
}
@media (max-width:760px){
  #page-home{ padding:16px; border-radius:16px; }
  .hs-hero{ height:180px; }
  .hs-card,.hs-promo{ padding:20px; }
  .hs-ctas .dbtn,.hs-promo .dbtn{ width:100%; min-width:0; }
  .hs-stats{ grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce){ .dbtn,.hs-bar-fill{ transition:none; } }

/* ═══════════════════════════════════════════════════════════════════════
   STUDYSPACE THEME — the whole dashboard. White page, flat colour, 2px
   borders, pressable buttons, Nunito. Orange = today/streak/goal,
   gold = XP, blue = time / secondary, green = the one main action.
   Loaded last on purpose: it re-maps every token the older rules read.
   ═══════════════════════════════════════════════════════════════════════ */
:root{
  --bg:#fff; --surface:#fff; --paper-light:#fff;
  --paper-2:#f7f7f7; --paper-3:#efefef; --paper-4:#e5e5e5;
  --line:#e5e5e5; --line-strong:#d4d4d4; --rule:#e5e5e5;
  --wood:#fff; --wood-deep:#e5e5e5; --wood-edge:#e5e5e5;
  --text:#4b4b4b; --text-2:#6b6b6b; --text-3:#8e8e8e;
  --blue:#1cb0f6; --blue-dark:#1899d6; --blue-soft:#ddf4ff;
  --green:#58a700; --green-soft:#d7ffb8;
  --amber:#ff9600; --amber-soft:#fff0d5;
  --red:#ea2b2b; --red-soft:#ffdfe0;
  --purple:#6b6b6b; --purple-soft:#efefef;
  --gold:#ffc800; --gold-text:#cd7900; --gold-lift:#ffc800;
  --terracotta:#1cb0f6; --terracotta-hover:#1899d6; --terracotta-soft:#ddf4ff; --terracotta-tint:#f7f7f7;
  --accent:#1cb0f6; --accent-soft:#ddf4ff;
  --radius:16px; --radius-sm:12px; --shadow:none;
  --sidebar-w:244px; --topbar-h:64px;
  --sans:'Nunito',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --serif:'Nunito',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}
body{ background:#fff; color:var(--text); font-family:var(--sans); font-weight:700; }
h1,h2,h3,h4,.card-head h3,.page-head h1,.modal h2,.stat-value,.hero-name{ font-family:var(--sans) !important; font-weight:900 !important; letter-spacing:0; text-transform:none; color:var(--text); }
.page-head h1{ font-size:28px; }
.page-head p{ font-weight:700; }
.card-head h3{ font-size:20px; }
*{ box-shadow:none; }

/* cards */
.card,.badge-card,.leaderboard-list,.community-list,.hero-banner,.private-feature,.msg-pane,.thread-list{
  background:#fff; border:2px solid var(--line) !important; border-radius:16px !important; box-shadow:none !important;
}
.card{ padding:24px; }
@media (max-width:640px){ .card{ padding:20px; } }

/* buttons: green = main action, pressable */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap;
  min-height:48px; padding:0 24px; border-radius:16px;
  font:900 15px/1 var(--sans); letter-spacing:.06em; text-transform:uppercase; text-decoration:none;
  color:#fff; background:#58cc02; border:2px solid #58cc02; border-bottom:4px solid #58a700; box-shadow:none;
  transition:filter .12s ease, transform .12s ease, border-bottom-width .12s ease, background-color .12s ease;
}
.btn:hover{ background:#58cc02; filter:brightness(1.05); }
.btn:active{ transform:translateY(2px); border-bottom-width:2px; }
.btn-sm{ min-height:36px; padding:0 16px; font-size:13px; border-radius:12px; border-bottom-width:3px; }
.btn-sm:active{ border-bottom-width:1px; }
.btn-lg{ min-height:52px; }
.btn-soft,.btn-onart{ background:#1cb0f6; border-color:#1cb0f6; border-bottom-color:#1899d6; color:#fff; }
.btn-soft:hover,.btn-onart:hover{ background:#1cb0f6; }
.btn-ghost{ background:#fff; color:#1cb0f6; border-color:var(--line); border-bottom-color:var(--line); }
.btn-ghost:hover{ background:#f7f7f7; filter:none; }
.btn-danger{ background:#fff; color:#ea2b2b; border-color:var(--line); border-bottom-color:var(--line); }
.btn-danger:hover{ background:#ffdfe0; filter:none; }
.btn.done,.btn.done:hover{ background:#d7ffb8; color:#58a700; border-color:#d7ffb8; cursor:default; }
.btn[disabled],.btn:disabled{ background:var(--line); border-color:var(--line); color:#afafaf; cursor:not-allowed; transform:none; filter:none; }
.btn:focus-visible,.icon-btn:focus-visible,.side-link:focus-visible,.top-tab:focus-visible,.tabbar button:focus-visible,.account-menu-item:focus-visible{ outline:2px solid #1cb0f6; outline-offset:2px; }

/* inputs */
.field input,.field select,.field textarea,.modal-form input,.modal-form textarea,input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],select,textarea{
  font-family:var(--sans); font-weight:700; color:var(--text); background:#f7f7f7;
  border:2px solid var(--line); border-radius:12px;
}
.field input:focus,.field select:focus,.field textarea:focus,.modal-form input:focus,.modal-form textarea:focus,input:focus,select:focus,textarea:focus{ border-color:#1cb0f6; background:#fff; outline:none; }
::placeholder{ color:#afafaf; font-weight:700; }

/* progress bars */
.progress-track{ height:16px; background:var(--line); border:0; border-radius:999px; }
.progress-fill{ background:#ff9600; border-radius:999px; }

/* pills & tags */
.pill,.tag{ font-weight:900; letter-spacing:.04em; border-radius:999px; }
.pill-green{ background:#d7ffb8; color:#58a700; }
.pill-amber{ background:#fff0d5; color:#cd7900; }
.pill-grey{ background:#efefef; color:#6b6b6b; }

/* sidebar */
.sidebar{ background:#fff; border-right:2px solid var(--line); padding:20px 16px; gap:20px; width:var(--sidebar-w); flex-basis:var(--sidebar-w); }
.sidebar-brand{ font:900 18px/1.15 var(--sans); color:#58cc02; letter-spacing:0; }
.sidebar-brand-icon{ background:#58cc02; color:#fff; border-radius:12px; width:40px; height:40px; flex-basis:40px; }
.sidebar-brand-icon .dicon{ stroke:#fff; }
.sidebar-nav{ gap:4px; }
.side-link{
  padding:11px 14px; border:2px solid transparent; border-radius:12px;
  font:900 13px/1 var(--sans); letter-spacing:.08em; text-transform:uppercase; color:var(--text-2);
  transition:background-color .12s ease, color .12s ease;
}
.side-link:hover{ background:#f7f7f7; color:var(--text); }
.side-link.active{ background:#ddf4ff; border-color:#84d8ff; color:#1cb0f6; font-weight:900; }
.side-link.active .side-icon svg{ stroke:#1cb0f6; }
.side-icon svg{ stroke-width:2.2; }
.side-link.side-profile{ text-transform:none; letter-spacing:0; font-size:15px; }
.side-quote-card{ background:#f7f7f7; border:2px solid var(--line); border-radius:16px; }
.side-quote-text{ font-weight:700; color:var(--text-2); font-style:normal; }
.side-quote-icon{ stroke:#58cc02; }
.side-badge{ background:#ff9600 !important; color:#fff !important; border-radius:999px; font-weight:900; }

/* top bar */
.topbar{ background:#fff; border-bottom:2px solid var(--line); height:var(--topbar-h); }
.search-wrap input{ background:#f7f7f7; border:2px solid var(--line); border-radius:12px; font-weight:700; }
.search-wrap input:focus{ border-color:#1cb0f6; background:#fff; }
.search-results{ border:2px solid var(--line); border-radius:16px; background:#fff; }
.top-tab{ border-radius:12px; color:var(--text-2); border:2px solid transparent; }
.top-tab:hover{ background:#f7f7f7; }
.top-tab.active{ background:#ddf4ff; border-color:#84d8ff; color:#1cb0f6; }
.top-tab.active svg{ stroke:#1cb0f6; }
.music-widget{ background:#f7f7f7; border:2px solid var(--line); border-radius:16px; }
.music-art{ background:#ddf4ff; color:#1cb0f6; border-radius:12px; }
.music-btn{ border-radius:10px; }
.music-btn:hover{ background:#ddf4ff; color:#1cb0f6; }
.icon-btn{ border-radius:12px; background:none; border:2px solid transparent; }
.icon-btn:hover{ background:#f7f7f7; }
.icon-btn .dot,.dot-count{ background:#ff9600; color:#fff; }
.avatar-btn{ border-radius:999px; }
.account-menu,.chats-panel{ background:#fff; border:2px solid var(--line); border-bottom-width:4px; border-radius:16px; }
.account-menu-item{ border-radius:12px; font-weight:800; }
.account-menu-item:hover{ background:#f7f7f7; }

/* counters in the top bar — the reward loop, always visible */
.top-counters{ display:flex; align-items:center; gap:18px; margin-right:6px; }
.tc{ display:inline-flex; align-items:center; gap:6px; font-weight:900; font-size:16px; }
.tc .dicon{ width:22px; height:22px; stroke-width:2.2; }
.tc-orange{ color:#ff9600; } .tc-gold{ color:#cd7900; } .tc-blue{ color:#1cb0f6; }

/* guest strip, invite banner */
.guest-strip{ background:#ddf4ff; border:0; border-radius:16px; color:var(--text); font-weight:800; }
.invite-banner{ border-radius:16px; }

/* modals */
.overlay{ background:rgba(255,255,255,.75); }
.modal{ background:#fff; border:2px solid var(--line); border-bottom-width:4px; border-radius:16px; box-shadow:none; }
.modal-close{ border-radius:12px; }
.modal-close:hover{ background:#f7f7f7; }
.modal-switch a{ color:#1cb0f6; font-weight:900; }

/* links like "View all" */
.section-head-link,.card-link{ font:900 13px/1 var(--sans); letter-spacing:.08em; text-transform:uppercase; color:#1cb0f6; background:none; border-radius:12px; }
.section-head-link:hover,.card-link:hover{ color:#1899d6; background:#ddf4ff; }

/* the Home page is no longer an island: the app is white now */
#page-home{ padding:0; border-radius:0; background:transparent; }
.page-wrap{ max-width:1180px; margin:0 auto; width:100%; }

/* phone tab bar: five icon-only 48px targets */
@media (max-width:820px){
  .tabbar{ background:#fff; border-top:2px solid var(--line); grid-template-columns:repeat(3,1fr); }
  .tabbar button{ font:900 11px var(--sans); letter-spacing:.06em; text-transform:uppercase; min-height:56px; justify-content:center; }
  .tabbar button.is-on{ color:#1cb0f6; background:#ddf4ff; }
  .top-counters{ gap:10px; }
  .tc{ font-size:14px; }
  .avatar-btn{ display:none; }
}

@media (prefers-reduced-motion:reduce){ .btn,.side-link{ transition:none; } }

/* specificity fixes against the older shell rules */
.sidebar-nav .side-link.active{ background:#ddf4ff; border-color:#84d8ff; color:#1cb0f6; font-weight:900; border-radius:12px; }
.sidebar-nav .side-link.active .side-icon svg{ stroke:#1cb0f6; }
.music-widget.music-pill-active{ background:#f7f7f7; color:var(--text); border:2px solid var(--line); border-radius:16px; box-shadow:none; padding:4px 10px 4px 6px; }
.music-widget.music-pill-active .music-art{ background:#ddf4ff; color:#1cb0f6; border-radius:12px; }
.music-widget.music-pill-active .music-title{ color:var(--text); font-weight:900; }
.music-widget.music-pill-active .music-sub{ color:var(--text-3); }
.music-widget.music-pill-active .music-btn{ color:#1cb0f6; }
.music-widget.music-pill-active .music-btn svg{ fill:#1cb0f6; }
.top-logo{ display:none; border-radius:12px; background:#58cc02; width:40px; height:40px; }
.top-logo .dicon{ stroke:#fff; }
.sidebar-toggle{ display:none !important; }
.icon-btn,.avatar-btn{ background:none; }
@media (max-width:820px){
  .top-logo{ display:grid; }
  .sidebar-toggle{ display:grid !important; }
}

.top-tabs{ display:none !important; }

/* ── Messages: chunky Studyspace restyle ─────────────────────────────── */
#page-messages{ font-family:'Nunito',var(--sans); color:#4b4b4b; }
#page-messages .page-head h1{ font-family:'Nunito',var(--sans); font-weight:800; font-size:34px; color:#3c3c3c; text-transform:none; letter-spacing:0; }
#page-messages .page-head p{ font-size:16px; font-weight:700; color:#777; }
#page-messages .msg-layout{ grid-template-columns:340px 1fr; gap:24px; }
#page-messages .msg-threads,#page-messages .msg-pane{ background:#fff; border:2px solid #e5e5e5; border-radius:16px; box-shadow:none; }
#page-messages .msg-threads-head{ padding:20px 20px 0; }
#page-messages .msg-threads-head h3{ font-family:'Nunito',var(--sans); font-size:22px; font-weight:800; color:#3c3c3c; }
#page-messages .msg-search{ margin:16px 20px 0; }
#page-messages .msg-search svg{ left:14px; width:20px; height:20px; stroke:#afafaf; stroke-width:2.5; }
#page-messages .msg-search input{ height:44px; padding:0 16px 0 44px; border:2px solid #e5e5e5; border-radius:12px; background:#f7f7f7; font-size:15px; font-weight:700; color:#3c3c3c; transition:border-color .15s,background-color .15s; }
#page-messages .msg-search input::placeholder{ color:#afafaf; }
#page-messages .msg-search input:focus{ outline:none; border-color:#84d8ff; background:#fff; }
#page-messages .msg-tabs{ gap:8px; padding:12px 20px 12px; }
#page-messages .msg-tab{ display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 14px; border:2px solid transparent; border-radius:12px; font:800 13px 'Nunito',var(--sans); letter-spacing:.06em; text-transform:uppercase; color:#777; }
#page-messages .msg-tab:hover{ background:#f7f7f7; }
#page-messages .msg-tab.on{ background:#ddf4ff; border-color:#84d8ff; color:#1cb0f6; }
.msg-tab-count{ display:grid; place-items:center; min-width:20px; height:20px; padding:0 4px; border-radius:999px; background:#1cb0f6; color:#fff; font-size:11px; letter-spacing:0; }
.msg-tab-count.hidden{ display:none; }
#page-messages .msg-thread-list{ padding:0 12px 12px; display:flex; flex-direction:column; gap:4px; }
#page-messages .chat-row{ gap:12px; padding:10px 12px; border:2px solid transparent; border-radius:12px; transition:background-color .15s; }
#page-messages .chat-row:hover{ background:#f7f7f7; }
#page-messages .chat-row.is-on{ background:#ddf4ff; border-color:#84d8ff; }
#page-messages .chat-name{ font-size:16px; font-weight:800; color:#3c3c3c; }
#page-messages .chat-last{ font-size:14px; font-weight:700; color:#777; }
#page-messages .chat-row.is-unread .chat-name{ font-weight:900; }
#page-messages .chat-row.is-unread .chat-last{ font-weight:800; color:#3c3c3c; }
#page-messages .chat-dot{ width:12px; height:12px; background:#1cb0f6; }
#page-messages .empty{ padding:40px 24px; text-align:center; font-size:15px; font-weight:700; color:#777; }
#page-messages .msg-pane-head{ margin:0 24px; padding:18px 0; border-bottom:2px solid #e5e5e5; gap:14px; }
#page-messages .msg-pane-head h3{ font-family:'Nunito',var(--sans); font-size:20px; font-weight:800; color:#3c3c3c; }
#page-messages .msg-with-sub{ font-size:14px; font-weight:700; color:#777; }
#page-messages #msg-view-profile{ height:36px; padding:0 16px; border:2px solid #e5e5e5; border-bottom-width:3px; border-radius:12px; background:#fff; color:#1cb0f6; font:800 13px 'Nunito',var(--sans); letter-spacing:.06em; text-transform:uppercase; }
#page-messages #msg-view-profile:hover{ background:#f7f7f7; }
#page-messages #msg-view-profile:active{ transform:translateY(2px); border-bottom-width:2px; }
#page-messages .msg-scroll{ padding:20px 24px; }
#page-messages .msg-time{ font-size:13px; font-weight:700; color:#777; }
#page-messages .bubble{ max-width:68%; padding:10px 16px; border-radius:16px; background:#f7f7f7; color:#3c3c3c; font-size:16px; font-weight:700; }
#page-messages .bubble.mine{ background:#1cb0f6; color:#fff; }
#page-messages .bubble.failed{ background:#ff4b4b; color:#fff; }
#page-messages .msg-status{ font-size:13px; font-weight:700; color:#777; }
#page-messages .msg-typing{ padding:2px 24px 6px; font-weight:700; }
#page-messages .typing-dots{ background:#f7f7f7; }
#page-messages .msg-compose{ align-items:center; gap:12px; padding:0 24px 24px; }
#page-messages .msg-compose textarea{ min-height:48px; padding:12px 16px; border:2px solid #e5e5e5; border-radius:16px; background:#f7f7f7; font:700 16px/1.4 'Nunito',var(--sans); color:#3c3c3c; transition:border-color .15s,background-color .15s; }
#page-messages .msg-compose textarea::placeholder{ color:#afafaf; }
#page-messages .msg-compose textarea:focus{ outline:none; border-color:#84d8ff; background:#fff; }
#page-messages .msg-send{ width:48px; height:48px; border-radius:16px; background:#1cb0f6; border:0; border-bottom:4px solid #1899d6; transition:transform .1s,border-width .1s,filter .1s; }
#page-messages .msg-send:hover{ background:#1cb0f6; filter:brightness(1.05); }
#page-messages .msg-send:active{ transform:translateY(2px); border-bottom-width:2px; }
.msg-back{ display:none; flex:none; width:40px; height:40px; margin-left:-4px; border:0; border-radius:12px; background:none; place-items:center; color:#777; cursor:pointer; }
.msg-back:hover{ background:#f7f7f7; }
.msg-back svg{ width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }

/* phone: one column — list first, tapping a chat swaps to the conversation */
@media (max-width:900px){
  #page-messages .msg-layout{ grid-template-columns:1fr; gap:0; }
  #page-messages .msg-threads{ height:calc(100vh - var(--topbar-h) - 200px); min-height:360px; }
  #page-messages .msg-pane{ height:calc(100vh - var(--topbar-h) - 150px); min-height:360px; }
  #page-messages:not(.chat-open) .msg-pane{ display:none; }
  #page-messages.chat-open .msg-threads{ display:none; }
  #page-messages.chat-open .page-head{ display:none; }
  #page-messages.chat-open .msg-back{ display:grid; }
  #page-messages .msg-pane-head,#page-messages .msg-scroll,#page-messages .msg-compose{ margin-left:16px; margin-right:16px; padding-left:0; padding-right:0; }
  #page-messages .msg-scroll{ margin:0; padding:16px; }
  #page-messages .msg-compose{ margin:0; padding:0 16px 16px; }
  #page-messages .bubble{ max-width:80%; }
  #page-messages #msg-view-profile{ display:none; }
}

/* message ticks: ✓ sent · ✓✓ delivered · blue ✓✓ seen */
.msg-status{ display:flex; align-items:center; gap:4px; }
.msg-status .tick{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; }
.msg-status.tick-seen{ color:#1cb0f6 !important; }
