:root {
  --bg: #242212;
  --surface: #000000;
  --accent: #FCF259;
  --text: #EDEDED;
  --muted: #8A8A8A;
  --chip-bg: #2A2A2A;
  --red: #E23B3B;
  --nav-h: 67px;
  --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 — mimic the 402px frame while designing on desktop */
.shell {
  max-width: 402px;
  margin: 0 auto;
  padding: 16px;
}

.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__word {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--accent);
  margin: 8px 0 2px;
  letter-spacing: -0.01em;
}

.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); }
/* 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: 402px;
  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: 402px;
  margin: 0 auto;
  height: 57px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  background: var(--bg);
}

/* 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; }
