:root {
  color-scheme: light;
  --bg: #f7fafc;
  --bg-soft: #eef6f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f3f8f8;
  --line: #d8e4e8;
  --line-strong: #bfd2d8;
  --text: #102033;
  --muted: #53677a;
  --quiet: #778998;
  --accent: #4ecdc4;
  --accent-strong: #15877f;
  --gold: #9b7a22;
  --sky: #3577ba;
  --warn: #b26b00;
  --danger: #b63b35;
  --shadow: 0 18px 45px rgba(20, 51, 90, 0.1);
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(78, 205, 196, 0.1), transparent 260px),
    radial-gradient(circle at 8% 4%, rgba(78, 205, 196, 0.12), transparent 260px);
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, label.file-button { cursor: pointer; }
button, a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, input, select, textarea, .panel, .item-card, .module-shell, .feature-card, .summary-card, .entry-form, .feed-stats, .top-nav, .mobile-nav {
  max-width: 100%;
  min-width: 0;
}
h1, h2, h3, h4, p, span, strong, button, a, label {
  overflow-wrap: break-word;
  word-break: normal;
}

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

.app-header {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 228, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(20, 51, 90, 0.08);
  backdrop-filter: blur(16px);
}

.brand, .top-nav, .hero-actions, .backup-actions, .item-actions, .social-links, .auth-status {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; min-width: fit-content; }
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; line-height: 1.1; font-size: 17px; color: #14335a; }
.brand small { color: var(--muted); font-size: 12px; }

.brand-emblem, .settings-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(20, 51, 90, 0.08);
}
.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}
.brand-emblem img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  border-radius: 6px;
}

.top-nav {
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  padding: 4px;
  border: 1px solid #e5eef1;
  border-radius: 8px;
  background: #f8fbfc;
}

.mobile-nav { display: none; }
.mobile-nav summary {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(78, 205, 196, 0.45);
  border-radius: 8px;
  background: #eefbf9;
  color: #14335a;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--accent-strong);
}
.mobile-nav[open] summary::after { content: "-"; }
.mobile-nav-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.nav-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  padding: 0 13px;
  white-space: normal;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.nav-button:hover, .nav-button.active {
  border-color: rgba(78, 205, 196, 0.42);
  background: #eaf9f7;
  color: #14335a;
}
.nav-button:hover { transform: translateY(-1px); }

.view { display: none; padding: 42px 0 42px; }
.view.active { display: block; }

.auth-status {
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.auth-status span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-status span + span {
  color: var(--accent-strong);
}
.auth-status .cloud-preview-active {
  color: #8a5a00;
  font-weight: 850;
}
.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.save-status-saving {
  border-color: rgba(53, 119, 186, 0.28);
  background: #eef6ff;
  color: #255f99;
}
.save-status-saved {
  border-color: rgba(78, 205, 196, 0.36);
  background: #eefbf9;
  color: var(--accent-strong);
}
.save-status-error {
  border-color: rgba(182, 59, 53, 0.28);
  background: #fff2f0;
  color: var(--danger);
}
.auth-button {
  min-height: 36px;
  border-color: var(--line-strong);
  background: #ffffff;
  color: #14335a;
  padding: 0 12px;
  box-shadow: none;
}
.auth-button:hover {
  border-color: rgba(78, 205, 196, 0.55);
  background: #f1fbfa;
}
.login-shell {
  display: grid;
  min-height: 58vh;
  place-items: center;
}
.login-panel {
  width: min(560px, 100%);
}
.auth-form {
  grid-template-columns: minmax(0, 1fr);
}
.auth-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(178, 107, 0, 0.24);
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4d00;
  font-weight: 800;
  line-height: 1.5;
}
.auth-notice.ready {
  border-color: rgba(78, 205, 196, 0.36);
  background: #eefbf9;
  color: #14335a;
}
.cloud-status-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.cloud-status-list p {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cloud-status-list strong {
  margin: 0;
  font-size: 15px;
  text-align: right;
}
.migration-warnings {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}
.migration-warnings li::marker {
  color: var(--warn);
}

.onboarding-panel[hidden] { display: none; }
.onboarding-panel {
  margin: 0 0 24px;
}
.onboarding-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border: 1px solid rgba(78, 205, 196, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f3fbfa);
  box-shadow: var(--shadow);
  padding: 22px;
}
.onboarding-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3vw, 38px);
}
.onboarding-copy,
.onboarding-steps,
.onboarding-step,
.onboarding-actions {
  min-width: 0;
}
.onboarding-copy p:last-child { margin-bottom: 0; }
.onboarding-copy p {
  max-width: 34ch;
}
.onboarding-steps {
  display: grid;
  gap: 10px;
}
.onboarding-step {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #14335a;
  text-align: left;
  padding: 10px 12px;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.onboarding-step:hover {
  border-color: rgba(78, 205, 196, 0.55);
  background: #eefbf9;
  transform: translateY(-1px);
}
.onboarding-step span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e5f8f6;
  color: var(--accent-strong);
  font-weight: 950;
}
.onboarding-step strong {
  font-size: 14px;
}
.onboarding-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 769px) {
  .onboarding-card {
    grid-template-columns: minmax(0, 0.78fr) minmax(280px, 1fr);
  }
  .onboarding-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 24px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  min-width: 0;
  width: 100%;
  padding: clamp(30px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 5.8vw, 76px);
  line-height: 1.02;
  color: #14335a;
}
h2 { margin-bottom: 12px; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; color: #14335a; }
h3 { margin-bottom: 8px; font-size: 22px; line-height: 1.18; color: #14335a; }
h1 + .hero-text, h2 + p, h3 + p { margin-top: 0; }
.hero-text, .panel p, .module-header p, .status-text, .app-message, .empty-state, .changelog, .item-card p {
  color: var(--muted);
  line-height: 1.62;
}
.panel p.update-note {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-weight: 850;
}
.hero-text { max-width: 680px; font-size: clamp(18px, 2vw, 23px); }
.hero-actions, .backup-actions { flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.status-text { margin: 14px 0 0; font-size: 14px; }

.premium-home-hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.78fr);
  gap: 22px;
  align-items: stretch;
}
.home-hero-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(78, 205, 196, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
  box-shadow: 0 16px 40px rgba(20, 51, 90, 0.08);
}
.home-brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
  min-width: 0;
}
.home-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(78, 205, 196, 0.36);
  border-radius: 18px;
  background: #f1fbfa;
  color: #14335a;
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(78, 205, 196, 0.16);
}
.home-brand-lockup h1 {
  margin-bottom: 0;
  font-size: clamp(46px, 7vw, 84px);
}
.home-description {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.66;
}
.home-badges {
  margin-top: 18px;
}
.home-actions {
  position: relative;
  z-index: 1;
}
.home-account-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.home-snapshot-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(20, 51, 90, 0.07);
}
.home-snapshot-card h2 {
  font-size: clamp(28px, 3.4vw, 42px);
}
.home-snapshot-list,
.home-daily-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.home-snapshot-list span,
.home-daily-list span {
  position: relative;
  min-width: 0;
  padding: 12px 12px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfc;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}
