:root {
  --app-bg: #f1e8dc;
  --bg: #f7f3ec;
  --bg-2: #efe4d5;
  --surface: #ffffff;
  --surface-soft: #f1e8dc;
  --surface-warm: #fbf7f0;
  --text: #1f2520;
  --muted: #667066;
  --border: #e2d8ca;
  --brand: #6f4e37;
  --brand-dark: #3f2d22;
  --brand-soft: #eadccd;
  --green: #496b4f;
  --orange: #d97941;
  --orange-dark: #bd6230;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --success: #28794f;
  --shadow: 0 12px 34px rgba(55, 39, 26, 0.1);
  --shadow-soft: 0 6px 18px rgba(55, 39, 26, 0.07);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--app-bg);
  min-height: 100%;
  height: auto;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  position: relative;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 121, 65, 0.12), transparent 28rem),
    linear-gradient(180deg, #fbf7f0 0%, var(--app-bg) 45%, #efe4d5 100%);
  overscroll-behavior-y: auto;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

.site-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.8rem clamp(1rem, 3vw, 2rem);
  background: rgba(251, 247, 240, 0.86);
  border-bottom: 1px solid rgba(111, 78, 55, 0.12);
  backdrop-filter: blur(14px);
}

.site-navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
  background: var(--surface-soft);
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav-links a {
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
}

.site-nav-links a:hover {
  background: rgba(111, 78, 55, 0.08);
  color: var(--brand-dark);
}

.site-nav-links .nav-pill {
  background: var(--brand-dark);
  color: #fff;
}

.app-page {
  width: 100%;
  min-height: calc(100vh - 76px);
  height: auto;
  padding: clamp(0.75rem, 2vw, 1.35rem);
  overflow: visible;
}

.app-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  height: auto;
  overflow: visible;
}

.app-hero {
  margin: 0 auto 0.85rem;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(241, 232, 220, 0.78)),
    radial-gradient(circle at top right, rgba(217, 121, 65, 0.08), transparent 18rem);
  border: 1px solid rgba(111, 78, 55, 0.12);
  box-shadow: var(--shadow-soft);
}

