/*
  Admin.css
  The look of the Meowky Way! admin site: the studio website's cream, ink, brass, pink and mint
  (Website/Public/Styles/Site.css) and its cartoon outlines, toned down for a practical dashboard
  that is read more than admired: compact text, dense tables, tabular numbers.

    1. Fonts and colour tokens
    2. Base elements
    3. Header, menu and banner
    4. Page layout, cards and headings
    5. Buttons, inputs, filters and badges
    6. Tiles and charts
    7. Tables and pager
    8. Levels page (difficulty colours, win-rate bars)
    9. Player page
   10. Dialog
   11. Sign-in view
   12. Phones and reduced motion

  No inline styles are needed (only bar widths set through the CSSOM), so a strict content
  security policy works. Phones get 16px side gutters; wide tables scroll inside their own box.
*/

/* ------------------------------------------------------------ 1. Fonts and colour tokens */

@font-face {
  font-family: 'Luckiest Guy';
  src: url('../Fonts/LuckiestGuy.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Fredoka';
  src: url('../Fonts/FredokaRegular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Fredoka';
  src: url('../Fonts/FredokaSemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --Cream: #FFF4DC;
  --CreamDeep: #FFE7B8;
  --Paper: #FFFDF7;
  --Ink: #2B1846;
  --InkSoft: #5A4778;
  --InkFaint: #8C7FA3;
  --Line: #E6DCC8;
  --Brass: #FFB627;
  --BrassLight: #FFD45E;
  --BrassPale: #FFE9B0;
  --BrassDark: #E07B00;
  --Pink: #FF6FA8;
  --PinkLight: #FF9CC6;
  --PinkPale: #FFD9E7;
  --PinkDark: #D93A7C;
  --Mint: #3ED6A6;
  --MintPale: #CFF5E7;
  --MintDark: #1A9E78;
  --Blue: #4A6FD8;
  --BluePale: #DCE4FF;
  --Error: #C4204B;
  --ErrorPale: #FFE1E8;

  --DisplayFont: 'Luckiest Guy', 'Arial Black', sans-serif;
  --BodyFont: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;

  --Outline: 3px solid var(--Ink);
  --ThinOutline: 2px solid var(--Ink);
  --Radius: 16px;
  --RadiusSmall: 10px;
  --CardShadow: 0 4px 0 var(--Ink);
  --PressShadow: 0 3px 0 var(--Ink);
  --ContentWidth: 1400px;
  --Gutter: 24px;
}

/* ------------------------------------------------------------ 2. Base elements */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--Cream);
  color: var(--Ink);
  font-family: var(--BodyFont);
  font-size: 15px;
  line-height: 1.45;
}

h1,
h2,
h3 {
  font-family: var(--DisplayFont);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 0.6em;
}

a {
  color: var(--Ink);
  text-decoration-color: var(--PinkDark);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--PinkDark);
}

:focus-visible {
  outline: 3px solid var(--Blue);
  outline-offset: 2px;
}

strong {
  font-weight: 600;
}

time {
  white-space: nowrap;
}

.Muted {
  color: var(--InkSoft);
}

.Code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.86em;
  word-break: break-all;
}

.VisuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.SkipLink {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
}

.SkipLink:focus {
  top: 8px;
}

.Positive {
  color: var(--MintDark);
  font-weight: 600;
}

.Negative {
  color: var(--Error);
  font-weight: 600;
}

/* ------------------------------------------------------------ 3. Header, menu and banner */

.Header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--Paper);
  border-bottom: var(--Outline);
}

.HeaderInner {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  max-width: var(--ContentWidth);
  margin: 0 auto;
  padding: 8px var(--Gutter);
}

.Brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}

.BrandIcon {
  width: 36px;
  height: 36px;
}

.BrandText {
  font-family: var(--DisplayFont);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-top: 3px;
}

.BrandAdmin {
  color: var(--PinkDark);
}

.Navigation {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
}

.MenuList {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.MenuLink {
  display: block;
  padding: 6px 14px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.MenuLink:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.MenuLink[aria-current='page'] {
  background: var(--Brass);
  border-color: var(--Ink);
}

.Account {
  order: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.AccountEmail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--InkSoft);
  font-size: 0.9rem;
}

.Banner {
  max-width: var(--ContentWidth);
  width: 100%;
  margin: 12px auto 0;
  padding: 0 var(--Gutter);
}

.BannerMessage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  box-shadow: var(--PressShadow);
}

.BannerError {
  background: var(--ErrorPale);
}

.BannerSuccess {
  background: var(--MintPale);
}

.BannerInformation {
  background: var(--BluePale);
}

