[hidden] {
  display: none !important;
}

:root {
  color-scheme: light dark;
  --hub-bg: #F9F6F0;
  --hub-surface: #FFFDF9;
  --hub-text: #1A2A4A;
  --hub-text-muted: #665F58;
  --hub-gold-text: #806014;
  --hub-gold-accent: #B08527;
  --hub-border: #8F8471;
  --hub-rule: #D8D0C4;
  --hub-focus: #1A2A4A;
  --hub-link: #1A2A4A;
  --module-24h-accent: #7B2D35;
  --module-ldc-accent: #1A2A4A;
  --module-marie-accent: #456A8D;
  --module-lettres-accent: #806014;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --radius-card: 1rem;
  --radius-control: .75rem;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", "Noto Serif", serif;
  --fs-body: 1.1875rem;
  --fs-card-desc: 1.125rem;
  --fs-card-title: 1.375rem;
  --fs-brand: 1.875rem;
  --page-inline: clamp(1rem, 4vw, 2rem);
}

html[data-text="small"] {
  --fs-body: 1rem;
  --fs-card-desc: 1rem;
  --fs-card-title: 1.25rem;
  --fs-brand: 1.75rem;
}

html[data-text="normal"] {
  --fs-body: 1.1875rem;
  --fs-card-desc: 1.125rem;
  --fs-card-title: 1.375rem;
  --fs-brand: 1.875rem;
}

html[data-text="large"] {
  --fs-body: 1.375rem;
  --fs-card-desc: 1.25rem;
  --fs-card-title: 1.5rem;
  --fs-brand: 2rem;
}

html[data-text="xlarge"] {
  --fs-body: 1.625rem;
  --fs-card-desc: 1.4375rem;
  --fs-card-title: 1.6875rem;
  --fs-brand: 2.125rem;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --hub-bg: #171717;
  --hub-surface: #211F1C;
  --hub-text: #F3EFE7;
  --hub-text-muted: #C6BFB4;
  --hub-gold-text: #D3B45A;
  --hub-gold-accent: #D3B45A;
  --hub-border: #7A7065;
  --hub-rule: #3A3630;
  --hub-focus: #F3EFE7;
  --hub-link: #F3EFE7;
  --module-24h-accent: #D7A0A5;
  --module-ldc-accent: #B7CDE0;
  --module-marie-accent: #9FC3DE;
  --module-lettres-accent: #D3B45A;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --hub-bg: #171717;
    --hub-surface: #211F1C;
    --hub-text: #F3EFE7;
    --hub-text-muted: #C6BFB4;
    --hub-gold-text: #D3B45A;
    --hub-gold-accent: #D3B45A;
    --hub-border: #7A7065;
    --hub-rule: #3A3630;
    --hub-focus: #F3EFE7;
    --hub-link: #F3EFE7;
    --module-24h-accent: #D7A0A5;
    --module-ldc-accent: #B7CDE0;
    --module-marie-accent: #9FC3DE;
    --module-lettres-accent: #D3B45A;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--hub-bg);
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--hub-link);
  text-underline-offset: .18em;
  text-decoration-thickness: .08em;
}

a:hover {
  text-decoration-thickness: .12em;
}

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

.skip-link {
  position: fixed;
  z-index: 1001;
  inset-block-start: .75rem;
  inset-inline-start: .75rem;
  padding: .65rem .85rem;
  border: 2px solid var(--hub-focus);
  border-radius: var(--radius-control);
  background: var(--hub-surface);
  color: var(--hub-text);
  transform: translateY(-180%);
}

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

