:root {
  --bg: #242212;
  --surface: #000000;
  --accent: #FCF259;
  --text: #EDEDED;
  --muted: #8A8A8A;
  --chip-bg: #2A2A2A;
  --red: #E23B3B;
  --nav-h: 67px;
  /* Phone-first column; widens at breakpoints below. */
  --content-max: 402px;
  --app-max: 1280px;
  --sidebar-w: 220px;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  /* Figma uses a handwritten display face for the About headings; this is
     the nearest common fallback until that font is licensed and self-hosted. */
  --display: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; }
body {
  padding-bottom: 80px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
}

/* page shell — centered column on small screens */
.shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

.card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 24px 22px 16px;
  border: 1px solid #1E1E1E;
}

.card__report {
  position: absolute;
  top: 18px; right: 18px;
  background: none; border: 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}
.card__report:hover { color: var(--text); }

.card__heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 2px;
}
.card__word {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.01em;
}
.card__speak {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 4px;
  border: 1px solid #333;
  border-radius: 50%;
  background: #141414;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.card__speak:hover {
  color: var(--accent);
  border-color: rgba(252, 242, 89, 0.35);
}
.card__also {
  margin: 0 0 12px;
  font-size: 14px;
}
.card__also-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.card__also-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.card__also-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
}
.card__also-link:hover { color: var(--accent); text-decoration: underline; }
.card__also-native {
  color: var(--muted);
  font-size: 13px;
  margin-left: 4px;
}

.card + .card{

  margin-top: 16px;
}

.card__native {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 14px;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.card__pron {
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0; padding: 0;
}

.chip {
  background: var(--chip-bg);
  color: var(--text);
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
}

.card__def {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.card__example {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.6;
  color: #D8D8D8;
  background: #191919;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  margin: 0 0 24px;
  padding: 14px 16px;
}

.card__byline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid #222;
  font-size: 13px;
  color: var(--muted);
}

.icon { width: 18px; height: 18px; display: block; }
.card__actions .icon { width: 17px; height: 17px; }
.card__report .icon { width: 16px; height: 16px; }

/* button reset — without this the browser paints its default
   light "buttonface" background behind every icon */
.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.action--share { margin-left: auto; }
/* Accent means "you voted", so it cannot also be the resting state of the
   upvote button — both sides stay muted until the viewer picks one. */
.action--on { color: var(--accent); font-weight: 600; }
.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
}
.nav__link.is-active { color: var(--text); }
.nav__dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: transparent;
}
.nav__link.is-active .nav__dot { background: var(--text); }
.nav__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* results scroll in normal flow; the bar is fixed, so reserve room for
   bar (~64px) + nav (67px) */
.shell--search { padding-bottom: 140px; }

.results .card + .card { margin-top: 16px; }

.hint {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

.searchbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  /* Sits directly on top of the nav. With interactive-widget=resizes-content
     the layout viewport shrinks when the keyboard opens, so "fixed" tracks
     the area above it rather than ending up behind it. */
  bottom: var(--nav-h);
  width: 100%;
  max-width: var(--content-max);
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid #1a1a1a;
}

.searchbar__input {
  width: 100%;
  height: 43px;
  border-radius: 999px;
  border: 1px solid #2A2A2A;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 0 18px;
  outline: none;
}
.searchbar__input:focus { border-color: var(--accent); }
.searchbar__input::placeholder { color: var(--muted); }

/* ---- Top bar ----------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar__title {
  display: none;
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.topbar__title-ta { color: var(--accent); }
.topbar__title-en { color: var(--red); margin-left: 0.35em; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.topbar__docs {
  display: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.topbar__docs:hover { color: var(--text); }

/* Shared by the top bar and the About page heading. */
.logo {
  width: 39px; height: 39px;
  border-radius: 50%;
  background: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}

/* ---- About ------------------------------------------------------------- */
.about { text-align: center; padding-bottom: 100px; }

.about__logo { margin: 8px 0 14px; }
.logo__ta { color: var(--accent); }
.logo__d  { color: var(--red); }

.about__title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 34px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.about__title-ta { color: var(--accent); }
.about__title-en { color: var(--red); }

.about__intro {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 46px;
  padding: 0 8px;
}

