: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--up { color: var(--accent); }
.action--share { margin-left: auto; }
.nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  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); }
/* 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;
}