.page-shell {
  width: min(100%, 1024px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(var(--page-inline), env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(var(--page-inline), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
  padding-block: .25rem 1rem;
}

.brand,
.page-title {
  margin: 0;
  color: var(--hub-text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.018em;
}

.brand {
  font-size: var(--fs-brand);
  line-height: 1.18;
}

.page-title {
  font-size: calc(var(--fs-brand) + .125rem);
  line-height: 1.22;
}

.settings-trigger {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-control);
  background: var(--hub-surface);
  color: var(--hub-text);
  font: 600 .95rem/1 var(--font-ui);
}

main {
  flex: 1 0 auto;
  min-width: 0;
}

.intro {
  max-width: 46rem;
  margin: 0 0 clamp(1.1rem, 3vw, 1.65rem);
  color: var(--hub-text-muted);
  font-size: var(--fs-body);
  line-height: 1.55;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(.75rem, 2.2vw, 1.15rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  min-width: 0;
  border: 1px solid var(--hub-border);
  border-inline-start-width: 4px;
  border-radius: var(--radius-card);
  background: var(--hub-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  overflow: clip;
}

.app-card--24h { border-inline-start-color: var(--module-24h-accent); }
.app-card--ldc { border-inline-start-color: var(--module-ldc-accent); }
.app-card--marie { border-inline-start-color: var(--module-marie-accent); }
.app-card--lettres { border-inline-start-color: var(--module-lettres-accent); }

.app-card__link,
.app-card__body {
  min-width: 0;
  min-height: 112px;
  padding: clamp(.85rem, 2.5vw, 1.15rem);
  display: grid;
  grid-template-columns: clamp(3.25rem, 7vw, 4rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.8rem, 2.4vw, 1.1rem);
}

.app-card__link {
  color: inherit;
  text-decoration: none;
}

.app-card__link:hover {
  background: color-mix(in srgb, var(--hub-surface) 94%, var(--hub-text) 6%);
}

.app-card__link:active {
  background: color-mix(in srgb, var(--hub-surface) 90%, var(--hub-text) 10%);
}

.app-card__link:focus-visible {
  outline: 3px solid var(--hub-focus);
  outline-offset: -4px;
}

.app-card__icon {
  width: clamp(3.25rem, 7vw, 4rem);
  height: clamp(3.25rem, 7vw, 4rem);
  border-radius: .9rem;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}

.app-card__copy {
  min-width: 0;
}

.app-card__title {
  margin: 0;
  color: var(--hub-text);
  font-family: var(--font-display);
  font-size: var(--fs-card-title);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.012em;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}

.app-card__desc,
.app-card__status {
  margin: .32rem 0 0;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.app-card__desc {
  color: var(--hub-text-muted);
  font-size: var(--fs-card-desc);
}

.app-card__status {
  color: var(--hub-gold-text);
  font-size: .95em;
  font-weight: 700;
}

.app-card__chevron {
  align-self: center;
  color: var(--hub-text-muted);
  font-family: var(--font-ui);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
}

.app-card.is-unavailable {
  box-shadow: none;
}

.app-card.is-unavailable .app-card__icon {
  opacity: .82;
}

.home-footer,
.page-footer {
  margin-block-start: clamp(1.25rem, 4vw, 2rem);
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--hub-rule);
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1.25rem;
}

.home-footer a,
.page-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--hub-text-muted);
  font-size: .95em;
  font-weight: 600;
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin: 1.8rem 0 .45rem;
  color: var(--hub-text);
  font-family: var(--font-display);
  font-size: 1.25em;
  line-height: 1.35;
}

.prose p {
  margin: .45rem 0 1rem;
  color: var(--hub-text-muted);
  line-height: 1.65;
}

.meta-list {
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: .45rem;
  list-style: none;
  color: var(--hub-text-muted);
}

.meta-list strong {
  color: var(--hub-text);
}

.build-note {
  margin-block-start: 1.5rem;
  padding: .85rem 1rem;
  border-inline-start: 4px solid var(--hub-gold-accent);
  background: var(--hub-surface);
  color: var(--hub-text-muted);
  font-size: .92em;
}

@media (min-width: 700px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-card__link,
  .app-card__body {
    min-height: 152px;
  }
}

@media (max-width: 359px) {
  .site-header {
    align-items: flex-start;
  }

  .app-card__link,
  .app-card__body {
    grid-template-columns: 3.25rem minmax(0, 1fr);
  }

  .app-card__chevron {
    display: none;
  }

  html[data-text="xlarge"] .app-card__link,
  html[data-text="xlarge"] .app-card__body {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  html[data-text="xlarge"] .app-card__icon {
    margin-block-end: .15rem;
  }
}

html[data-text="xlarge"] .app-card__chevron {
  display: none;
}

@media (forced-colors: active) {
  .app-card {
    border-color: CanvasText;
  }

  .app-card__link:focus-visible,
  :focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

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

body.is-scroll-locked {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
}

.settings-dialog {
  width: min(calc(100% - 1rem), 680px);
  max-inline-size: 680px;
  max-block-size: min(92vh, 100dvh);
  padding: 0;
  border: 1px solid var(--hub-border);
  border-radius: 1.25rem;
  background: var(--hub-surface);
  color: var(--hub-text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  overflow: auto;
}

.settings-dialog::backdrop {
  background: rgba(15, 19, 28, .55);
}

.settings-dialog__inner {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.settings-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-dialog__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55em;
  line-height: 1.25;
}

.icon-control,
.support-actions button {
  min-width: 44px;
  min-height: 44px;
  padding: .7rem .9rem;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-control);
  background: var(--hub-surface);
  color: var(--hub-text);
  font: 600 .95em/1.2 var(--font-ui);
}

.settings-scope {
  margin: .8rem 0 1.25rem;
  color: var(--hub-text-muted);
  line-height: 1.5;
}

.settings-group {
  margin: 0;
  padding: 1rem 0;
  border: 0;
  border-block-start: 1px solid var(--hub-rule);
}

.settings-group legend {
  padding: 0;
  color: var(--hub-text);
  font-weight: 700;
}

.radio-list {
  display: grid;
  gap: .45rem;
  margin-block-start: .7rem;
}

.radio-list label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.radio-list label:hover {
  background: color-mix(in srgb, var(--hub-surface) 92%, var(--hub-text) 8%);
}

.radio-list input[type="radio"] {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--hub-text);
}

.radio-list input[type="radio"]:focus-visible {
  outline: 3px solid var(--hub-focus);
  outline-offset: 4px;
}

.technical-support {
  margin-block-start: 2rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--hub-rule);
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.support-feedback,
.reset-confirmation {
  margin-block-start: 1rem;
  padding: 1rem;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-control);
  background: var(--hub-surface);
}

.support-feedback p,
.reset-confirmation p {
  margin-block-start: 0;
}

.reset-confirmation h3 {
  margin: 0 0 .55rem;
  font-family: var(--font-display);
  font-size: 1.05em;
  line-height: 1.35;
}

#diagnostics-text {
  width: 100%;
  min-height: 12rem;
  margin-block-start: .4rem;
  padding: .75rem;
  resize: vertical;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-control);
  background: var(--hub-bg);
  color: var(--hub-text);
  font: 1rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 520px) {
  .settings-dialog {
    width: calc(100% - .5rem);
    max-block-size: 100vh;
    max-block-size: 100dvh;
    border-radius: 1rem;
  }
}

@media (forced-colors: active) {
  .settings-dialog,
  .settings-group,
  .technical-support,
  .support-feedback,
  .reset-confirmation,
  .icon-control,
  .support-actions button,
  #diagnostics-text {
    border-color: CanvasText;
  }

  .radio-list input[type="radio"] {
    forced-color-adjust: auto;
  }
}


/* One persistent system banner; offline has priority over update. */
.system-banner {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, .75rem);
  min-height: 44px;
  padding: .55rem max(1rem, env(safe-area-inset-right)) .55rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--hub-border);
  background: var(--hub-surface);
  color: var(--hub-text);
  font: 600 .95rem/1.35 var(--font-ui);
}
.system-banner button {
  min-width: 44px;
  min-height: 44px;
  padding: .5rem .8rem;
  border: 1px solid var(--hub-border);
  border-radius: var(--radius-control);
  background: var(--hub-bg);
  color: var(--hub-text);
  font: inherit;
}
.system-banner button:focus-visible { outline: 3px solid var(--hub-focus); outline-offset: 2px; }
@media (max-width: 420px) {
  .system-banner { justify-content: space-between; font-size: .875rem; }
}