.BannerText {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
  overflow-wrap: anywhere;
}

.BannerClose {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--Ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.BannerClose:hover {
  background: rgba(43, 24, 70, 0.1);
}

/* ------------------------------------------------------------ 4. Page layout, cards and headings */

.Main {
  flex: 1;
  width: 100%;
  max-width: var(--ContentWidth);
  margin: 0 auto;
  padding: 16px var(--Gutter) 40px;
  outline: none;
}

.Page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.Results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.Stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.Results.Refreshing {
  opacity: 0.55;
  transition: opacity 0.2s;
}

.PageHeading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.PageHeading h1 {
  margin-bottom: 4px;
}

.PageHeading p {
  margin: 0;
}

.PageActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.Card {
  min-width: 0;
  padding: 16px;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Paper);
  box-shadow: var(--CardShadow);
}

.CardTitle {
  margin-bottom: 12px;
}

.Card > .TableScroll {
  margin: 0 -4px;
}

.Explanation {
  max-width: 80ch;
  margin: 0;
  color: var(--InkSoft);
  font-size: 0.92rem;
}

.ResultCount {
  margin: 0;
  font-weight: 600;
}

.Loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 4px;
  color: var(--InkSoft);
}

.Spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--BrassPale);
  border-top-color: var(--BrassDark);
  border-radius: 50%;
  animation: Spin 0.8s linear infinite;
}

@keyframes Spin {
  to {
    transform: rotate(360deg);
  }
}

.Empty {
  margin: 0;
  padding: 20px 16px;
  border: 2px dashed var(--InkFaint);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  color: var(--InkSoft);
  text-align: center;
}

.Footer {
  padding: 16px var(--Gutter) 24px;
  color: var(--InkSoft);
  font-size: 0.82rem;
  text-align: center;
}

/* ------------------------------------------------------------ 5. Buttons, inputs, filters and badges */

.Button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 16px;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
  box-shadow: var(--PressShadow);
  color: var(--Ink);
  font-family: var(--BodyFont);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.Button:hover {
  background: var(--BrassPale);
}

.Button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--Ink);
}

.Button[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.ButtonPrimary {
  background: var(--Brass);
}

.ButtonPrimary:hover {
  background: var(--BrassLight);
}

.ButtonDanger {
  background: var(--Pink);
}

.ButtonDanger:hover {
  background: var(--PinkLight);
}

.ButtonDangerOutline {
  color: var(--PinkDark);
  border-color: var(--PinkDark);
  box-shadow: 0 3px 0 var(--PinkDark);
}

.ButtonDangerOutline:hover {
  background: var(--PinkPale);
}

.ButtonQuiet {
  box-shadow: none;
}

.ButtonQuiet:active {
  transform: none;
  box-shadow: none;
}

.ButtonSmall {
  min-height: 32px;
  padding: 3px 12px;
  font-size: 0.86rem;
}

.Input {
  min-height: 40px;
  padding: 6px 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  color: var(--Ink);
  font: inherit;
  max-width: 100%;
}

select.Input {
  padding-right: 8px;
}

textarea.Input {
  resize: vertical;
  width: 100%;
}

.InputShort {
  width: 9.5em;
}

.InputWide {
  width: 22em;
}

.FilterBar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 16px;
  border: var(--ThinOutline);
  border-radius: var(--Radius);
  background: var(--CreamDeep);
}

.Field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.FieldLabel {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.FieldHelp {
  font-size: 0.82rem;
  color: var(--InkSoft);
}

.CheckboxField {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
  font-weight: 600;
}

.CheckboxField input {
  width: 20px;
  height: 20px;
  accent-color: var(--BrassDark);
  margin: 0;
}

.Segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
  overflow: hidden;
}

