/* Copied from catriname/Roger (Roger.Shared/wwwroot/css/theme.css) so Roger WX matches the Roger app.
   Change the look there first, then re-copy, so the two stay in step. WX-specific styles live in wx.css. */

/* Anton is the display face for the hero/brand lockup only; Lora carries everything else.
   Elsie is NOT hosted: it carries the Roger wordmark, and the app is built to work with no
   connection -- a brand that falls back to Georgia on a train is not a brand. Self-hosted below
   under the OFL (see fonts/OFL.txt). */
@import url("https://fonts.googleapis.com/css2?family=Anton&family=Lora:ital,wght@0,400..700;1,400..700&display=swap");

:root {
  color-scheme: light;
  /* La-Z-Boy inspired palette */
  --grr-bg: #EAE4D9;
  --grr-bg-card: #FBF9F4;
  --grr-border: #DDD4C2;
  --grr-input-bg: #F1EBE0;
  --grr-primary: #003349;
  --grr-green: #708058;
  --grr-red: #A0402B;
  --grr-text: #3B2314;
  --grr-text-dim: #8A7A68;
}

body {
  background-color: var(--grr-bg);
  color: var(--grr-text);
  font-family: "Lora", Georgia, "Times New Roman", serif;
  margin: 0;
  /* The hero escapes .grr-app with width:100vw, and 100vw includes the vertical scrollbar --
     so every page could scroll sideways by the scrollbar's width, which also shifted the
     header controls in and out of reach depending on whether the scrollbar was present. */
  overflow-x: hidden;
}

a { color: var(--grr-primary); }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--grr-green);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--grr-input-bg);
  border: 1px solid var(--grr-border);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--grr-green);
  border: 2px solid var(--grr-bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--grr-input-bg);
  border: 1px solid var(--grr-border);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--grr-green);
  border: 2px solid var(--grr-bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.grr-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
}