.about__heading {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 14px;
}
.about__heading--left { text-align: left; margin-top: 60px; }

.about__motto {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.sitemap {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 12px;
  text-align: left;
}
.sitemap a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.sitemap a:hover { color: var(--text); }

.about__footer {
  margin-top: 80px;
  font-size: 11px;
  color: var(--muted);
}

/* ---- 404 --------------------------------------------------------------- */
.notfound { text-align: center; padding-top: 90px; }
.notfound__code {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}
.notfound__text {
  color: var(--muted);
  font-size: 15px;
  margin: 12px 0 28px;
}
.notfound__link {
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ---- Search results (compact list) ------------------------------------- */
.wordlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Same surface treatment as the feed card, at list density: a result should
   read as a smaller version of the thing it opens, not a different object. */
.wordrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid #1E1E1E;
  border-radius: 14px;
  cursor: pointer;
}
.wordrow:hover { border-color: #2E2E2E; }
.wordrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The expanded row is just a positioning context for the card and its
   Close control; the card brings its own surface. */
.wordrow-open {
  position: relative;
  list-style: none;
}

.wordrow__collapse {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: 0;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.wordrow__collapse:hover { color: var(--text); }

.wordrow__word {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

/* One line, truncated: every row is the same height and the word column
   stays aligned no matter how long the definition is. */
.wordrow__def {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ---- Page heading ------------------------------------------------------ */
.post__head { padding: 6px 2px 18px; }
.post__title {
  font-family: var(--serif);
  font-size: 30px; font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px; letter-spacing: -0.01em;
}
.post__sub {
  font-family: var(--serif);
  font-size: 16px; line-height: 1.5;
  color: rgba(255,255,255,.5);
  margin: 0;
}

/* ---- Form -------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }

.field {
  background: var(--surface);
  border: 1px solid #1E1E1E;
  border-radius: 14px;
  padding: 14px 16px 15px;
}
.field:focus-within { border-color: rgba(252,242,89,.35); }

.field__label {
  display: flex; align-items: baseline; gap: 7px;
  font-family: var(--serif);
  font-size: 15px; color: rgba(255,255,255,.7);
  margin-bottom: 8px;
}
.field__req { color: var(--accent); font-size: 13px; }
.field__opt { color: rgba(255,255,255,.35); font-size: 13px; }

.field__input,
.field__area {
  width: 100%;
  background: none; border: 0; outline: none; padding: 0;
  color: rgba(255,255,255,.92);
  font-family: var(--serif);
  font-size: 18px; line-height: 1.55;
  resize: none;
}
.field__input::placeholder,
.field__area::placeholder { color: rgba(255,255,255,.28); }
.field__input--tamil { font-family: var(--tamil); font-size: 19px; }
.field__input--pron { font-style: italic; font-size: 16px; }
.field__area { min-height: 92px; }

.field__help {
  font-family: var(--serif);
  font-size: 13.5px; line-height: 1.5;
  color: rgba(255,255,255,.35);
  margin: 9px 0 0;
}
.field__count {
  float: right;
  font-family: var(--serif);
  font-size: 13px;
  color: rgba(255,255,255,.28);
}

/* ---- Chips ------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--serif);
  font-size: 14px; line-height: 1;
  padding: 6px 12px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  cursor: pointer;
}
.chip.is-on {
  background: rgba(252,242,89,.14);
  border-color: rgba(252,242,89,.35);
  color: var(--accent);
}
.chip--tag { padding-right: 8px; display: inline-flex; align-items: center; gap: 6px; }
.chip__x {
  color: rgba(255,255,255,.4);
  font-size: 15px; line-height: 1;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.chip__x:hover { color: var(--text); }

.tagline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tagline__input {
  flex: 1; min-width: 110px;
  background: none; border: 0; outline: none;
  font-family: var(--serif); font-size: 15px;
  color: rgba(255,255,255,.92);
}
.tagline__input::placeholder { color: rgba(255,255,255,.28); }

/* ---- Live preview of the example, matching the Word Card quote block --- */
.quote {
  display: flex; gap: 13px;
  background: rgba(255,255,255,.04);
  border-radius: 10;
  border-radius: 10px;
  padding: 13px 14px;
  margin-top: 12px;
}
.quote__bar { width: 3px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }
.quote__text {
  font-family: var(--serif); font-style: italic;
  font-size: 17px; line-height: 1.5;
  color: rgba(255,255,255,.8);
  margin: 0;
}

/* ---- Guidelines -------------------------------------------------------- */
.rules {
  background: var(--surface);
  border: 1px solid #1E1E1E;
  border-radius: 14px;
  padding: 16px 18px 18px;
  margin-top: 4px;
}
.rules__title {
  font-family: var(--serif);
  font-size: 17px; font-weight: 600;
  color: rgba(255,255,255,.92);
  margin: 0 0 12px;
}
.rules__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules__list li {
  display: flex; gap: 10px;
  font-family: var(--serif);
  font-size: 14.5px; line-height: 1.5;
  color: rgba(255,255,255,.6);
}
.rules__list li::before {
  content: "—";
  color: var(--accent);
  flex-shrink: 0;
}

/* ---- Actions ----------------------------------------------------------- */
.actions { display: flex; gap: 10px; margin-top: 18px; }
/* inline-flex, not block: .btn is worn by both <button> and <a>, and an
   anchor ignores height without it — the label sits on the top edge. */
.btn {
  flex: 1;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--serif);
  font-size: 17px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #100F06; }
.btn--ghost {
  background: none;
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  flex: 0 0 108px;
  font-weight: 400;
}
.terms {
  font-family: var(--serif);
  font-size: 13px; line-height: 1.55;
  color: rgba(255,255,255,.35);
  text-align: center;
  margin: 14px 0 0;
}
.terms a { color: rgba(255,255,255,.55); }

/* ---- Bottom nav -------------------------------------------------------- */
/* Full width, no frame: the links spread across whatever the screen gives. */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-around;
  background: #000; border-top: 1px solid #1a1a1a;
}
.nav__link {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted); text-decoration: none;
}
.nav__link.is-active { color: var(--text); }
.nav__dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.nav__link.is-active .nav__dot { background: var(--text); }
.icon { width: 18px; height: 18px; display: block; }

/* ---- Signed-out gate --------------------------------------------------- */
/* The form stays on the page, blurred, so the page reads as "this is what
   you get once you sign in" rather than an empty shell. It is decoration:
   RequireMember on POST /word is the actual check. */
.gate {
  position: relative;
  max-height: 430px;
  overflow: hidden;
}
.gate__blur {
  filter: blur(3px);
  opacity: .4;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}
.gate__panel {
  position: absolute;
  top: 54px; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 0 16px;
}
.gate__text {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255,255,255,.85);
  margin: 0;
}
.gate__sub {
  font-family: var(--serif);
  font-size: 14px;
  color: rgba(255,255,255,.45);
  margin: -10px 0 0;
}

/* Google's own light button treatment — white plate, dark label, G mark.
   Recognisable at a glance, which a yellow pill would not be. */
.btn--google {
  flex: 0 0 auto;
  background: #FFFFFF;
  color: #1F1F1F;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
}
.btn--google:hover { background: #F2F2F2; }
.btn__g { width: 18px; height: 18px; flex-shrink: 0; }

/* ---- Selectable chips (Type / Tags) ------------------------------------ */
/* The chip is a real radio/checkbox so selection survives without JS and the
   values post with the form. The input itself is visually hidden, not
   display:none — that would take it out of the tab order. */
.chip-opt { display: inline-flex; cursor: pointer; }
.chip-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chip-opt .chip { user-select: none; }
.chip-input:checked + .chip {
  background: rgba(252,242,89,.14);
  border-color: rgba(252,242,89,.35);
  color: var(--accent);
}
.chip-input:focus-visible + .chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- handle modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.66);
  backdrop-filter: blur(3px);
}
.modal__card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 22px 20px 20px;
}
.modal__title {
  font-family: var(--serif);
  font-size: 21px; line-height: 1.2;
  color: rgba(255,255,255,.92);
  margin: 0;
}
.modal__sub {
  font-family: var(--serif);
  font-size: 13.5px; line-height: 1.5;
  color: rgba(255,255,255,.5);
  margin: 6px 0 18px;
}
.handle-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.handle-input__at {
  font-family: var(--serif);
  font-size: 17px;
  color: rgba(255,255,255,.35);
}
.handle-input .field__input { flex: 1 1 auto; min-width: 0; }
.field__err {
  font-family: var(--serif);
  font-size: 13.5px; line-height: 1.5;
  color: var(--red);
  margin: 9px 0 0;
}
.actions--modal {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.actions--modal .btn--primary { flex: 1 1 auto; }

.field__input--tags { margin-top: 10px; }

.topbar__signin { color: var(--accent); font-size: 14px; text-decoration: none; }
.topbar__signin:hover { text-decoration: underline; }
.card__word-link { color: inherit; text-decoration: none; }
.card__word-link:hover { text-decoration: underline; }
.searchbar__tag {
  width: 100%;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid #333;
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.feed-more { text-align: center; margin: 20px 0 8px; }
.btn--ghost {
  background: transparent;
  border: 1px solid #444;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.word-page__back { text-align: center; font-size: 14px; color: var(--muted); }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.logout-form { display: inline; }
.mod-list { list-style: none; padding: 0; margin: 0; }
.mod-list__item { background: var(--surface); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.mod-list__body { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.signin-help__title {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 12px;
  color: var(--accent);
}
.signin-help__lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 20px;
}
.signin-help__steps {
  margin: 0 0 24px;
  padding-left: 1.2rem;
  line-height: 1.6;
  font-size: 15px;
}
.signin-help__steps a { color: var(--accent); }
.signin-help__code,
.signin-help__pre {
  display: block;
  margin: 10px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid #333;
  border-radius: 10px;
  font-size: 13px;
  overflow-x: auto;
  word-break: break-all;
}
.signin-help__pre { white-space: pre-wrap; }
.signin-help__back a { color: var(--accent); font-size: 14px; }

.link-pick-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.link-pick {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: var(--surface);
  color: var(--text);
  font-family: var(--serif);
  font-size: 15px;
  cursor: pointer;
}
.link-pick:hover { border-color: rgba(252, 242, 89, 0.35); color: var(--accent); }
.link-pick__native { color: var(--muted); font-size: 13px; margin-left: 6px; }
.link-pick__chosen { display: block; margin-top: 6px; color: var(--accent); font-size: 13px; }

/* ---- Responsive: tablet ----------------------------------------------- */
@media (min-width: 640px) {
  :root {
    --content-max: min(600px, 92vw);
  }
}

/* ---- Responsive: desktop ------------------------------------------------ */
@media (min-width: 900px) {
  :root {
    --content-max: 100%;
  }

  body {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
    padding-bottom: 24px;
    max-width: var(--app-max);
    margin: 0 auto;
    min-height: 100vh;
    align-items: start;
  }

  .topbar {
    grid-area: topbar;
    max-width: none;
    margin: 0;
    padding: 14px 28px;
    border-bottom: 1px solid #1a1a1a;
    position: sticky;
    top: 0;
    background: rgba(36, 34, 18, 0.92);
    backdrop-filter: blur(8px);
  }

  .topbar__title { display: block; }
  .topbar__docs { display: inline; }

  #content {
    grid-area: main;
    padding: 8px 28px 32px;
    max-width: 960px;
  }

  .shell {
    max-width: none;
    margin: 0;
    padding: 8px 0 0;
  }

  .nav {
    grid-area: sidebar;
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    height: 100vh;
    max-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 24px 12px;
    border-top: none;
    border-right: 1px solid #1a1a1a;
    background: #0a0a0a;
  }

  .nav__link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--serif);
  }
  .nav__link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
  }
  .nav__link.is-active {
    background: rgba(252, 242, 89, 0.08);
    color: var(--accent);
  }
  .nav__link.is-active .nav__dot { display: none; }

  .nav__label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .searchbar {
    position: sticky;
    top: 72px;
    bottom: auto;
    left: auto;
    transform: none;
    max-width: none;
    margin: 0 0 16px;
    padding: 0;
    border-top: none;
    background: transparent;
  }

  .shell--search {
    padding-bottom: 24px;
  }

  .feed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  .feed-grid .card + .card {
    margin-top: 0;
  }
  .shell--feed .feed-more {
    grid-column: 1 / -1;
  }

  .form {
    max-width: 640px;
  }

  .about {
    max-width: 520px;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) {
  #content {
    max-width: 1040px;
  }
}
