/* ═══════════════════════════════════════════════════════════
   MedicoSphere — design system
   Visual language from Index.tsx: soft rounded cards, icon
   badges, emoji topic tiles, gradient CTA, generous spacing.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* medical-* scale */
  --medical-50:  #eefbf8;
  --medical-100: #d5f5ee;
  --medical-200: #aeeade;
  --medical-300: #79d9c9;
  --medical-400: #43bfae;
  --medical-500: #21a494;
  --medical-600: #14857a;
  --medical-700: #146b63;
  --medical-800: #155551;
  --medical-900: #144744;

  --foreground: #0f2c31;
  --muted:      #5c7981;
  --muted-2:    #8aa3aa;
  --border:     #e3ebea;
  --border-2:   #d3dedc;
  --background: #f6faf9;
  --card:       #ffffff;

  /* topic tints */
  --tint-red:    #fee8e7;  --tint-red-fg:    #b03a2e;
  --tint-blue:   #e4eefd;  --tint-blue-fg:   #2b5c9e;
  --tint-purple: #efe8fb;  --tint-purple-fg: #6741a5;
  --tint-green:  #e3f6e8;  --tint-green-fg:  #2c7a44;
  --tint-teal:   #d5f5ee;  --tint-teal-fg:   #146b63;
  --tint-amber:  #fdf0d9;  --tint-amber-fg:  #91641a;
  --tint-slate:  #e9eef1;  --tint-slate-fg:  #46606c;
  --tint-pink:   #fde8f0;  --tint-pink-fg:   #a43a68;
  --tint-orange: #fdeada;  --tint-orange-fg: #9c5a1c;
  --tint-indigo: #e7e9fc;  --tint-indigo-fg: #4448a0;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --r-md: 10px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 20px;
  --shadow-soft: 0 4px 20px -6px rgba(20, 71, 68, 0.12);
  --shadow-lift: 0 18px 44px -18px rgba(20, 71, 68, 0.3);
  --rail-w: 208px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
body:not(.has-chrome) { background: #fff; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--medical-600); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }

.muted { color: var(--muted); }
.link { color: var(--medical-600); font-weight: 500; }
.link:hover { color: var(--medical-700); }
.inline { display: inline; }
.push-right { margin-left: auto; }
.mono { font-variant-numeric: tabular-nums; font-size: .92em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* ─────────── buttons ─────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border: 1px solid transparent; border-radius: var(--r-lg);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s;
}
.btn-primary { background: var(--medical-600); color: #fff; box-shadow: 0 6px 18px -8px rgba(20,133,122,.8); }
.btn-primary:hover { background: var(--medical-700); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--border-2); color: var(--foreground); font-weight: 500; }
.btn-outline:hover { border-color: var(--medical-500); color: var(--medical-700); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; }
.btn-ghost:hover { background: var(--medical-50); color: var(--medical-700); }
.btn-white { background: #fff; color: var(--medical-800); }
.btn-white:hover { background: var(--medical-50); color: var(--medical-800); }
.btn-onteal { background: var(--medical-500); color: #fff; border-color: rgba(255,255,255,.5); }
.btn-onteal:hover { background: var(--medical-400); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--r-md); }
.btn-lg { padding: 11px 22px; font-size: 14px; border-radius: var(--r-xl); }
.btn-block { width: 100%; }

.linklike { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 6px 0; }
.linklike:hover { color: #b03a2e; }

/* ─────────── brand + avatars ─────────── */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--medical-500), var(--medical-700));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--medical-400), var(--medical-700));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.avatar:hover { color: #fff; filter: brightness(1.06); }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* ─────────── badges + tags ─────────── */

.badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px;
}
.badge-doctor  { color: var(--medical-700); background: var(--medical-100); }
.badge-student { color: var(--tint-amber-fg); background: var(--tint-amber); }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.tag {
  font-size: 10.5px; color: var(--medical-700); background: var(--medical-50);
  padding: 1px 7px; border-radius: 4px; font-weight: 500;
}

.icon-badge {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  background: var(--medical-100);
}
.tint-red   { background: var(--tint-red); }
.tint-blue  { background: var(--tint-blue); }
.tint-purple{ background: var(--tint-purple); }
.tint-green { background: var(--tint-green); }
.tint-teal  { background: var(--tint-teal); }
.tint-amber { background: var(--tint-amber); }
.tint-slate { background: var(--tint-slate); }
.tint-pink  { background: var(--tint-pink); }
.tint-orange{ background: var(--tint-orange); }
.tint-indigo{ background: var(--tint-indigo); }

/* ─────────── app chrome ─────────── */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-nav { display: flex; align-items: center; gap: 10px; }

.shell { display: flex; gap: clamp(16px, 2.5vw, 36px); max-width: 1280px; margin: 0 auto; padding: 0 clamp(0px, 2vw, 32px); }

