:root {
  --bg: #120d08;
  --bg-soft: #1f160f;
  --leaf: #c88b45;
  --leaf-2: #f0c17d;
  --cream: #fff7ea;
  --paper: #fbf3e6;
  --ink: #24170e;
  --muted: #896f57;
  --line: rgba(36, 23, 14, .13);
  --smoke: rgba(255, 247, 234, .72);
  --danger: #8d2b1f;
  --shadow: 0 26px 90px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, rgba(200,139,69,.28), transparent 34%), var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.app-shell { max-width: 1180px; margin: 0 auto; }

.hero {
  color: var(--cream);
  padding: max(18px, env(safe-area-inset-top)) 18px 34px;
  min-height: 620px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 70px -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(240,193,125,.24), transparent 62%);
  pointer-events: none;
}
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}
.brand-mark, .nav-link {
  color: var(--cream);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .02em;
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.ember-dot {
  width: 16px; height: 16px; display: inline-block;
  background: radial-gradient(circle at 30% 30%, #fff, var(--leaf-2) 30%, #9a4f20 72%);
  box-shadow: 0 0 30px rgba(240,193,125,.85);
}
.nav-link { border-bottom: 1px solid rgba(255,255,255,.65); padding-bottom: 4px; }
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .8fr;
  gap: 44px;
  align-items: center;
  padding: 44px 0 20px;
}
.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 900;
  color: var(--leaf-2);
}
.eyebrow.dark { color: #9a5d26; }
h1 {
  max-width: 690px;
  margin: 0;
  text-transform: uppercase;
  font-size: clamp(48px, 9vw, 92px);
  line-height: .94;
  font-weight: 300;
  letter-spacing: -.055em;
}
.hero-text {
  max-width: 580px;
  color: var(--smoke);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.35;
  margin: 24px 0 0;
}
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .ghost-button, .export-actions button, .delete-entry, .edit-entry, .close-form {
  border: 0;
  text-decoration: none;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.primary-button:hover, .ghost-button:hover, .export-actions button:hover, .delete-entry:hover, .edit-entry:hover, .close-form:hover { transform: translateY(-1px); }
.primary-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 22px;
  background: var(--leaf-2); color: #1d1109;
  font-weight: 900;
}
.ghost-button {
  min-height: 50px; padding: 0 18px;
  color: var(--cream); background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  font-weight: 800;
}
.install-help {
  max-width: 620px;
  margin: 14px 0 0;
  padding: 13px 15px;
  color: var(--cream);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.2);
  line-height: 1.45;
}
.phone-card {
  justify-self: center;
  width: min(360px, 100%);
  padding: 18px;
  background: linear-gradient(145deg, #23170e, #0b0806);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
}
.phone-notch { width: 88px; height: 6px; background: rgba(255,255,255,.35); margin: 0 auto 22px; }
.preview-card {
  background: linear-gradient(160deg, rgba(255,247,234,.98), rgba(230,196,143,.92));
  color: var(--ink);
  padding: 26px;
  min-height: 260px;
}
.tag {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(36,23,14,.12);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.preview-card h2 { font-size: 35px; line-height: 1; margin: 24px 0 12px; }
.preview-card p { color: #5f4129; line-height: 1.4; }
.rating-row { display: flex; justify-content: space-between; align-items: end; margin-top: 42px; }
.rating-row span { font-size: 54px; font-weight: 300; }
.rating-row small { font-weight: 900; color: #704418; text-transform: uppercase; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.14); margin-top: 12px; }
.mini-grid div { background: #120d08; padding: 16px; }
.mini-grid strong, .mini-grid span { display: block; }
.mini-grid span { color: rgba(255,247,234,.58); font-size: 12px; margin-top: 5px; }

.landing-section,
.beta-section {
  margin: 18px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.42);
}
.landing-heading {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) 1.1fr;
  gap: 24px;
  align-items: end;
}
.landing-heading > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.feature-grid article {
  min-height: 190px;
  padding: 18px;
  background: rgba(255,255,255,.56);
}
.feature-grid strong,
.feature-grid span { display: block; }
.feature-grid strong {
  font-size: 18px;
  line-height: 1.05;
  margin-bottom: 12px;
}
.feature-grid span {
  color: var(--muted);
  line-height: 1.42;
}
.beta-section {
  display: grid;
  grid-template-columns: .86fr 1.14fr;
  gap: 24px;
  align-items: start;
  color: var(--cream);
  background: linear-gradient(145deg, #21140b, #120d08);
  border-color: rgba(255,255,255,.12);
}
.beta-section h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: .96;
  letter-spacing: -.055em;
}
.beta-section p:not(.eyebrow):not(.helper-text) {
  color: var(--smoke);
  font-size: 18px;
  line-height: 1.45;
}
.beta-form {
  padding: 18px;
  background: var(--paper);
  color: var(--ink);
}
.beta-actions { margin-top: 16px; }

.stats-panel {
  margin: 18px 18px 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--cream);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 22px 60px rgba(0,0,0,.22);
}
.stats-panel article { padding: 22px; border-right: 1px solid var(--line); }
.stats-panel article:last-child { border-right: 0; }
.stats-panel span { display: block; font-size: clamp(28px, 5vw, 45px); font-weight: 300; line-height: 1; }
.stats-panel small { color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, .86fr) 1.14fr;
  gap: 18px;
  padding: 18px;
  align-items: start;
}
.workspace.form-collapsed { grid-template-columns: 1fr; }
.workspace.form-collapsed .log-form { display: none; }
.log-form, .journal-panel {
  background: var(--paper);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255,255,255,.42);
}
.log-form {
  position: sticky;
  top: 12px;
}
.section-heading h2 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.04em;
}
.form-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.close-form {
  width: 38px;
  height: 38px;
  background: rgba(36, 23, 14, .08);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  font-weight: 300;
}
.field-grid, .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 900; color: #4b2e1a; }
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(36, 23, 14, .16);
  background: rgba(255,255,255,.68);
  color: var(--ink);
  min-height: 46px;
  padding: 11px 12px;
  outline-color: var(--leaf);
}
textarea { min-height: 92px; resize: vertical; }
input[type="range"] { padding-left: 0; padding-right: 0; background: transparent; border: 0; }
output { font-size: 14px; color: var(--muted); font-weight: 900; }
.photo-picker {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.helper-text {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.photo-preview {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(36, 23, 14, .12);
}
.photo-preview img {
  width: 108px;
  height: 108px;
  object-fit: cover;
  background: rgba(36,23,14,.08);
}
.photo-preview strong,
.photo-preview span { display: block; }
.photo-preview span {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.photo-preview button {
  min-height: 36px;
  margin-top: 0;
}
.flavor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 16px;
}
.flavor-chips button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(36, 23, 14, .13);
  background: rgba(200,139,69,.14);
  color: #704418;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.flavor-chips button.is-selected {
  background: #21140b;
  color: var(--cream);
}
.check-row, .compact-check { display: flex; grid-template-columns: unset; align-items: center; gap: 10px; margin-top: 14px; }
.check-row input, .compact-check input { width: auto; min-height: auto; }
.dark-button { background: #21140b; color: var(--cream); }
.dark-ghost { color: #21140b; border-color: rgba(36,23,14,.18); background: rgba(255,255,255,.6); }
.journal-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.journal-subtext {
  max-width: 540px;
  margin: -8px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.export-actions button {
  min-height: 38px; padding: 0 12px;
  background: #21140b; color: var(--cream); font-weight: 900;
}
#openFormBtn { background: var(--leaf); color: #1d1109; }
.import-status {
  min-height: 20px;
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.buy-again-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(200,139,69,.22), rgba(255,255,255,.55));
  border: 1px solid rgba(200,139,69,.28);
}
.buy-again-panel strong {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.buy-again-panel span { color: var(--muted); font-weight: 800; }
.filters { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: center; margin-bottom: 18px; }
.view-toggle {
  display: inline-flex;
  min-height: 46px;
  padding: 4px;
  background: rgba(36,23,14,.07);
  border: 1px solid rgba(36,23,14,.12);
}
.view-toggle button {
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: #704418;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.view-toggle button.is-active {
  background: #21140b;
  color: var(--cream);
}
.entries { display: grid; gap: 12px; }
.empty-state { padding: 28px; border: 1px dashed rgba(36,23,14,.24); color: var(--muted); background: rgba(255,255,255,.38); }
.entry-card { background: rgba(255,255,255,.72); border: 1px solid var(--line); padding: 18px; }
.entry-card.rebuy-card { border-color: rgba(200,139,69,.5); box-shadow: inset 4px 0 0 var(--leaf); }
.entry-photo {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  margin: 8px 0 12px;
  background: rgba(36,23,14,.08);
}
.entry-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.entry-actions { display: flex; align-items: center; gap: 8px; }
.edit-entry { min-height: 30px; padding: 0 10px; background: rgba(200,139,69,.18); color: #704418; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.delete-entry { width: 30px; height: 30px; background: rgba(141,43,31,.09); color: var(--danger); font-size: 22px; line-height: 1; }
.entry-card h3 { margin: 10px 0 4px; font-size: 28px; line-height: 1.05; }
.entry-meta { margin: 0 0 12px; color: var(--muted); }
.entry-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; background: rgba(200,139,69,.16); color: #6f431e; font-size: 12px; font-weight: 900; }
.entry-notes { line-height: 1.48; margin: 0 0 12px; }
.pros-cons { display: grid; gap: 5px; color: #57402e; }
.pros-cons p { margin: 0; }

@media (max-width: 880px) {
  .hero { min-height: auto; }
  .hero-grid, .workspace, .landing-heading, .beta-section { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .phone-card { justify-self: stretch; }
  .stats-panel { grid-template-columns: 1fr 1fr; }
  .stats-panel article:nth-child(2) { border-right: 0; }
  .stats-panel article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-top: 8px; }
  .topbar { align-items: start; flex-direction: column; gap: 14px; }
  .nav-links { flex-wrap: wrap; gap: 12px; }
  h1 { font-size: clamp(42px, 15vw, 62px); }
  .stats-panel { margin-left: 14px; margin-right: 14px; }
  .landing-section, .beta-section { margin-left: 14px; margin-right: 14px; }
  .feature-grid { grid-template-columns: 1fr; }
  .field-grid, .two-col { grid-template-columns: 1fr; }
  .workspace { padding: 14px; }
  .journal-heading { flex-direction: column; }
  .photo-preview { grid-template-columns: 84px 1fr; }
  .photo-preview img { width: 84px; height: 84px; }
  .buy-again-panel { align-items: start; flex-direction: column; }
  .view-toggle { width: 100%; }
  .view-toggle button { flex: 1; }
}