.grr-topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1.25rem 0.75rem;
  border-bottom: 1px solid var(--grr-border);
  background: var(--grr-bg-card);
}
.grr-topbar i {
  font-size: 1.4rem;
  color: var(--grr-primary);
}
.grr-topbar strong {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

/* Placeholder banner reserving space for a real header image per page -- swap the icon
   for a background-image (or an img tag) once artwork exists, layout stays the same. */
.grr-page-header {
  height: 140px;
  border-radius: 10px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--grr-bg), var(--grr-input-bg));
  border: 1px dashed var(--grr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.grr-page-header i {
  font-size: 2rem;
  color: var(--grr-primary);
  opacity: 0.6;
}
.grr-page-header.has-image {
  border-style: solid;
  background: var(--grr-input-bg);
}

/* Full-bleed variant: escapes .grr-app's max-width/padding to span the full viewport
   width and sits flush against the very top of the screen (topbar is hidden for these
   pages, per the route, in MainLayout). Room reserved for overlaid title/subtitle
   text later. */
.grr-page-header--hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1rem;
  /* The artwork is 1440x736 (~2:1). A fixed 220px band happened to suit a phone -- where the
     full image is about 199px tall anyway -- but on a desktop viewport it forced an 800px-tall
     image into 220px and object-fit:cover discarded roughly three quarters of it. Following the
     ratio keeps the whole illustration on narrow screens; max-height caps how much of the page
     it can eat on wide ones, where some cropping is the lesser evil. */
  height: auto;
  aspect-ratio: 1440 / 736;
  max-height: 520px;
  border-width: 0;
  border-radius: 0;
}
.grr-page-header img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grr-page-header__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 60%);
}
.grr-page-header__text {
  position: absolute;
  left: 1.25rem;
  bottom: 0.85rem;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
@font-face {
  font-family: "Elsie";
  src: url("../fonts/Elsie-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Elsie";
  src: url("../fonts/Elsie-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Elsie Black -- a display serif with swashed R and g, matching the splash. Heavier and wider
   on the em than a script, so everything using it sits smaller than the calligraphic face it
   replaced, and the trailing padding only has to clear the r's small terminal. */
.grr-wordmark {
  font-family: "Elsie", Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  padding-right: 0.06em;
  display: inline-block;
}

.grr-page-header__title {
  font-family: "Elsie", Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: 2.7rem;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0;
  padding-right: 0.06em;
  color: #ffffff;
  /* Layered rather than one blur: a tight dark offset gives the strokes an edge against a busy
     photograph, and a wider soft shadow lifts the whole mark off it. Elsie Black carries its own
     weight, so unlike the script it needs no outline to survive the lighter passages. */
  text-shadow:
    0 2px 0 rgba(59, 35, 20, 0.55),
    0 1px 12px rgba(0, 0, 0, 0.55);
}

/* Wide screens: stop the hero full-bleeding and let it sit in the content column as a card,
   the same width as the article cards below it. At 720px the 2:1 artwork is ~367px tall, which
   is under max-height -- so nothing is cropped at all, which edge-to-edge could never manage
   without either a huge banner or throwing most of the illustration away. Phones keep the
   full-bleed, where a 100vw hero is the whole point.
   720px content + 2 x 1.25rem padding = 760px, so that is where the switch happens. */
@media (min-width: 760px) {
  .grr-page-header--hero {
    position: relative;
    left: auto;
    right: auto;
    width: 100%;
    margin: 0 0 1rem;
    border-radius: 10px;
    overflow: hidden;
  }

}

.grr-card {
  background: var(--grr-bg-card);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--grr-border);
}
.grr-card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}
.grr-card p i {
  margin-right: 0.5rem;
  color: var(--grr-green);
  width: 1.2rem;
  text-align: center;
  display: inline-block;
}

.grr-card--attribution,
.grr-card--wordmap {
  padding: 0.65rem 1rem;
}
.grr-card--attribution summary,
.grr-card--wordmap summary {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
}
.grr-card--attribution p {
  color: var(--grr-text-dim);
  font-size: 0.85rem;
  margin: 0.65rem 0 0;
}

.grr-tabrow {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.grr-linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--grr-primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
}
.grr-linklike:disabled { opacity: 0.5; cursor: default; text-decoration: none; }

.grr-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.grr-stat-tile {
  flex: 1 1 160px;
  background: var(--grr-bg-card);
  border: 1px solid var(--grr-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.grr-stat-tile__label {
  font-size: 0.8rem;
  color: var(--grr-text-dim);
}
.grr-stat-tile__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--grr-text);
}

.grr-chart-card { overflow-x: auto; }
.grr-chart {
  width: 100%;
  height: auto;
  display: block;
}
.grr-chart__grid {
  stroke: var(--grr-border);
  stroke-width: 1;
}
.grr-chart__axis-label {
  font-size: 9px;
  fill: var(--grr-text-dim);
}
.grr-chart__end-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--grr-text);
  dominant-baseline: middle;
}
.grr-chart__caption {
  color: var(--grr-text-dim);
  font-size: 0.8rem;
  margin: 0.4rem 0 0;
}
.grr-heatmap__cell--habit {
  stroke: var(--grr-primary);
  stroke-width: 1.5;
  animation: grr-heatmap-habit-pulse 2s ease-in-out infinite;
}
@keyframes grr-heatmap-habit-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 2.5px var(--grr-primary)); }
}