.SegmentedButton {
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  border-right: var(--ThinOutline);
  background: transparent;
  color: var(--Ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.SegmentedButton:last-child {
  border-right: 0;
}

.SegmentedButton:hover {
  background: var(--BrassPale);
}

.SegmentedButton[aria-pressed='true'] {
  background: var(--Brass);
}

.Badge {
  display: inline-block;
  padding: 0 7px;
  border: 1.5px solid var(--Ink);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}

.BadgeBrass {
  background: var(--BrassPale);
}

.BadgePink {
  background: var(--PinkPale);
}

.BadgeMint {
  background: var(--MintPale);
}

.BadgeBlue {
  background: var(--BluePale);
}

.BadgeInk {
  background: var(--Ink);
  color: var(--Paper);
}

.BadgeNeutral {
  background: #EFE8DB;
}

/* ------------------------------------------------------------ 6. Tiles and charts */

.Tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.Tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: var(--ThinOutline);
  border-left-width: 6px;
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

.TileBrass {
  border-left-color: var(--BrassDark);
}

.TilePink {
  border-left-color: var(--PinkDark);
}

.TileBlue {
  border-left-color: var(--Blue);
}

.TileLabel {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.TileValue {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.TileNote {
  font-size: 0.8rem;
  color: var(--InkSoft);
}

.Charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.Chart {
  min-width: 0;
  margin: 0;
  padding: 12px 14px 8px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

.ChartHeading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin-bottom: 6px;
}

.ChartReadout {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--InkSoft);
}

.ChartPlot {
  width: 100%;
  min-height: 150px;
  touch-action: pan-y;
}

.ChartSvg {
  display: block;
  overflow: visible;
}

.ChartGrid {
  stroke: var(--Line);
  stroke-width: 1;
}

.ChartBaseline {
  stroke: var(--InkFaint);
  stroke-width: 1;
}

.ChartAxisText {
  fill: var(--InkSoft);
  font-family: var(--BodyFont);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ChartBrass {
  --ChartColour: var(--BrassDark);
}

.ChartPink {
  --ChartColour: var(--PinkDark);
}

.ChartMint {
  --ChartColour: var(--MintDark);
}

.ChartBar {
  fill: var(--ChartColour);
}

.ChartLine {
  fill: none;
  stroke: var(--ChartColour);
  stroke-width: 2;
  stroke-linejoin: round;
}

.ChartArea {
  fill: var(--ChartColour);
  opacity: 0.12;
}

.ChartCrosshair {
  stroke: var(--Ink);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.ChartMarker {
  fill: var(--ChartColour);
  stroke: var(--Paper);
  stroke-width: 2;
  pointer-events: none;
}

.ChartHitArea {
  fill: transparent;
  cursor: crosshair;
}

.DailyDetails > summary {
  margin-bottom: 0;
  cursor: pointer;
}

.DailyDetails[open] > summary {
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ 7. Tables and pager */

/* Wide tables scroll sideways inside this box, never the page. */
.TableScroll {
  max-width: 100%;
  overflow-x: auto;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  -webkit-overflow-scrolling: touch;
}

.DataTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.DataTable th,
.DataTable td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--Line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.DataTable tbody th {
  font-weight: 600;
}

.DataTable thead th {
  position: relative;
  background: var(--CreamDeep);
  border-bottom: var(--ThinOutline);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.DataTable tbody tr:last-child > * {
  border-bottom: 0;
}

.DataTable tbody tr:nth-child(even) > * {
  background: #FFF8EA;
}

.DataTable tbody tr:hover > * {
  background: var(--BrassPale);
}

.DataTable .Numeric {
  text-align: right;
}

.ClickableRows tbody tr {
  cursor: pointer;
}

.RowLink {
  text-decoration: none;
}

.RowLink:hover {
  text-decoration: underline;
}

.RowMuted > * {
  color: var(--InkSoft);
}

/* The first column stays in view while scrolling sideways. */
.StickyFirstColumn tbody th,
.StickyFirstColumn thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--Paper);
  box-shadow: inset -1px 0 0 var(--Line);
}

.StickyFirstColumn thead th:first-child {
  background: var(--CreamDeep);
}

.SortButton {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.SortButton:hover,
.SortButton.Sorted {
  color: var(--Ink);
}

.SortArrow {
  display: inline-block;
  min-width: 0.8em;
  font-size: 0.7rem;
}

.NameCell {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
}

.PlayerName {
  max-width: 16em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.RefundInfo {
  display: inline-block;
  min-width: 15em;
  max-width: 24em;
  white-space: normal;
  font-size: 0.85rem;
  line-height: 1.3;
}

.DetailText,
.RefundNote {
  display: inline-block;
  min-width: 16em;
  max-width: 34em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.RefundNote {
  display: block;
  font-style: italic;
  color: var(--InkSoft);
}

.Pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.PagerText {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ 8. Levels page */

.LevelSummary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 170px)) 1fr;
  gap: 12px;
  align-items: stretch;
}

.DifficultyCounts {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 8px 14px;
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.DifficultyLabel {
  display: inline-block;
  min-width: 5.4em;
  padding: 1px 8px;
  border: 1.5px solid var(--Ink);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* The bands: the label always says the band too, so colour is never the only clue. */
.DifficultyTooEasy {
  --Band: var(--Blue);
  background: var(--BluePale);
}

.DifficultyEasy {
  --Band: var(--MintDark);
  background: var(--MintPale);
}

.DifficultyFair {
  --Band: var(--InkFaint);
  background: #EFE8DB;
}

.DifficultyHard {
  --Band: var(--BrassDark);
  background: var(--BrassPale);
}

.DifficultyTooHard {
  --Band: var(--Error);
  background: var(--PinkPale);
  color: #8E0F35;
}

.WinRate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.WinRateText {
  min-width: 2.8em;
  text-align: right;
  font-weight: 600;
}

.WinRateBar {
  position: relative;
  width: 64px;
  height: 8px;
  border-radius: 999px;
  background: var(--Line);
  overflow: hidden;
}

.WinRateFill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--Band);
}

/* ------------------------------------------------------------ 9. Player page */

.PlayerHeader {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.BackLink {
  margin: 0;
  font-weight: 600;
}

.PlayerTitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.PlayerTitle h1 {
  overflow-wrap: anywhere;
}

.Badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.Facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  margin: 4px 0 0;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  overflow: hidden;
}

/* Hairlines between facts (drawn right and below each, the outer ones hidden by the frame). */
.Fact {
  min-width: 0;
  padding: 8px 12px;
  margin: 0 -1px -1px 0;
  border-right: 1px solid var(--Line);
  border-bottom: 1px solid var(--Line);
}

.Fact dt {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.Fact dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ActionNote {
  margin-top: 10px;
}

.ActionBar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.EventSummary::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--InkFaint);
  vertical-align: 1px;
}

.EventWin::before {
  background: var(--MintDark);
}

.EventLoss::before {
  background: var(--Error);
}

.EventLevel::before {
  background: var(--BrassDark);
}

.EventSession::before {
  background: var(--Blue);
}

.EventMoney::before {
  background: var(--PinkDark);
}

/* ------------------------------------------------------------ 10. Dialog */

.Dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Paper);
  box-shadow: 0 6px 0 var(--Ink);
  color: var(--Ink);
}

.Dialog::backdrop {
  background: rgba(43, 24, 70, 0.45);
}

.DialogForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.DialogTitle {
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.DialogMessage p {
  margin: 0 0 0.5em;
}

.DialogField.Field .Input {
  width: 100%;
}

.DialogError {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--RadiusSmall);
  background: var(--ErrorPale);
  color: var(--Error);
  font-weight: 600;
}

.DialogButtons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ------------------------------------------------------------ 11. Sign-in view */

.SignInCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 8vh auto 0;
  padding: 28px 24px;
  text-align: center;
}

.SignInLogo {
  width: 96px;
  height: 96px;
}

.SignInTitle {
  font-size: 2rem;
}

.GoogleButton {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
}

.SignInStatus {
  min-height: 1.4em;
  margin: 0;
  color: var(--InkSoft);
}

.SignInStatus:empty {
  display: none;
}

.SignInError {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--RadiusSmall);
  background: var(--ErrorPale);
  color: var(--Error);
  font-weight: 600;
}

/* ------------------------------------------------------------ 12. Phones and reduced motion */

/* Narrow screens: the menu moves to its own row (scrolling sideways if it must). */
@media (max-width: 860px) {
  .HeaderInner {
    flex-wrap: wrap;
  }

  .Navigation {
    order: 4;
    flex-basis: 100%;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--Gutter));
    padding: 0 var(--Gutter) 2px;
    scrollbar-width: none;
  }

  .Navigation::-webkit-scrollbar {
    display: none;
  }

  .LevelSummary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .DifficultyCounts {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  :root {
    --Gutter: 16px;
  }

  body {
    font-size: 14.5px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .BrandText {
    font-size: 1.1rem;
  }

  .BrandIcon {
    width: 30px;
    height: 30px;
  }

  .AccountEmail {
    display: none;
  }

  .MenuList {
    justify-content: space-between;
  }

  .MenuLink {
    padding: 4px 6px;
    font-size: 0.9rem;
  }

  .FilterBar .Field.FieldPath {
    flex-basis: 100%;
  }

  .FieldPath .Segmented {
    display: flex;
  }

  .FieldPath .SegmentedButton {
    flex: 1 1 auto;
    padding: 4px 6px;
  }

  .Card {
    padding: 12px;
  }

  .Tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .Tile {
    padding: 8px 10px;
  }

  .TileValue {
    font-size: 1.35rem;
  }

  .Charts {
    grid-template-columns: minmax(0, 1fr);
  }

  .FilterBar {
    padding: 10px 12px;
  }

  .FilterBar .Field {
    flex: 1 1 140px;
  }

  .FilterBar .Input {
    width: 100%;
  }

  .Facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .PageActions,
  .PageActions .Button {
    width: 100%;
  }

  .DialogButtons .Button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}
