:root {
  color-scheme: light;
  --paper: #f2eee4;
  --paper-deep: #e8e1d3;
  --ink: #173937;
  --ink-soft: #49605e;
  --teal: #0b504e;
  --teal-bright: #176c67;
  --sage: #a8b99f;
  --rust: #944124;
  --gold: #c79742;
  --line: rgba(23, 57, 55, 0.17);
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(23, 57, 55, 0.1);
  --ambient-one-color: #dfb777;
  --ambient-two-color: #8eb1a4;
  --serif: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-background-color="sage"] {
  --paper: #e8f0e8;
  --paper-deep: #dbe6d9;
  --ambient-one-color: #d8bd87;
  --ambient-two-color: #78a28d;
}

html[data-background-color="sky"] {
  --paper: #e9f1f5;
  --paper-deep: #dbe7ed;
  --ambient-one-color: #d6b984;
  --ambient-two-color: #7ca8b8;
}

html[data-background-color="peach"] {
  --paper: #f7ebe3;
  --paper-deep: #eedcd0;
  --ambient-one-color: #e1a578;
  --ambient-two-color: #9cb39b;
}

html[data-background-color="lavender"] {
  --paper: #f0ebf5;
  --paper-deep: #e3ddeb;
  --ambient-one-color: #d4ad83;
  --ambient-two-color: #958db4;
}

html[data-background-color="sand"] {
  --paper: #f3ead8;
  --paper-deep: #e8dcc3;
  --ambient-one-color: #d6a95f;
  --ambient-two-color: #8fa98f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-bottom: 170px;
}