.eyebrow,
.section-label {
  margin: 0 0 0.42rem;
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-hero h1,
.page-title {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(2rem, 5.6vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.app-hero p,
.page-subtitle {
  max-width: 680px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: clamp(0.94rem, 2vw, 1rem);
  line-height: 1.58;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.app-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(111, 78, 55, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(0.95rem, 2.6vw, 1.35rem);
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.card-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
  font-size: 1.12rem;
}

.card-title h2,
.card-title h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.12rem, 2.4vw, 1.38rem);
  letter-spacing: -0.03em;
}

.card-title p,
.muted {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.form-label,
.form-group label {
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 850;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="file"] {
  padding: 0.82rem 1rem;
}

textarea {
  min-height: 120px;
  padding-top: 0.9rem;
  resize: vertical;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(217, 121, 65, 0.16);
}

.form-help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.btn,
button.btn,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 50px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(217, 121, 65, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(217, 121, 65, 0.32);
  filter: brightness(1.02);
}

.btn-secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: none;
}

.btn-dark {
  background: var(--brand-dark);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-full {
  width: 100%;
}

.checkout-inline-error {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(207, 103, 77, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(207, 103, 77, 0.08);
  color: var(--orange-dark);
  font-size: 0.9rem;
  line-height: 1.45;
}

.btn-small {
  min-height: 40px;
  padding: 0 0.9rem;
  font-size: 0.88rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.flash-messages,
.flashes,
.messages {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 1rem;
  padding: 0;
  list-style: none;
}

.alert,
.flash,
.flash-message {
  --flash-accent: #cf674d;
  --flash-bg: rgba(255, 250, 244, 0.96);
  --flash-border: rgba(207, 103, 77, 0.26);
  --flash-icon-bg: rgba(207, 103, 77, 0.11);

  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  margin: 0 0 0.9rem;
  padding: 1rem 1.05rem 1rem 1.2rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 14rem),
    var(--flash-bg);
  border: 1px solid var(--flash-border);
  color: var(--brand-dark);
  box-shadow: 0 12px 30px rgba(55, 39, 26, 0.08);
  overflow: hidden;
  transition: opacity 260ms ease, transform 260ms ease, margin 260ms ease, padding 260ms ease, max-height 260ms ease;
  max-height: 220px;
}

.flash__accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--flash-accent);
}

.flash__icon {
  position: relative;
  z-index: 1;
  width: 3.2rem;
  height: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3.2rem;
  border-radius: 18px;
  background: var(--flash-icon-bg);
  color: var(--flash-accent);
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.flash__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.flash__title {
  display: block;
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.flash__message {
  display: block;
  color: var(--brand-dark);
  font-size: 0.95rem;
  line-height: 1.35;
}

.flash--success {
  --flash-accent: var(--success);
  --flash-bg: rgba(247, 253, 249, 0.96);
  --flash-border: rgba(40, 121, 79, 0.24);
  --flash-icon-bg: rgba(40, 121, 79, 0.1);
}

.flash--error,
.flash--danger {
  --flash-accent: #cf674d;
  --flash-bg: rgba(255, 248, 244, 0.96);
  --flash-border: rgba(207, 103, 77, 0.28);
  --flash-icon-bg: rgba(207, 103, 77, 0.11);
}

.flash--warning {
  --flash-accent: #c98a38;
  --flash-bg: rgba(255, 250, 240, 0.96);
  --flash-border: rgba(201, 138, 56, 0.26);
  --flash-icon-bg: rgba(201, 138, 56, 0.12);
}

.flash--info {
  --flash-accent: #6f4e37;
  --flash-bg: rgba(251, 247, 240, 0.96);
  --flash-border: rgba(111, 78, 55, 0.2);
  --flash-icon-bg: rgba(111, 78, 55, 0.1);
}

.alert.is-hiding,
.flash.is-hiding,
.flash-message.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

@media (max-width: 520px) {
  .flash-messages,
  .flashes,
  .messages {
    margin-bottom: 0.85rem;
  }

  .flash,
  .alert,
  .flash-message {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.9rem 0.95rem 0.9rem 1.05rem;
    border-radius: 18px;
  }

  .flash__icon {
    width: 2.75rem;
    height: 2.75rem;
    flex-basis: 2.75rem;
    border-radius: 15px;
    font-size: 1.55rem;
  }

  .flash__title {
    font-size: 0.95rem;
  }

  .flash__message {
    font-size: 0.9rem;
  }
}

.mobile-app-nav {
  display: none;
}

.pwa-mode .site-navbar {
  display: none;
}

.pwa-mode body {
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}

.pwa-mode .mobile-app-nav {
  position: fixed !important;
  left: 14px;
  right: 14px;
  top: auto !important;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 2147483000;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.45rem;
  background: rgba(15, 15, 14, .96);
  border: 1px solid rgba(244, 238, 228, .11);
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .48);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  isolation: isolate;
}

.pwa-mode .mobile-app-nav a {
  min-width: 0;
  padding: 0.55rem 0.3rem 0.45rem;
  border-radius: 20px;
  text-decoration: none;
  color: #8f857b;
  font-weight: 850;
  text-align: center;
  line-height: 1.05;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pwa-mode .mobile-app-nav a:hover {
  color: #f4eee4;
  background: rgba(255, 255, 255, .055);
}

.pwa-mode .mobile-app-nav a:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, .055);
}

.pwa-mode .mobile-app-nav a:focus-visible {
  outline: 2px solid rgba(228, 122, 53, .55);
  outline-offset: 2px;
}

.pwa-mode .mobile-app-nav a.active {
  color: #fff9f2;
  background: linear-gradient(145deg, #3b2115, #2a1710);
  box-shadow: inset 0 0 0 1px rgba(240, 122, 45, .20), 0 8px 20px rgba(0, 0, 0, .24);
}

.pwa-mode .mobile-app-nav svg {
  width: 21px;
  height: 21px;
  display: block;
  margin: 0 auto 0.2rem;
  fill: currentColor;
}

.pwa-mode .mobile-app-nav svg.nav-horse-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pwa-mode .mobile-app-nav svg.nav-analytics-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pwa-mode .mobile-app-nav svg.nav-horse-icon path {
  fill: none;
}

.pwa-mode .mobile-app-nav svg.nav-horse-icon circle {
  fill: currentColor;
  stroke: none;
}

.pwa-mode .mobile-app-nav span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.64rem;
  letter-spacing: -0.01em;
}

@media (max-width: 860px) {
  .site-navbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
  }

  .site-nav-links a {
    white-space: nowrap;
  }

  .app-page {
    padding: 0.75rem;
  }

  .app-hero {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

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

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

  .button-row {
    flex-direction: column;
  }

  .button-row .btn,
  .button-row form {
    width: 100%;
  }
}


@media (max-width: 520px) {
  .app-page {
    padding: 0.75rem;
  }

  .app-card {
    padding: 0.95rem;
  }

  .app-hero {
    padding: 1rem;
  }

  .app-hero h1,
  .page-title {
    font-size: clamp(2rem, 10vw, 2.55rem);
  }

  .card-header-row {
    gap: 0.65rem;
  }

  .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}

/* Subtle app install guide */
.get-app-footer {
  margin-top: 0.85rem;
  padding-bottom: 0.25rem;
}

.get-app-card {
  width: 100%;
  border: 1px solid rgba(111, 78, 55, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft);
  padding: 0.78rem 0.85rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.78rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.get-app-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(217, 121, 65, 0.25);
}

.get-app-card:active {
  transform: scale(0.99);
}

.get-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(55, 39, 26, 0.14);
  background: var(--surface-soft);
  flex: 0 0 auto;
}

.get-app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.get-app-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.get-app-label {
  color: var(--orange-dark);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.get-app-copy strong {
  color: var(--brand-dark);
  font-size: 0.95rem;
  line-height: 1.18;
}

.get-app-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.get-app-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  font-weight: 900;
}

body.modal-open {
  overflow: hidden;
  height: 100vh;
}

html:has(body.modal-open) {
  overflow: hidden;
}

.app-guide-modal[hidden] {
  display: none;
}

.app-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: end center;
  padding: 1rem;
}

