﻿:root {
  --forest: #075747;
  --ink: #203c34;
  --muted: #65756b;
  --paper: #fbfaf5;
  --line: #dce2d6;
  --sage: #e7f0e4;
  --clay: #a8542f;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 280px at 100% -40px, rgba(7, 87, 71, 0.08), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
}

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

img { display: block; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--forest);
  color: white;
  padding: 8px 12px;
}

.skip:focus { top: 8px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.94);
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 22px;
}

.brand img { border-radius: 9px; }

.bar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bar nav a, .bar nav button {
  background: none;
  border: 0;
  padding: 6px 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.bar nav a[aria-current="page"] { color: var(--forest); box-shadow: inset 0 -2px 0 var(--forest); }

.bar nav a:hover, .bar nav button:hover { color: var(--clay); }

.console-menu { position: relative; }
.console-menu > summary {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  list-style: none; font-size: 13px; font-weight: 700; background: white;
}
.console-menu > summary::-webkit-details-marker { display: none; }
.console-menu[open] > summary { background: var(--sage); }
.hamburger { display: grid; gap: 4px; width: 17px; }
.hamburger i { height: 2px; background: currentColor; border-radius: 2px; }
.console-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px;
  max-width: calc(100vw - 32px); max-height: calc(100dvh - 100px); overflow-y: auto;
  padding: 12px; background: white; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(32, 60, 52, .16);
}
.menu-group { margin: 8px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.bar nav .console-menu-panel a, .bar nav .console-menu-panel button {
  display: block; width: 100%; padding: 10px 12px; text-align: left; border-radius: 8px;
}
.bar nav .console-menu-panel a:hover, .bar nav .console-menu-panel button:hover { background: var(--paper); }
.bar nav .console-menu-panel a[aria-current="page"] { background: var(--sage); box-shadow: inset 3px 0 var(--forest); }
.console-menu-panel form { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
summary:focus-visible { outline: 3px solid #be673d; outline-offset: 3px; border-radius: 6px; }

@media (max-width: 540px) {
  .bar { padding: 10px 16px; gap: 10px; }
  .brand { font-size: 18px; gap: 7px; }
  .brand img { width: 30px; height: 30px; }
  .bar nav { gap: 8px; flex-wrap: nowrap; }
  .bar nav .language-picker select { max-width: 88px; }
  .console-menu > summary { padding: 8px; gap: 6px; }
  .console-menu-panel { position: fixed; top: 66px; right: 16px; }
}

main {
  width: min(1080px, calc(100% - 40px));
  margin: 28px auto 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 14px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.panel-heading h1 { margin: 0; }

.panel-heading a { font-size: 13px; font-weight: 700; color: var(--forest); }

.fold { margin: 12px 0 0; }
.fold > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸ "; }
.fold[open] > summary::before { content: "▾ "; }
.fold > summary + * { margin-top: 10px; }
.fold table { font-size: 13px; }
.fold th, .fold td { padding: 5px 8px 5px 0; }

.login-panel { max-width: 460px; margin-inline: auto; width: 100%; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

h1 { font-size: 24px; line-height: 1.3; }

h2 { font-size: 18px; }

h3 {
  margin: 18px 0 6px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 700;
}

.lead, .note, .empty, .hint { color: var(--muted); margin: 0 0 16px; }

.alert {
  background: #fbf1ea;
  color: #6d341c;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
}

.stack, .providers { display: grid; gap: 8px; }

label { font-size: 13px; font-weight: 700; margin-top: 6px; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 12px 14px;
}

input:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid #be673d;
  outline-offset: 2px;
}

.primary, .apple {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  margin-top: 8px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

.primary {
  border: 0;
  background: var(--forest);
  color: white;
}

.primary:hover { background: #034638; }

.primary.link { padding: 0 16px; }

.apple {
  background: #111;
  color: white;
}

.or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 22px 0;
}

.or::before, .or::after { content: ""; height: 1px; background: var(--line); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cards article {
  background: var(--sage);
  border-radius: 12px;
  padding: 10px 12px 8px;
}

.cards p, .cards span { margin: 0; color: var(--muted); font-size: 12px; }

.cards strong {
  display: block;
  margin: 2px 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--forest);
}

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.bars li {
  display: grid;
  grid-template-columns: 7em 1fr 3em;
  gap: 10px;
  align-items: center;
}

.track { height: 10px; background: var(--sage); border-radius: 99px; overflow: hidden; }

.fill { display: block; height: 100%; background: var(--forest); border-radius: inherit; }

.count { text-align: right; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

th { font-size: 12px; color: var(--muted); font-weight: 700; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
}

.chips span { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

.chips .flag,
.chips .flag-missing,
.chips .flag-code {
  display: inline-flex;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

#coverage-map {
  width: 100%;
  height: min(45vw, 360px);
  min-height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sage);
  border: 1px solid var(--line);
}

#coverage-map.failed { height: auto; min-height: 0; }

#coverage-map .maplibregl-canvas-container,
#coverage-map .maplibregl-canvas {
  border-radius: 12px;
}

#coverage-map .maplibregl-ctrl-attrib {
  font-size: 11px;
  line-height: 1.35;
  max-width: min(100%, 420px);
}

#coverage-map .maplibregl-ctrl-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
}

#coverage-map .maplibregl-ctrl-group button {
  width: 36px;
  height: 36px;
}

.coverage-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; color: var(--muted); }

.coverage-legend .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 3px; }