.rail {
  position: sticky; top: 70px; align-self: flex-start;
  width: var(--rail-w); flex-shrink: 0;
  padding: 22px 0 40px; display: flex; flex-direction: column; gap: 3px;
  max-height: calc(100vh - 70px); overflow-y: auto;
}
.rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-lg);
  color: var(--muted); font-weight: 500;
}
.rail-item:hover { background: var(--medical-50); color: var(--foreground); }
.rail-item.is-active { background: var(--medical-100); color: var(--medical-800); font-weight: 600; }
.rail-glyph { font-size: 13px; width: 16px; text-align: center; }
.rail-cta { margin: 16px 0 6px; }

.rail-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.rail-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2); padding: 0 14px 8px; }
.rail-room { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--r-md); font-size: 12.5px; color: var(--muted); }
.rail-room:hover { background: var(--medical-50); color: var(--foreground); }
.rail-room .em { font-size: 15px; }
.rail-room .n { margin-left: auto; color: var(--muted-2); font-size: 12.5px; }

.rail-footer { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--border); }
.rail-me { display: flex; align-items: center; gap: 11px; padding: 9px 14px; border-radius: var(--r-lg); }
.rail-me:hover { background: var(--medical-50); }
.rail-me strong { display: block; font-size: 12.5px; font-weight: 600; }
.rail-me em { display: block; font-size: 12.5px; color: var(--muted); font-style: normal; }
.rail-footer form { padding: 0 14px; }

.main { flex: 1; min-width: 0; max-width: 680px; padding: clamp(16px, 2vw, 26px) clamp(12px, 2vw, 0) 96px; }
.bottombar, .fab { display: none; }

/* ─────────── cards + posts ─────────── */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
  transition: box-shadow .2s, border-color .2s;
}
.post-card:hover { box-shadow: var(--shadow-soft); border-color: var(--border-2); }

.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 20px; margin-bottom: 4px; }
.section-heading { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2); margin: 28px 0 12px; }

.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-byline { flex: 1; min-width: 0; }
.byline-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.author { font-weight: 600; }

.post-title { display: block; font-size: 20.5px; font-weight: 700; line-height: 1.32; margin-bottom: 8px; }
.post-title:hover { color: var(--medical-700); }
.post-excerpt { color: var(--muted); line-height: 1.65; }

.post-full-title { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.25; margin: 6px 0 12px; }
.prose p { margin-bottom: 10px; color: var(--foreground); line-height: 1.65; font-size: 13.5px; }
.prose p:last-child { margin-bottom: 0; }

.post-actions { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.action {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--muted); padding: 7px 12px; border-radius: var(--r-md); cursor: pointer;
}
.action:hover { background: var(--medical-50); color: var(--medical-700); }
.action.is-on { color: var(--medical-700); background: var(--medical-100); font-weight: 600; }
.action-sm { font-size: 12.5px; padding: 5px 9px; }
.glyph { font-size: 15px; line-height: 1; }

.composer-stub {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 8px 12px; margin-bottom: 10px; font-size: 12.5px;
}
.composer-stub:hover { border-color: var(--medical-300); box-shadow: var(--shadow-soft); }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab { padding: 9px 16px; color: var(--muted); font-weight: 500; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.tab:hover { border-color: var(--medical-300); color: var(--medical-700); }
.tab.is-active { background: var(--medical-600); border-color: var(--medical-600); color: #fff; font-weight: 600; }

.back-link { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 14px; font-weight: 500; }

.comment { padding: 18px 20px; }
.comment-body { color: var(--foreground); line-height: 1.6; font-size: 13px; }
.reply-box textarea { margin-top: 12px; }
.reply-head { display: flex; align-items: center; gap: 11px; }

.list-row { display: flex; flex-direction: column; gap: 5px; padding: 16px 20px; }
.list-row:hover { border-color: var(--medical-300); box-shadow: var(--shadow-soft); }
.list-title { font-size: 17px; font-weight: 700; }

.notice { text-align: center; color: var(--muted); }
.notice a { color: var(--medical-600); font-weight: 600; }

/* ─────────── forms ─────────── */

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: block; font-size: 12.5px; font-weight: 600; }
.stack label .muted { font-weight: 400; }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; margin-top: 5px; padding: 8px 10px; font: inherit; color: var(--foreground);
  background: #fff; border: 1px solid var(--border-2); border-radius: var(--r-lg);
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--medical-500); box-shadow: 0 0 0 3px var(--medical-100);
}
::placeholder { color: var(--muted-2); }

.row-end { display: flex; justify-content: flex-end; gap: 10px; }
.row-split { display: flex; justify-content: space-between; gap: 10px; }

.error { background: var(--tint-red); color: var(--tint-red-fg); padding: 11px 14px; border-radius: var(--r-lg); font-size: 14px; font-weight: 500; }