.app-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 37, 32, 0.42);
  backdrop-filter: blur(8px);
}

.app-guide-sheet {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(217, 121, 65, 0.12), transparent 18rem),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(111, 78, 55, 0.14);
  box-shadow: 0 28px 80px rgba(31, 37, 32, 0.26);
  padding: 1.2rem;
}

.app-guide-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-dark);
  font-size: 1.55rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-guide-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.35rem 2.2rem 1rem 0.1rem;
}

.app-guide-header img {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  box-shadow: 0 10px 22px rgba(55, 39, 26, 0.16);
}

.app-guide-header h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.app-guide-header p:not(.section-label) {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.app-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.app-guide-platform {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.platform-pill {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 0.65rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--orange-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-guide-platform h3 {
  margin: 0 0 0.55rem;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.app-guide-platform ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.app-guide-platform li + li {
  margin-top: 0.35rem;
}

.app-guide-platform strong {
  color: var(--brand-dark);
}

@media (max-width: 640px) {
  .get-app-card {
    padding: 0.72rem;
    gap: 0.65rem;
  }

  .get-app-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .get-app-copy strong {
    font-size: 0.88rem;
  }

  .get-app-copy small {
    font-size: 0.73rem;
  }

  .get-app-arrow {
    width: 28px;
    height: 28px;
  }

  .app-guide-modal {
    padding: 0.75rem;
    align-items: end;
  }

  .app-guide-sheet {
    border-radius: 28px 28px 22px 22px;
    padding: 1rem;
  }

  .app-guide-header {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding-right: 2.2rem;
  }

  .app-guide-header img {
    width: 52px;
    height: 52px;
  }

  .app-guide-grid {
    grid-template-columns: 1fr;
  }
}


/* Offline fallback */
.offline-page {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.offline-card {
  width: min(100%, 480px);
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid rgba(111, 78, 55, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 232, 220, 0.82)),
    radial-gradient(circle at top right, rgba(217, 121, 65, 0.1), transparent 15rem);
  box-shadow: var(--shadow);
  text-align: left;
}

.offline-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--orange-dark);
  font-size: 1.7rem;
  box-shadow: var(--shadow-soft);
}

.offline-card h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.offline-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.offline-button {
  width: 100%;
  margin-top: 1.25rem;
  border: 0;
  border-radius: 16px;
  background: var(--orange);
  color: #fff;
  padding: 0.95rem 1.1rem;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(217, 121, 65, 0.22);
}

.offline-button:active {
  transform: translateY(1px);
}

.offline-card .offline-note {
  color: rgba(102, 112, 102, 0.86);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .offline-page {
    min-height: 100dvh;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(6.25rem + env(safe-area-inset-bottom));
  }

  .offline-card {
    border-radius: 24px;
  }
}

/* Security hardening: state-changing navigation actions are POST forms. */
.nav-inline-form {
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
}

.site-nav-links .nav-link-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.6rem 0.85rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

.site-nav-links .nav-link-button:hover,
.site-nav-links .nav-link-button:focus-visible {
  background: rgba(111, 78, 55, 0.08);
  color: var(--brand-dark);
}

.site-nav-links .nav-link-button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}


.site-footer {
  width: 100%;
  padding: 1.5rem 1rem 6rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(111, 78, 55, 0.12);
}

.site-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer-attribution {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 650;
  opacity: .82;
}

.site-footer-attribution:hover,
.site-footer-attribution:focus-visible {
  color: var(--brand-dark);
  text-decoration: none;
  opacity: 1;
}

.site-footer-attribution img {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  display: block;
  opacity: .82;
}

@media (max-width: 720px) {
  .site-footer-attribution {
    justify-content: flex-start;
  }
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .site-footer {
    padding-bottom: 7rem;
  }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Final dark PWA shell + install-guide pass.
   Keep the installed app canvas and bottom navigation dark even on public/auth pages
   where the app-theme stylesheet is intentionally not loaded. */
html.pwa-mode,
html.pwa-mode body {
  background: #0a0a09 !important;
  color: #f4eee4;
}

html.pwa-mode body::before {
  background:
    radial-gradient(ellipse 90% 45% at 82% 5%, rgba(125, 52, 21, .22), transparent 62%),
    linear-gradient(180deg, #0a0a09 0%, #120806 48%, #0a0a09 100%) !important;
}

/* The install guide is intentionally dark everywhere so public mobile pages
   match the authenticated desktop/app experience. */
.app-guide-backdrop {
  background: rgba(0, 0, 0, .72) !important;
}

.app-guide-sheet {
  background:
    radial-gradient(circle at top left, rgba(240, 122, 45, .10), transparent 18rem),
    #151412 !important;
  border-color: rgba(244, 238, 228, .12) !important;
  color: #e9e1d7 !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55) !important;
}

.app-guide-close {
  background: rgba(255, 255, 255, .05) !important;
  color: #f4eee4 !important;
  border-color: rgba(244, 238, 228, .12) !important;
}

.app-guide-header h2,
.app-guide-platform h3,
.app-guide-platform strong {
  color: #f4eee4 !important;
}

.app-guide-header p:not(.section-label),
.app-guide-platform ol {
  color: #b9aaa0 !important;
}

.app-guide-platform {
  background: #211914 !important;
  border-color: rgba(255, 218, 190, .12) !important;
}

.platform-pill {
  background: rgba(240, 122, 45, .10) !important;
  color: #ff9845 !important;
}
/* Unified PWA top safe-area spacing. Every installed-PWA page gets identical clearance below the iOS status bar. */
html.pwa-mode body .app-page,
html.pwa-mode body .dashboard-page {
  padding-top: max(3.5rem, calc(0.75rem + env(safe-area-inset-top))) !important;
}

html.pwa-mode body .offline-page {
  padding-top: max(1rem, calc(0.75rem + env(safe-area-inset-top))) !important;
}