.home-snapshot-list span::before,
.home-daily-list span::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.14);
}
.home-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}
.home-overview-section {
  margin-top: 0;
}
.home-overview-section .section-heading {
  align-items: center;
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
  box-shadow: 0 12px 32px rgba(20, 51, 90, 0.06);
  margin-bottom: 16px;
  padding: 18px;
}
.home-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.home-overview-grid .summary-card {
  min-height: 120px;
}
.home-overview-grid .summary-card strong {
  font-size: clamp(24px, 3vw, 36px);
}
.premium-icon-card {
  overflow: hidden;
  padding-right: 86px;
}
.premium-icon-card::after,
.premium-icon {
  align-items: center;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 42%),
    linear-gradient(145deg, #e8f7f6 0%, #f8fbfd 100%);
  border: 1px solid rgba(78, 205, 196, 0.32);
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(20, 51, 90, 0.1);
  color: #14335a;
  display: inline-flex;
  font-family: "Segoe UI Symbol", "Arial", sans-serif;
  font-size: 25px;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  line-height: 1;
  width: 52px;
}
.premium-icon-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 1;
}
.premium-icon-card:hover::after,
.home-overview-card:focus-visible::after {
  border-color: rgba(78, 205, 196, 0.62);
  box-shadow: 0 16px 30px rgba(20, 51, 90, 0.14);
}
.premium-icon-card.icon-cloud::after,
.premium-icon.icon-cloud::before { content: "☁"; }
.premium-icon-card.icon-shield::after,
.premium-icon.icon-shield::before { content: "✓"; }
.premium-icon-card.icon-people::after,
.premium-icon.icon-people::before { content: "●●"; font-size: 18px; letter-spacing: -4px; }
.premium-icon-card.icon-chart::after,
.premium-icon.icon-chart::before { content: "↗"; }
.premium-icon-card.icon-location::after,
.premium-icon.icon-location::before { content: "⌖"; }
.premium-icon-card.icon-weather::after,
.premium-icon.icon-weather::before { content: "☔"; }
.premium-icon-card.icon-horse::after,
.premium-icon.icon-horse::before { content: "♞"; }
.premium-icon-card.icon-task::after,
.premium-icon.icon-task::before { content: "☑"; }
.premium-icon-card.icon-check::after,
.premium-icon.icon-check::before { content: "✓"; }
.premium-icon-card.icon-clock::after,
.premium-icon.icon-clock::before { content: "◷"; }
.premium-icon-card.icon-feed::after,
.premium-icon.icon-feed::before { content: "◫"; }
.premium-icon-card.icon-calendar::after,
.premium-icon.icon-calendar::before { content: "▦"; }
.premium-icon-card.icon-account::after,
.premium-icon.icon-account::before { content: "◎"; }
.premium-icon-card.icon-settings::after,
.premium-icon.icon-settings::before { content: "⚙"; }
.premium-icon-card.icon-mobile::after,
.premium-icon.icon-mobile::before { content: "▯"; }
.premium-icon-card.icon-backup::after,
.premium-icon.icon-backup::before { content: "↻"; }
.premium-icon-card.icon-alert::after,
.premium-icon.icon-alert::before { content: "!"; }
.premium-icon-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 22px auto 8px;
}
.premium-icon-strip .premium-icon {
  height: 48px;
  width: 48px;
}
.home-overview-card {
  appearance: none;
  border-color: var(--line);
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  text-align: left;
  width: 100%;
}
.home-overview-card small {
  align-items: center;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 6px;
  margin-top: 14px;
}
.home-overview-card small::after {
  content: ">";
  font-size: 14px;
  line-height: 1;
}
.home-overview-card:hover,
.home-overview-card:focus-visible {
  border-color: rgba(78, 205, 196, 0.65);
  box-shadow: 0 16px 36px rgba(20, 51, 90, 0.13);
  transform: translateY(-1px);
}
.home-overview-card:focus-visible {
  outline: 3px solid rgba(78, 205, 196, 0.35);
  outline-offset: 3px;
}
.turnout-weather-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.07);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  min-width: 0;
  padding: 20px 22px;
}
.home-overview-grid .turnout-weather-card {
  grid-column: span 2;
  margin-bottom: 0;
  min-height: 120px;
}
.turnout-weather-card strong {
  color: #14335a;
  display: block;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  margin-top: 8px;
}
.turnout-weather-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}
.turnout-weather-card::before {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 950;
  height: 50px;
  justify-content: center;
  order: -1;
  width: 50px;
}
.turnout-weather-card--loading::before {
  background: #eef6fb;
  color: #45637f;
  content: "...";
}
.turnout-weather-card--ok {
  border-color: rgba(78, 205, 196, 0.42);
  background: linear-gradient(180deg, #ffffff 0%, #f3fcfb 100%);
}
.turnout-weather-card--ok::before {
  background: rgba(78, 205, 196, 0.18);
  color: #0e7d75;
  content: "OK";
  font-size: 14px;
}
.turnout-weather-card--rain {
  border-color: rgba(20, 51, 90, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}
.turnout-weather-card--rain::before {
  background: #e6eef8;
  color: #14335a;
  content: "!";
}
.turnout-weather-card--error {
  border-color: rgba(182, 59, 53, 0.22);
  background: #fffafa;
}
.turnout-weather-card--error::before {
  background: #fff0ee;
  color: var(--danger);
  content: "!";
}
.turnout-disclaimer {
  flex: 0 1 280px;
  font-size: 13px;
  text-align: right;
}
.alerts-panel {
  background: #ffffff;
  border: 1px solid rgba(78, 205, 196, 0.24);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(20, 51, 90, 0.07);
  display: grid;
  gap: 16px;
  margin: 18px 0;
  min-width: 0;
  padding: 20px;
}
.alerts-list {
  display: grid;
  gap: 14px;
}
.alerts-empty {
  margin: 0;
}
.alert-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.alert-group-heading {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
  gap: 10px;
}
.alert-severity-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  text-transform: uppercase;
}
.alert-severity-critical {
  background: #fff0ee;
  color: #9f2f2a;
}
.alert-severity-attention {
  background: #fff7dd;
  color: #8a5b00;
}
.alert-severity-info {
  background: #eef9fb;
  color: #116c75;
}
.alert-group-list {
  display: grid;
  gap: 10px;
}
.alert-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid #4ecdc4;
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 16px;
}
.alert-card-critical {
  background: #fffafa;
  border-color: rgba(182, 59, 53, 0.24);
  border-left-color: #d9534f;
}
.alert-card-attention {
  background: #fffdf7;
  border-color: rgba(224, 166, 39, 0.28);
  border-left-color: #d89a24;
}
.alert-card-info {
  background: #fbfefe;
  border-color: rgba(78, 205, 196, 0.26);
  border-left-color: #4ecdc4;
}
.alert-card h4 {
  color: #14335a;
  margin: 4px 0 5px;
}
.alert-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.alert-meta {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.alert-action {
  white-space: nowrap;
}
.home-quick-links {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.06);
  padding: 18px;
}
.home-quick-links .hero-actions {
  margin-top: 12px;
}
.home-process {
  margin-top: 34px;
}
.home-process .section-heading {
  border-bottom: 0;
  margin-bottom: 16px;
  padding-bottom: 0;
}
.home-process-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-step-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.06);
}
.home-step-card > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eaf9f7;
  color: var(--accent-strong);
  font-weight: 950;
}
.home-step-card h3 {
  margin-top: 16px;
}
.home-step-card p,
.home-daily-card p,
.home-contact-card p {
  color: var(--muted);
  line-height: 1.62;
}
.home-daily-card,
.home-contact-card {
  border-radius: 14px;
}
.social-links span,
.social-links a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfc;
  color: #14335a;
  font-weight: 900;
  padding: 0 14px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 17px;
  font-weight: 900;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled {
  cursor: not-allowed;
  transform: none;
  border-color: var(--line);
  background: #f4f7f8;
  color: var(--quiet);
  box-shadow: none;
}
.button:focus-visible, .nav-button:focus-visible, .tab-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(78, 205, 196, 0.75);
  outline-offset: 3px;
}
.primary {
  border-color: #39bcb3;
  background: #4ecdc4;
  color: #08322f;
  box-shadow: 0 12px 26px rgba(78, 205, 196, 0.24);
}
.primary:hover {
  border-color: #16948b;
  background: #61d8d0;
  box-shadow: 0 14px 30px rgba(78, 205, 196, 0.3);
}
.secondary { border-color: var(--line-strong); background: #ffffff; color: #14335a; }
.secondary:hover { border-color: rgba(78, 205, 196, 0.55); background: #f1fbfa; }
.ghost { min-height: 36px; border-color: var(--line); background: #ffffff; color: var(--muted); padding: 0 11px; }
.ghost:hover { border-color: rgba(78, 205, 196, 0.5); background: #f3fbfa; color: #14335a; }
.danger {
  border-color: rgba(182, 59, 53, 0.32);
  color: var(--danger);
  background: #fff7f6;
}
.disabled { pointer-events: none; border-color: var(--line); background: #f4f7f8; color: var(--quiet); box-shadow: none; }

.feature-grid, .summary-grid, .settings-grid, .home-lower, .quick-actions, .today-list, .calendar-tools {
  display: grid;
  gap: 14px;
}
.feature-grid {
  grid-template-columns: 1fr;
  align-content: center;
}
.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.settings-grid, .home-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }
.settings-hero {
  align-items: center;
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
  box-shadow: 0 16px 40px rgba(20, 51, 90, 0.08);
  padding: 24px;
}
.settings-hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 760px;
}
.settings-page {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}
.settings-section {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.settings-section-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.settings-section-header h3 {
  margin-bottom: 6px;
}
.settings-section-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.58;
  margin: 0;
  max-width: 780px;
}
.settings-card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-section .panel {
  border-radius: 14px;
}
.support-panel {
  display: grid;
  gap: 16px;
}
.support-contact-list {
  display: grid;
  gap: 8px;
}
.support-contact-list p {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.support-contact-list span {
  color: var(--muted);
  font-weight: 800;
}
.support-contact-list strong {
  color: #14335a;
}
.stable-location-panel {
  grid-column: 1 / -1;
}
.stable-location-panel .admin-user-form {
  margin-top: 12px;
}
.settings-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.06);
  overflow: hidden;
}
.settings-details summary {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 16px 18px;
  color: #14335a;
  cursor: pointer;
  font-weight: 950;
  list-style: none;
}
.settings-details summary::-webkit-details-marker { display: none; }
.settings-details summary::after {
  content: "+";
  position: absolute;
  justify-self: end;
  color: var(--accent-strong);
}
.settings-details[open] summary::after { content: "-"; }
.settings-details summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  padding-right: 28px;
}
.settings-details > .settings-card-grid,
.settings-details > .danger-zone {
  border-top: 1px solid var(--line);
  box-shadow: none;
  margin: 0;
  padding: 16px;
}
.settings-details > .danger-zone {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
.advanced-tools-section {
  border: 1px solid rgba(182, 59, 53, 0.18);
  border-radius: 14px;
  background: #fffafa;
  padding: 14px;
}
.danger-details {
  border-color: rgba(182, 59, 53, 0.25);
  box-shadow: 0 10px 28px rgba(182, 59, 53, 0.05);
}
.danger-details summary {
  background: #fffafa;
  color: var(--danger);
}
.admin-settings-section .admin-panel {
  width: 100%;
}
.privacy-panel {
  border-color: rgba(78, 205, 196, 0.24);
  background: #ffffff;
}
.privacy-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.58;
}
.privacy-list li::marker {
  color: var(--accent-strong);
}
.advanced-cloud-heading {
  grid-column: 1 / -1;
  background: #f3fbfa;
  border-color: rgba(78, 205, 196, 0.35);
}
.advanced-cloud-heading h3 {
  margin-bottom: 6px;
}
.admin-panel {
  border-color: rgba(20, 51, 90, 0.16);
  background: #ffffff;
}
.admin-user-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.admin-subsection {
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 10px;
  margin-top: 16px;
  padding: 16px;
  background: #f7fdfc;
}
.admin-subsection h4 {
  margin-bottom: 6px;
}
.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.checkbox-row input {
  min-height: 18px;
  width: 18px;
}
.permission-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 14px;
}
.permission-grid legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  padding: 0 6px;
}
.permission-grid label {
  align-items: center;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  min-width: 0;
}
.permission-grid input {
  min-height: 18px;
  width: 18px;
}
.calendar-tools {
  align-items: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}