.grr-btn {
  background: var(--grr-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.grr-btn:disabled { opacity: 0.4; cursor: default; }
.grr-btn.secondary { background: var(--grr-input-bg); color: var(--grr-text); border: 1px solid var(--grr-border); }
.grr-btn i { font-size: 1.1rem; vertical-align: middle; }
.grr-btn:has(i:only-child) { padding: 0.6rem 0.85rem; }

.grr-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.grr-input-wrap {
  position: relative;
  display: grid;
  border-radius: 6px;
  border: 2px solid var(--grr-border);
  background: var(--grr-input-bg);
}
.grr-input-wrap > * {
  grid-area: 1 / 1;
  font-size: 1.25rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  font-family: inherit;
  padding: 0.6rem 0.8rem;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  min-height: 6rem;
}
.grr-input-highlight {
  color: var(--grr-text);
  pointer-events: none;
}
.grr-input-placeholder { color: var(--grr-text-dim); }
.grr-input {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: transparent;
  caret-color: var(--grr-text);
  resize: none;
  overflow: hidden;
}
.grr-input:disabled { opacity: 0.5; }

/* Sidebar nav: one row per destination, active row marked with a green rail down its left
   edge. A list rather than a fixed row of tabs, so new destinations (reports, and so on)
   are just another entry rather than a squeeze on everything else. */
.grr-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--grr-text);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
}
.grr-nav__item i {
  font-size: 1.4rem;
  width: 1.6rem;
  text-align: center;
  color: var(--grr-text-dim);
}
.grr-nav__item:hover { background: var(--grr-input-bg); }
.grr-nav__item.active {
  color: var(--grr-green);
  background: var(--grr-input-bg);
}
.grr-nav__item.active i { color: var(--grr-green); }
.grr-nav__item.active::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--grr-green);
}

.grr-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--grr-text);
  padding: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
}
.grr-hamburger i { font-size: 1.6rem; }

/* On hero pages there is no topbar to sit in, so the button floats over the artwork --
   dark pill for contrast, since the top of a photo can be any colour. */
.grr-hamburger--over-hero {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  left: 0.9rem;
  z-index: 22;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  /* Same circle as .grr-header-action -- the two float over the hero as a matched pair, so a
     pill on one side and a circle on the other would show. */
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
}

.cw-correct { color: var(--grr-green); }
.cw-incorrect { color: var(--grr-red); text-decoration: underline; text-decoration-thickness: 2px; }
.cw-pending { color: var(--grr-text-dim); }

.grr-badge-locked { opacity: 0.35; filter: grayscale(1); }

.grr-operator-banner { border-color: var(--grr-primary); }

.grr-sync-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border-color: var(--grr-red);
  font-size: 0.85rem;
  color: var(--grr-text-dim);
}
.grr-sync-warning i {
  color: var(--grr-red);
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.grr-sync-warning a { color: var(--grr-primary); }

/* Text fields borrow the trainer copy box's look -- same 2px border, fill, radius and green
   focus -- so an input means the same thing everywhere in the app. Always full width, with the
   label stacked above rather than inline, which is what let the old ones size to nothing. */
.grr-field {
  display: block;
  margin-bottom: 0.85rem;
}
.grr-field__label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.grr-field__optional {
  font-weight: 400;
  color: var(--grr-text-dim);
}
.grr-field__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--grr-text-dim);
}
.grr-field__input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--grr-border);
  border-radius: 6px;
  background: var(--grr-input-bg);
  color: var(--grr-text);
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  padding: 0.6rem 0.8rem;
}
.grr-field__input:focus {
  outline: none;
  border-color: var(--grr-green);
}

/* The catalog's Sort by <select>: smaller than the base field size (that scale is tuned for
   typed text, not a short dropdown label). Named apart from the existing bare `select` rule
   further down (which already styles Settings' Punctuation dropdown) rather than reusing/
   renaming it, since that rule intentionally applies to every plain <select> in the app and
   this one shouldn't.
   The native dropdown arrow ignores padding-right in at least one real browser -- it's UA
   chrome, not a padding-respecting glyph, so there's no standards guarantee it moves at all.
   appearance:none strips it and a hand-drawn chevron background-image replaces it, positioned
   explicitly, so the gap from the border is actually guaranteed rather than hoped for. */
.grr-sort-select {
  font-size: 1rem;
  padding-right: 2.25rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' stroke='%238A7A68' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.7rem;
}

