/* Fredoka (SIL OFL 1.1), self-hosted: closest open match to the rounded heavy lettering on the slang.ie logo and book cover */
@font-face {
  font-family: "Fredoka";
  src: url("../assets/fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
/* slang.ie — portrait book reader */
:root {
  --brand: "Fredoka", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --ink: #1a1814;
  --ink-soft: #3d3830;
  --muted: #6b645a;
  --rule: #c9c2b4;
  --paper: #fafafa;
  --paper-edge: #ecece8;
  --accent: #2f5d4a;
  --accent-soft: #4a7a64;
  --link: #1e4d3a;
  --shadow: 0 12px 40px rgba(40, 35, 25, 0.18);
  --page-max: 28rem; /* phone-ish portrait width */
  --radius: 2px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  /* Almost-white reading surface; greyscale cover only peeks in desktop margins */
  background-color: #fafafa;
  background-image: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

/* Portrait book stage — centred column on every viewport */
.stage {
  width: 100%;
  max-width: var(--page-max);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

@media (min-width: 480px) {
  body {
    padding: 1.25rem 0.75rem;
    align-items: flex-start;
    /* Greyscale cover only in margins around the portrait book column */
    background-color: #2a2a2a;
    background-image:
      linear-gradient(180deg, rgba(40,40,40,0.42), rgba(28,28,28,0.55)),
      url("../assets/cover-bg-grey.jpg");
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
  }
  .stage {
    min-height: calc(100dvh - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
    border-radius: 4px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
}

.page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(0,0,0,0.015) 0, transparent 8px),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 10%, var(--paper) 100%);
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

/* Watermark */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/slang-ie-logo.png") center 42% / 42% no-repeat;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
.page::after {
  content: "slang.ie";
  position: absolute;
  right: 1rem;
  bottom: 4.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--ink);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  transform: rotate(-90deg);
  transform-origin: right bottom;
}

.page > * { position: relative; z-index: 1; }

/* Top chrome */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.4rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(252, 252, 251, 0.96);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 1.35rem; height: 1.35rem; object-fit: contain; }

/* County cookie trail — one compact line */
.crumb {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb a {
  color: var(--ink-soft);
  text-decoration: none;
  flex-shrink: 0;
}
.crumb a:hover { color: var(--accent); }
.crumb-home { font-weight: 700; color: var(--ink); }
.crumb-sep {
  color: var(--rule);
  font-weight: 400;
  flex-shrink: 0;
}
.crumb-current,
.crumb-county {
  color: var(--accent);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb a.crumb-county { color: var(--accent); }

.progress {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Search (icon + overlay panel) */
.search-wrap {
  position: relative;
  flex-shrink: 0;
}
.search-toggle {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.search-toggle:hover,
.search-wrap.is-open .search-toggle {
  color: var(--accent);
  border-color: var(--rule);
  background: #fff;
}
.search-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(calc(100vw - 1.5rem), 22rem);
  max-width: calc(var(--page-max) - 1.2rem);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(40, 35, 25, 0.16);
  padding: 0.55rem;
  z-index: 20;
}
.search-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 93, 74, 0.15);
}
.search-results {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  max-height: min(50dvh, 18rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.search-results li a {
  display: block;
  padding: 0.5rem 0.45rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 3px;
  border-bottom: 1px solid var(--paper-edge);
}
.search-results li:last-child a { border-bottom: 0; }
.search-results li.is-active a,
.search-results li a:hover {
  background: rgba(47, 93, 74, 0.08);
}
.search-results .sr-phrase {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}
.search-results .sr-meta {
  display: block;
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.1rem;
}
.search-results .sr-def {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}
.search-empty {
  margin: 0.45rem 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* Thumb index: dictionary-style tabs, A-M left, N-Z + # right (mirrored) */
.thumb-index {
  position: absolute;
  top: 3.9rem;
  bottom: 4.2rem;
  width: 1.3rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* both columns top-aligned; left ends one tab short */
  gap: 2px;
}
.thumb-right { right: 0; }
.thumb-left { left: 0; }
.thumb-index a, .thumb-index span {
  flex: 0 0 auto;
  height: min(3rem, calc((100% - 26px) / 14)); /* same size both sides: 14 slots */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--paper-edge);
  border: 1px solid var(--rule);
}
.thumb-right a, .thumb-right span { border-right: 0; border-radius: 5px 0 0 5px; }
.thumb-left a, .thumb-left span { border-left: 0; border-radius: 0 5px 5px 0; }
.thumb-index a:hover,
.thumb-index a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.thumb-right a:hover, .thumb-right a[aria-current="page"] { margin-left: -0.25rem; }
.thumb-left a:hover, .thumb-left a[aria-current="page"] { margin-right: -0.25rem; }
.thumb-index .is-empty { color: var(--rule); background: transparent; }
html.search-open .thumb-index { pointer-events: none; }
.page > .entry { padding-left: 2.2rem; padding-right: 2.2rem; } /* 1.3rem tab + ~14px gutter */

/* Entry body */
.entry {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: 1.35rem 1.25rem 1rem;
}

.entry-header {
  margin-bottom: 1rem;
}

.phrase {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 6.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}
.meta-line .pos { font-style: italic; color: var(--ink-soft); }
.meta-line .county {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.definition {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 36em;
}

.example-block {
  margin: 0 0 0.7rem;
  padding: 0.4rem 0 0.4rem 0.75rem;
  border-left: 3px solid var(--accent-soft);
}
.example-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.example {
  margin: 0;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink);
  quotes: "\201C" "\201D" "\2018" "\2019";
}
/* Keep open/close quotes inline with the quote text (not on their own lines) */
.example p {
  display: inline;
  margin: 0;
}
.example::before {
  content: open-quote;
  font-style: normal;
  font-size: 1em;
  line-height: 1;
  opacity: 0.55;
}
.example::after {
  content: close-quote;
  font-style: normal;
  font-size: 1em;
  line-height: 1;
  opacity: 0.55;
}

.posh {
  margin: 0.15rem 0 1.1rem;
  padding: 0.65rem 0.75rem;
  background: rgba(47, 93, 74, 0.06);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.posh-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.posh p { margin: 0; font-style: normal; }

/* Related / counties */
.section {
  margin: 0 0 1.1rem;
}
.section h2 {
  margin: 0 0 0.45rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip-list a, .chip-list span {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--link);
  background: #ebe6d8;
  border-radius: 999px;
  border: 1px solid transparent;
}
.chip-list a:hover {
  border-color: var(--accent);
  background: #e2ecdf;
}
.chip-list .muted { color: var(--muted); background: transparent; padding-left: 0; }
.hint {
  margin: 0.25rem 0 0;
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--muted);
}

/* Book ad (bottom of entry) */
.promo {
  margin: 1rem 0 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fafafa;
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0.65rem;
  align-items: center;
}
.promo img {
  width: 3.75rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.promo h2,
.promo .promo-title {
  margin: 0 0 0.3rem;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}
.promo .promo-blurb {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.promo .promo-insult {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.promo p {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.promo .cta {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

/* Bottom nav */
.nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--rule);
  background: rgba(252, 252, 251, 0.98);
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}
.nav-btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn[aria-disabled="true"],
.nav-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.nav-btn.prev { justify-self: start; }
.nav-btn.next { justify-self: end; }
.nav-hint {
  font-family: var(--sans);
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

/* TOC / home extras */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 1.5rem;
}
.toc-list li {
  border-bottom: 1px solid var(--rule);
}
.toc-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  text-decoration: none;
  color: var(--ink);
}
.toc-list a:hover .toc-phrase { color: var(--accent); }
.toc-phrase { font-weight: 700; }
.toc-county {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.lede {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}


/* Mobile: free vertical room so Posh English lands above the fold */
@media (max-width: 480px) {
  .entry {
    padding: 1.1rem 1.1rem 0.85rem;
  }
  .entry-header {
    margin-bottom: 0.75rem;
  }
  .promo {
    margin: 0.85rem 0 0.25rem;
    padding: 0.55rem;
    gap: 0.5rem;
    grid-template-columns: 3.1rem 1fr;
  }
  .promo img {
    width: 3.1rem;
  }
  .promo h2,
  .promo .promo-title {
    font-size: 20px;
    margin-bottom: 0.2rem;
  }
  .promo .promo-blurb {
    margin: 0 0 0.25rem;
    font-size: 0.74rem;
    line-height: 1.3;
  }
  .promo .promo-insult {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
  }
  .promo p {
    margin: 0 0 0.3rem;
    font-size: 0.74rem;
    line-height: 1.3;
  }
}

/* Swipe feedback */
.page.swipe-left { animation: swipeL 0.22s ease; }
.page.swipe-right { animation: swipeR 0.22s ease; }
@keyframes swipeL {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-12%); opacity: 0.4; }
}
@keyframes swipeR {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(12%); opacity: 0.4; }
}


/* County browse extras */
.meta-line a.county:hover { text-decoration: underline; }

.province-block { margin: 0 0 0.85rem; }
.province-label {
  margin: 0 0 0.35rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip-list .count {
  font-weight: 600;
  opacity: 0.7;
  margin-left: 0.15rem;
}
.province-section h2 {
  margin-top: 0.25rem;
}
.toc-list .toc-empty {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  opacity: 0.45;
  font-family: var(--serif);
}
.county-toc a {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.county-toc .toc-pos {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-soft);
}
.county-toc .toc-def {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}
.lede .cta { margin-right: 0.15rem; }


/* Sortable county table */
.table-wrap {
  margin: 0.35rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.county-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.county-table th,
.county-table td {
  padding: 0.5rem 0.45rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--paper-edge);
}
.county-table th {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-edge);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.county-table .sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.county-table .sort-btn.is-active { color: var(--accent); }
.county-table .sort-ind {
  font-size: 0.7rem;
  min-width: 0.7rem;
}
.county-table .col-phrase a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.county-table .col-phrase a:hover { color: var(--accent); }
.county-table .col-pos {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ink-soft);
  white-space: nowrap;
}
.county-table .col-def {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.county-table .col-score {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  white-space: nowrap;
  width: 3.2rem;
}
.county-table th.col-score { text-align: right; }
@media (max-width: 420px) {
  .county-table .col-pos { display: none; }
  .county-table .col-def {
    font-size: 0.68rem;
  }
  .county-table th,
  .county-table td {
    padding: 0.45rem 0.35rem;
  }
}

/* ---------- Home redesign ---------- */
.home { --cream: #f6f0e1; --cream-deep: #ece3cc; }
.home-hero { text-align: center; margin: 0.4rem 0 0.9rem; }
.home-title {
  margin: 0; font-family: var(--serif); font-size: 2.3rem; line-height: 1.05;
  color: var(--accent); letter-spacing: -0.01em;
}
.home-sub {
  margin: 0.3rem 0 0; font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.sotd {
  position: relative; background: var(--cream); border: 1px solid var(--cream-deep);
  border-radius: 14px; padding: 1rem 1rem 0.9rem; margin: 0 0 0.9rem;
  box-shadow: 0 6px 18px rgba(60, 50, 20, 0.08);
}
.sotd.is-flip { animation: sotd-in 0.35s ease-out; }
@keyframes sotd-in { from { opacity: 0.2; transform: rotate(-1deg) translateY(4px); } to { opacity: 1; transform: none; } }
.sotd-kicker {
  display: inline-block; margin: 0 0 0.45rem; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-family: var(--sans); font-size: 0.66rem;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-2deg);
}
.sotd-link { display: block; text-decoration: none; color: inherit; }
.sotd-phrase {
  display: block; font-family: var(--serif); font-weight: 700; font-size: 2rem;
  line-height: 1.1; color: var(--ink);
}
.sotd-link:hover .sotd-phrase { color: var(--accent); }
.sotd-county {
  display: inline-block; margin-top: 0.3rem; font-family: var(--sans); font-size: 0.75rem;
  font-weight: 700; color: var(--accent);
}
.sotd-label {
  margin: 0.7rem 0 0.1rem; font-family: var(--sans); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.sotd-example { margin: 0; font-style: italic; font-size: 1rem; line-height: 1.4; }
.sotd-posh { margin: 0; font-size: 0.95rem; line-height: 1.4; color: var(--ink-soft); }
.sotd-shuffle {
  margin-top: 0.85rem; appearance: none; border: 2px solid var(--accent); background: #fff;
  color: var(--accent); font-family: var(--sans); font-weight: 700; font-size: 0.85rem;
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; min-height: 2.6rem;
}
.sotd-shuffle:hover, .sotd-shuffle:active { background: var(--accent); color: #fff; }
.hero-search { position: relative; margin: 0 0 1.1rem; }
.hero-search-icon { position: absolute; left: 0.9rem; top: 0.95rem; color: var(--accent); pointer-events: none; }
.hero-search-input {
  width: 100%; font-family: var(--sans); font-size: 1.05rem; padding: 0.9rem 1rem 0.9rem 2.8rem;
  border: 2px solid var(--accent); border-radius: 999px; background: #fff; color: var(--ink);
  min-height: 3.3rem; -webkit-appearance: none; appearance: none;
}
.hero-search-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(47, 93, 74, 0.18); }
.hero-results:not(:empty) {
  background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 0.25rem; max-height: none;
}
.map-card { margin: 0 0 1.1rem; text-align: center; }
.map-card h2 {
  margin: 0 0 0.2rem; font-family: var(--sans); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.map-label { position: sticky; top: 0; z-index: 2; background: rgba(250,250,250,0.95); padding: 0.25rem 0; margin: 0 0 0.4rem; min-height: 1.6rem; font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft); }
.map-label strong { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); }
.map-open {
  margin-left: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent);
  color: #fff; text-decoration: none; font-weight: 700; font-size: 0.75rem;
}
.ie-map { width: 100%; max-width: 22rem; height: auto; display: block; margin: 0 auto; }
.ie-map path { stroke: #fff; stroke-width: 0.6; stroke-linejoin: round; transition: fill 0.15s; cursor: pointer; }
.ie-map .shade-0 { fill: #e3eddc; }
.ie-map .shade-1 { fill: #d6e5cd; }
.ie-map .shade-2 { fill: #c8dcbe; }
.ie-map .shade-3 { fill: #b9d2ae; }
.ie-map .shade-4 { fill: #a9c79e; }
.ie-map .m-county.is-on path, .ie-map .m-county:focus-visible path { stroke: #2f5d4a; stroke-width: 1.2; }
@media (hover: hover) { .ie-map .m-county:hover path { stroke: #2f5d4a; stroke-width: 1.2; } }
.ie-map .m-county:focus { outline: none; }
.chip-list--compact { gap: 0.3rem; }
.chip-list--compact a { padding: 0.2rem 0.5rem; font-size: 0.72rem; }
.home .province-block { margin-bottom: 0.55rem; }
.home-bar { grid-template-columns: 1fr 1fr; }

/* Random-entry button: deep green pill/stamp */
.hitme-wrap { margin: 0.2rem 0 1.4rem; text-align: center; }
.hitme {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; box-sizing: border-box; padding: 1.1rem 1.2rem; border-radius: 999px;
  background: #24493a; color: #f6f0dc;
  border: 2px solid #f6f0dc; outline: 2px solid #24493a;
  font-family: var(--brand); font-weight: 600; font-size: 1.7rem; line-height: 1.1;
  text-decoration: none;
  box-shadow: 0 5px 0 #173328, 0 10px 18px rgba(23, 51, 40, 0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.hitme:hover { background: #2a5543; }
.hitme:active { transform: translateY(4px); box-shadow: 0 1px 0 #173328, 0 4px 8px rgba(23, 51, 40, 0.25); }
.hitme-dice { flex: 0 0 auto; transform: rotate(-10deg); }
.az-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.45rem; }
.az-grid a, .az-grid span {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border-radius: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none;
  color: var(--accent); border: 1.5px solid currentColor;
}
.az-grid a:hover { background: var(--accent); color: #fff; }
.az-grid .is-empty { opacity: 0.28; }
.heard-in { margin: -0.35rem 0 0.9rem; font-size: 0.9rem; color: var(--muted); }
.prose p { font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; margin: 0 0 0.9rem; }
.prose a { color: var(--link); }
.site-foot { margin: 1.2rem 0 0.4rem; text-align: center; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.site-foot a { color: var(--muted); }

/* Header: one row. Logo + strapline left, compact search right (expands on focus) */
.topbar { flex-wrap: nowrap; }
.topbar-main { flex: 1 1 auto; min-width: 0; gap: 0.35rem; }
.strapline {
  font-family: var(--brand);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.search-wrap { flex: 0 0 8.4rem; height: 2.05rem; position: relative; display: flex; align-items: center; }
.search-wrap .search-icon { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 7; }
.search-wrap .search-input {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 100%; padding: 0.38rem 0.5rem 0.38rem 1.75rem; font-size: 0.9rem;
  transition: width 0.18s ease; z-index: 6;
}
.search-wrap .search-input::placeholder { font-family: var(--brand); font-weight: 500; color: var(--muted); }
.search-wrap:focus-within .search-input { width: min(21rem, calc(100vw - 1.4rem)); }
.search-wrap .search-panel { left: auto; right: 0; width: min(21rem, calc(100vw - 1.4rem)); max-width: none; top: calc(100% + 0.3rem); }
.search-toggle { display: none; }
.thumb-index { top: 3.4rem; }

/* slang.ie - For Focal Sake: one baseline, matched size */
.topbar .crumb { align-items: baseline; gap: 0.3rem; font-size: 0.78rem; }
.topbar .crumb-sep { color: var(--muted); font-weight: 600; }
.topbar .strapline { font-size: 0.82rem; line-height: 1; }
.topbar .crumb-home { line-height: 1; }

/* Related terms (collapsible) */
details.related > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.4rem; min-height: 2.2rem; }
details.related > summary::-webkit-details-marker { display: none; }
details.related > summary h2 { margin: 0; }
details.related > summary::after { content: "+"; font-family: var(--sans); font-weight: 700; color: var(--accent); }
details.related[open] > summary::after { content: "–"; }
details.related > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.related-list { list-style: none; margin: 0.3rem 0 0; padding: 0; border-top: 1px solid var(--paper-edge); }
.related-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--paper-edge); }
.related-list a { font-family: var(--sans); font-weight: 700; color: var(--ink); }
.related-def { display: block; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.35; }

/* Smaller random pill on inner pages */
.hitme-wrap.is-small { margin: 0.4rem 0 1.2rem; }
.hitme-wrap.is-small .hitme { width: auto; min-width: 70%; padding: 0.7rem 1.1rem; font-size: 1.2rem; gap: 0.45rem;
  box-shadow: 0 4px 0 #173328, 0 8px 14px rgba(23, 51, 40, 0.22); }
.hitme[aria-busy="true"] .hitme-dice { animation: dice-roll 0.6s linear infinite; }
@keyframes dice-roll { to { transform: rotate(350deg); } }

/* In-content Back / Next */
.entry-steps { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; margin: 0.2rem 0 1rem; }
.step-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; min-width: 6.2rem;
  padding: 0.55rem 1rem; border: 1.5px solid var(--accent); border-radius: 999px; background: #fff;
  color: var(--accent); font-family: var(--sans); font-weight: 700; font-size: 0.95rem; text-decoration: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.step-btn.back { justify-self: start; }
.step-btn.fwd { justify-self: end; background: var(--accent); color: #fff; }
.step-btn:hover { filter: brightness(1.08); }
.step-btn:active { transform: translateY(1px); }
.step-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.step-btn.is-disabled { opacity: 0.35; border-style: dashed; }
.swipe-hint { font-family: var(--sans); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.05em; white-space: nowrap; }
.first-view .swipe-hint { color: var(--accent); }

/* Page-turn animation */
.turn-out-next { animation: turnOutNext 0.2s ease-in forwards; }
.turn-out-prev { animation: turnOutPrev 0.2s ease-in forwards; }
.turn-in-next { animation: turnInNext 0.26s ease-out; }
.turn-in-prev { animation: turnInPrev 0.26s ease-out; }
@keyframes turnOutNext { to { transform: translateX(-12%) rotate(-0.5deg); opacity: 0; } }
@keyframes turnOutPrev { to { transform: translateX(12%) rotate(0.5deg); opacity: 0; } }
@keyframes turnInNext { from { transform: translateX(12%) rotate(0.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes turnInPrev { from { transform: translateX(-12%) rotate(-0.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
.page.swipe-left, .page.swipe-right { animation: none; }

/* Idle nudge on Next (JS adds .is-nudging at random 8-20s intervals) */
.step-btn.fwd.is-nudging, .nav-btn.next.is-nudging { animation: nudge 0.9s ease-in-out 2; }
.first-view .swipe-hint { animation: hintPulse 0.9s ease-in-out 0.8s 2; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(3px); } 60% { transform: translateX(-1px); } }
@keyframes hintPulse { 50% { opacity: 0.4; } }

@media (prefers-reduced-motion: reduce) {
  .turn-out-next, .turn-out-prev, .turn-in-next, .turn-in-prev,
  .step-btn.fwd.is-nudging, .nav-btn.next.is-nudging, .first-view .swipe-hint,
  .pull-random, .pull-random svg,
  .hitme[aria-busy="true"] .hitme-dice { animation: none !important; }
}

/* Compact Back/Next strip at the top of entries */
.entry-steps { margin: -0.6rem 0 0.6rem; gap: 0.4rem; }
.entry-steps .step-btn { min-height: 2.75rem; min-width: 0; padding: 0.3rem 0.9rem; font-size: 0.85rem; }

/* Tight bottom: ~12px between footer and the bottom bar */
.entry, .page > .entry { padding-bottom: 0.45rem; }
.site-foot { margin-bottom: 0.3rem; }
@media (max-width: 479px) { .entry { padding-bottom: 0.45rem; } }

/* Pull-to-random (touch) */
body, .page > .entry { overscroll-behavior-y: contain; }
.pull-random {
  position: absolute; left: 50%; z-index: 8; pointer-events: none; opacity: 0;
  transform: translate(-50%, -40px);
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border-radius: 999px;
  background: #24493a; color: #f6f0dc; border: 2px solid #f6f0dc; outline: 2px solid #24493a;
  font-family: var(--brand); font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(23, 51, 40, 0.25);
}
.pull-random.is-snap { transition: transform 0.2s ease, opacity 0.2s ease; }
.pull-random.is-armed { background: #2f5d4a; }
.pull-random.is-going svg { animation: dice-roll 0.6s linear infinite; }
html.pull-active .entry { touch-action: none; }

/* Auto-links inside examples: subtle */
.example a.autolink { color: inherit; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.example a.autolink:hover { color: var(--accent); }

/* FAQ block */
.faq h3.faq-q { margin: 0.6rem 0 0.2rem; font-family: var(--sans); font-size: 0.9rem; font-weight: 700; color: var(--ink); text-align: left; }
.faq p.faq-a { margin: 0 0 0.4rem; font-size: 0.92rem; line-height: 1.45; color: var(--ink-soft); text-align: left; }

/* Slang of the day callout with a day name: wrap/shrink gracefully on mobile */
.sotd-kicker { max-width: calc(100% - 0.5rem); white-space: normal; line-height: 1.25; text-wrap: balance; }
.sotd-kicker.is-day { font-size: clamp(0.58rem, 2.6vw, 0.66rem); letter-spacing: 0.06em; }

/* Page turn v2: longer, clearer; incoming animation starts on first paint */
.turn-out-next { animation: turnOutNext2 0.26s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
.turn-out-prev { animation: turnOutPrev2 0.26s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
html.turn-in-next .entry { animation: turnInNext2 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
html.turn-in-prev .entry { animation: turnInPrev2 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes turnOutNext2 { to { transform: translateX(-60%) rotate(-3deg); opacity: 0; } }
@keyframes turnOutPrev2 { to { transform: translateX(60%) rotate(3deg); opacity: 0; } }
@keyframes turnInNext2 { from { transform: translateX(55%) rotate(3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes turnInPrev2 { from { transform: translateX(-55%) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Idle tug on Next: clearer but still subtle (bigger on phones) */
@keyframes tug {
  0%, 100% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(47, 93, 74, 0); }
  15% { transform: translateX(6px) scale(1.04); box-shadow: 0 0 0 4px rgba(47, 93, 74, 0.18); }
  30% { transform: translateX(-2px); }
  45% { transform: translateX(4px) scale(1.02); box-shadow: 0 0 0 3px rgba(47, 93, 74, 0.12); }
  65% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(47, 93, 74, 0); }
}
@media (max-width: 600px), (pointer: coarse) {
  .step-btn.fwd.is-nudging, .nav-btn.next.is-nudging { animation: tug 1.1s ease-in-out 2; }
}

/* One-off pull hint */
.pull-random.is-hint { animation: pullHint 2.4s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }
@keyframes pullHint {
  0% { opacity: 0; transform: translate(-50%, -40px); }
  18% { opacity: 1; transform: translate(-50%, 14px); }
  28% { transform: translate(-50%, 4px); }
  36% { transform: translate(-50%, 10px); }
  80% { opacity: 1; transform: translate(-50%, 8px); }
  100% { opacity: 0; transform: translate(-50%, -40px); }
}
@media (prefers-reduced-motion: reduce) {
  html.turn-in-next .entry, html.turn-in-prev .entry, .turn-out-next, .turn-out-prev,
  .step-btn.fwd.is-nudging, .nav-btn.next.is-nudging { animation: none !important; }
  .pull-random.is-hint { animation: pullHintStill 2.4s linear forwards; }
  @keyframes pullHintStill { 0%, 100% { opacity: 0; transform: translate(-50%, 8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 8px); } }
}

/* Idle tug v3: the whole entry card lifts slightly left, then settles */
@keyframes pageTug {
  0%, 100% { transform: none; }
  22% { transform: translateX(-16px) rotate(-0.6deg); }
  40% { transform: translateX(-12px) rotate(-0.4deg); }
  70% { transform: translateX(2px) rotate(0.1deg); }
  85% { transform: translateX(-1px); }
}
.page > .entry.is-nudging { animation: pageTug 1.1s cubic-bezier(0.35, 0, 0.25, 1) 1; transform-origin: 70% 40%; }
@media (min-width: 601px) and (pointer: fine) { .page > .entry.is-nudging { animation-name: pageTugDesk; } }
@keyframes pageTugDesk { 0%, 100% { transform: none; } 25% { transform: translateX(-10px) rotate(-0.4deg); } 70% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .page > .entry.is-nudging { animation: none !important; } }

/* SOTD kicker straddles the card's top edge */
.sotd { margin-top: 1.5rem; padding-top: 1.55rem; }
.sotd-kicker { position: absolute; top: 0; left: 0.8rem; margin: 0; transform: translateY(-50%) rotate(-2deg); box-shadow: 0 2px 6px rgba(0,0,0,0.15); max-width: calc(100% - 1.6rem); }

/* Share button */
.share { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.9rem 0 0.4rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--brand); font-weight: 600; font-size: 0.98rem;
  color: var(--accent); background: #fff; border: 2px solid var(--accent);
  border-radius: 999px; padding: 0.45rem 1rem 0.45rem 0.8rem; min-height: 44px; cursor: pointer;
}
.share-btn:hover, .share-btn[aria-expanded="true"] { background: var(--accent); color: #fff; }
.share-btn:focus-visible, .share-opt:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.share-menu { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.share-menu[hidden], .share-toast[hidden] { display: none; }
.share-opt {
  font-family: var(--brand); font-weight: 500; font-size: 0.92rem; color: var(--ink);
  background: var(--paper-edge); border: 0; border-radius: 999px; padding: 0.5rem 0.9rem; min-height: 40px;
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center;
}
.share-opt:hover { background: #dfe9e3; color: var(--accent); }
.share-toast {
  margin: 0;
  font-family: var(--brand); font-weight: 600; font-size: 0.88rem; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 0.35rem 0.85rem; box-shadow: var(--shadow);
}

/* Top row: ‹ Previous | dice | Next › (compact, one line at 360px) */
.entry-steps { grid-template-columns: auto 1fr auto; gap: 0.35rem; }
.entry-steps .step-btn { min-width: 0; padding: 0.45rem 0.75rem; min-height: 2.6rem; font-size: 0.9rem; white-space: nowrap; }
.hitme.hitme-top {
  justify-self: center; display: inline-flex; align-items: center; gap: 0.3rem; width: auto; min-width: 0; max-width: 100%; outline: none; line-height: 1;
  min-height: 2.6rem; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1.5px solid var(--accent);
  background: #eef4f0; color: var(--accent); font-family: var(--brand); font-weight: 600; font-size: 0.86rem;
  text-decoration: none; white-space: nowrap; overflow: hidden; box-shadow: none; transform: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.hitme.hitme-top span { overflow: hidden; text-overflow: clip; }
.hitme.hitme-top .hitme-dice { flex: none; }
.hitme.hitme-top:hover { background: var(--accent); color: #fff; }
@media (max-width: 380px) {
  .entry-steps .step-btn { padding: 0.4rem 0.6rem; font-size: 0.84rem; }
  .hitme.hitme-top { font-size: 0.78rem; padding: 0.3rem 0.55rem; gap: 0.25rem; }
}
@media (max-width: 340px) { .hitme.hitme-top span { display: none; } }

/* Gesture tips under the top-row buttons (touch only) */
.step-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.step-cell.is-start { justify-self: start; }
.step-cell.is-mid { justify-self: center; max-width: 100%; }
.step-cell.is-end { justify-self: end; }
.step-cell .step-btn, .step-cell .hitme-top { justify-self: auto; }
.step-tip { display: block; margin-top: 0.12rem; font-family: var(--sans); font-size: 0.62rem; line-height: 1; color: var(--muted); white-space: nowrap; }
@media (pointer: fine), (max-width: 339px) { .step-tip { display: none; } }

/* Equal weight Previous / Next: both solid green, same width; dice stays light */
.entry-steps .step-btn.back, .entry-steps .step-btn.fwd { background: var(--accent); color: #fff; border-color: var(--accent); min-width: 5.9rem; }
.entry-steps .step-btn.is-disabled { background: #fff; color: var(--accent); }
@media (max-width: 380px) { .entry-steps .step-btn.back, .entry-steps .step-btn.fwd { min-width: 5.4rem; } }
.home-steps { margin-top: 0.4rem; }

/* v-btns: main actions clear. Prev/Next quiet white, dice + share solid green */
.entry-steps .step-btn.back, .entry-steps .step-btn.fwd {
  background: #fff; color: var(--ink); border: 1px solid var(--rule);
}
.entry-steps .step-btn.back:hover, .entry-steps .step-btn.fwd:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.entry-steps .step-btn.is-disabled { background: #fff; color: var(--muted); }
.hitme.hitme-top {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.hitme.hitme-top:hover { background: #2a5543; color: #fff; }
.step-cell.is-mid .step-tip { color: var(--accent); font-weight: 700; }
.share-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.share-btn:hover, .share-btn[aria-expanded="true"] { background: #2a5543; color: #fff; border-color: #2a5543; }
/* Buy Me a Coffee: quiet white outline beside the solid green Share */
.coffee-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; box-sizing: border-box;
  font-family: var(--brand); font-weight: 600; font-size: 0.98rem; line-height: 1.2; white-space: nowrap;
  color: var(--ink); background: #fff; border: 2px solid var(--rule);
  border-radius: 999px; padding: 0.45rem 0.95rem 0.45rem 0.75rem; min-height: 44px; text-decoration: none;
}
.coffee-btn:hover { border-color: var(--accent); color: var(--accent); }
.coffee-btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.coffee-ico { font-size: 1rem; line-height: 1; }
.share-btn { white-space: nowrap; }
@media (max-width: 480px) {
  .share { gap: 0.4rem; }
  .share-btn, .coffee-btn { font-size: 0.9rem; gap: 0.3rem; padding: 0.4rem 0.75rem 0.4rem 0.6rem; }
  .share-btn svg { width: 16px; height: 16px; }
  .coffee-ico { font-size: 0.92rem; }
}