.calendar-tools label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.stable-hero {
  align-items: center;
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
  box-shadow: 0 16px 40px rgba(20, 51, 90, 0.08);
  padding: 24px;
}
.stable-hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 760px;
}
.stable-hero-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: min(420px, 100%);
}
.stable-hero-actions .button {
  min-height: 44px;
  padding: 0 14px;
}
.stable-summary {
  margin-top: 24px;
}
.stable-summary .summary-card {
  min-height: 138px;
}
.stable-secondary-actions {
  display: none;
}
.calendar-hero {
  align-items: center;
  border: 1px solid rgba(78, 205, 196, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
  box-shadow: 0 16px 40px rgba(20, 51, 90, 0.08);
  padding: 24px;
}
.calendar-hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 760px;
}
.calendar-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.calendar-dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.85fr);
  margin: 24px 0;
}
.race-entry-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 24px 0 18px;
}
.race-control-dashboard {
  margin-bottom: 18px;
  border: 1px solid rgba(78, 205, 196, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfc 100%);
}
.race-control-summary {
  margin: 18px 0;
}
.race-control-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.race-control-actions button {
  min-height: 104px;
  cursor: pointer;
  text-align: left;
}
.race-control-actions button:focus-visible {
  outline: 3px solid rgba(78, 205, 196, 0.42);
  outline-offset: 3px;
}
.race-entry-panel,
.race-import-panel,
.race-entry-list-section {
  margin-bottom: 18px;
}
.race-entry-card {
  align-items: start;
}
.race-plan-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.race-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(78, 205, 196, 0.22);
  border-radius: 10px;
  background: #f8fbfc;
}
.race-plan-card strong {
  color: #14335a;
}
.race-plan-card p {
  margin: 4px 0 0;
  color: var(--muted);
}
.race-import-preview {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.manual-import-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 14px;
  background: #f8fbfc;
}
.manual-import-box textarea {
  min-height: 120px;
}
.import-diagnostics {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(78, 205, 196, 0.26);
  border-radius: 14px;
  background: #f7fcfc;
  color: #14335a;
}
.import-diagnostics h4 {
  margin: 0 0 10px;
  color: #08213d;
}
.import-diagnostics dl {
  display: grid;
  grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}