/* Full-width action under a field, matching the trainer's "Finish now". */
.grr-btn--block {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

/* Leaderboard table. Scrolls inside its own card rather than pushing the page sideways on a
   narrow phone. */
.grr-table-card { padding: 0.5rem; overflow-x: auto; }
.grr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.grr-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grr-text-dim);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--grr-border);
  white-space: nowrap;
}
.grr-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--grr-border);
}
.grr-table tbody tr:last-child td { border-bottom: none; }
/* Qualified with th/td deliberately: .grr-table th sets text-align:left and outranks a bare
   class, so the header of a numeric column stayed left while its cells went right. */
.grr-table th.grr-table__num,
.grr-table td.grr-table__num { text-align: right; font-variant-numeric: tabular-nums; }
.grr-table__row--you {
  background: var(--grr-input-bg);
  font-weight: 700;
}

/* Row of mutually exclusive choices -- which name goes on a certificate, and the like. */
.grr-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.grr-form-error {
  color: var(--grr-red);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
.grr-form-note {
  color: var(--grr-green);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.grr-certificate-naming { margin-bottom: 1rem; }

/* Filtered down to nothing -- distinct from an empty catalog, and carrying the way out. */
.grr-empty-filter {
  color: var(--grr-text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.grr-page-subtitle {
  color: var(--grr-text-dim);
  margin: -0.5rem 0 1.25rem;
}

/* "Steps Explained" and the like: a page-level heading that has to outrank the group titles
   beneath it, which previously matched it in size and left the groups looking like siblings. */
.grr-section-heading {
  margin-top: 2rem;
  font-size: 1.5rem;
}

/* Each badge category is boxed as one unit -- the cards inside were previously separated from
   the next group only by a heading, which made the boundaries hard to find while scrolling. */
.grr-badge-group {
  border: 2px solid var(--grr-border);
  border-radius: 12px;
  padding: 0.9rem 0.9rem 0.1rem;
  margin-bottom: 1.25rem;
  background: var(--grr-input-bg);
}
.grr-badge-group__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grr-text-dim);
}
.grr-badge-group__count {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.grr-certificate-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}
/* Certificate tiles flip to show the artwork you are working toward. The tile is the flip
   container; both faces stack in one grid cell so the card keeps the height of the taller face
   and nothing jumps when it turns. */
.grr-certificate-tile {
  perspective: 1200px;
  filter: grayscale(0.8);
  opacity: 0.75;
  margin-bottom: 1rem;
}
.grr-certificate-tile--earned { filter: none; opacity: 1; }
.grr-certificate-tile--earned .grr-flip__face { border-color: var(--grr-green); }

.grr-flip {
  display: grid;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}
.grr-certificate-tile.is-flipped .grr-flip { transform: rotateY(180deg); }
.grr-flip__face {
  grid-area: 1 / 1;
  margin: 0;
  backface-visibility: hidden;
}
.grr-flip__face--back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}
.grr-flip__preview {
  width: 100%;
  height: auto;
  border: 1px solid var(--grr-border);
  border-radius: 4px;
}
.grr-flip__hint {
  color: var(--grr-text-dim);
  font-size: 0.85rem;
}

.grr-certificate-tile__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.grr-certificate-tile__actions .grr-btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .grr-flip { transition: none; }
}

