:root {
  --bg: #f6f2eb;
  --paper: #fffdf9;
  --ink: #1d2730;
  --muted: #5d6973;
  --faint: #5f6870;
  --line: #e4dbcc;
  /* colours: these are the "earth" scheme; build/build.py adds the scheme chosen in settings.txt at the end of
     this file (head1/head2 header, sea headings and words, ochre highlights, clay the title panel) */
  --sea: #6a2314;
  --sea2: #8e3a1e;
  --link: #9a3412;
  --logo-red: #b03517;
  --head1: #8f2c15;
  --head2: #6e2010;
  --ochre: #b0502a;
  --ochre-soft: #f5e2d4;
  --sand: #ece2d1;
  --mark: #fbe3a6;
  --clay: #ecc0ab;
  --dots: rgba(244, 178, 112, .55);
  --focus: #f0b48f;
  --v-font: "Charis SIL", "Gentium Plus", "Gentium Book Plus", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 40, 55, .06), 0 3px 10px rgba(23, 40, 55, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--ui-font);
}
body.noscroll { overflow: hidden; }
a { color: var(--link); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.v { font-family: var(--v-font); }
.sc { font-variant-caps: all-small-caps; letter-spacing: .03em; }
.muted { color: var(--faint); }
kbd {
  font: 600 .75rem var(--ui-font);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 .35em; background: var(--paper); color: var(--muted);
}
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- header ---------- */
.site-header {
  position: relative;
  background: linear-gradient(135deg, var(--head1) 0%, var(--head2) 100%);
  color: #fff;
}
/* a row of dots along the top, like the dotted line in the logo */
.site-header::before {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 8px; pointer-events: none;
  background: radial-gradient(circle, var(--dots) 2px, transparent 2.6px) 0 0 / 16px 8px repeat-x;
}
.head-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px 40px;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 14px;
}
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 80px; height: 80px; flex: none; }
/* the dictionary's logo and name sit on a light panel, so a dark logo shows on the header */
.brand-panel {
  background: var(--clay); color: var(--sea);
  justify-self: start; padding: 8px 26px 8px 8px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.brand-panel:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.brand-title { font: 700 1.7rem/1.1 var(--v-font); letter-spacing: .01em; }
.brand-sub { font-size: .85rem; opacity: .8; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

.search { display: flex; flex-direction: column; gap: 8px; max-width: 640px; width: 100%; justify-self: end; }
.search-box { position: relative; }
.search-box input {
  width: 100%;
  font: 1.08rem var(--ui-font);
  padding: 12px 44px 12px 44px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #fff;
  color: var(--ink);
  outline: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.search-box input:focus { border-color: var(--focus); }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.search-icon {
  position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round;
}
.search-box .hint { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.search-box input:focus ~ .hint, .search-box input:not(:placeholder-shown) ~ .hint { display: none; }

.tabs { display: flex; gap: 4px; padding-top: 4px; }
.tabs a, .tabs span {
  color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 10px 16px 11px; border-radius: 10px 10px 0 0;
}
.tabs a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tabs .on { background: var(--bg); color: var(--sea); }
.tabs [data-tab="about"] { margin-left: auto; }                /* About sits on the far side */
/* "coming soon" badge (Lessons tab and its placeholder page) */
.soon, .tabs a .soon {
  display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; vertical-align: 2px;
  font: 600 .66rem/1.6 var(--ui-font); letter-spacing: .04em; text-transform: uppercase;
  background: var(--ochre); color: #fff;
}
@media (max-width: 520px) {
  .tabs { gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs span { padding: 9px 8px 10px; font-size: .9rem; white-space: nowrap; }
}
@media (max-width: 440px) {                                    /* six tabs on a phone: a little tighter so all fit */
  .tabs.wrap { padding: 0 8px; }
  .tabs a, .tabs span { padding: 9px 5px 10px; font-size: .85rem; }
  .tabs a[data-tab="lessons"] { position: relative; }
  .tabs a .soon { position: absolute; top: 1px; right: 1px; margin: 0; padding: 0 3px; font-size: .5rem; line-height: 1.5; }  /* badge in the corner: no extra width */
  .tabs a .soon-w { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }  /* "coming" still read aloud */
}

/* ---------- browse bar ---------- */
.browse-bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letters a {
  min-width: 40px; height: 38px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 .95rem var(--v-font); color: var(--sea); text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: 9px;
}
.letters a:hover { border-color: var(--ochre); color: var(--ochre); }
.letters a.on { background: var(--ochre); border-color: var(--ochre); color: #fff; }
.letters a.all { font: 600 .9rem var(--ui-font); padding: 0 12px; margin-right: 6px; }   /* "All": every word */
.letters .off {                                    /* a letter with no entries (English alphabet) */
  min-width: 40px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 .95rem var(--v-font); color: var(--faint); border: 1px dashed var(--line); border-radius: 9px; opacity: .6;
}
/* wordlist order: the language first / English first / by topic */
.wl-order { display: inline-flex; margin-top: 16px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.wl-order a { font: 600 .86rem var(--ui-font); color: var(--sea); text-decoration: none; padding: 7px 15px; }
.wl-order a + a { border-left: 1px solid var(--line); }
.wl-order a:hover { color: var(--ochre); }
.wl-order a.on { background: var(--sea); color: #fff; }
/* topics */
.tp-group .section-title a { color: inherit; text-decoration: none; }
.tp-group .section-title a:hover { color: var(--ochre); }
.tp-list { list-style: none; margin: 4px 0 6px; padding: 0; columns: 3 220px; column-gap: 28px; }
.tp-list li { padding: 3px 0 3px calc(var(--d) * 18px); break-inside: avoid; }
.tp-list a { color: var(--link); font-weight: 600; text-decoration: none; }
.tp-list a:hover { text-decoration: underline; }
.tp-list span { color: var(--faint); font-size: .85rem; margin-left: 2px; }
.tp-crumbs { margin: 16px 0 2px; font-size: .9rem; color: var(--muted); }
.tp-crumbs a { color: var(--link); }
.tp-subs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.tp-subs a { font: 600 .84rem var(--ui-font); color: var(--sea); text-decoration: none; padding: 4px 11px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; }
.tp-subs a:hover { border-color: var(--ochre); color: var(--ochre); }
.tp-subs span { color: var(--faint); font-weight: 500; }
.suggest { margin: 4px 0 14px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--ochre); border-radius: 10px; }
.suggest a { color: var(--link); font-weight: 600; }
.suggest-note { display: block; margin-top: 2px; color: var(--muted); font-size: .85rem; }
.entry-topics { margin-top: 6px; font-size: .88rem; color: var(--muted); }
.entry-topics a { color: var(--link); }
.tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 600 .82rem var(--ui-font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; cursor: pointer;
}
.chip span { color: var(--faint); font-weight: 500; margin-left: 2px; }
.chip:hover { border-color: var(--sea2); }
.chip.on { background: var(--sea); border-color: var(--sea); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .75); }
.chip.zero { opacity: .45; }
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--paper); }
.viewtoggle button {
  font: 600 .8rem var(--ui-font); color: var(--muted); background: none; border: 0;
  padding: 5px 12px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center;
}
.viewtoggle button + button { border-left: 1px solid var(--line); }
.viewtoggle button[aria-pressed="true"] { background: var(--sand); color: var(--sea); }
.viewtoggle svg { width: 14px; height: 14px; fill: currentColor; }

.list-title { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; font: 700 2rem/1.1 var(--v-font); color: var(--sea); }
.list-title small { font: 500 .9rem var(--ui-font); color: var(--muted); }
.section-title { font: 700 1.35rem var(--v-font); color: var(--sea); margin: 28px 0 4px; display: flex; gap: 10px; align-items: baseline; }
.section-title small { font: 500 .85rem var(--ui-font); color: var(--muted); }
/* search results: words found only in an example sentence, folded under each list */
.ex-hits { margin: 14px 0 6px; }
.ex-hits > summary {
  display: inline-flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font: 600 .9rem var(--ui-font); color: var(--sea);
}
.ex-hits > summary::-webkit-details-marker { display: none; }
.ex-hits > summary:hover { border-color: var(--ochre); }
.ex-hits > summary:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.ex-hits[open] > summary { margin-bottom: 12px; }
.ex-act { font-size: .82rem; color: var(--link); }
.ex-act::after { content: " ▾"; }
.ex-hits[open] .ex-act::after { content: " ▴"; }
.ex-hits[open] .ex-show, .ex-hits:not([open]) .ex-hide { display: none; }
.section-intro { color: var(--muted); margin: 0 0 14px; font-size: .93rem; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 0 6px; }
.results-head h2 { margin: 0; font: 700 1.5rem var(--v-font); color: var(--sea); }
.empty { padding: 40px 0; color: var(--muted); }

/* ---------- word of the day ---------- */
/* a panel that folds away: the heading line (summary) opens and closes it; folded, it shows just the word.
   Open or folded is remembered (store 'wotd'). */
.wotd-box {
  margin: 20px 0 6px;
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--ochre);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.wotd-box > summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 24px 0; cursor: pointer; list-style: none;
}
.wotd-box > summary::-webkit-details-marker { display: none; }
.wotd-box > summary:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; border-radius: 6px; }
.wotd-box:not([open]) > summary { padding-bottom: 12px; }
.wotd-peek, .wotd-box[open] .wotd-show, .wotd-box:not([open]) .wotd-hide, .wotd-box:not([open]) .wotd-date { display: none; }
.wotd-box:not([open]) .wotd-peek { display: inline; }
.wotd-peek .v { font: 700 1.05rem var(--v-font); letter-spacing: 0; text-transform: none; color: var(--sea); }
.wotd-act { flex: none; font: 600 .8rem var(--ui-font); letter-spacing: .02em; text-transform: none; color: var(--link); }
.wotd-act::after { content: " ▴"; }
.wotd-box:not([open]) .wotd-act::after { content: " ▾"; }
.wotd {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 32px; align-items: center;
  padding: 6px 24px 18px; border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
.wotd:hover .hw { color: var(--ochre); }
.wotd:focus-visible { outline: 2px solid var(--ochre); outline-offset: -2px; }
.wotd-word { display: flex; flex-direction: column; gap: 2px; }
.wotd-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ochre); }
.wotd .hw { font: 700 1.9rem/1.15 var(--v-font); color: var(--sea); overflow-wrap: anywhere; }
.wotd .pos { font-style: italic; color: var(--muted); font-size: .9rem; }
.wotd .gl { font-size: 1.08rem; font-weight: 600; }
.wotd-ex { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 3px solid var(--ochre-soft); }
.wotd-ex .exv { font-size: 1.08rem; }
.wotd-ex .exe { color: var(--muted); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px 13px; color: inherit; text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .12s, transform .12s, box-shadow .12s;
  min-height: 92px;
}
.card:hover, .card:focus-visible { border-color: var(--ochre); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(23, 40, 55, .1); outline: none; }
.card .hw { font: 700 1.16rem/1.25 var(--v-font); color: var(--sea); overflow-wrap: anywhere; }
.card .hw sup, .row .hw sup { font-size: .62em; color: var(--ochre); margin-left: 1px; }
.card .pos { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ochre); }
.card .gl {
  font-size: .92rem; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .under, .row .under { font-size: .76rem; color: var(--muted); }
.card .note, .row .note { font-size: .75rem; color: var(--faint); font-style: italic; }
.card.sub { background: #fcf9f3; border-left: 3px solid var(--sand); }
.card.nk .hw::after, .row.nk .hw::after { content: " †"; color: var(--faint); font-weight: 400; }
/* English-first cards and rows: the English word leads, the entry's word comes under it */
.card .ehw { font: 700 1.1rem/1.25 var(--ui-font); color: var(--ink); overflow-wrap: anywhere; }
.card.eng .hw { font-size: 1.02rem; }
.card.eng .gl .pos, .row.eng .gl .pos { margin-right: 3px; }
.row.eng { grid-template-columns: minmax(130px, 24%) minmax(130px, 24%) minmax(0, 1fr); }
.row .ehw { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

/* compact list view */
.rows { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(150px, 24%) 150px minmax(0, 1fr);
  gap: 4px 14px; align-items: baseline;
  padding: 8px 16px; color: inherit; text-decoration: none; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }

/* each card/row sits in a cell so a play button can sit beside the link */
.cell { position: relative; display: flex; min-width: 0; }
.cell > .card, .cell > .row { flex: 1; min-width: 0; }
.rows > .cell > .row { border-top: 0; }
.rows > .cell + .cell { border-top: 1px solid var(--line); }
.cell.has-audio > .card .hw { padding-right: 40px; }
.cell.has-audio > .card .ehw { padding-right: 40px; }
.cell.has-audio > .card.eng .hw { padding-right: 0; }
.cell.has-audio > .row { padding-right: 60px; }

/* ---------- interlinear examples ---------- */
.igt-words { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 4px; }
.iw { display: inline-flex; flex-direction: column; line-height: 1.3; }
.iw-s { font-size: 1.06rem; font-weight: 700; color: var(--ink); }
.iw-m { font-size: .95rem; color: var(--muted); }
.iw-g { font-size: .82rem; color: var(--muted); }
.mo { color: inherit; text-decoration: none; }
a.mo { color: var(--link); border-bottom: 1px dotted rgba(31, 94, 133, .45); }
a.mo:hover { border-bottom-style: solid; }
.mo.hl { background: var(--mark); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.igt-ref { font-size: .74rem; color: var(--faint); margin-top: 2px; }

/* grammatical abbreviations: small caps; the full name pops up on hover or tap */
abbr.gab {
  font-variant-caps: all-small-caps; letter-spacing: .04em; text-decoration: none;
  position: relative; cursor: help; border-bottom: 1px dotted currentColor; outline: none;
}
abbr.gab[data-full]:hover::after, abbr.gab[data-full]:focus::after {
  content: attr(data-full); position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5;
  font-variant-caps: normal; letter-spacing: 0; white-space: nowrap;
  font: 500 .78rem/1.3 var(--ui-font); color: #fff; background: var(--sea);
  padding: 3px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); pointer-events: none;
}
.card abbr.gab, .row abbr.gab { border-bottom: 0; cursor: inherit; }
.gx { color: var(--muted); font-weight: 400; font-size: .92em; }
.abbr-list { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 8px 0 0; font-size: .92rem; }
.abbr-list dt abbr.gab { border-bottom: 0; cursor: default; }
.abbr-list dd { margin: 0; color: var(--muted); }
.ling { margin: 6px 0 2px; padding: 6px 10px 6px 26px; background: #f3f0fa; border-radius: 8px;
  font-size: .85rem; color: #4b4366; }
.ling li { margin: 2px 0; }
body:not(.show-ling) .ling { display: none; }
.ling-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.ling-toggle input { accent-color: #6a5acd; }
details.more-ex summary { cursor: pointer; color: var(--sea2); font-weight: 600; font-size: .9rem; margin-top: 10px; }
.blk > h3 .count { font-weight: 600; color: var(--faint); letter-spacing: 0; }

/* ---------- audio buttons ---------- */
.play {
  -webkit-tap-highlight-color: transparent;
  width: 40px; height: 40px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--sea);
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.play svg { width: 21px; height: 21px; }
.play .spk { fill: currentColor; }
.play .wave { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .55; }
.play:hover { border-color: var(--ochre); color: var(--ochre); }
.play.playing { background: var(--ochre); border-color: var(--ochre); color: #fff; }
.play.playing .wave { opacity: 1; animation: pulse .7s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
.cell > .play { position: absolute; top: 9px; right: 9px; }
.rows .cell > .play { top: 50%; transform: translateY(-50%); right: 12px; width: 36px; height: 36px; }
.play.big { width: 48px; height: 48px; }
.play.big svg { width: 25px; height: 25px; }
.forms .play { width: 32px; height: 32px; margin-left: 6px; vertical-align: middle; }
.forms .play svg { width: 17px; height: 17px; }
.play.inline { width: 26px; height: 26px; vertical-align: middle; cursor: default; }
.play.inline svg { width: 15px; height: 15px; }
.study.inline { width: 26px; height: 26px; vertical-align: middle; cursor: default; }
.study.inline svg { width: 14px; height: 14px; }
.hw-line { display: flex; align-items: center; gap: 14px; }

/* ---------- my study list: bookmark toggle ---------- */
.study {
  -webkit-tap-highlight-color: transparent;
  width: 32px; height: 32px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--faint);
  font: 600 .9rem var(--ui-font); cursor: pointer; transition: color .12s, border-color .12s;
}
.study svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.study:hover { border-color: var(--ochre); color: var(--ochre); }
.study[aria-pressed="true"] { color: var(--ochre); border-color: var(--ochre); }
.study[aria-pressed="true"] svg { fill: currentColor; }
.study.wide { width: auto; height: 40px; padding: 0 14px 0 11px; border-radius: 999px; color: var(--sea); }
.study.wide[aria-pressed="true"] { color: var(--ochre); background: var(--ochre-soft); }
.cell > .study { position: absolute; bottom: 8px; right: 8px; }
.grid .cell > .card .gl, .grid .cell > .card .under, .grid .cell > .card .note { margin-right: 30px; }
.rows .cell > .study { bottom: auto; top: 50%; transform: translateY(-50%); right: 12px; }
.rows .cell.has-audio > .study { right: 56px; }
.rows > .cell > .row { padding-right: 52px; }
.rows > .cell.has-audio > .row { padding-right: 98px; }
.wotd-wrap { position: relative; }
.wotd-wrap > .play { position: absolute; top: 4px; right: 16px; }
.wotd-wrap.has-audio > .wotd { padding-right: 84px; }
.row:hover, .row:focus-visible { background: #fbf4ec; outline: none; }
.row .hw { font: 700 1.02rem var(--v-font); color: var(--sea); overflow-wrap: anywhere; }
.row .pos { font-size: .78rem; color: var(--ochre); }
.row .gl { font-size: .93rem; }
.row .under, .row .note { grid-column: 3; }
.row.sub .hw { padding-left: 14px; font-weight: 600; }

.more-btn {
  display: block; margin: 16px auto 0; font: 600 .9rem var(--ui-font);
  background: var(--paper); color: var(--sea); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; cursor: pointer;
}

/* ---------- entry panel ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(14, 28, 40, .48);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 4vh 16px; overflow-y: auto; overscroll-behavior: contain;
}
.overlay[hidden] { display: none; }
.panel {
  background: var(--paper); width: 100%; max-width: 800px;
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  margin-bottom: 4vh;
}
.entry-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: rgba(255, 253, 249, .96);
  border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0;
}
.entry-bar .spacer { flex: 1; }
.nav-btn, .close-btn {
  font: 600 .85rem var(--ui-font); color: var(--sea);
  background: var(--paper); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; cursor: pointer; max-width: 40%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-btn .v { font-weight: 700; }
.nav-btn:hover:not(:disabled), .close-btn:hover { border-color: var(--ochre); color: var(--ochre); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.close-btn { font-size: 1.1rem; line-height: 1; padding: 6px 10px; }

.entry-head { padding: 22px 32px 14px; }
.entry-hw { margin: 0; font: 700 2.3rem/1.15 var(--v-font); color: var(--sea); overflow-wrap: anywhere; }
.entry-hw sup { font-size: .5em; color: var(--ochre); margin-left: 2px; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; color: var(--muted); font-style: italic; }
.parent-link { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.badge {
  display: inline-block; font: 700 .68rem/1.6 var(--ui-font); letter-spacing: .05em; text-transform: uppercase; font-style: normal;
  padding: 0 8px; border-radius: 999px; background: var(--sand); color: var(--sea);
}
.badge.nk { background: #ece9e6; color: #6a6058; }
.badge.loan { background: #e3eef5; color: var(--sea2); }
.badge.place { background: #e6f0e4; color: #3d6136; }

.blk { padding: 6px 32px 14px; }
.blk > h3, .subs > h3 {
  margin: 10px 0 10px; font: 700 .74rem var(--ui-font); letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; gap: 10px;
}
.blk > h3::after, .subs > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.senses { list-style: none; margin: 0; padding: 0; }
.sense { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 6px; margin-bottom: 14px; }
.senses.single .sense { grid-template-columns: minmax(0, 1fr); }
.sn {
  width: 23px; height: 23px; border-radius: 50%; background: var(--sea); color: #fff;
  font: 700 .75rem/23px var(--ui-font); text-align: center; margin-top: 2px;
}
.sense .gl { font-size: 1.12rem; font-weight: 600; }
.s-ps { font-style: italic; color: var(--muted); font-size: .9rem; margin-right: 4px; }
.de { color: var(--ink); margin-top: 2px; }
.sci { margin-top: 3px; font-size: .92rem; color: var(--muted); }
.lit, .snote { margin-top: 3px; font-size: .92rem; color: var(--muted); }
.ex { margin: 9px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--ochre-soft); }
.exv { font-size: 1.05rem; }
.exe { color: var(--muted); font-size: .95rem; }
.ex.ug { border-left-color: #e4e0dc; }
.ex.ug .exv { color: var(--muted); }
.ug-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

.forms { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.forms dt { color: var(--muted); font-size: .9rem; padding-top: 1px; }
.forms dd { margin: 0; }
.forms .v { font-size: 1.04rem; }
.tr { color: var(--muted); }
.src { color: var(--faint); font-size: .85rem; }
a.v { color: var(--link); text-decoration: underline; text-decoration-color: rgba(31, 94, 133, .35); text-underline-offset: 2px; }
a.v:hover { text-decoration-color: currentColor; }

.subs { padding: 4px 32px 10px; }
.subentry { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 4px; margin-bottom: 12px; background: #fffefb; scroll-margin-top: 70px; }
.subentry.hl { border-color: var(--ochre); box-shadow: 0 0 0 3px var(--ochre-soft); }
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.sub-hw { font: 700 1.28rem var(--v-font); color: var(--sea); text-decoration: none; }
.sub-hw:hover { color: var(--ochre); }
.sub-head .pos { font-style: italic; color: var(--muted); font-size: .92rem; }
.subentry .blk { padding: 0 0 8px; }
.subentry .blk > h3 { margin-top: 4px; }

details.more { margin: 2px 32px 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.subentry details.more { margin: 2px 0 12px; }
details.more summary { cursor: pointer; color: var(--sea2); font-weight: 600; font-size: .9rem; padding: 4px 0; }
details.more .forms { margin-top: 8px; font-size: .92rem; }
.entry-foot { padding: 0 32px 24px; font-size: .82rem; color: var(--faint); }

/* ---------- about ---------- */
.prose { max-width: 760px; padding: 10px 0 30px; }
.prose h2 { font: 700 1.8rem var(--v-font); color: var(--sea); margin: 18px 0 8px; }
.prose h3 { font: 700 1.2rem var(--v-font); color: var(--sea); margin: 24px 0 6px; }
.prose li { margin-bottom: 6px; }

.site-footer { padding: 30px 20px 40px; color: var(--faint); font-size: .85rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.site-footer a { color: var(--link); font-weight: 600; }
.site-notice { flex-basis: 100%; margin: 0; }

/* ---------- feedback page ---------- */
.fb-cards { display: grid; gap: 14px; margin-top: 12px; }
.fb-card { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--sea2); border-radius: var(--radius); padding: 14px 18px; }
.fb-card.on { border-left-color: var(--ochre); }
.fb-card h3 { margin: 0 0 4px; font: 700 1.2rem var(--v-font); color: var(--sea); }
.fb-card p { margin: 0 0 12px; }
.fb-card a.gbtn { display: inline-block; text-decoration: none; }
.fb-word { max-width: 320px; margin: 0 0 12px; }
.fb-note { color: var(--muted); font-size: .9rem; margin-top: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .head-row { grid-template-columns: minmax(0, 1fr); padding-top: 16px; padding-bottom: 12px; gap: 10px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand { gap: 9px; }
  .brand-panel { padding: 4px 16px 4px 4px; }
  .site-header::before { top: 4px; }
  .brand-title { font-size: 1.15rem; }
  .search { justify-self: stretch; max-width: none; }
  .search-box .hint { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .card { padding: 10px 12px; min-height: 0; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .row .pos, .row .gl, .row .under, .row .note { grid-column: 1; }
  .row.eng { grid-template-columns: minmax(0, 1fr); }
  .cell.has-audio > .card .ehw { padding-right: 0; }
  .letters .off { min-width: 36px; height: 36px; flex: none; }
  .wl-order { display: grid; grid-template-columns: 1fr 1fr auto; border-radius: 14px; }
  .wl-order a { padding: 7px 10px; text-align: center; font-size: .82rem; }
  .browse-bar { position: static; }
  .wotd-box { margin-top: 14px; }
  .wotd-box > summary { padding: 10px 16px 0; }
  .wotd-box:not([open]) > summary { padding-bottom: 10px; }
  .wotd { grid-template-columns: minmax(0, 1fr); padding: 4px 16px 14px; }
  .wotd .hw { font-size: 1.6rem; }
  .grid .cell > .play { top: auto; bottom: 8px; right: 8px; }
  .cell.has-audio > .card .hw { padding-right: 0; }
  .cell.has-audio > .card { padding-bottom: 50px; }
  .grid .cell > .card { padding-bottom: 46px; }
  .grid .cell.has-audio > .card { padding-bottom: 50px; }
  .grid .cell > .card .gl, .grid .cell > .card .under, .grid .cell > .card .note { margin-right: 0; }
  .grid .cell.has-audio > .study { bottom: 12px; right: 54px; }
  .letters, .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .letters::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .letters a { min-width: 36px; height: 36px; flex: none; }
  .chip { flex: none; }
  .tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  .viewtoggle { justify-self: start; }
  .overlay { padding: 0; }
  .panel { border-radius: 0; min-height: 100%; margin: 0; }
  .entry-head, .blk, .subs, .entry-foot { padding-left: 18px; padding-right: 18px; }
  details.more { margin-left: 18px; margin-right: 18px; }
  .entry-hw { font-size: 1.9rem; }
  .forms { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .forms dd { margin-bottom: 8px; }
}

/* text for screen readers only */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* people who ask their device to reduce motion get no shaking, sliding or pulsing */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* colours: settings.txt, Colours: sea (written by build/build.py) */
:root {
  --sea: #12405e;
  --sea2: #1f5e85;
  --link: #1d5c84;
  --head1: #1d5a80;
  --head2: #123f5c;
  --ochre: #a8501f;
  --ochre-soft: #f6e3d3;
  --clay: #cfe3ef;
  --dots: rgba(160, 205, 230, .5);
  --focus: #8cc0e0;
}