.import-diagnostics dt {
  font-weight: 800;
  color: #14335a;
}
.import-diagnostics dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.import-diagnostics pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(20, 51, 90, 0.1);
  white-space: pre-wrap;
}
.race-import-list {
  display: grid;
  gap: 14px;
}
.race-day-browser {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.race-day-sidebar,
.race-day-detail {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(20, 51, 90, 0.08);
}
.module-header.compact {
  margin-bottom: 12px;
}
.race-track-list,
.race-day-list {
  display: grid;
  gap: 10px;
}
.race-track-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 14px;
  background: #f8fbfc;
}
.race-track-group h4 {
  margin: 0;
  color: #14335a;
}
.race-day-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 12px;
  background: #ffffff;
  color: #14335a;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.race-day-button:hover,
.race-day-button:focus-visible,
.race-day-button.active {
  border-color: rgba(78, 205, 196, 0.65);
  box-shadow: 0 10px 24px rgba(20, 51, 90, 0.1);
  transform: translateY(-1px);
}
.race-day-button span {
  font-weight: 850;
}
.race-day-button small {
  color: var(--muted);
}
.race-day-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.inline-checkbox {
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 12px;
  background: #f8fbfc;
}
.horse-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.horse-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.12);
  color: #14335a;
  font-size: 13px;
  font-weight: 850;
}
.horse-chip.subtle {
  background: #eef4f7;
  border-color: rgba(20, 51, 90, 0.12);
}
.horse-chip.attention {
  background: #fff7e6;
  border-color: rgba(217, 137, 36, 0.28);
}
.eligibility-reasons {
  margin-top: 10px;
  color: var(--muted);
}
.eligibility-reasons summary {
  color: #14335a;
  cursor: pointer;
  font-weight: 850;
}
.eligibility-reasons p {
  margin: 6px 0 0;
}
.manual-check {
  align-items: center;
}
.muted-inline {
  color: var(--muted);
  font-size: 14px;
}
.race-program-management-heading,
.race-program-status-group {
  display: grid;
  gap: 10px;
}
.race-program-management-heading h4,
.race-program-status-group h4 {
  margin: 0;
  color: #14335a;
}
.race-program-management-heading p {
  margin: 0;
  color: var(--muted);
}
.race-program-status-group {
  margin-top: 14px;
}
.race-program-admin-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.race-import-card {
  padding: 14px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(20, 51, 90, 0.08);
}
.race-program-card {
  padding: 18px;
  border: 1px solid rgba(20, 51, 90, 0.1);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(20, 51, 90, 0.08);
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #14335a;
  font-weight: 800;
}
.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.compact-form {
  padding: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #f8fbfc;
  box-shadow: none;
}
.calendar-month-card, .selected-day-card, .calendar-list-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(20, 51, 90, 0.07);
  padding: 18px;
}
.calendar-card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.calendar-card-header h3, .selected-day-card h3 { margin: 0; }
.calendar-actions, .calendar-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calendar-actions .button, .calendar-view-toggle .button {
  min-height: 40px;
  padding: 0 12px;
}
.calendar-view-toggle { margin: 0 0 14px; }
.calendar-view-toggle .button.active {
  background: #14335a;
  border-color: #14335a;
  color: #ffffff;
}
.calendar-weekdays, .calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-weekdays {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
}
.calendar-month-grid { gap: 8px; }
.calendar-day {
  appearance: none;
  border: 1px solid #dfe9ee;
  border-radius: 10px;
  background: #fbfdfe;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 118px;
  min-width: 0;
  padding: 9px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}