.grr-progress-track {
  background: var(--grr-input-bg);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.grr-progress-fill {
  background: var(--grr-green);
  height: 100%;
  border-radius: 999px;
}

.grr-certificate-toolbar { margin-bottom: 1rem; }
.grr-certificate-sheet {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  /* cqw units below scale the overlay text with the artwork at any render size. */
  container-type: inline-size;
}
.grr-certificate-sheet img {
  display: block;
  width: 100%;
  height: auto;
}
.grr-certificate-overlay {
  position: absolute;
  inset: 0;
}
/* The "Awarded To" box on the 3300x2550 artwork: x 1950-2925, y 1750-2005.
   Percentages are those pixels over the artwork's own width/height, so the box
   tracks the image however it is scaled. Text sits on the rule at the box's foot. */
.grr-certificate-overlay__name {
  position: absolute;
  left: 59.091%;   /* 1950 / 3300 */
  top: 68.627%;    /* 1750 / 2550 */
  width: 29.545%;  /* (2925 - 1950) / 3300 */
  height: 10%;     /* (2005 - 1750) / 2550 */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  /* Default for a short name; the page overrides it inline for anything long enough to run past
     the rule, mirroring what certificate.js does when compositing the emailed copy. */
  font-size: var(--grr-name-size, 4.5cqw);
  line-height: 1;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #5b4526;
}

@media print {
  .grr-topbar, .grr-hamburger, .grr-page-header, .grr-certificate-toolbar, .grr-certificate-naming {
    display: none !important;
  }
  .grr-certificate-sheet { max-width: 100%; }
}

.grr-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--grr-input-bg);
  color: var(--grr-text-dim);
  margin-right: 0.4rem;
}
/* Kinds of thing, told apart by colour alone. None is filled: a filled tag existed to make
   News pop out of a fiction-heavy feed, and there is no News tag any more. */
.grr-tag.type-Nonfiction {
  background: transparent;
  color: var(--grr-primary);
  border: 1px solid var(--grr-primary);
}
.grr-tag.type-Wire {
  background: transparent;
  color: var(--grr-primary);
  border: 1px solid var(--grr-primary);
}
.grr-tag.type-Telegram {
  background: transparent;
  color: var(--grr-green);
  border: 1px solid var(--grr-green);
}

.grr-tag.difficulty-Beginning { color: var(--grr-green); }
.grr-tag.difficulty-Intermediate { color: var(--grr-primary); }
.grr-tag.difficulty-Advanced { color: var(--grr-red); }

.grr-status-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}
.grr-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 1rem;
}
.grr-status-badge--done { background: var(--grr-green); color: #fff; }
.grr-status-badge--progress { background: var(--grr-input-bg); color: var(--grr-primary); border: 1px solid var(--grr-border); }

select, .grr-select {
  background: var(--grr-input-bg);
  color: var(--grr-text);
  border: 1px solid var(--grr-border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}

/* Rounded pill switcher for a small, mutually-exclusive choice (e.g. Word vs. Sentence
   correction mode) -- solid-fill active tab, plain text inactive. */
.grr-pill-tabs {
  display: inline-flex;
  background: var(--grr-input-bg);
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.25rem;
}
.grr-pill-tab {
  border: none;
  background: transparent;
  color: var(--grr-text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
}
.grr-pill-tab.active {
  background: var(--grr-primary);
  color: #ffffff;
}

/* Page-level icon controls floated over the hero artwork's lower-right corner, diagonally
   opposite the title. Keeps a control like Filters out of the page body, where it read as a
   stray button above the first card. */
.grr-page-header__actions {
  position: absolute;
  /* Clear of the viewport edge: the count badge overhangs the button's top-right corner, and at
     1rem that overhang landed on the boundary -- which is also where the scrollbar appears and
     disappears, shifting it. */
  right: 1.75rem;
  bottom: 0.85rem;
  display: flex;
  gap: 0.5rem;
}
/* Sized off .grr-hamburger deliberately -- same glyph size and padding, so the two floating
   controls over the hero read as a matched pair at opposite corners. */
.grr-header-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Equal width and height so this is a real circle: sizing from padding gave ~2.6rem x 2.4rem,
     an oval, and border-radius:999px on an oval is a pill -- which is what made the 1px ring
     look uneven, tighter at the ends than along the top. 2.5rem lands on a whole 40px at the
     default root size, so the border falls on pixel boundaries rather than straddling them. */
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #ffffff;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  color: #ffffff;
  line-height: 1;
  cursor: pointer;
}
/* .grr-page-header i paints every icon in the header blue at 60% opacity -- right for the
   placeholder glyph it was written for, wrong here: it left the filter blue on a blue fill,
   where it disappeared. Colour and opacity have to be restated, not just the size. */
.grr-header-action i {
  font-size: 1.6rem;
  color: #ffffff;
  opacity: 1;
}
.grr-header-action--active { background: var(--grr-primary); }
/* Sits on the button's corner rather than inside it -- offset by roughly half its own size so
   the two circles overlap at the edges instead of the badge appearing to be part of the icon. */
.grr-header-action .grr-filter-count {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  border: 2px solid var(--grr-bg);
}

/* A circle, not a pill: equal width and height with no padding, so min-width plus side padding
   cannot stretch it wider than it is tall. Flex centring puts the digit dead centre regardless
   of the ring drawn around it -- line-height centring measured the content box only, which left
   the number sitting low once the border was added. */
.grr-filter-count {
  background: var(--grr-green);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grr-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.grr-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--grr-bg-card);
  border-left: 1px solid var(--grr-border);
  z-index: 31;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: grr-drawer-in 0.2s ease-out;
}

@keyframes grr-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Same drawer, hinged on the other edge: nav comes from the left, the catalog filters keep
   the right, so the two never fight over the same slot. */
.grr-drawer--nav {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid var(--grr-border);
  animation-name: grr-drawer-in-left;
}

@keyframes grr-drawer-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* The wordmark on light backgrounds -- topbar and nav drawer. Same face as the hero, inked in
   the accent with only a whisper of shadow, since there is no photograph to fight. */
.grr-wordmark--ink {
  font-size: 1.8rem;
  color: var(--grr-primary);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.grr-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--grr-border);
  flex-shrink: 0;
}