.role-pick { border: 0; display: grid; gap: 11px; }
.role-pick legend { font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.role-option { display: block; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--r-xl); cursor: pointer; position: relative; }
.role-option:hover { border-color: var(--medical-300); }
.role-option:has(input:checked) { border-color: var(--medical-500); background: var(--medical-50); box-shadow: 0 0 0 3px var(--medical-100); }
.role-option input { position: absolute; opacity: 0; }
.role-option strong { display: block; font-size: 13px; }
.role-option .muted { font-size: 12px; font-weight: 400; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-2); border-radius: 999px; font-size: 14px; cursor: pointer; user-select: none; background: #fff; }
.chip { font-size: 12.5px; }
.chip:hover { border-color: var(--medical-300); }
.chip:has(input:checked) { background: var(--medical-600); border-color: var(--medical-600); color: #fff; font-weight: 600; }
.chip input { position: absolute; opacity: 0; width: 0; }

/* ─────────── empty / stats / toast ─────────── */

.empty { text-align: center; padding: 40px 20px; }
.empty-glyph { font-size: 28px; margin-bottom: 10px; }
.empty h2 { font-size: 17px; margin-bottom: 8px; }
.empty p { margin-bottom: 20px; }

.stat-row { display: flex; gap: 24px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.stat-row strong { display: block; font-size: 18px; font-weight: 800; color: var(--medical-700); }
.stat-row span { font-size: 11.5px; color: var(--muted); }

.profile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.profile-name { font-size: 20px; margin-bottom: 6px; }
.profile-bio { color: var(--muted); margin-top: 14px; line-height: 1.7; }

/* topic / room cards */
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.room-card {
  display: flex; flex-direction: column; gap: 7px; margin-bottom: 0;
  padding: 16px; border-radius: var(--r-lg);
}
.room-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); border-color: transparent; }
.room-name { font-size: 15px; font-weight: 700; }
.room-blurb { font-size: 12px; flex: 1; line-height: 1.6; }
.room-meta { display: flex; gap: 12px; color: var(--muted-2); font-size: 11.5px; font-weight: 500; }
.room-card form { margin-top: 6px; }

.norms { margin-top: 24px; border-radius: var(--r-2xl); padding: 24px; }
.norms h2 { font-size: 15px; margin-bottom: 12px; }
.norms ul { list-style: none; display: grid; gap: 10px; }
.norms li { padding-left: 22px; position: relative; color: var(--muted); font-size: 12.5px; }
.norms li::before { content: '✓'; position: absolute; left: 0; color: var(--medical-500); font-weight: 700; }

.toast { font-size: 12.5px;
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--medical-800); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lift); z-index: 90; animation: rise .3s ease both;
}

@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes riseFlat { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }


/* ═══════════ compact feed rows + voting ═══════════ */

.rows { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }

.row {
  display: flex; gap: 10px;
  padding: 8px 12px 8px 6px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #fbfdfd; }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.row-title {
  display: block; font-size: 14px; font-weight: 600; line-height: 1.32;
  color: var(--foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-title:hover { color: var(--medical-700); }

.row-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  font-size: 11.5px; color: var(--muted-2); line-height: 1.4;
}
.row-meta a { color: var(--muted); font-weight: 500; }
.row-meta a:hover { color: var(--medical-700); text-decoration: underline; }
.row-meta .room-link { color: var(--medical-700); font-weight: 600; }
.row-meta .sep { color: var(--border-2); }

.row-actions { display: flex; align-items: center; gap: 2px; margin-top: 1px; }
.act {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--muted-2); padding: 3px 6px; border-radius: 4px; cursor: pointer;
}
.act:hover { background: var(--medical-50); color: var(--medical-700); }
.act.is-on { color: var(--medical-700); }

/* vote column */
.votes {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  width: 30px; flex-shrink: 0; padding-top: 1px;
}
.votes form { display: block; line-height: 0; }
.vote {
  display: block; width: 22px; height: 18px; line-height: 18px; text-align: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--muted-2); border-radius: 3px;
  transition: color .12s, background .12s;
}
.vote:hover { background: var(--medical-50); }
.vote.up:hover, .vote.up.is-on { color: var(--medical-600); }
.vote.down:hover, .vote.down.is-on { color: #c2603f; }
.vote.up.is-on, .vote.down.is-on { background: transparent; }

.score {
  font-size: 12px; font-weight: 700; color: var(--foreground);
  font-variant-numeric: tabular-nums; line-height: 1.1; padding: 1px 0;
}
.score.up { color: var(--medical-600); }
.score.down { color: #c2603f; }

.votes-sm { width: 24px; }
.votes-sm .vote { width: 18px; height: 15px; line-height: 15px; font-size: 9.5px; }
.votes-sm .score { font-size: 11px; }

/* sort bar */
.sortbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 6px 8px; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  font-size: 12px;
}
.sorts { display: flex; align-items: center; gap: 2px; }
.sort {
  padding: 4px 10px; border-radius: 999px; font-weight: 600;
  color: var(--muted); font-size: 12px;
}
.sort:hover { background: var(--medical-50); color: var(--medical-700); }
.sort.is-active { background: var(--medical-100); color: var(--medical-800); }
.sorts-sub .sort { font-weight: 500; font-size: 11.5px; padding: 3px 8px; }
.sortbar-comments { margin: 14px 0 8px; }

/* room header */
.room-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.room-head h1 { font-size: 19px; margin-bottom: 2px; }
.room-head p { font-size: 12.5px; }

/* post detail */
.post-full-grid { display: flex; gap: 12px; }
.reply-box textarea { margin-top: 0; font-size: 13px; }
.reply-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 11.5px; }