.calendar-day:hover {
  border-color: rgba(78, 205, 196, 0.75);
  box-shadow: 0 10px 24px rgba(20, 51, 90, 0.08);
  transform: translateY(-1px);
}
.calendar-day.outside-month {
  background: #f4f7f9;
  color: #91a1ad;
}
.calendar-day.today {
  border-color: #4ecdc4;
  box-shadow: inset 0 0 0 1px rgba(78, 205, 196, 0.55);
}
.calendar-day.selected {
  background: #eefbf9;
  border-color: #14335a;
}
.calendar-day-number {
  align-items: center;
  display: inline-flex;
  font-weight: 950;
  height: 26px;
  justify-content: center;
  width: 26px;
}
.calendar-day.today .calendar-day-number {
  background: #14335a;
  border-radius: 999px;
  color: #ffffff;
}
.calendar-day-events {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.calendar-event-pill, .event-type-pill {
  border: 1px solid rgba(78, 205, 196, 0.34);
  border-radius: 999px;
  background: #e9faf8;
  color: #14335a;
  display: inline-block;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event-more {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.event-type-race { background: #eef4ff; border-color: #bcd0ff; color: #14335a; }
.event-type-training { background: #e9faf8; border-color: rgba(78, 205, 196, 0.45); color: #0b6964; }
.event-type-shoeing { background: #fff8e9; border-color: #f3d08b; color: #7b5200; }
.event-type-vaccination, .event-type-vet { background: #f2f7ff; border-color: #bfd7f7; color: #215684; }
.event-type-feeding { background: #eefbea; border-color: #b7e7a8; color: #2f6b23; }
.event-type-other { background: #f4f7f9; border-color: #d8e3ea; color: #51606b; }
.selected-day-card {
  align-self: start;
  display: grid;
  gap: 12px;
}
.selected-day-agenda {
  display: grid;
  gap: 10px;
}
.selected-event-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
}
.selected-event-card h4 {
  color: #14335a;
  margin: 8px 0 4px;
}
.selected-event-card p {
  color: var(--muted);
  margin: 0;
}
.quick-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 18px;
}
.quick-actions .button {
  min-height: 44px;
  padding: 0 12px;
}
.stable-today {
  border: 1px solid rgba(78, 205, 196, 0.34);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(20, 51, 90, 0.07);
  margin: 0 0 20px;
  padding: 20px;
}
.calendar-planner {
  border: 1px solid rgba(78, 205, 196, 0.34);
  border-radius: 8px;
  background: #f3fbfa;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.06);
  margin: 0 0 18px;
  padding: 18px;
}
.calendar-planner .module-header { margin-bottom: 12px; }
.shopping-panel {
  border: 1px solid rgba(78, 205, 196, 0.34);
  border-radius: 8px;
  background: #f3fbfa;
  margin: 0 0 18px;
  padding: 18px;
}
.shopping-panel .module-header { margin-bottom: 12px; }
.stable-today .module-header { margin-bottom: 12px; }
.today-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.today-card {
  border: 1px solid rgba(78, 205, 196, 0.24);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(20, 51, 90, 0.05);
  padding: 14px;
}
.today-card h4 {
  color: #14335a;
  margin: 0 0 8px;
}
.today-card p {
  color: var(--muted);
  margin: 7px 0 0;
}
.today-empty { margin: 0; }

.feature-card, .summary-card, .panel, .module-shell, .side-tabs, .module-panel, .item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.feature-card, .panel, .summary-card {
  position: relative;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.07);
}
.feature-card, .summary-card, .panel, .item-card, .module-shell, .side-tabs {
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.feature-card { min-height: 132px; }
.feature-card:hover, .summary-card:hover, .panel:hover, .item-card:hover {
  border-color: #bfdfe0;
  box-shadow: 0 12px 32px rgba(20, 51, 90, 0.1);
}
.feature-card::before, .summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: var(--accent);
}
.feature-card span, .summary-card span, .panel > span, .meta-label {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.feature-card h3 { margin-top: 16px; }
.summary-card strong { display: block; margin-top: 12px; font-size: 42px; line-height: 1; color: #14335a; }
.panel { background: var(--surface-strong); }
.panel strong { display: block; margin-bottom: 10px; font-size: 28px; color: #14335a; }
.install-list {
  color: var(--muted);
  display: grid;
  gap: 8px;
  line-height: 1.55;
  margin: 14px 0;
  padding-left: 18px;
}
.offline-status, .update-notice {
  border: 1px solid rgba(78, 205, 196, 0.35);
  border-radius: 8px;
  background: #f3fbfa;
  color: #14335a;
  font-weight: 750;
  margin-top: 12px;
  padding: 12px;
}
.offline-status[hidden], .update-notice[hidden] { display: none; }
.update-notice {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.update-notice .button {
  min-height: 38px;
  width: auto;
}
.social-links { flex-wrap: wrap; gap: 10px; }
.panel a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  font-weight: 850;
  padding: 0 12px;
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.social-links a:hover, .panel a:hover {
  border-color: rgba(78, 205, 196, 0.5);
  background: #f1fbfa;
  color: #14335a;
}
.social-links a {
  min-height: 42px;
  border-radius: 999px;
  background: #f8fbfc;
  color: #14335a;
  font-weight: 900;
}
.danger-panel {
  border-color: rgba(182, 59, 53, 0.25);
  background: #fffafa;
}
.about-panel {
  display: flex;
  gap: 14px;
  align-items: center;
}
.settings-emblem {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  font-size: 17px;
  background: #eefbf9;
  border-color: rgba(78, 205, 196, 0.36);
}

.section-heading, .module-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}
.section-heading {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin-bottom: 0; }
.module-header h3 { margin-bottom: 6px; }
.app-message { min-height: 26px; margin: 8px 0 18px; border-radius: 8px; font-weight: 750; color: var(--accent-strong); }
.app-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 18px; }
.side-tabs {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.07);
}
.tab-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
  padding: 0 12px;
  white-space: normal;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.tab-button:hover, .tab-button.active {
  border-color: rgba(78, 205, 196, 0.45);
  background: #eefbf9;
  color: #14335a;
}
.tab-button:hover { transform: translateX(2px); }
.module-shell {
  min-height: 640px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 51, 90, 0.07);
}
.module-panel { display: none; border: 0; background: transparent; padding: 24px; }
.module-panel.active { display: block; }

.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}
.entry-form label, .language-picker {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.entry-form label span, .language-picker span { line-height: 1.35; }
.entry-form .full, .entry-form button { grid-column: 1 / -1; }
.care-history-header {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.care-form {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}
.form-help {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.form-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 16px;
}
.form-group legend {
  color: #14335a;
  font-size: 14px;
  font-weight: 900;
  padding: 0 8px;
}
.form-group .full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 13px 12px;
  outline: none;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
select[multiple] { min-height: 116px; }
input:focus, select:focus, textarea:focus {
  border-color: #4ecdc4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.18);
}
input::placeholder, textarea::placeholder { color: #9aacb8; }
textarea { resize: vertical; }
.file-button input { display: none; }

.item-list { display: grid; gap: 12px; }
.item-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  background: #ffffff;
}
.item-card > div { min-width: 0; }
.item-card h4 { margin: 0 0 6px; font-size: 18px; color: #14335a; }
.item-card p { margin-bottom: 0; }
.premium-stable-card {
  border-color: rgba(20, 51, 90, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(20, 51, 90, 0.06);
}
.premium-stable-card::before {
  background: linear-gradient(180deg, #4ecdc4, #14335a);
  border-radius: 999px;
  content: "";
  height: calc(100% - 28px);
  left: 0;
  opacity: 0.75;
  position: absolute;
  top: 14px;
  width: 4px;
}
.horse-profile-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}
.horse-care-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(78, 205, 196, 0.24);
  border-radius: 10px;
  background: #f8fbfc;
}
.horse-care-preview h5 {
  margin: 0;
  color: #14335a;
  font-size: 14px;
}
.horse-care-preview p {
  margin: 0;
  color: var(--muted);
}
.care-history-list {
  margin-top: 12px;
}
.care-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}
.care-type-pill {
  border-color: rgba(78, 205, 196, 0.42);
  color: var(--accent-strong);
  background: #eefbf9;
}
.task-card.task-open {
  background: #ffffff;
}
.task-card.task-done {
  background: #f7fbfa;
  opacity: 0.86;
}
.work-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}
.calendar-card.past-event {
  background: #f8fbfc;
  opacity: 0.78;
}
.event-type-pill {
  border-color: rgba(78, 205, 196, 0.38);
  color: #14335a;
}
.event-type-pill.event-type-race, .calendar-event-pill.event-type-race { background: #eef4ff; border-color: #bcd0ff; color: #14335a; }
.event-type-pill.event-type-training, .calendar-event-pill.event-type-training { background: #e9faf8; border-color: rgba(78, 205, 196, 0.45); color: #0b6964; }
.event-type-pill.event-type-shoeing, .calendar-event-pill.event-type-shoeing { background: #fff8e9; border-color: #f3d08b; color: #7b5200; }
.event-type-pill.event-type-vaccination, .event-type-pill.event-type-vet, .calendar-event-pill.event-type-vaccination, .calendar-event-pill.event-type-vet { background: #f2f7ff; border-color: #bfd7f7; color: #215684; }
.event-type-pill.event-type-feeding, .calendar-event-pill.event-type-feeding { background: #eefbea; border-color: #b7e7a8; color: #2f6b23; }
.event-type-pill.event-type-other, .calendar-event-pill.event-type-other { background: #f4f7f9; border-color: #d8e3ea; color: #51606b; }
.feed-extra {
  grid-column: 1 / -1;
}
.shopping-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  padding: 12px;
}
.shopping-item p { margin: 4px 0 0; color: var(--muted); }
.horse-profile-card { align-items: start; }
.horse-profile-main {
  display: grid;
  gap: 12px;
}
.horse-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.horse-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.horse-details summary {
  color: #14335a;
  cursor: pointer;
  font-weight: 900;
  list-style-position: inside;
  min-height: 40px;
  padding: 8px 0;
  touch-action: manipulation;
}
.horse-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 8px;
}
.horse-detail-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 12px;
}
.horse-detail-group h5 {
  color: #14335a;
  font-size: 13px;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.horse-detail-group p {
  display: grid;
  gap: 3px;
  margin: 9px 0 0;
}
.horse-detail-group strong {
  color: var(--muted);
  font-size: 12px;
}
.horse-detail-group span {
  color: var(--text);
  overflow-wrap: anywhere;
}
.racing-performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.racing-profile-shell {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(78, 205, 196, 0.26);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
  box-shadow: 0 16px 38px rgba(14, 45, 77, 0.08);
  padding: 16px;
}
.racing-profile-shell.compact {
  margin-top: 14px;
  padding: 14px;
}
.racing-profile-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.racing-profile-header h4 {
  color: #14335a;
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
}
.racing-profile-header .eyebrow {
  margin: 0 0 4px;
}
.racing-profile-panels {
  padding-top: 0;
}
.racing-mini-card,
.racing-start-row {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(14, 45, 77, 0.06);
}
.racing-mini-card {
  display: grid;
  gap: 6px;
  padding: 12px;
}
.racing-stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.racing-stat-row span {
  display: grid;
  gap: 2px;
}
.racing-stat-row b {
  color: #14335a;
  font-size: 18px;
}
.racing-mini-card strong,
.racing-start-row strong {
  color: #14335a;
}
.racing-mini-card span,
.racing-start-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.racing-start-history {
  grid-column: 1 / -1;
  margin-top: 14px;
}
.racing-start-history h5 {
  color: #14335a;
  margin: 0 0 10px;
}
.racing-start-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
  box-shadow: 0 10px 24px rgba(14, 45, 77, 0.06);
}
.racing-start-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 13px;
}
.racing-start-table th,
.racing-start-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.racing-start-table th {
  position: sticky;
  top: 0;
  background: #f0fbfa;
  color: #14335a;
  font-size: 12px;
  text-transform: uppercase;
  z-index: 1;
}
.racing-start-table td {
  color: var(--text);
}
.racing-start-actions {
  min-width: 160px;
}
.racing-start-list {
  display: grid;
  gap: 10px;
}
.racing-start-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.racing-start-row p,
.racing-start-row a,
.racing-start-row .item-actions {
  grid-column: 1 / -1;
}
.subtle-name {
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 750;
}
.item-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  max-width: 100%;
}
.pill.good { border-color: rgba(78, 205, 196, 0.46); color: var(--accent-strong); background: #eefbf9; }
.pill.warn { border-color: rgba(178, 107, 0, 0.3); color: #8a5700; background: #fff8e8; }
.pill.critical { border-color: rgba(182, 59, 53, 0.34); color: var(--danger); background: #fff2f0; }
.pill.empty { border-color: rgba(182, 59, 53, 0.42); color: #8f221d; background: #ffe9e6; }
.feed-card { grid-template-columns: 1fr; }
.feed-main { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.feed-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.feed-stats div { border: 1px solid var(--line); border-radius: 8px; background: #f8fbfc; padding: 12px; }
.feed-stats strong { display: block; margin-top: 5px; font-size: 16px; color: #14335a; }
.detail-box,
.backup-preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--muted);
  line-height: 1.55;
  padding: 12px;
}
.detail-box strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 13px;
}
.calendar-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 18px;
}
.item-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
}
.item-actions .button {
  min-height: 42px;
  min-width: 74px;
}

.changelog { white-space: pre-wrap; }
.changelog a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 28px 0 42px;
  color: var(--quiet);
  font-size: 14px;
}
.site-footer a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}
.site-footer a:hover {
  color: #14335a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.action-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 18px;
}
.action-empty p { margin: 0; }

@media (max-width: 1024px) {
  .app-header, main, .site-footer { width: min(1180px, calc(100% - 32px)); }
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .brand { align-self: flex-start; }
  .top-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .auth-status {
    width: 100%;
    justify-content: space-between;
  }
  .nav-button {
    width: 100%;
    min-height: 44px;
    padding: 7px 10px;
  }
  .home-hero, .app-layout, .settings-grid, .home-lower { grid-template-columns: minmax(0, 1fr); }
  .settings-card-grid { grid-template-columns: minmax(0, 1fr); }
  .stable-hero { align-items: stretch; flex-direction: column; }
  .stable-hero-actions { min-width: 0; width: 100%; }
  .home-hero { min-height: 0; }
  .hero-copy { max-width: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-dashboard, .race-entry-layout, .race-control-actions { grid-template-columns: minmax(0, 1fr); }
  .race-day-browser,
  .race-day-filters { grid-template-columns: minmax(0, 1fr); }
  .race-program-admin-card { grid-template-columns: minmax(0, 1fr); }
  .calendar-card-header { align-items: stretch; flex-direction: column; }
  .calendar-tools { grid-template-columns: minmax(0, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-list { grid-template-columns: minmax(0, 1fr); }
  .side-tabs { position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tab-button { min-height: 48px; text-align: center; padding: 8px 10px; }
  .tab-button:hover { transform: translateY(-1px); }
  .module-shell { min-height: 0; }
}

@media (max-width: 768px) {
  .app-header, main, .site-footer { width: min(1180px, calc(100% - 24px)); }
  .app-header {
    position: sticky;
    top: 6px;
    margin-top: 6px;
    padding: 10px;
    gap: 10px;
  }
  .section-heading, .module-header, .site-footer { flex-direction: column; align-items: stretch; }
  .wide-nav { display: none; }
  .mobile-nav { display: block; width: 100%; }
  .mobile-nav-panel .nav-button {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    padding: 8px 12px;
  }
  .brand-emblem { width: 34px; height: 34px; border-radius: 8px; }
  .brand small { font-size: 11px; }
  .hero-copy { padding: 24px; }
  .home-brand-lockup {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .home-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 21px;
  }
  .home-brand-lockup h1 {
    font-size: clamp(34px, 11vw, 44px);
  }
  .home-description {
    font-size: 16px;
    line-height: 1.58;
  }
  .home-account-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .home-process-grid { grid-template-columns: minmax(0, 1fr); }
  .home-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .home-overview-grid .turnout-weather-card { grid-column: auto; }
  .turnout-weather-card {
    align-items: flex-start;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .turnout-weather-card::before { grid-row: span 2; }
  .turnout-disclaimer {
    grid-column: 2;
    text-align: left;
  }
  .alert-card {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }
  .alert-action {
    width: 100%;
  }
  .home-snapshot-card { padding: 18px; }
  h1 { max-width: 13ch; margin-bottom: 16px; font-size: clamp(32px, 8vw, 40px); line-height: 1.08; }
  h2 { font-size: clamp(27px, 8vw, 38px); }
  h3 { font-size: 20px; }
  .hero-text { max-width: 32ch; font-size: 17px; line-height: 1.58; }
  .nav-button { min-height: 46px; font-size: 13px; line-height: 1.2; }
  .view { padding-top: 28px; padding-bottom: 38px; }
  .onboarding-card { padding: 18px; }
  .onboarding-copy p { max-width: 30ch; }
  .button, .file-button { width: 100%; }
  .auth-status { display: grid; grid-template-columns: minmax(0, 1fr); }
  .auth-status span { max-width: 100%; text-align: center; }
  .auth-button { width: 100%; min-height: 46px; }
  .cloud-status-list p {
    display: grid;
    gap: 4px;
  }
  .cloud-status-list strong {
    text-align: left;
  }
  .button { min-height: 50px; padding: 0 14px; }
  .summary-grid, .feature-grid, .side-tabs, .entry-form, .item-card, .feed-stats, .quick-actions, .form-group, .horse-detail-grid, .calendar-tools, .permission-grid, .racing-performance-grid, .racing-start-row, .racing-stat-row { grid-template-columns: minmax(0, 1fr); }
  .import-diagnostics dl { grid-template-columns: minmax(0, 1fr); }
  .racing-profile-header { display: grid; }
  .calendar-hero { padding: 18px; }
  .stable-hero { padding: 18px; }
  .settings-hero { padding: 18px; }
  .stable-hero-actions { grid-template-columns: minmax(0, 1fr); }
  .calendar-actions, .calendar-view-toggle { display: grid; grid-template-columns: minmax(0, 1fr); }
  .calendar-month-card, .selected-day-card, .calendar-list-section { padding: 14px; }
  .calendar-month-grid { gap: 5px; }
  .calendar-day { min-height: 86px; padding: 6px; border-radius: 8px; }
  .calendar-event-pill { font-size: 10px; padding: 3px 5px; }
  .calendar-weekdays { font-size: 10px; }
  .summary-card strong { font-size: 36px; }
  .feature-card, .panel, .summary-card { padding: 18px; }
  .update-notice { align-items: stretch; display: grid; }
  .about-panel { align-items: flex-start; }
  .settings-emblem { width: 48px; height: 48px; }
  .module-panel { padding: 16px; }
  .stable-today { padding: 16px; }
  .calendar-planner { padding: 16px; }
  .shopping-panel { padding: 16px; }
  .entry-form { gap: 14px; margin: 18px 0 20px; padding: 16px; }
  .entry-form label, .language-picker { font-size: 14px; }
  .form-group { padding: 14px; }
  input, select, textarea { min-height: 48px; font-size: 16px; }
  textarea { min-height: 112px; }
  select[multiple] { min-height: 150px; }
  .shopping-item { grid-template-columns: minmax(0, 1fr); }
  .feed-main { flex-direction: column; }
  .feed-main .pill { align-self: flex-start; }
  .item-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .item-actions .button { min-height: 48px; width: 100%; }
  .ghost { min-height: 42px; }
  .social-links { display: grid; grid-template-columns: 1fr; }
  .social-links span, .social-links a { width: 100%; }
  .site-footer { padding-bottom: 32px; }
}

@media (max-width: 540px) {
  .app-header, main, .site-footer { width: min(1180px, calc(100% - 22px)); }
  .brand { gap: 10px; }
  .brand strong { font-size: 16px; }
  .nav-button { min-height: 48px; }
  .view { padding-top: 22px; }
  .home-hero { gap: 14px; }
  .hero-copy { padding: 20px 18px; }
  .home-brand-lockup { display: grid; }
  .home-brand-mark { width: 50px; height: 50px; }
  .home-snapshot-list span,
  .home-daily-list span {
    padding: 11px 11px 11px 34px;
  }
  h1 { max-width: 12ch; font-size: clamp(29px, 9vw, 36px); }
  h2 { font-size: clamp(25px, 8vw, 32px); }
  .hero-text, .panel p, .module-header p, .status-text, .app-message, .empty-state, .changelog, .item-card p {
    line-height: 1.56;
  }
  .hero-text { max-width: 29ch; font-size: 16px; }
  .hero-actions, .backup-actions { gap: 10px; margin-top: 20px; }
  .feature-card, .panel, .summary-card, .item-card { padding: 16px; }
  .section-heading { margin-bottom: 18px; padding-bottom: 16px; }
  .summary-grid, .home-lower, .settings-grid { gap: 12px; }
  .calendar-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stable-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-day { min-height: 72px; }
  .calendar-day-number { height: 22px; width: 22px; font-size: 12px; }
  .calendar-event-pill:nth-child(n+3), .calendar-event-more { display: none; }
  .side-tabs { gap: 7px; padding: 8px; }
  .tab-button { min-height: 46px; }
  .module-panel { padding: 12px; }
  .entry-form { padding: 14px; }
  .compact-form { grid-template-columns: minmax(0, 1fr); }
  .item-card { gap: 12px; }
  .race-plan-card { grid-template-columns: minmax(0, 1fr); }
  .pill { max-width: 100%; overflow-wrap: anywhere; }
}

@media (max-width: 390px) {
  .app-header, main, .site-footer { width: min(1180px, calc(100% - 18px)); }
  .app-header { padding: 8px; }
  .brand-emblem { width: 32px; height: 32px; }
  .brand small { display: none; }
  .hero-copy { padding: 18px 14px; }
  .home-brand-lockup h1 { font-size: clamp(30px, 10vw, 36px); }
  .home-snapshot-card { padding: 14px; }
  .settings-page { gap: 18px; }
  .settings-details summary { padding: 14px; }
  .settings-details > .settings-card-grid,
  .settings-details > .danger-zone { padding: 12px; }
  h1 { font-size: clamp(28px, 8.8vw, 33px); }
  h2 { font-size: clamp(24px, 8vw, 30px); }
  .feature-card, .panel, .summary-card, .item-card { padding: 14px; }
  .entry-form { padding: 12px; }
  .calendar-month-card, .selected-day-card, .calendar-list-section { padding: 12px; }
  .calendar-month-grid { gap: 4px; }
  .calendar-day { min-height: 64px; padding: 5px; }
  .calendar-event-pill { font-size: 0; height: 8px; padding: 0; width: 100%; }
}