.grr-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.grr-filter-group {
  margin-bottom: 1.5rem;
}
.grr-filter-group h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grr-text-dim);
  margin: 0 0 0.5rem;
}

.grr-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  cursor: pointer;
}
.grr-checkbox input { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }

.grr-drawer__footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--grr-border);
  flex-shrink: 0;
}
.grr-drawer__footer .grr-btn { flex: 1; }
.grr-drawer__footer .grr-btn:not(.secondary) { background: var(--grr-green); }

/* Playback page accents green, matching the active nav item, filter badge and drawer
   footer -- the blue primary is reserved for links and difficulty tags elsewhere. */
.grr-trainer .grr-btn:not(.secondary) { background: var(--grr-green); }
.grr-trainer a:not(.grr-btn) { color: var(--grr-green); }
.grr-trainer .grr-input-wrap:focus-within { border-color: var(--grr-green); }

/* Word map: the whole page laid out word by word, but only what has been copied correctly is
   legible -- the rest stays blurred so the map never gives the answer away. Every word is a
   replay-from-here target, blurred ones included (going back to the word you fumbled is the
   point). */
.grr-wordmap__hint {
  color: var(--grr-text-dim);
  font-size: 0.85rem;
  margin: 0.65rem 0;
}
.grr-wordmap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
}
.grr-word {
  border: none;
  background: transparent;
  font: inherit;
  color: var(--grr-green);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  cursor: pointer;
}
.grr-word:hover { background: var(--grr-input-bg); }
.grr-word.blurred {
  color: var(--grr-text-dim);
  filter: blur(6px);
}

.grr-tooltip-anchor {
  position: relative;
  display: inline-flex;
}

.grr-tooltip-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.4rem;
  background: #27272a;
  color: #f4f4f5;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 25;
  pointer-events: none;
  animation: grr-tooltip-in 0.12s ease-out;
}

@keyframes grr-tooltip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.grr-toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  background: var(--grr-green);
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 50;
  pointer-events: none;
  animation: grr-toast-in 0.2s ease-out, grr-toast-out 0.3s ease-in 1.7s forwards;
}

