/* GearRoper: one stylesheet, no build step. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f2a24;
  --muted: #5f6b64;
  --line: #e2ded4;
  --forest: #2f5d46;
  --forest-dark: #234635;
  --forest-tint: #e6efe9;
  --sand: #f1e9d8;
  --rust: #b4532a;
  --rust-tint: #f8e7de;
  --amber: #a86d00;
  --amber-tint: #fbf0d6;
  --sky: #2d6a8f;
  --sky-tint: #e3eef5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 2px 8px rgba(31, 42, 36, .05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--forest); }
a:hover { color: var(--forest-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
.topbar { background: var(--forest-dark); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 1.25rem; padding-top: .7rem; padding-bottom: .7rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.brand span { color: #b9d8c4; font-weight: 600; }
.topbar nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.topbar nav a, .topbar .user a, .topbar .user button { color: #dbe9e0; text-decoration: none; font-size: .95rem; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; }
.topbar .user { display: flex; gap: .9rem; align-items: center; font-size: .9rem; color: #b9d8c4; }
.topbar .user form { margin: 0; }
.topbar .user button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 1.5rem; padding-bottom: 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: var(--forest-tint); border: 1px solid #c8dccf; }
.messages li.error { background: var(--rust-tint); border-color: #eac3b1; }
.messages li.warning { background: var(--amber-tint); border-color: #ecd59c; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--forest);
  background: var(--forest); color: #fff; font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--forest-dark); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--forest); }
.btn.secondary:hover { background: var(--forest-tint); color: var(--forest-dark); }
.btn.danger { background: var(--surface); color: var(--rust); border-color: #e3b8a4; }
.btn.danger:hover { background: var(--rust-tint); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.link { background: none; border: 0; color: var(--forest); padding: 0; font-weight: 500; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .25rem; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid #cfcabd; border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3ad; outline-offset: 0; border-color: var(--forest); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--forest); vertical-align: middle; }
input[type=range] { width: 100%; accent-color: var(--forest); }
.field { margin-bottom: 1rem; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.field .errors { color: var(--rust); font-size: .85rem; margin-top: .2rem; }
.field.check { display: flex; gap: .5rem; align-items: flex-start; }
.field.check label { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.nonfield { color: var(--rust); margin-bottom: 1rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
.group-head td { background: #faf8f3; font-weight: 700; font-size: .9rem; }

/* Pills & status */
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--sand); color: #6b5a33; white-space: nowrap; }
.pill.essential { background: var(--rust-tint); color: var(--rust); }
.pill.recommended { background: var(--amber-tint); color: var(--amber); }
.pill.optional { background: #eceae4; color: var(--muted); }
.pill.ok { background: var(--forest-tint); color: var(--forest); }
.pill.warn { background: var(--amber-tint); color: var(--amber); }
.pill.bad { background: var(--rust-tint); color: var(--rust); }
.pill.info { background: var(--sky-tint); color: var(--sky); }

/* Trip header + ROPER tabs */
.trip-head { margin-bottom: .5rem; }
.trip-head .meta { color: var(--muted); }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin: 1rem 0 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a b { color: var(--forest); font-size: 1.05rem; margin-right: .1rem; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--forest); }
.tabs a:hover { color: var(--ink); }

/* Weather */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.stat { background: #faf8f3; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .8rem; }
.stat .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--muted); }
.stat.cold .v { color: var(--sky); }
.stat.hot .v { color: var(--rust); }
.forecast { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.forecast .day { min-width: 92px; text-align: center; background: #faf8f3; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font-size: .85rem; }
.notes-list { padding-left: 1.1rem; margin: 0; }
.notes-list li { margin-bottom: .35rem; }

/* Needs */
.need { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.need:last-child { border-bottom: 0; }
.need .title { font-weight: 700; }
.need .why { font-size: .9rem; }
.need .advice { font-size: .88rem; color: var(--muted); }
.need .have { font-size: .88rem; grid-column: 1 / -1; }
.need.gap { background: #fffaf7; }
.review-links { font-size: .88rem; margin-top: .2rem; }

/* Checklist */
.check-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item input { width: 1.4rem; height: 1.4rem; flex: none; }
.check-item.packed .name { text-decoration: line-through; color: var(--muted); }
.check-item .name { flex: 1; }
.progress { height: 10px; background: #e7e3d8; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--forest); transition: width .2s; }
.cat-head { padding: .45rem 1rem; background: #faf8f3; font-weight: 700; font-size: .85rem; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
details.picker summary { cursor: pointer; font-weight: 600; }
.pick-list { max-height: 420px; overflow-y: auto; margin: .75rem 0; }
.pick-list label { font-weight: 400; display: flex; gap: .5rem; padding: .25rem 0; align-items: center; }

/* Map */
#map { height: 520px; border-radius: var(--radius); border: 1px solid var(--line); }
#picker-map { height: 340px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 1rem; }
.search-results { list-style: none; padding: 0; margin: .25rem 0 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.search-results:empty { display: none; }
.search-results li { padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: 0; }
.search-results li:hover { background: var(--forest-tint); }

/* Review */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .1rem; }
.stars input { display: none; }
.stars label { font-size: 1.5rem; color: #d6d0c2; cursor: pointer; margin: 0; font-weight: 400; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #d99a1e; }
.review-item { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.field-note { font-size: .88rem; background: var(--sky-tint); border-radius: 6px; padding: .35rem .6rem; margin: .4rem 0; }

/* Landing */
.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.4rem; max-width: 18ch; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.roper { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 2rem 0; }
.roper .card b { font-size: 2rem; color: var(--forest); display: block; line-height: 1; margin-bottom: .35rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .btn { margin-top: .5rem; }
pre.plan-text { white-space: pre-wrap; background: #faf8f3; border: 1px solid var(--line); border-radius: 8px; padding: .9rem; font-size: .85rem; max-height: 360px; overflow: auto; }

/* Shared / printable plan */
.print-only { display: none; }
@media print {
  .topbar, .no-print, .tabs { display: none !important; }
  .print-only { display: block; }
  body, :root { background: #fff; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  main.wrap { padding: 0; max-width: none; }
  #map { height: 380px; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .hero h1 { font-size: 1.9rem; }
  .card { padding: .9rem 1rem; }
  .topbar nav { order: 3; width: 100%; }
  #map { height: 420px; }
  th, td { padding: .5rem; }
  .hide-sm { display: none; }
}