body {
  min-width: 320px;
  margin: 0;
  padding-right: env(safe-area-inset-right, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
}

.boot-panel {
  position: sticky;
  top: 8px;
  z-index: 60;
  width: min(944px, calc(100% - 24px));
  margin: 8px auto 0;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--ink, #153c3b);
  background: rgba(250, 248, 241, 0.96);
  border: 1px solid rgba(21, 60, 59, 0.2);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(40, 47, 43, 0.1);
  backdrop-filter: blur(10px);
}

.boot-panel[hidden] { display: none; }
.boot-spinner { width: 18px; height: 18px; border: 2px solid rgba(21, 60, 59, 0.18); border-top-color: currentColor; border-radius: 50%; animation: boot-spin 0.9s linear infinite; }
.boot-copy { min-width: 0; display: grid; gap: 3px; }
.boot-copy small { color: var(--muted, #64736f); line-height: 1.35; }
.boot-copy progress { width: min(320px, 100%); height: 5px; margin-top: 3px; accent-color: #a94424; }
.boot-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.boot-actions button, .boot-actions a { min-height: 38px; padding: 7px 11px; border: 1px solid rgba(21, 60, 59, 0.28); border-radius: 999px; color: inherit; background: transparent; font: inherit; text-decoration: none; cursor: pointer; }
.boot-actions button:first-child { color: #fff; background: #153c3b; }
html[data-boot-state="error"] .boot-panel { border-color: rgba(161, 47, 47, 0.42); }
html[data-boot-state="error"] .boot-spinner { animation: none; border-color: #a12f2f; }
html[data-boot-state="safe"] .boot-panel { position: relative; top: 0; border-color: rgba(150, 101, 19, 0.42); }
html[data-boot-state="safe"] .boot-spinner { animation: none; border-color: #966513; }
html[data-boot-state="degraded"] .boot-panel { position: relative; top: 0; border-color: rgba(150, 101, 19, 0.42); }
html[data-boot-state="degraded"] .boot-spinner { animation: none; border-color: #966513; }
@keyframes boot-spin { to { transform: rotate(360deg); } }

.catalog-detail-placeholder { min-height: 260px; display: grid; place-items: center; }
.detail-placeholder-copy { width: min(100% - 36px, 520px); padding: 24px 0; text-align: center; }
.detail-placeholder-copy h3 { margin: 10px 0; font: 500 clamp(25px, 4vw, 38px)/1.15 Georgia, "Noto Serif SC", serif; }
.detail-placeholder-copy p { color: var(--muted, #64736f); line-height: 1.65; }
.detail-loading-mark { display: inline-block; width: 24px; height: 4px; margin-top: 12px; border-radius: 999px; background: #a94424; animation: detail-pulse 1.1s ease-in-out infinite alternate; }
@keyframes detail-pulse { from { opacity: 0.25; transform: scaleX(0.45); } to { opacity: 1; transform: scaleX(1); } }

.storage-preflight { margin-top: 18px; padding: 16px; border: 1px solid rgba(21, 60, 59, 0.16); border-radius: 12px; background: rgba(255, 255, 255, 0.32); }
.storage-preflight h4 { margin: 0 0 8px; }
.storage-preflight .settings-actions { margin-top: 10px; }
.storage-preflight .diagnostic-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.storage-preflight [data-status="warning"] { color: #8b4b16; }

@media (max-width: 680px) {
  .boot-panel { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .boot-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

body.has-toast {
  padding-bottom: 160px;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  color: white;
  background: var(--teal);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.paper-noise {
  position: fixed;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(23, 57, 55, 0.045) 0 0.7px, transparent 0.8px),
    radial-gradient(circle at 80% 60%, rgba(191, 91, 53, 0.045) 0 0.65px, transparent 0.75px);
  background-size: 9px 9px, 11px 11px;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.22;
}

.ambient-one {
  top: -20vw;
  right: -9vw;
  background: var(--ambient-one-color);
}

.ambient-two {
  bottom: -23vw;
  left: -12vw;
  background: var(--ambient-two-color);
}

html[data-background-style="clean"] .paper-noise {
  opacity: 0;
}

html[data-background-style="clean"] .ambient {
  opacity: 0.1;
}

html[data-background-style="botanical"] .paper-noise {
  opacity: 0.3;
  background-image:
    radial-gradient(ellipse at 12% 18%, rgba(23, 80, 70, 0.1) 0 7px, transparent 7.6px),
    radial-gradient(ellipse at 88% 72%, rgba(148, 65, 36, 0.075) 0 9px, transparent 9.7px),
    linear-gradient(115deg, transparent 0 48%, rgba(23, 80, 70, 0.035) 49% 51%, transparent 52% 100%);
  background-position: 0 0, 42px 31px, 0 0;
  background-size: 86px 96px, 104px 118px, 138px 138px;
}

html[data-background-style="botanical"] .ambient {
  opacity: 0.27;
}

html[data-background-style="aurora"] .paper-noise {
  opacity: 0.42;
  background-image:
    radial-gradient(ellipse at 15% 25%, rgba(95, 150, 143, 0.19), transparent 38%),
    radial-gradient(ellipse at 82% 18%, rgba(209, 158, 106, 0.18), transparent 42%),
    radial-gradient(ellipse at 62% 86%, rgba(128, 112, 170, 0.12), transparent 38%);
  background-size: 100% 100%;
}

html[data-background-style="aurora"] .ambient {
  opacity: 0.3;
  filter: blur(34px);
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50% 50% 48% 52%;
  font-family: var(--serif);
  font-size: 22px;
  transform: rotate(-4deg);
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.12em;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.header-actions,
.music-toolbar,
.music-button,
.record-button,
.settings-button {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 10px;
}

.music-toolbar,
.record-button,
.settings-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  backdrop-filter: blur(12px);
}

.music-toolbar {
  gap: 3px;
  padding: 4px 8px 4px 5px;
}

.music-button,
.record-button,
.settings-button,
.track-step {
  cursor: pointer;
}

.music-button {
  gap: 9px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px 4px 5px;
  border: 0;
  background: transparent;
}

.music-icon {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  color: white;
  background: var(--teal);
}

.music-icon i {
  display: block;
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
}

.music-icon i:nth-child(2) {
  height: 14px;
}

.music-copy {
  display: grid;
  text-align: left;
  line-height: 1.1;
}

.music-copy strong {
  font-size: 12px;
}

.music-copy small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.music-button[aria-pressed="true"] .music-icon i {
  animation: equalize 0.75s ease-in-out infinite alternate;
}

.music-button[aria-pressed="true"] .music-icon i:nth-child(2) {
  animation-delay: -0.35s;
}

.music-button[aria-pressed="true"] .music-icon i:nth-child(3) {
  animation-delay: -0.6s;
}

@keyframes equalize {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

.volume-control {
  display: grid;
  gap: 2px;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.volume-control input {
  width: 64px;
  height: 44px;
  accent-color: var(--rust);
  cursor: pointer;
}

.track-step {
  display: grid;
  width: 34px;
  min-width: 34px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--teal);
  background: transparent;
  font-family: var(--serif);
  font-size: 23px;
}

.track-step:hover,
.track-step:focus-visible {
  background: rgba(11, 80, 78, 0.08);
}

.track-control select,
.select-row select,
.select-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px 2px 8px 2px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  font: inherit;
}

.appearance-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 10px;
}

.appearance-controls .select-row {
  display: grid;
  max-width: none;
  gap: 5px;
}

.appearance-controls select {
  width: 100%;
  min-width: 0;
}

.appearance-preview {
  position: relative;
  height: 58px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px 14px 2px 14px;
  background: var(--paper);
}

.appearance-preview i {
  position: absolute;
  border-radius: 50%;
  filter: blur(7px);
  opacity: 0.44;
}

.appearance-preview i:nth-child(1) {
  width: 95px;
  height: 95px;
  top: -56px;
  left: 8%;
  background: var(--ambient-one-color);
}

.appearance-preview i:nth-child(2) {
  width: 120px;
  height: 80px;
  right: 8%;
  bottom: -49px;
  background: var(--ambient-two-color);
}

.appearance-preview i:nth-child(3),
.appearance-preview i:nth-child(4) {
  width: 4px;
  height: 4px;
  filter: none;
  background: var(--ink);
  opacity: 0.09;
}

.appearance-preview i:nth-child(3) {
  top: 18px;
  left: 47%;
}

.appearance-preview i:nth-child(4) {
  right: 31%;
  bottom: 13px;
}

.track-control select {
  width: 122px;
  padding: 5px 22px 5px 7px;
  font-size: 10px;
}

.record-button {
  gap: 9px;
  padding: 6px 8px 6px 15px;
}

.settings-button {
  gap: 7px;
  min-height: 48px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.settings-button span:first-child {
  color: var(--rust);
  font-size: 16px;
}

.record-icon {
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--paper);
  background: var(--rust);
}

.record-button > span:nth-child(2) {
  font-size: 12px;
  font-weight: 700;
}

.record-count {
  display: grid;
  min-width: 30px;
  height: 30px;
  padding-inline: 7px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--teal);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 48px;
  padding: 76px 0 66px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--rust);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow span {
  width: 26px;
  height: 1px;
  background: currentColor;
}

.hero h1,
.section-heading h2,
.how-intro h2,
.dialog-header h2 {
  font-family: var(--serif);
  font-weight: 500;
}

.hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(42px, 6.7vw, 78px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--rust);
  font-style: italic;
}

.hero-intro {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.date-stamp {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 178px;
  padding: 16px 18px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.date-day {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
}

.date-detail {
  display: grid;
  gap: 4px;
}

.date-detail strong {
  font-family: var(--serif);
  font-size: 15px;
}

.date-detail small {
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.recommendation-section {
  padding-bottom: 84px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.theme-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 22px;
  border: 1px solid rgba(11, 80, 78, 0.28);
  border-radius: 2px 18px 2px 18px;
  background: linear-gradient(120deg, rgba(11, 80, 78, 0.09), rgba(199, 151, 66, 0.12));
}

.theme-index,
.theme-mode {
  color: var(--teal);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.theme-index {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(11, 80, 78, 0.35);
  border-radius: 50%;
}

.theme-banner strong {
  font-family: var(--serif);
  font-size: 20px;
}

.theme-banner p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.theme-mode {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
  white-space: nowrap;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: 34px;
  line-height: 1.2;
}

.section-note {
  max-width: 390px;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.section-note span {
  margin-right: 5px;
  color: var(--rust);
}

.featured-grid,
.discovery-grid {
  display: grid;
  gap: 18px;
}

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

.discovery-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 18px;
}

.city-card {
  grid-column: span 5;
}

.german-card {
  grid-column: span 3;
}

.medical-card {
  grid-column: span 4;
}

.recommendation-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px 24px 4px 24px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow);
  transition: opacity 150ms ease, transform 150ms ease;
}

.recommendation-card.is-swapping {
  opacity: 0.5;
  transform: translateY(3px);
}

.media-card {
  display: grid;
  grid-template-columns: minmax(180px, 37%) 1fr;
  min-height: 510px;
}

.card-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  color: white;
  background: var(--visual, var(--teal));
}

.cover-image {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 10px;
  padding: 28px 22px 64px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.24)),
    repeating-linear-gradient(135deg, transparent 0 16px, rgba(255,255,255,0.05) 16px 17px);
}

.visual-fallback small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.visual-fallback strong {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.25;
}

.visual-topline,
.visual-number {
  position: absolute;
  z-index: 3;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

.visual-topline {
  top: 18px;
  left: 18px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.52);
  border-radius: 3px;
  background: rgba(10, 37, 36, 0.78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  backdrop-filter: blur(8px);
}

.visual-number {
  right: 17px;
  bottom: 16px;
  font-family: var(--serif);
  font-size: 28px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(10, 37, 36, 0.78);
}

.visual-number small {
  font-family: var(--sans);
  font-size: 10px;
}

.card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 30px 30px 26px;
}

.card-overline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.genre-chip,
.topic-chip,
.level-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(168, 185, 159, 0.24);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(27px, 2.5vw, 37px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.card-title:focus {
  outline: none;
}

.original-title {
  min-height: 20px;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: 10px;
}

.meta-row span:not(:last-child)::after {
  content: "·";
  margin-left: 13px;
  color: var(--gold);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.tag-row span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 10px;
}

.summary {
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.reason {
  margin: 13px 0 0;
  padding-left: 13px;
  border-left: 2px solid var(--rust);
  font-family: var(--serif);
  font-size: 12px;
}

.audience-note {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.curation-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.content-warning {
  padding: 8px 10px;
  border: 1px solid rgba(191, 91, 53, 0.28);
  border: 1px solid color-mix(in srgb, var(--rust) 28%, transparent);
  border-radius: 8px;
  background: rgba(191, 91, 53, 0.06);
  background: color-mix(in srgb, var(--rust) 6%, transparent);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 19px;
}

.rating-score {
  color: var(--rust);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.rating-score small {
  font-family: var(--sans);
  font-size: 10px;
}

.rating-detail {
  display: grid;
  min-width: 0;
  gap: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.rating-detail a {
  width: fit-content;
  color: var(--ink);
  font-weight: 800;
  text-underline-offset: 3px;
}

.popularity-badge {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 2px;
  color: var(--teal);
  background: rgba(199, 151, 66, 0.15);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 18px;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.feedback-button,
.speech-button,
.weather-button {
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.62);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.feedback-button[aria-pressed="true"] {
  border-color: var(--rust);
  color: var(--rust);
  background: rgba(166, 73, 47, 0.09);
}

.feedback-button.unsuitable-button[aria-pressed="true"] {
  border-color: var(--teal);
  color: var(--white);
  background: var(--teal);
}

.speech-button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--teal);
  background: rgba(199, 151, 66, 0.2);
}

.german-example-tools,
.city-live-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.weather-result,
.speech-status-inline {
  color: var(--ink-soft);
  font-size: 10px;
}

.primary-button,
.secondary-button,
.source-button,
.icon-button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 2px 13px 2px 13px;
  color: white;
  background: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--teal-bright);
}

.secondary-button {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 2px 12px 2px 12px;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.secondary-button:hover {
  border-color: var(--teal);
  background: rgba(168, 185, 159, 0.12);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-arrow {
  font-size: 16px;
  font-weight: 400;
}

.source-button {
  display: grid;
  width: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px 2px 12px 2px;
  text-decoration: none;
}

.source-button svg {
  width: 18px;
  height: 18px;
}

.city-inner,
.german-inner,
.medical-inner {
  display: flex;
  min-height: 555px;
  flex-direction: column;
}

.city-visual {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  padding: 23px;
  color: white;
  background:
    linear-gradient(125deg, rgba(11, 80, 78, 0.92), rgba(191, 91, 53, 0.72)),
    var(--visual, #0b504e);
}

.city-visual::before,
.city-visual::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 50%;
}

.city-visual::before {
  width: 220px;
  height: 220px;
  top: -105px;
  right: -65px;
  box-shadow: 0 0 0 25px rgba(255,255,255,0.035), 0 0 0 50px rgba(255,255,255,0.025);
}

.city-visual::after {
  width: 105px;
  height: 105px;
  right: 42px;
  bottom: -65px;
}

.city-coordinate {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.city-monogram {
  position: absolute;
  right: 18px;
  bottom: -26px;
  color: rgba(255,255,255,0.17);
  font-family: Georgia, serif;
  font-size: 130px;
  font-style: italic;
  line-height: 1;
}

.city-heading {
  position: absolute;
  z-index: 1;
  left: 23px;
  bottom: 23px;
}

.city-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.05;
}

.city-heading p {
  margin: 5px 0 0;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.city-copy,
.german-copy,
.medical-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.detail-list dt {
  color: var(--rust);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  color: var(--ink-soft);
}

.city-copy .card-actions,
.german-copy .card-actions,
.medical-copy .card-actions {
  margin-top: auto;
  padding-top: 22px;
}

.german-inner {
  position: relative;
  color: white;
  background: var(--teal);
}

.german-inner::before {
  position: absolute;
  top: -70px;
  right: -55px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 25px rgba(255,255,255,0.035);
}

.german-copy {
  position: relative;
  z-index: 1;
}

.german-card .section-kicker {
  color: #f0c87e;
}

.german-phrase {
  margin: 36px 0 0;
  font-family: Georgia, var(--serif);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.german-translation {
  margin: 18px 0 0;
  color: #f5dba9;
  font-family: var(--serif);
  font-size: 17px;
}

.german-explanation,
.german-example {
  margin: 23px 0 0;
  color: rgba(255,255,255,0.74);
  font-size: 11px;
}

.german-example {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.german-example strong,
.german-example span {
  display: block;
}

.german-example span {
  margin-top: 5px;
  color: #f5dba9;
}

.german-card .level-chip {
  color: var(--teal);
  background: #f5dba9;
}

.german-card .primary-button {
  color: var(--teal);
  background: #f5dba9;
}

.german-card .primary-button:hover {
  background: #ffe9b9;
}

.german-card .secondary-button,
.german-card .source-button {
  color: white;
  border-color: rgba(255,255,255,0.3);
}

.german-card .feedback-button,
.german-card .speech-button {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.german-card .feedback-button[aria-pressed="true"],
.german-card .feedback-button.unsuitable-button[aria-pressed="true"],
.german-card .speech-button[aria-pressed="true"] {
  color: var(--teal);
  border-color: #f5dba9;
  background: #f5dba9;
}

.german-card .speech-status-inline {
  color: rgba(255, 255, 255, 0.88);
}

.medical-visual {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  background: #e9e4d5;
}

.medical-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.medical-topic {
  position: absolute;
  z-index: 2;
  left: 17px;
  bottom: 15px;
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: rgba(11, 80, 78, 0.92);
  font-size: 9px;
  font-weight: 800;
}

.medical-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.25;
}

.action-box,
.warning-box {
  margin-top: 15px;
  padding: 11px 12px;
  border-radius: 2px 10px 2px 10px;
  font-size: 10px;
}

.action-box {
  color: var(--teal);
  background: rgba(168, 185, 159, 0.23);
}

.warning-box {
  color: #6e2f1e;
  background: rgba(191, 91, 53, 0.12);
}

.action-box strong,
.warning-box strong {
  display: block;
  margin-bottom: 2px;
}

.source-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.source-note a {
  font-weight: 800;
  text-underline-offset: 3px;
}

.exhausted-card {
  min-height: 320px;
}

.exhausted-card > div {
  display: grid;
  height: 100%;
  min-height: 320px;
  padding: 40px;
  place-content: center;
  text-align: center;
}

.exhausted-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rust);
  font-family: var(--serif);
  font-size: 22px;
}

.exhausted-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
}

.exhausted-card p {
  max-width: 360px;
  margin: 10px auto 20px;
  color: var(--ink-soft);
  font-size: 11px;
}

.compact-button {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 112px;
}

.how-it-works {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.6fr);
  gap: 70px;
  padding: 70px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.how-intro h2 {
  margin: 12px 0 0;
  font-size: 39px;
  line-height: 1.23;
}

.steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 17px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.steps li:first-child {
  padding-top: 0;
}

.steps li:last-child {
  border-bottom: 0;
}

.steps > li > span {
  color: var(--rust);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.steps strong {
  font-family: var(--serif);
  font-size: 15px;
}

.steps p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.medical-boundary {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 20px;
  margin: 28px 0 0;
  padding: 19px 22px;
  border: 1px solid rgba(191, 91, 53, 0.25);
  border-radius: 2px 15px 2px 15px;
  background: rgba(255,253,248,0.45);
}

.medical-boundary strong {
  color: var(--rust);
  font-family: var(--serif);
}

.medical-boundary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.storage-warning {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(191, 91, 53, 0.34);
  color: #6f301f;
  background: rgba(191, 91, 53, 0.09);
  font-size: 11px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 120px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color: var(--ink-soft);
  font-size: 10px;
}

.site-footer p {
  margin: 0;
}

.site-footer p span {
  margin-inline: 7px;
  color: var(--rust);
}

.site-footer button {
  min-height: 44px;
  border: 0;
  color: var(--ink);
  background: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px 24px 4px 24px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 30px 100px rgba(12, 44, 42, 0.24);
}

dialog[open] {
  display: grid;
  height: min(82vh, 760px);
}

.record-dialog[open] {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.data-dialog[open] {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.settings-dialog[open] {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

dialog::backdrop {
  background: rgba(10, 37, 36, 0.46);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 28px 19px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 6px 0 0;
  font-size: 30px;
}

.icon-button {
  display: grid;
  width: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
}

.dialog-description,
.data-copy {
  color: var(--ink-soft);
  font-size: 11px;
}

.settings-copy {
  min-height: 0;
  padding: 4px 28px 28px;
  overflow: auto;
}

.settings-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child {
  border-bottom: 0;
}

.settings-section h3,
.record-list h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 17px;
}

.settings-section > p,
.boundary-note,
.settings-status {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.switch-row,
.select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.switch-row input,
.preference-grid input,
.medical-preferences input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.switch-row span {
  display: grid;
}

.switch-row small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.preference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.preference-grid fieldset,
.medical-preferences {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px 11px 2px 11px;
}

.preference-grid legend,
.medical-preferences legend {
  padding: 0 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
}

.preference-grid label,
#medicalPreferenceOptions label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  font-size: 10px;
}

.medical-preferences {
  margin-top: 10px;
}

#medicalPreferenceOptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 10px;
}

.select-row {
  justify-content: space-between;
  max-width: 520px;
}

.select-row select,
.select-row input {
  min-width: min(280px, 55%);
  padding: 7px 10px;
}

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.settings-actions .primary-button {
  flex: 0 1 auto;
}

.backup-password-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 8px 0 12px;
}

.backup-password-fields[hidden] {
  display: none;
}

.backup-password-fields label,
.backup-unlock label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.backup-password-fields input,
.backup-unlock input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.backup-preview-dialog[open] {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.backup-preview-dialog .dialog-description {
  margin: 0;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
}

.backup-unlock,
.backup-preview-copy {
  min-height: 0;
  padding: 22px 28px;
  overflow: auto;
}

.backup-unlock[hidden],
.backup-preview-copy[hidden] {
  display: none;
}

.backup-unlock h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 20px;
}

.backup-unlock label {
  max-width: 480px;
  margin-bottom: 12px;
}

.backup-mode-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.backup-mode-choices legend {
  padding: 0 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.backup-mode-choices label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 3px 12px 3px 12px;
  background: var(--paper);
  cursor: pointer;
}

.backup-mode-choices label:has(input:checked) {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(11, 80, 78, 0.32);
}

.backup-mode-choices input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.backup-mode-choices span {
  display: grid;
  min-width: 0;
}

.backup-mode-choices small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.backup-diff-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.backup-diff-summary > div {
  display: grid;
  gap: 2px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 3px 10px 3px 10px;
  background: rgba(255, 253, 248, 0.72);
}

.backup-diff-summary strong {
  color: var(--rust);
  font-family: var(--serif);
  font-size: 23px;
}

.backup-diff-summary span,
.backup-diff-details {
  color: var(--ink-soft);
  font-size: 10px;
}

.backup-diff-details {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px 12px 3px 12px;
}

.backup-diff-details summary {
  min-height: 30px;
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.backup-diff-details section {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.backup-diff-details h4,
.backup-diff-details p,
.backup-diff-details ul {
  margin: 0;
}

.backup-diff-details h4 {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
}

.backup-preview-dialog > .settings-status {
  min-height: 42px;
  margin: 0;
  padding: 10px 28px;
  border-top: 1px solid var(--line);
}

.offline-mode-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.offline-mode-choices legend {
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.offline-mode-choices label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 3px 12px 3px 12px;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  cursor: pointer;
}

.offline-mode-choices label:has(input:checked) {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 35%, transparent);
}

.offline-mode-choices input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.offline-mode-choices span {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
}

.offline-mode-choices small {
  color: var(--ink-soft);
  font-size: 10px;
}

.offline-progress {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.offline-progress[hidden] {
  display: none;
}

.offline-progress progress {
  width: 100%;
  height: 10px;
  accent-color: var(--teal);
}

.offline-progress span {
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.favorite-heading {
  margin-top: 26px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.record-favorite-mark {
  color: var(--gold);
}

.dialog-description {
  margin: 0;
  padding: 17px 28px 0;
}

.record-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 18px 28px;
}

.record-stat {
  display: grid;
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: 2px 10px 2px 10px;
  text-align: center;
}

.record-stat strong {
  color: var(--rust);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.record-stat span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.record-list {
  min-height: 0;
  max-height: none;
  padding: 0 28px;
  overflow: auto;
}

.record-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.record-item-type {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-family: var(--serif);
  font-size: 11px;
}

.record-item-copy {
  display: grid;
  min-width: 0;
}

.record-item-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-item-copy small {
  color: var(--ink-soft);
  font-size: 10px;
}

.empty-records {
  padding: 25px 0;
  color: var(--ink-soft);
  text-align: center;
  font-size: 11px;
}

.record-load-more {
  width: 100%;
  min-height: 44px;
  margin: 14px 0 6px;
}

.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 28px 26px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.dialog-actions.one-action {
  justify-content: flex-end;
}

.danger-button {
  color: #7b2c1a;
}

.data-copy {
  min-height: 0;
  max-height: none;
  padding: 12px 28px 24px;
  overflow: auto;
}

.data-copy h3 {
  margin: 18px 0 5px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
}

.data-copy p {
  margin: 7px 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.source-links a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 50;
  right: max(22px, env(safe-area-inset-right, 0px));
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  display: flex;
  max-width: min(440px, calc(100% - 44px));
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 3px 14px 3px 14px;
  color: white;
  background: var(--teal);
  box-shadow: 0 16px 50px rgba(10, 37, 36, 0.3);
  font-size: 12px;
}

.toast[hidden] {
  display: none;
}

.toast-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: #f0c87e;
}

#toastMessage {
  min-width: 0;
}

.toast-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.toast button {
  min-width: 44px;
  min-height: 44px;
  margin-left: 0;
  border: 0;
  color: #f0c87e;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.toast .toast-close {
  color: white;
  font-weight: 700;
  text-decoration: none;
}

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

.noscript-message,
.compatibility-message {
  position: fixed;
  z-index: 99;
  inset: 0;
  display: grid;
  padding: 30px;
  place-items: center;
  color: white;
  background: var(--teal);
  text-align: center;
}

.compatibility-message[hidden] {
  display: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 8px var(--ink);
}

@media (max-width: 1050px) {
  .track-control,
  .settings-button span:last-child {
    display: none;
  }

  .media-card {
    grid-template-columns: minmax(160px, 34%) 1fr;
  }

  .city-card {
    grid-column: span 6;
  }

  .german-card,
  .medical-card {
    grid-column: span 6;
  }

  .medical-card {
    grid-column-start: 4;
  }
}

@media (max-width: 900px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 34px, 760px);
  }

  .site-header {
    min-height: 86px;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .media-card {
    min-height: 470px;
  }

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

  .city-card,
  .german-card,
  .medical-card {
    grid-column: auto;
  }

  .medical-card {
    grid-column: 1 / -1;
  }

  .medical-inner {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) 1.1fr;
    min-height: 440px;
  }

  .medical-visual {
    min-height: 100%;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px 0;
  }

  .brand-copy small,
  .record-button > span:nth-child(2),
  .volume-control span {
    display: none;
  }

  .header-actions {
    align-items: stretch;
    width: 100%;
    justify-content: space-between;
    margin-top: 12px;
  }

  .settings-button {
    width: 46px;
    justify-content: center;
    padding: 6px;
  }

  .music-toolbar {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    min-width: 0;
    flex: 1;
    border-radius: 18px;
  }

  .music-copy {
    display: none;
  }

  .music-button {
    padding-right: 4px;
  }

  .volume-control input {
    width: 54px;
  }

  .record-button {
    padding-left: 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 55px 0 48px;
  }

  .date-stamp {
    width: fit-content;
  }

  .section-heading {
    display: block;
  }

  .section-note {
    margin-top: 11px;
    text-align: left;
  }

  .media-card {
    grid-template-columns: minmax(135px, 34%) 1fr;
  }

  .card-content {
    padding: 25px 22px 22px;
  }

  .card-title {
    font-size: 29px;
  }

  .discovery-grid {
    grid-template-columns: 1fr;
  }

  .medical-card {
    grid-column: auto;
  }

  .city-inner,
  .german-inner,
  .medical-inner {
    display: flex;
    min-height: 520px;
  }

  .city-visual,
  .german-copy,
  .medical-copy {
    min-width: 0;
    overflow: hidden;
  }

  .city-coordinate,
  .german-phrase,
  .german-example strong,
  .german-example span {
    overflow-wrap: anywhere;
  }

  .medical-visual {
    min-height: 220px;
  }

  .medical-boundary {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .record-summary {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .theme-mode {
    grid-column: 2;
    width: fit-content;
  }

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

  .appearance-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 24px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .music-toolbar {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 44px 44px 44px minmax(0, 1fr);
    padding-right: 8px;
  }

  .track-step {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .settings-button {
    grid-column: 1;
    justify-self: start;
  }

  .record-button {
    grid-column: 2;
  }

  .record-button {
    min-height: 46px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 55px);
  }

  .media-card {
    display: block;
  }

  .card-visual {
    min-height: 360px;
  }

  .card-content {
    min-height: 480px;
  }

  .rating-row {
    flex-wrap: wrap;
  }

  .popularity-badge {
    margin-left: 0;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .secondary-button {
    flex: 1;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 0;
  }

  .dialog-header,
  .dialog-actions {
    padding-inline: 19px;
  }

  .record-dialog .weekly-report {
    max-height: 112px;
    margin-block: 10px 0;
    padding: 12px;
    overflow: auto;
  }

  .dialog-header {
    padding-block: 15px 11px;
  }

  .dialog-header h2 {
    font-size: 23px;
  }

  .dialog-description,
  .record-summary,
  .record-list,
  .data-copy,
  .settings-copy {
    padding-inline: 19px;
  }

  .record-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding-block: 10px;
  }

  .record-stat {
    padding: 8px 2px;
  }

  .record-stat strong {
    font-size: 20px;
  }

  .record-stat span {
    font-size: 9px;
    line-height: 1.2;
  }

  .dialog-actions {
    padding-block: 12px 14px;
  }

  .preference-grid,
  #medicalPreferenceOptions {
    grid-template-columns: 1fr;
  }

  .select-row {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .select-row select,
  .select-row input {
    width: 100%;
    min-width: 0;
  }

  .settings-dialog select,
  .settings-dialog input[type="time"] {
    font-size: 16px;
  }

  .offline-mode-choices {
    grid-template-columns: 1fr;
  }

  .offline-progress {
    grid-template-columns: 1fr auto;
  }

  .offline-progress progress {
    grid-column: 1 / -1;
  }

  .toast {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 24px);
  }
}

.skip-link-explore {
  top: 62px;
}

.explore-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.explore-section {
  padding: 74px 0 82px;
  border-top: 1px solid var(--line);
}

.explore-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 3px 18px 3px 18px;
  background: rgba(255, 253, 248, 0.68);
}

.explore-form label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.explore-form .explore-search {
  grid-column: span 2;
}

.explore-form input,
.explore-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
  font-size: 13px;
}

.explore-form select:disabled {
  opacity: 0.45;
}

.explore-reset {
  align-self: end;
  min-height: 44px;
}

.explore-status {
  margin: 18px 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.explore-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.explore-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px 16px 3px 16px;
  background: rgba(255, 253, 248, 0.8);
  box-shadow: 0 12px 32px rgba(23, 57, 55, 0.06);
}

.explore-visual {
  position: relative;
  display: grid;
  min-height: 190px;
  overflow: hidden;
  place-items: center;
  background: var(--visual, #0b504e);
  background: linear-gradient(145deg, var(--visual, #0b504e), color-mix(in srgb, var(--visual, #0b504e) 58%, #f2eee4));
}

.explore-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.explore-monogram {
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--serif);
  font-size: 42px;
}

.explore-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 15px 16px;
}

.explore-type {
  color: var(--rust);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.explore-card h3 {
  margin: 4px 0 3px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.25;
}

.explore-card p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.explore-card .explore-meta,
.explore-card .explore-series {
  -webkit-line-clamp: 2;
}

.explore-card .explore-series {
  color: var(--teal);
}

.explore-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.explore-card footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--teal);
  font-weight: 800;
  text-underline-offset: 3px;
}

.explore-card footer svg {
  width: 13px;
  height: 13px;
}

.explore-empty {
  grid-column: 1 / -1;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  text-align: center;
}

.explore-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.explore-pagination[hidden] {
  display: none;
}

.weekly-report {
  margin: 18px 28px 2px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 3px 14px 3px 14px;
  background: linear-gradient(120deg, rgba(11, 80, 78, 0.07), rgba(199, 151, 66, 0.08));
}

.weekly-heading,
.weekly-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weekly-heading h3 {
  margin: 2px 0 0;
  font-family: var(--serif);
}

.weekly-heading > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.weekly-summary {
  margin-top: 14px;
}

.weekly-summary > div {
  display: grid;
  text-align: center;
}

.weekly-summary strong {
  color: var(--rust);
  font-family: var(--serif);
  font-size: 22px;
}

.weekly-summary span,
.weekly-breakdown h4,
.weekly-empty {
  color: var(--ink-soft);
  font-size: 10px;
}

.weekly-breakdown section {
  margin-top: 12px;
}

.weekly-breakdown h4 {
  margin: 0 0 5px;
}

.weekly-breakdown section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.weekly-breakdown section span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  font-size: 9px;
}

.keyboard-help {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.keyboard-help summary {
  color: var(--teal);
  font-weight: 800;
  cursor: pointer;
}

.action-box h4,
.warning-box h4 {
  margin: 0 0 3px;
  font-size: 11px;
}

.action-box p,
.warning-box p {
  margin: 0;
}

.quick-nav {
  display: none;
}

html[data-text-size="large"] body {
  font-size: 18px;
}

html[data-text-size="large"] .summary,
html[data-text-size="large"] .reason,
html[data-text-size="large"] .audience-note,
html[data-text-size="large"] .action-box,
html[data-text-size="large"] .warning-box,
html[data-text-size="large"] .source-note,
html[data-text-size="large"] .explore-card p,
html[data-text-size="large"] button,
html[data-text-size="large"] select,
html[data-text-size="large"] input {
  font-size: 1rem;
}

html[data-text-size="large"] .meta-row,
html[data-text-size="large"] .tag-row,
html[data-text-size="large"] .curation-note,
html[data-text-size="large"] .rating-detail,
html[data-text-size="large"] .detail-list,
html[data-text-size="large"] .weather-result,
html[data-text-size="large"] .german-translation,
html[data-text-size="large"] .german-explanation,
html[data-text-size="large"] .german-example,
html[data-text-size="large"] .source-note,
html[data-text-size="large"] .record-item-copy,
html[data-text-size="large"] .settings-section > p,
html[data-text-size="large"] .boundary-note,
html[data-text-size="large"] .settings-status,
html[data-text-size="large"] .explore-status,
html[data-text-size="large"] .weekly-report {
  font-size: 0.875rem;
}

html[data-text-size="large"] .section-kicker,
html[data-text-size="large"] .section-note,
html[data-text-size="large"] .snapshot-note,
html[data-text-size="large"] .theme-banner-copy p,
html[data-text-size="large"] .card-overline,
html[data-text-size="large"] .genre-chip,
html[data-text-size="large"] .level-chip,
html[data-text-size="large"] .original-title,
html[data-text-size="large"] .popularity-badge,
html[data-text-size="large"] .speech-status-inline,
html[data-text-size="large"] .dialog-description,
html[data-text-size="large"] .record-stat span,
html[data-text-size="large"] .record-item-copy small,
html[data-text-size="large"] .switch-row small,
html[data-text-size="large"] .preference-grid,
html[data-text-size="large"] .medical-preferences,
html[data-text-size="large"] .select-row,
html[data-text-size="large"] .keyboard-help,
html[data-text-size="large"] .explore-form label,
html[data-text-size="large"] .explore-type,
html[data-text-size="large"] .explore-card footer,
html[data-text-size="large"] .weekly-summary span,
html[data-text-size="large"] .weekly-breakdown h4,
html[data-text-size="large"] .weekly-empty,
html[data-text-size="large"] .backup-diff-summary span,
html[data-text-size="large"] .backup-diff-details,
html[data-text-size="large"] .backup-mode-choices small {
  font-size: 0.875rem;
}

html[data-contrast="high"] {
  --ink: #082b29;
  --ink-soft: #243f3d;
  --line: rgba(8, 43, 41, 0.48);
  --white: #fffefa;
}

html[data-contrast="high"] .recommendation-card,
html[data-contrast="high"] .explore-card,
html[data-contrast="high"] .settings-section,
html[data-contrast="high"] .weekly-report,
html[data-contrast="high"] .backup-mode-choices label,
html[data-contrast="high"] .backup-diff-summary > div,
html[data-contrast="high"] .backup-diff-details {
  border-color: var(--ink);
  background-color: var(--white);
}

html[data-motion="reduce"] {
  scroll-behavior: auto;
}

html[data-motion="reduce"] *,
html[data-motion="reduce"] *::before,
html[data-motion="reduce"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

html[data-density="compact"] .hero {
  padding-block: 42px 34px;
}

html[data-density="compact"] .recommendation-section,
html[data-density="compact"] .explore-section {
  padding-bottom: 48px;
}

html[data-density="compact"] .card-content,
html[data-density="compact"] .city-copy,
html[data-density="compact"] .german-copy,
html[data-density="compact"] .medical-copy {
  padding: 20px;
}

@media (max-width: 900px) {
  .explore-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .explore-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .explore-button {
    min-height: 46px;
    padding-inline: 12px;
  }

  .explore-section {
    padding-block: 54px;
    scroll-margin-top: 18px;
  }

  .explore-form {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }

  .explore-form .explore-search {
    grid-column: 1 / -1;
  }

  .explore-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .explore-visual {
    min-height: 176px;
  }

  .quick-nav {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 -8px 28px rgba(23, 57, 55, 0.12);
    backdrop-filter: blur(14px);
  }

  .quick-nav a {
    display: grid;
    min-width: 0;
    min-height: 44px;
    place-items: center;
    border-radius: 8px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
  }

  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .weekly-report {
    margin-inline: 19px;
  }

  .backup-password-fields,
  .backup-mode-choices {
    grid-template-columns: 1fr;
  }

  .backup-preview-dialog .dialog-description,
  .backup-unlock,
  .backup-preview-copy,
  .backup-preview-dialog > .settings-status {
    padding-inline: 19px;
  }

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

  html[data-density="compact"] .card-visual {
    min-height: 220px;
  }

  html[data-density="compact"] .card-content,
  html[data-density="compact"] .city-inner,
  html[data-density="compact"] .german-inner,
  html[data-density="compact"] .medical-inner {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .explore-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .explore-form {
    grid-template-columns: 1fr;
  }

  .explore-form .explore-search {
    grid-column: auto;
  }

  .explore-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .explore-card-copy {
    padding: 13px;
  }

  .weekly-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .backup-diff-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .recommendation-card,
  .music-toolbar,
  .record-button,
  .source-button,
  .secondary-button {
    border: 1px solid CanvasText;
  }
}
