:root {
  --bg-top: #e8f0ea;
  --bg-bottom: #f7f3ea;
  --ink: #14231c;
  --ink-muted: #3d5348;
  --brand: #0f3d2e;
  --brand-soft: #1f6b4f;
  --accent: #c45c26;
  --surface: rgba(255, 252, 246, 0.88);
  --line: #c9d5cc;
  --danger: #8b1e1e;
  --ok: #1f6b4f;
  --focus: #0b57d0;
  --radius: 12px;
  --touch: 44px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.boot-msg {
  margin: 1.5rem 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d7e8dc 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e0c8 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

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

.offline-banner {
  background: #2b3a33;
  color: #f7f3ea;
  text-align: center;
  font-size: 0.95rem;
  padding: 0.35rem 0.75rem;
  min-height: 1.75rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(247, 243, 234, 0.72);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.3rem;
  background: linear-gradient(145deg, var(--brand), var(--brand-soft));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.hero-panel {
  padding: 1.5rem 0 0.5rem;
  animation: rise 420ms ease-out;
}

.hero-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  color: var(--brand);
}

.lede {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-family: var(--font-display);
  color: var(--brand);
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #9aaf9f;
  border-radius: 8px;
  min-height: var(--touch);
  padding: 0.55rem 0.75rem;
  width: 100%;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #f7f3ea;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-soft);
}

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border-color: #8eaa97;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: transparent;
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.muted {
  color: var(--ink-muted);
}

.error {
  color: var(--danger);
  margin: 0.5rem 0 0;
}

.ok {
  color: var(--ok);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.timeline li {
  border-left: 3px solid var(--brand-soft);
  padding: 0.35rem 0 0.35rem 0.85rem;
}

.photo-preview {
  width: min(100%, 360px);
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  margin-top: 0.75rem;
}

.storage-note {
  font-size: 0.95rem;
  color: var(--ink-muted);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.status-syncing {
  animation: pulse-soft 1.2s ease-in-out infinite;
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.75rem 0.85rem;
  }

  .brand-name {
    font-size: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel,
  .status-syncing {
    animation: none;
  }
}