.comments { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.comment {
  display: flex; gap: 8px; padding: 10px 12px 10px 6px;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-main .row-meta { margin-bottom: 3px; }

/* ─────────── mobile menu ─────────── */

.mobile-menu-btn {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--foreground); border-radius: 2px;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.mobile-menu-btn.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed; inset: 0; padding-top: 60px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(32px) saturate(180%); -webkit-backdrop-filter: blur(32px) saturate(180%);
  z-index: 19; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.mobile-menu.is-open { display: flex; animation: menuSlide .3s cubic-bezier(.4,0,.2,1); }
.mobile-menu > a {
  font-size: 22px; font-weight: 700; padding: 20px 28px;
  color: var(--foreground); letter-spacing: -.01em;
  transition: color .15s, padding-left .2s;
}
.mobile-menu > a:hover { color: var(--medical-600); padding-left: 36px; }
.mobile-menu-cta {
  display: flex; flex-direction: column; gap: 12px;
  margin: 32px 28px 0; padding-top: 28px; border-top: 1px solid var(--border);
}
.mobile-menu-cta .btn {
  padding: 16px; font-size: 15px; border-radius: 16px;
}
.mobile-menu-cta .btn-primary {
  box-shadow: 0 6px 20px -6px rgba(20,133,122,.5);
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════ landing ═══════════ */

.landing { background: #fff; }

.landing-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.landing-links { display: none; gap: 26px; }
.landing-links a { color: var(--muted); font-weight: 500; font-size: 14.5px; }
.landing-links a:hover { color: var(--medical-700); }
.landing-bar-actions { display: flex; align-items: center; gap: 8px; }

.hero {
  display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); align-items: center;
  padding: clamp(44px, 7vw, 88px) 0;
  background: linear-gradient(180deg, var(--medical-50) 0%, #fff 100%);
}
.hero-inner { display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.hero-copy { animation: riseIn .5s ease both; }
.hero-demo { animation: riseIn .6s .08s ease both; }
.hero-demo .card { box-shadow: var(--shadow-lift); border-radius: var(--r-2xl); padding: 24px; margin: 0; }

.pill { font-size: 11.5px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 999px;
  background: #fff; border: 1px solid var(--medical-200); color: var(--medical-700);
  font-size: 13.5px; font-weight: 600; margin-bottom: 24px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--medical-500); }

.hero-title { font-size: clamp(28px, 4vw, 44px); line-height: 1.06; letter-spacing: -.03em; margin-bottom: 20px; text-wrap: pretty; }
.hero-title .accent { color: var(--medical-600); }
.hero-sub { font-size: clamp(14px, 1.2vw, 16px); line-height: 1.65; color: var(--muted); margin-bottom: 32px; max-width: 48ch; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 52px); border-top: 1px solid var(--border); padding-top: 26px; }
.hero-stats strong { display: block; font-size: 21px; font-weight: 800; color: var(--medical-700); }
.hero-stats span { font-size: 11.5px; color: var(--muted); }
.demo-note { text-align: center; font-size: 13.5px; margin-top: 14px; }

section.band { padding: clamp(52px, 7vw, 84px) 0; }
.band-white { background: #fff; }
.band-wash  { background: var(--medical-50); }

.band-head { text-align: center; max-width: 760px; margin: 0 auto clamp(36px, 5vw, 56px); }
.band-head h2 { font-size: clamp(21px, 2.6vw, 28px); margin-bottom: 14px; }
.band-head p { font-size: clamp(13.5px, 1.1vw, 15px); color: var(--muted); line-height: 1.6; }

.band-head-split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: clamp(32px, 4vw, 48px); }
.band-head-split h2 { font-size: clamp(21px, 2.6vw, 28px); margin-bottom: 12px; }
.band-head-split p { font-size: clamp(13px, 1.1vw, 14.5px); color: var(--muted); max-width: 46ch; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.feature {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 30px 22px; border: 1px solid var(--border); border-radius: var(--r-2xl); background: #fff;
  transition: box-shadow .2s, transform .2s;
}
.feature:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.feature h3 { font-size: 15px; margin: 12px 0 7px; }
.feature p { color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.carousel-wrap { position: relative; }
.carousel {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 0 18px; scrollbar-width: thin;
}
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; }
.slide {
  flex: 0 0 clamp(240px, 30vw, 320px); scroll-snap-align: start;
  border-radius: var(--r-2xl); padding: 28px 24px; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; min-height: 200px;
}
.slide .em { font-size: 26px; }
.slide h3 { font-size: 15px; }
.slide p { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.cta-band {
  background: linear-gradient(135deg, var(--medical-600) 0%, var(--medical-800) 100%);
  color: #fff; text-align: center; padding: clamp(52px, 7vw, 88px) 0;
}
.cta-band h2 { font-size: clamp(21px, 2.6vw, 30px); margin-bottom: 16px; }
.cta-band p { font-size: clamp(13.5px, 1.1vw, 15px); color: var(--medical-100); max-width: 52ch; margin: 0 auto 32px; line-height: 1.6; }
.cta-band .hero-cta { justify-content: center; margin: 0; }

.landing-foot { background: var(--foreground); color: #fff; padding: clamp(40px, 5vw, 56px) 0 32px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.foot-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--medical-300); margin-bottom: 14px; font-weight: 700; }
.foot-grid a, .foot-grid p { display: block; color: #b9cfcd; font-size: 14.5px; margin-bottom: 9px; line-height: 1.6; }
.foot-grid a:hover { color: #fff; }
.landing-foot .brand-name { color: #fff; }
.foot-base { border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; color: #8fadab; font-size: 13.5px; text-align: center; line-height: 1.7; }

/* ─────────── auth + onboarding ─────────── */

.auth-split { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.auth-aside { display: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 44px 20px; }
.auth-card { width: 100%; max-width: 450px; }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 24px; }
.auth-card .stack { margin-top: 22px; }
.auth-card .back { display: inline-block; margin-top: 20px; font-size: 14px; }

.segmented { display: inline-flex; padding: 4px; background: var(--medical-50); border-radius: var(--r-lg); margin-bottom: 24px; }
.segmented a { padding: 8px 18px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; color: var(--muted); }
.segmented a.is-active { background: #fff; color: var(--medical-800); font-weight: 700; box-shadow: 0 1px 4px rgba(20,71,68,.12); }

.onboard { max-width: 580px; margin: 0 auto; padding: 44px 20px 80px; }
.onboard .brand { margin-bottom: 34px; }
.step-label { color: var(--muted-2); text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 700; margin-bottom: 12px; }
.progress { height: 5px; background: var(--medical-100); border-radius: 999px; margin-bottom: 26px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--medical-500); border-radius: 999px; transition: width .3s; }

/* ─────────── responsive ─────────── */

@media (min-width: 760px) {
  .hero-inner { grid-template-columns: 1.05fr 1fr; }
  .landing-links { display: flex; }
  .mobile-menu-btn { display: none !important; }
  .mobile-menu { display: none !important; }
}

@media (min-width: 900px) {
  .auth-split { grid-template-columns: 1fr 1.1fr; }
  .auth-aside {
    display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 60px;
    background: linear-gradient(150deg, var(--medical-600), var(--medical-900));
    color: #fff;
  }
  .auth-aside .brand-name { color: #fff; }
  .auth-aside blockquote { font-size: 19px; line-height: 1.4; font-weight: 600; max-width: 24ch; }
  .auth-aside .muted { color: var(--medical-200); }
  .aside-points { display: grid; gap: 14px; margin-top: 8px; }
  .aside-point { display: flex; gap: 12px; align-items: flex-start; color: var(--medical-100); font-size: 15px; }
  .aside-point b { color: #fff; display: block; font-size: 15px; }
  .aside-note { margin-top: 20px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.16); font-size: 14px; }
}


/* ═══════════════════════════════════════════
   MOBILE — 899px and below
   Premium glass + shadow design system
   ═══════════════════════════════════════════ */

@media (max-width: 899px) {

  /* ── global mobile feel ─────────────── */

  *, *::before, *::after { -webkit-tap-highlight-color: transparent; }
  body.has-chrome { font-size: 14px; }

  /* ── app chrome ─────────────────────── */

  .rail { display: none; }
  .main { max-width: 100%; padding: 14px 16px calc(92px + env(safe-area-inset-bottom)); }
  .shell { padding: 0; }

  .topbar {
    padding: 8px 16px; border-bottom: 0;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(20,71,68,.04), 0 4px 24px -6px rgba(20,71,68,.06);
  }
  .topbar .brand-mark { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
  .topbar .brand-name { font-size: 15px; }
  .topbar-nav .btn { display: none; }

  /* bottom nav — floating pill */
  .bottombar {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
    display: flex; justify-content: space-around; align-items: center;
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%);
    box-shadow: 0 4px 32px -4px rgba(20,71,68,.14),
                0 0 0 .5px rgba(20,71,68,.08),
                inset 0 .5px 0 rgba(255,255,255,.6);
    padding: 4px 4px;
    border-radius: 22px;
  }
  .bottombar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: 10px; font-weight: 600; letter-spacing: .02em;
    color: var(--muted-2); padding: 8px 0; border-radius: 16px;
    position: relative; transition: color .25s, transform .15s; flex: 1;
  }
  .bottombar a .rail-glyph {
    font-size: 22px; line-height: 1;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  }
  .bottombar a.is-active { color: var(--medical-600); }
  .bottombar a.is-active .rail-glyph { transform: scale(1.12) translateY(-1px); }
  .bottombar a.is-active::after {
    content: ''; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: var(--medical-500);
  }

  /* FAB — gradient with glow */
  .fab {
    position: fixed; right: 20px;
    bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 45;
    width: 54px; height: 54px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--medical-400), var(--medical-600) 50%, var(--medical-800));
    color: #fff; font-size: 28px; font-weight: 300; border: 0;
    box-shadow: 0 4px 20px -4px rgba(20,133,122,.55),
                0 8px 32px -8px rgba(20,133,122,.25);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
  }
  .fab:hover, .fab:active {
    color: #fff; transform: scale(1.08) rotate(90deg);
    box-shadow: 0 6px 28px -4px rgba(20,133,122,.65),
                0 12px 48px -8px rgba(20,133,122,.35);
  }

  /* ── feed ──────────────────────────── */

  .row-title { white-space: normal; }

  .sortbar {
    position: sticky; top: 49px; z-index: 10;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-wrap: nowrap;
    margin: 0 -16px 12px; padding: 8px 16px;
    border-radius: 0; border-left: 0; border-right: 0;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .sortbar::-webkit-scrollbar { display: none; }
  .sorts { flex-shrink: 0; }
  .sort { padding: 6px 14px; font-size: 12.5px; }

  .room-head { padding: 0; }
  .room-head h1 { font-size: 18px; }

  .composer-stub {
    border-radius: 18px; padding: 14px 18px; font-size: 13.5px;
    border: 1.5px dashed var(--border-2); background: var(--medical-50);
    transition: border-color .2s, background .2s, box-shadow .2s;
  }
  .composer-stub:hover {
    border-color: var(--medical-400); border-style: solid;
    background: #fff; box-shadow: var(--shadow-soft);
  }

  /* ── post detail ───────────────────── */

  .post-full { border-radius: 22px; padding: 22px; }
  .post-full-grid { gap: 10px; }
  .post-full-title { font-size: 21px; line-height: 1.25; }
  .prose p { font-size: 14.5px; line-height: 1.7; }

  .card.reply-box { border-radius: 22px; padding: 18px; }
  .reply-box textarea {
    font-size: 15px; padding: 14px 16px; border-radius: 14px;
    background: var(--background); border-color: transparent;
    transition: background .2s, border-color .2s;
  }
  .reply-box textarea:focus { background: #fff; border-color: var(--medical-500); }
  .reply-foot { flex-direction: column; gap: 10px; align-items: stretch; }
  .reply-foot .muted { text-align: center; font-size: 12px; }
  .reply-foot .btn { width: 100%; justify-content: center; }

  .comments { border-radius: 22px; }
  .comment { padding: 14px 16px 14px 10px; }
  .comment-body { font-size: 13.5px; line-height: 1.65; }

  /* ── landing mobile ────────────────── */

  .landing-bar { padding: 10px 16px; }
  .landing-bar-actions { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero {
    padding: 0;
    background: linear-gradient(165deg, var(--medical-50) 0%, #e8f7f4 30%, #fff 70%, var(--medical-50) 100%);
    position: relative; overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; top: -40%; right: -30%; width: 80%; height: 80%;
    background: radial-gradient(circle, rgba(20,133,122,.07) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
  }
  .hero-inner { gap: 28px; padding: 32px 20px 44px; position: relative; z-index: 1; }
  .pill {
    font-size: 11.5px; padding: 7px 14px; margin-bottom: 20px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px -4px rgba(20,71,68,.1);
  }
  .hero-title { font-size: 30px; line-height: 1.08; margin-bottom: 16px; letter-spacing: -.03em; }
  .hero-sub { font-size: 15px; margin-bottom: 28px; line-height: 1.6; }
  .hero-cta { gap: 10px; flex-direction: column; margin-bottom: 30px; }
  .hero-cta .btn {
    width: 100%; text-align: center; justify-content: center;
    padding: 15px 24px; font-size: 15px; border-radius: 16px;
  }
  .hero-cta .btn-primary { box-shadow: 0 8px 24px -6px rgba(20,133,122,.5); }

  /* stats as glass cards */
  .hero-stats {
    gap: 8px; padding: 0; border-top: 0;
    display: grid; grid-template-columns: repeat(3, 1fr);
  }
  .hero-stats > div {
    text-align: center; padding: 18px 8px;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: 18px; border: 1px solid rgba(20,71,68,.06);
    box-shadow: 0 2px 8px -4px rgba(20,71,68,.06);
  }
  .hero-stats strong { font-size: 26px; }
  .hero-stats span { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; color: var(--medical-600); }
  .hero-demo { display: none; }

  section.band { padding: 44px 0; }
  .band-head { margin-bottom: 28px; }
  .band-head h2 { font-size: 23px; }
  .band-head p { font-size: 14px; }

  .carousel { padding: 4px 20px 14px; gap: 12px; }
  .slide {
    flex: 0 0 260px; padding: 24px 20px; min-height: 170px; border-radius: 22px;
    background: #fff; border-color: transparent;
    box-shadow: 0 2px 16px -4px rgba(20,71,68,.08);
  }
  .slide .em { font-size: 30px; }
  .slide h3 { font-size: 14.5px; }
  .slide p { font-size: 12.5px; }

  .feature-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feature {
    padding: 22px 16px; border-radius: 22px;
    border-color: transparent;
    box-shadow: 0 2px 16px -4px rgba(20,71,68,.08);
  }
  .feature .icon-badge { width: 48px; height: 48px; font-size: 22px; border-radius: 14px; }
  .feature h3 { font-size: 14px; margin: 10px 0 5px; }
  .feature p { font-size: 12.5px; }

  .room-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .room-card {
    padding: 16px; border-radius: 20px;
    border-color: transparent;
    box-shadow: 0 2px 12px -4px rgba(20,71,68,.08);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  }
  .room-card:active { transform: scale(.97); }
  .room-card .icon-badge { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .room-name { font-size: 14px; }
  .room-blurb {
    font-size: 11.5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .room-meta { font-size: 11px; }

  .band-head-split { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 24px; }
  .band-head-split .link { font-size: 13.5px; }

  .cta-band {
    padding: 52px 0;
    background: linear-gradient(150deg, var(--medical-500) 0%, var(--medical-700) 40%, var(--medical-900) 100%);
    position: relative; overflow: hidden;
  }
  .cta-band::before {
    content: '';
    position: absolute; top: -60%; left: -20%; width: 80%; height: 140%;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 60%);
    border-radius: 50%; pointer-events: none;
  }
  .cta-band h2 { font-size: 24px; position: relative; }
  .cta-band p { font-size: 14.5px; margin-bottom: 28px; position: relative; }
  .cta-band .hero-cta {
    flex-direction: column; align-items: center; gap: 10px;
    position: relative; margin: 0;
  }
  .cta-band .hero-cta .btn {
    min-width: 260px; padding: 15px 24px;
    font-size: 15px; border-radius: 16px;
  }

  .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .foot-grid a, .foot-grid p { font-size: 13.5px; }
  .foot-base { font-size: 12px; line-height: 1.6; }

  /* ── auth ───────────────────────────── */

  .auth-split {
    min-height: 100vh;
    background: linear-gradient(170deg, var(--medical-600) 0%, var(--medical-800) 25%, var(--background) 25.1%);
  }
  .auth-main { padding: 56px 20px 40px; align-items: flex-start; }
  .auth-card {
    background: #fff; border-radius: 28px; padding: 36px 24px;
    box-shadow: 0 20px 60px -20px rgba(20,71,68,.15),
                0 0 0 1px rgba(20,71,68,.03);
    max-width: 100%;
  }
  .auth-card h1 { font-size: 24px; margin-bottom: 8px; }
  .segmented { width: 100%; border-radius: 14px; }
  .segmented a { flex: 1; text-align: center; padding: 11px 14px; border-radius: 10px; }

  /* ── onboarding ─────────────────────── */

  .onboard { padding: 24px 20px 96px; }
  .chip {
    padding: 11px 18px; font-size: 14px; border-radius: 999px;
    transition: all .2s;
  }
  .chip-grid { gap: 8px; }
  .chip:has(input:checked) { box-shadow: 0 4px 16px -4px rgba(20,133,122,.3); }

  /* ── profile ────────────────────────── */

  .profile-top { flex-direction: column; align-items: center; text-align: center; }
  .profile-name { font-size: 24px; }
  .avatar-lg { width: 72px; height: 72px; font-size: 24px; }
  .stat-row {
    justify-content: center; gap: 0;
    display: grid; grid-template-columns: repeat(3, 1fr);
  }
  .stat-row > div { text-align: center; }
  .stat-row strong { font-size: 24px; }

  /* ── general polish ────────────────── */

  .card {
    border-radius: 22px; padding: 18px;
    border-color: transparent;
    box-shadow: 0 2px 12px -4px rgba(20,71,68,.08), 0 0 0 .5px rgba(20,71,68,.04);
  }
  .post-card:hover { box-shadow: 0 4px 24px -6px rgba(20,71,68,.14); }
  .back-link { font-size: 13.5px; margin-bottom: 14px; }
  .page-head h1 { font-size: 21px; }
  .notice { border-radius: 22px; font-size: 13.5px; padding: 18px; }
  .empty { padding: 40px 24px; border-radius: 22px; }
  .empty-glyph { font-size: 38px; margin-bottom: 14px; }
  .empty h2 { font-size: 19px; }
  .tags { gap: 6px; }
  .tag { padding: 4px 12px; font-size: 11.5px; border-radius: 8px; }

  .action { padding: 8px 14px; border-radius: 12px; font-size: 13px; transition: all .15s; }
  .action:active { transform: scale(.95); }
  .post-actions { padding-top: 14px; margin-top: 18px; gap: 6px; }
  .badge { font-size: 10px; padding: 2px 8px; border-radius: 6px; }

  /* forms — premium feel */
  input[type=text], input[type=email], input[type=password], textarea, select {
    font-size: 16px; padding: 14px 16px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--background);
    transition: background .2s, border-color .2s, box-shadow .2s;
  }
  input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, textarea:focus, select:focus {
    background: #fff; border-color: var(--medical-500);
    box-shadow: 0 0 0 4px var(--medical-100), 0 4px 16px -4px rgba(20,133,122,.1);
  }

  .btn { padding: 13px 20px; border-radius: 14px; font-size: 14px; transition: all .2s; }
  .btn:active { transform: scale(.97); }
  .btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 12px; }
  .btn-lg { padding: 15px 26px; font-size: 15px; border-radius: 16px; }
  .btn-block { padding: 15px; border-radius: 16px; }
  .btn-primary { box-shadow: 0 4px 16px -4px rgba(20,133,122,.4); }

  .toast {
    left: 20px; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom));
    transform: none; text-align: center;
    font-size: 13.5px; padding: 14px 20px; border-radius: 16px;
    background: var(--foreground);
    box-shadow: 0 12px 40px -8px rgba(0,0,0,.3);
    animation: riseFlat .3s ease both;
  }

  .norms { border-radius: 22px; padding: 24px; }
  .norms li { font-size: 13.5px; line-height: 1.6; }

  .rows { border-radius: 22px; }
}


/* ═══════════════════════════════════════════
   PHONE — 599px and below
   ═══════════════════════════════════════════ */

@media (max-width: 599px) {

  /* ── post cards: borderless shadow cards with inline votes ── */

  .rows {
    background: transparent; border: 0; border-radius: 0; overflow: visible;
    display: flex; flex-direction: column; gap: 10px;
  }
  .row {
    flex-wrap: wrap; gap: 4px;
    background: #fff; border: 0; border-radius: 22px;
    padding: 18px 20px;
    box-shadow: 0 2px 12px -4px rgba(20,71,68,.08), 0 0 0 .5px rgba(20,71,68,.04);
    transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s;
  }
  .row:last-child { border-bottom: 0; }
  .row:hover { background: #fff; }
  .row:active { transform: scale(.98); box-shadow: 0 1px 6px -3px rgba(20,71,68,.1); }

  .row-main { display: contents; }
  .row-title { flex-basis: 100%; order: 1; font-size: 15.5px; line-height: 1.35; font-weight: 700; }
  .row-meta { flex-basis: 100%; order: 2; font-size: 12px; gap: 5px; line-height: 1.5; padding-top: 4px; }

  /* votes — contained pill */
  .votes {
    order: 3; flex-direction: row; width: auto;
    gap: 0; padding: 4px; align-items: center;
    background: var(--background); border-radius: 12px;
    margin-top: 8px;
  }
  .votes .vote {
    width: 36px; height: 32px; line-height: 32px;
    font-size: 13px; border-radius: 10px;
  }
  .votes .score { padding: 0 4px; font-size: 13px; min-width: 24px; text-align: center; }
  .votes form { display: inline; }

  .row-actions { order: 3; margin-left: auto; margin-top: 8px; padding-top: 0; }
  .row-actions .act {
    padding: 8px 14px; font-size: 12px; border-radius: 10px; min-height: 36px;
    display: inline-flex; align-items: center;
    background: var(--background);
  }

  /* ── post detail: immersive ── */

  .post-full-grid { flex-direction: column; }
  .post-full-grid > .votes {
    flex-direction: row; width: auto; order: 10;
    gap: 0; padding: 10px 12px; margin-top: 8px;
    background: var(--background); border-radius: 14px;
    border-top: 0; align-items: center;
  }
  .post-full-grid > .votes .vote {
    width: 44px; height: 40px; line-height: 40px;
    font-size: 16px; border-radius: 12px;
  }
  .post-full-grid > .votes .score { padding: 0 8px; font-size: 16px; font-weight: 800; }

  /* ── comments: horizontal votes in pill ── */

  .comment { flex-wrap: wrap; }
  .comment .votes.votes-sm {
    order: 2; flex-direction: row; width: auto;
    gap: 0; padding: 3px; align-items: center;
    background: var(--background); border-radius: 10px; margin-top: 6px;
  }
  .comment .votes-sm .vote { width: 30px; height: 28px; line-height: 28px; font-size: 12px; border-radius: 8px; }
  .comment .votes-sm .score { padding: 0 3px; font-size: 12px; }
  .comment-main { order: 1; flex-basis: 100%; }

  /* ── landing phone ─────────────────── */

  .hero-title { font-size: 28px; }
  .hero-sub { font-size: 14.5px; }

  .feature-grid { grid-template-columns: 1fr; gap: 10px; }
  .feature {
    display: grid; grid-template-columns: 56px 1fr; gap: 2px 16px;
    text-align: left; padding: 20px; align-items: start;
  }
  .feature .icon-badge {
    grid-row: 1 / 3; align-self: center;
    width: 56px; height: 56px; font-size: 24px; border-radius: 16px;
  }
  .feature h3 { margin: 0 0 3px; font-size: 15px; align-self: end; }
  .feature p { margin: 0; font-size: 12.5px; align-self: start; }

  .foot-grid { grid-template-columns: 1fr; gap: 20px; }

  .sort { padding: 7px 14px; font-size: 13px; }
  .sorts-sub .sort { padding: 5px 12px; }

  .room-grid { gap: 8px; }

  .auth-split {
    background: linear-gradient(170deg, var(--medical-600) 0%, var(--medical-800) 20%, var(--background) 20.1%);
  }
  .auth-card { padding: 32px 20px; border-radius: 24px; }
  .auth-card h1 { font-size: 22px; }
}


/* ── reduced motion ────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