@keyframes grr-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes grr-toast-out {
  to { opacity: 0; transform: translate(-50%, 10px); }
}

/* Placed after .grr-hamburger--over-hero so it actually overrides it: the hamburger is fixed to
   the viewport, which strands it on the page background once the hero stops reaching the edge.
   Pin it to the content column so it stays over the artwork. */
@media (min-width: 760px) {
  .grr-hamburger--over-hero {
    /* Inset from the card's corner rather than the viewport's: .grr-app contributes 1rem of top
       padding before the hero starts, and the card has a 10px radius to clear. */
    top: 1.9rem;
    left: max(0.9rem, calc(50% - 360px + 0.9rem));
  }
}

/* ── One-time intro ────────────────────────────────────────────────────────────────────────
   Timing lives in CSS, staggered by inline animation-delay from the component, so the beats do
   not depend on C# timers firing on schedule while the app is still booting behind the overlay.

   Every line occupies the same grid cell rather than stacking, so they cross-fade in place and
   nothing below them shifts as the text changes length. */
.grr-intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--grr-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.45s ease;
}
.grr-intro.is-leaving { opacity: 0; }

.grr-intro__skip {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: 1rem;
  border: none;
  background: transparent;
  color: var(--grr-text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.grr-intro__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 30rem;
  width: 100%;
}

.grr-intro__mark {
  width: min(58vw, 17rem);
  height: auto;
  /* Settles in first and stays: the emblem is the constant the lines change against. */
  animation: grr-intro-mark 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes grr-intro-mark {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* One cell, every child in it -- cross-fade without reflow. min-height reserves the tallest
   the finale gets, so the emblem never jumps when the last beat lands. */
.grr-intro__lines {
  display: grid;
  place-items: center;
  margin-top: 1.75rem;
  min-height: 13rem;
  width: 100%;
}
.grr-intro__lines > * { grid-area: 1 / 1; }

.grr-intro__line {
  font-size: 1.35rem;
  /* Honours the newlines in Features while still wrapping long lines on narrow screens. */
  white-space: pre-line;
  /* Same ink as the blurb the sequence ends on, so the four beats read as one voice. */
  color: var(--grr-text-dim);
  opacity: 0;
  /* Duration is overridden inline from BeatSeconds -- this value is only the fallback. */
  animation: grr-intro-line 2.9s ease-in-out both;
}

/* Rises in, holds, leaves upward -- the drift carries the eye to where the next line arrives. */
@keyframes grr-intro-line {
  0%   { opacity: 0; transform: translateY(0.75rem); }
  18%  { opacity: 1; transform: translateY(0); }
  76%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-0.75rem); }
}

.grr-intro__finale {
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: grr-intro-finale 1.2s ease-out both;
}

@keyframes grr-intro-finale {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.grr-intro__title {
  font-size: 2.2rem;
  color: var(--grr-primary);
  margin: 0;
}

.grr-intro__blurb {
  color: var(--grr-text-dim);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 26rem;
}

.grr-intro__enter { margin-top: 0.5rem; }

/* Reduced motion: drop the movement, keep the timing. An earlier version collapsed every
   duration to 0.01s with step-end, which left the wrong end state -- the third line stuck at
   full opacity and the finale never appeared, so the intro dead-ended for anyone with the
   preference set. Cross-fading in place is not the motion the preference is about; travelling
   across the screen is, and that is all that goes. */
@media (prefers-reduced-motion: reduce) {
  .grr-intro__mark { animation-name: grr-intro-fade; }
  .grr-intro__line { animation-name: grr-intro-line-plain; }
  .grr-intro__finale { animation-name: grr-intro-fade; }
}

@keyframes grr-intro-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes grr-intro-line-plain {
  0%, 100% { opacity: 0; }
  18%, 76% { opacity: 1; }
}

.grr-signed-out { border-color: var(--grr-red); }
