/* iPhone-first. One column, big taps, no framework. */

:root {
  --wine:      #7b1e3c;
  --wine-deep: #3b1220;
  --bg:        #fbf7f4;
  --card:      #ffffff;
  --ink:       #241a1d;
  --muted:     #7d6f73;
  --line:      #e7ddd9;
  --ok:        #1f6b45;
  --warn:      #8a4b12;
  --err:       #a01f28;
  --tap:       48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wine:      #c76185;
    --wine-deep: #1a0d12;
    --bg:        #171013;
    --card:      #221619;
    --ink:       #f3e9ea;
    --muted:     #a9989d;
    --line:      #3a2a2f;
    --ok:        #6fd39d;
    --warn:      #e0a463;
    --err:       #ef8b93;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ---- top bar ---- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 4px;
  background: var(--wine-deep);
  color: #fff;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
}
.bar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-back {
  color: #fff;
  text-decoration: none;
  font-size: 30px;
  line-height: 1;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}
.bar-who {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  background: rgba(255, 255, 255, .16);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

main { padding: 14px 14px 20px; max-width: 720px; margin: 0 auto; }

/* ---- bottom tabs ---- */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 7px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}
.tabs a span { font-size: 21px; line-height: 1; }
.tabs a.on { color: var(--wine); font-weight: 600; }

/* ---- cards / list ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 0 0 12px;
}
.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li { margin-bottom: 10px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  min-height: var(--tap);
}
.row:active { background: var(--bg); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.row-side { text-align: right; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.row-chev { color: var(--muted); font-size: 22px; }
.thumb {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  flex: none;
}

.group-head {
  margin: 18px 2px 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.group-head:first-child { margin-top: 2px; }

.chip {
  display: inline-block;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  margin: 0 6px 6px 0;
}

/* ---- forms ---- */
label { display: block; margin: 12px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%;
  font-size: 17px; /* 17px+ stops iOS zoom-on-focus */
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  margin-top: 5px;
  min-height: var(--tap);
  -webkit-appearance: none;
  appearance: none;
}
select { background-image: none; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--wine); outline-offset: 1px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  margin-top: 16px;
  padding: 13px 16px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--wine);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button:active, .btn:active { filter: brightness(.92); }
.btn-2 { background: var(--card); color: var(--wine); border-color: var(--line); }
.btn-danger { background: var(--card); color: var(--err); border-color: var(--line); }
button:disabled { opacity: .5; }

.seg { display: flex; gap: 8px; margin-top: 6px; }
.seg label {
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 12px 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span,
.seg label:has(input:checked) { background: var(--wine); color: #fff; border-color: var(--wine); }

.stars-pick { display: flex; gap: 6px; margin-top: 6px; }
.stars-pick label {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 24px;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stars-pick label:has(input:checked) { background: var(--wine); border-color: var(--wine); color: #fff; }

/* ---- misc ---- */
.flash { padding: 11px 13px; border-radius: 11px; margin: 0 0 14px; font-size: 15px; }
.flash.ok   { background: rgba(31, 107, 69, .12);  color: var(--ok); }
.flash.warn { background: rgba(138, 75, 18, .12);  color: var(--warn); }
.flash.err  { background: rgba(160, 31, 40, .12);  color: var(--err); }

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; }
.empty-big { font-size: 44px; display: block; margin-bottom: 10px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.stack-tight > * + * { margin-top: 8px; }
h2 { font-size: 17px; margin: 0 0 8px; }
a { color: var(--wine); }
.hero-photo { width: 100%; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 14px; }

/* The camera input is driven by its <label>, which can be styled as a button. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