.coverage-legend .cell { background: rgba(245, 140, 50, 0.32); border: 1px solid rgba(224, 112, 20, 0.6); }

.coverage-legend .point { border-radius: 50%; background: rgba(239, 108, 0, 0.5); border: 1px solid #fff; }

.coverage-legend .country { background: rgba(47, 125, 98, 0.35); border: 1px solid rgba(47, 125, 98, 0.7); }

.daily { margin: 0 0 18px; }

.daily figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; margin-bottom: 4px; }

.daily figcaption .summary { color: var(--muted); font-size: 12px; font-weight: 500; }

.daily .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 12px; }

.daily .legend li { display: flex; align-items: center; gap: 6px; }

.daily .chart-scroll { overflow-x: auto; }

.daily svg { display: block; width: 100%; min-width: 640px; height: auto; }

.daily .axis { stroke: var(--muted); stroke-width: 1; }

.daily .grid { stroke: var(--line); stroke-dasharray: 3 3; }

.daily .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.daily rect.stories, .swatch.stories { fill: var(--forest); background: var(--forest); }

.daily rect.lang-ja, .swatch.lang-ja { fill: #075747; background: #075747; }

.daily rect.lang-en, .swatch.lang-en { fill: #a8542f; background: #a8542f; }

.daily rect.lang-zh, .swatch.lang-zh { fill: #c4a35a; background: #c4a35a; }
.daily rect.lang-zh-tw, .swatch.lang-zh-tw { fill: #d9bf7f; background: #d9bf7f; }

.daily rect.lang-ko, .swatch.lang-ko { fill: #3d6b8c; background: #3d6b8c; }

.daily rect.lang-es, .swatch.lang-es { fill: #6b4c7a; background: #6b4c7a; }

.daily rect.lang-fr, .swatch.lang-fr { fill: #2f7d6d; background: #2f7d6d; }

.daily rect.lang-de, .swatch.lang-de { fill: #8a4b2f; background: #8a4b2f; }

.daily rect.lang-other, .swatch.lang-other { fill: #8a8175; background: #8a8175; }

.daily rect:hover { opacity: 0.7; }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

.countries-fold { margin-top: 10px; }
.countries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.countries > li { border-bottom: 1px solid var(--line); }
.countries summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; cursor: pointer; font-size: 13px; }
.countries summary .country-name { font-weight: 600; }
.countries summary .country-meta { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: 0.9em; }
.countries summary .country-meta strong { color: var(--ink); font-size: 1.05em; }
.countries .places { margin: 0 0 6px 14px; }
.places { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; }

.places li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 3px; font-size: 13px; }
.places .place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.places .coords { color: var(--muted); font-size: 0.8em; }

.filters {
  display: grid;
  grid-template-columns: minmax(12em, 1.4fr) 9em minmax(9em, 1fr) 9em 8em auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.user-filters {
  grid-template-columns: minmax(16em, 2.2fr) 11em minmax(12em, 1.4fr) auto;
}

.pinpoint-filters {
  grid-template-columns: minmax(12em, 1.8fr) 11em 12em 12em auto;
}

.flag {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 0;
}

.flag img {
  display: block;
  width: 1.35em;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.flag-code,
.flag-missing {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.flag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chips .flag {
  margin-right: 4px;
}

.badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.badges li {
  background: var(--sage);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.pinpoint-story-group h2 {
  margin-top: 0;
}

.panel .cards ~ h2 { margin-top: 22px; }

.chips a { color: inherit; text-decoration: none; }

.chips a:hover { color: var(--clay); }

.pinpoint-table { min-width: 1180px; }

.pinpoint-table form { margin: 0; }

.quiet {
  margin: 0;
  min-height: 0;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.quiet:hover { border-color: var(--clay); color: var(--clay); }

textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
}

.invite-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 12px 0;
}

.invite-form label { display: grid; gap: 4px; margin: 0; }

.invite-code {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.08em;
  font-weight: 700;
}

input.invite-code {
  font-size: 1.35rem;
  max-width: 14em;
  width: 100%;
}

.filters label { display: grid; gap: 4px; margin-top: 0; }

.filters .primary { margin-top: 0; padding: 0 18px; }

.excerpt { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.guides-table { table-layout: fixed; min-width: 860px; }
.guides-table .guide-title-col { width: 40%; }
.guides-table .guide-country-col { width: 10%; }
.guides-table .guide-region-col { width: 16%; }
.guides-table .guide-category-col { width: 10%; }
.guides-table .guide-requester-col { width: 14%; }
.guides-table .guide-updated-col { width: 10%; }
.guides-table td { overflow-wrap: anywhere; }

table a { color: var(--forest); font-weight: 700; text-decoration: none; word-break: break-all; }

table a:hover { color: var(--clay); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.pager a { font-weight: 700; color: var(--forest); }

.back-row { margin: 0; }

.back { font-weight: 700; color: var(--forest); }

.prose { white-space: pre-wrap; margin: 0; }

.meta {
  display: grid;
  grid-template-columns: 10em 1fr;
  gap: 6px 16px;
  margin: 16px 0 0;
}

.meta dt { color: var(--muted); font-size: 13px; font-weight: 700; }

.meta dd { margin: 0; overflow-wrap: anywhere; }

.panel .lead a { color: var(--forest); font-weight: 700; }

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

.bar nav .language-picker { display: flex; align-items: center; gap: 6px; }

.bar nav .language-picker select { width: auto; padding: 4px 8px; font-size: 13px; border-radius: 8px; }

.notice {
  background: var(--sage);
  color: var(--forest);
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
}

[hidden] { display: none !important; }

.bar { z-index: 20; }

html { scroll-behavior: smooth; }

.profile-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.profile-nav {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 4px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.profile-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.profile-nav a:hover { background: var(--paper); color: var(--ink); }

.profile-nav a[aria-current] { background: var(--sage); color: var(--forest); box-shadow: inset 3px 0 0 var(--forest); }

.nav-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; }

.nav-icon .icon { width: 28px; height: 28px; object-fit: contain; }

.section-title { display: flex; align-items: center; gap: 12px; }

.section-icon {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 2px;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.category-icon { width: 32px; height: 32px; margin: -4px 0; object-fit: contain; flex: none; }

.info-icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.profile { display: grid; gap: 18px; min-width: 0; }

.profile .panel { scroll-margin-top: 92px; }

.profile h2 { margin-top: 4px; margin-bottom: 18px; font-size: 22px; }

.profile .field { display: grid; gap: 6px; margin: 0 0 24px; }

.profile .field:last-child { margin-bottom: 4px; }

.profile .field .hint { margin: 0 0 4px; font-size: 13px; }

.profile fieldset { border: 0; padding: 0; margin-inline: 0; min-width: 0; }

.profile legend { font-size: 15px; font-weight: 700; padding: 0; margin-bottom: 2px; }

.profile .field > label { font-size: 15px; margin-top: 0; }

.profile .grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

.profile .grid-2 > label { display: grid; gap: 4px; margin-top: 0; }

.profile .hint.info { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border-radius: 12px; padding: 10px 14px; margin: 16px 0 0; font-size: 13px; }

.profile .hint.warn { color: var(--clay); font-weight: 700; margin-top: 8px; }

.mini-label { margin: 6px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

/* hero */
.profile-hero { background: linear-gradient(135deg, #ffffff 0%, var(--sage) 140%); }

.hero-id { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(7, 87, 71, 0.25);
}

.hero-id h1 { margin: 0; overflow-wrap: anywhere; }

.hero-id .eyebrow { margin-bottom: 2px; }

.hero-sub { margin: 0; color: var(--muted); font-size: 13px; }

.summary {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary li {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 0;
}

.summary span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }

.summary strong { display: block; color: var(--forest); font-size: 15px; overflow-wrap: anywhere; transition: color 0.2s; }

.toast {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 30;
  margin: 0;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(32, 60, 52, 0.18);
  border: 1px solid #bcd5c0;
  transition: opacity 0.4s, transform 0.4s;
}

.toast.is-hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* inputs */
.profile input[type="text"], .profile input:not([type]), .big-select { font-size: 16px; padding: 13px 14px; }

.label-row { display: flex; justify-content: space-between; align-items: baseline; }

.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* radio tiles */
.tiles { display: grid; gap: 10px; }

.tiles-6 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

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

.tile { position: relative; display: block; margin: 0; cursor: pointer; }

.tile input, .segmented input, .meter-step input, .unset input, .switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.tile-body {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.tile-body strong { font-size: 15px; }

.tile-body small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.45; }

.tile:hover .tile-body { border-color: #9fbfae; }

.tile:active .tile-body { transform: scale(0.98); }

.tile input:checked + .tile-body {
  border-color: var(--forest);
  background: var(--sage);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.tile input:checked + .tile-body strong { color: var(--forest); }

.tile input:checked + .tile-body::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.tile input:focus-visible + .tile-body,
.segmented input:focus-visible + span,
.meter-step input:focus-visible + .meter-bar,
.unset input:focus-visible + span,
.switch input:focus-visible + .track-ui {
  outline: 3px solid #be673d;
  outline-offset: 2px;
}

.level-tile .tile-body { justify-items: start; padding-top: 14px; }

.level-tile strong { font-size: 18px; }

.signal { display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-bottom: 4px; }

.signal i { display: block; width: 5px; border-radius: 2px; background: var(--line); }

.signal i:nth-child(1) { height: 20%; }
.signal i:nth-child(2) { height: 40%; }
.signal i:nth-child(3) { height: 60%; }
.signal i:nth-child(4) { height: 80%; }
.signal i:nth-child(5) { height: 100%; }

.signal i.on { background: #9fbfae; }

.tile input:checked + .tile-body .signal i.on { background: var(--forest); }

/* segmented */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.segmented label { flex: 1 1 auto; margin: 0; position: relative; }

.segmented span {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.segmented label:hover span { background: var(--sage); }

.segmented input:checked + span { background: var(--forest); color: white; box-shadow: 0 2px 6px rgba(7, 87, 71, 0.25); }

.rates span { font-variant-numeric: tabular-nums; }

/* narration */
.narration { display: grid; gap: 6px; }

.narration-order { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }

.narration-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  background: var(--sage);
  border: 2px solid var(--forest);
  border-radius: 14px;
  animation: pop 0.18s ease-out;
}

.narration-item .num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.narration-item .name { font-weight: 700; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-weight: 700;
}

.icon-btn:hover:not(:disabled) { border-color: var(--forest); color: var(--forest); }

.icon-btn:disabled { opacity: 0.35; cursor: default; }

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

.chip {
  border: 1px dashed #9fbfae;
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--forest);
}

.chip:hover:not(:disabled) { background: var(--sage); border-style: solid; }

.chip:disabled { opacity: 0.4; cursor: not-allowed; }

@keyframes pop { from { transform: scale(0.97); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* voices */
.voice-groups { display: grid; gap: 12px; }

.voice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.voice-option { display: flex; gap: 8px; align-items: stretch; }

.voice-option .tile { flex: 1; }

.play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
}

.play:hover { border-color: var(--forest); }

.play.is-loading { opacity: 0.7; cursor: progress; }

.play.is-playing { background: var(--forest); border-color: var(--forest); color: white; }

.rate-play { justify-self: start; min-height: 42px; margin-top: 6px; }

/* interests */
.interests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.profile .interest {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 12px;
  background: white;
  display: grid;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.interest-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.interest-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; min-width: 0; }

.interest-value { font-size: 13px; font-weight: 700; color: var(--forest); text-align: right; }

.interest[data-level=""] { background: var(--paper); }

.interest[data-level=""] .interest-value { color: var(--muted); }

.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; height: 46px; margin-top: 4px; }

.meter-step { margin: 0; height: 100%; display: flex; align-items: flex-end; cursor: pointer; position: relative; }

.meter-bar {
  display: block;
  width: 100%;
  height: calc(var(--step) * 20%);
  min-height: 8px;
  border-radius: 6px;
  background: var(--line);
  transition: background 0.15s, transform 0.1s;
}

.meter-step:hover .meter-bar { background: #9fbfae; }

.meter-step input:checked + .meter-bar { background: var(--forest); }

.interest[data-level="0"] .meter-step:nth-child(-n+1) .meter-bar,
.interest[data-level="1"] .meter-step:nth-child(-n+2) .meter-bar,
.interest[data-level="2"] .meter-step:nth-child(-n+3) .meter-bar,
.interest[data-level="3"] .meter-step:nth-child(-n+4) .meter-bar,
.interest[data-level="4"] .meter-step:nth-child(-n+5) .meter-bar { background: var(--forest); }

.interest[data-level="0"] .meter-step:first-child .meter-bar { background: var(--clay); }

.meter-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.unset { position: relative; margin: 2px 0 0; justify-self: start; font-weight: 500; }

.unset span {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.unset input:checked + span { background: var(--muted); border-color: var(--muted); color: white; }

/* switches */
.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.switch:hover { border-color: #9fbfae; }

.track-ui {
  flex: none;
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c9d1c6;
  transition: background 0.2s;
}

.track-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.switch input:checked + .track-ui { background: var(--forest); }

.switch input:checked + .track-ui::after { transform: translateX(20px); }

.profile #sec-voice .field { margin-top: 16px; }

/* save bar */
.savebar {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(32, 60, 52, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.savebar.is-dirty { border-color: var(--clay); box-shadow: 0 10px 30px rgba(168, 84, 47, 0.2); }

.savebar-status { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; color: var(--muted); }

.savebar .dot { width: 10px; height: 10px; border-radius: 50%; background: #9fbfae; }

.savebar.is-dirty .savebar-status { color: var(--clay); }

.savebar.is-dirty .dot { background: var(--clay); animation: pulse 1.4s infinite; }

.savebar-actions { display: flex; gap: 8px; }

.savebar .primary { margin: 0; min-width: 9em; padding: 0 22px; }

.savebar .primary:disabled { background: #a9b8b0; cursor: default; }

.ghost {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-weight: 700;
}

.ghost:hover:not(:disabled) { border-color: var(--ink); }

.ghost:disabled { opacity: 0.45; cursor: default; }

@keyframes pulse { 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .narration-item, .savebar.is-dirty .dot { animation: none; }
}

@media (max-width: 960px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
  .profile-nav {
    top: 72px;
    z-index: 15;
    display: flex;
    overflow-x: auto;
    border-radius: 14px;
    padding: 6px;
  }
  .profile-nav a { flex: none; padding: 8px 12px; }
  .profile .panel { scroll-margin-top: 140px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-5 { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .interests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .cards, .bars li, .filters, .meta, .profile .grid-2 { grid-template-columns: 1fr; }
  .count { text-align: left; }
  h1 { font-size: 28px; }
  .panel { padding: 22px 16px; }
  .savebar { flex-wrap: wrap; bottom: 8px; padding: 10px 12px; }
  .savebar-actions { flex: 1; justify-content: flex-end; }
  .toast { left: 16px; right: 16px; top: 80px; }
}

@media (max-width: 480px) {
  .interests, .summary { grid-template-columns: 1fr; }
  .avatar { width: 54px; height: 54px; font-size: 24px; }
}
.users-table th,
.users-table td { vertical-align: middle; }

.users-table th .sort {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  word-break: normal;
}

.users-table th .sort:hover { color: var(--forest); }

.users-table .plan-col {
  width: 1%;
  white-space: nowrap;
}

.users-table .plan-col select,
.users-table .plan-col input[type="date"] {
  width: auto;
  min-height: 36px;
  padding: 6px 8px;
}

.users-table .plan-col button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
}

.users-table .plan-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
}


/* The browser console uses a persistent left navigation on wide, signed-in screens.
   The same links remain in the header menu for narrower viewports. */
.console-sidebar { display: none; }

@media (min-width: 1200px) {
  .console-shell--signed-in {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 24px;
    max-width: 1520px;
    margin-inline: auto;
    padding-inline: 24px;
    align-items: start;
  }

  .console-shell--signed-in main {
    width: 100%;
    min-width: 0;
    max-width: 1080px;
    margin: 28px auto 64px;
  }

  .console-sidebar {
    display: block;
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 116px);
    max-height: calc(100dvh - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 28px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
  }

  .console-sidebar-nav { display: grid; gap: 2px; }
  .console-sidebar-nav .menu-group { margin: 10px 12px 5px; }
  .console-sidebar-nav a,
  .console-sidebar-nav form button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
  }
  .console-sidebar-nav a:hover,
  .console-sidebar-nav form button:hover { background: var(--paper); color: var(--clay); }
  .console-sidebar-nav a[aria-current="page"] {
    color: var(--forest);
    background: var(--sage);
    box-shadow: inset 3px 0 var(--forest);
  }
  .console-sidebar-nav form {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 8px;
  }
}
.pinpoint-coverage-details > summary { cursor: pointer; }
.pinpoint-coverage-details > summary h2 { display: inline; }
