:root {
  --paper: #f6f1e7;
  --card: #fffdf8;
  --ink: #1f2430;
  --muted: #5f6672;
  --line: #e2d9c8;
  --navy: #23395b;
  --accent: #e8593c;
  --ok: #2f7d4f;
  --warn: #b5541b;
  --sky: #dfe9f4;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(31, 36, 48, 0.04), 0 6px 18px rgba(31, 36, 48, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 860px; margin: 0 auto; padding: 18px 18px 6px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; }
.sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.top-actions { display: flex; gap: 8px; }
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 99px; background: var(--navy); color: #fff; font-size: 0.75rem; text-align: center; margin-left: 4px; }
main { max-width: 860px; margin: 0 auto; padding: 6px 18px 24px; display: flex; flex-direction: column; }
.col-a, .col-b { display: contents; }
#step-trip { order: 1; } #step-weather { order: 2; } #step-list { order: 3; } #step-bag { order: 4; }
.banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; padding: 10px 14px; border-radius: 12px; background: #fbeee3; color: #6e3612; font-size: 0.93rem; }
.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--navy); text-decoration: underline; font-weight: 600; }
.titlebar { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 14px; flex-wrap: wrap; }
.titlebar input.trip-title { flex: 1 1 260px; border-radius: 0; min-height: 0; width: auto; border: 0; border-bottom: 2px dashed var(--line); background: transparent; font-size: 1.3rem; font-family: Georgia, "Iowan Old Style", serif; padding: 6px 2px; }
.titlebar input.trip-title:focus { outline: none; border-bottom-color: var(--accent); }
.trip-dates { color: var(--muted); font-size: 0.9rem; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 18px; margin-bottom: 16px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-head h2 { margin: 0; font-size: 1.1rem; }
.step-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 0.9rem; flex: none; }
.step-aside { margin-left: auto; color: var(--muted); font-size: 0.86rem; text-align: right; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 10px; }
.empty { color: var(--muted); font-style: italic; margin: 8px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
button { cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 9px 14px; min-height: 42px; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(232, 89, 60, 0.35); outline-offset: 2px; }
.primary { background: var(--navy); color: #fff; font-weight: 600; }
.primary:hover { background: #1a2c47; }
.primary:disabled { opacity: 0.55; cursor: progress; }
.ghost { background: transparent; border-color: var(--line); }
.ghost:hover { background: #f1eadc; }
.sm { min-height: 38px; min-width: 38px; padding: 4px 10px; font-weight: 700; }
.field { margin: 0 0 12px; }
.field label, .label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field.inline label { margin: 0; }
input[type="search"], input[type="date"], input[type="number"], input[type="text"], select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fffefb; min-height: 42px; width: 100%; min-width: 0;
}
select { width: auto; max-width: 200px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.small-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 4px; }
.stepper { display: flex; gap: 6px; }
.stepper input { text-align: center; font-variant-numeric: tabular-nums; }
.combo { position: relative; }
.results { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); max-height: 280px; overflow: auto; }
.results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.results li[aria-selected="true"], .results li:hover { background: var(--sky); }
.results .meta { color: var(--muted); font-size: 0.85rem; }
.seg { display: flex; gap: 4px; background: #efe7d7; padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; min-height: 36px; padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.seg small { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 4px 12px; border-radius: 99px; font-size: 0.88rem; font-weight: 600; background: transparent; border: 1px dashed #c9bda7; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--sky); border: 1px solid var(--navy); color: var(--ink); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.94rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--navy); }
.msg { margin: 8px 0 0; font-size: 0.92rem; color: var(--muted); }
.msg:empty { display: none; }
.msg.err { color: #a3321d; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.day { flex: 0 0 86px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 10px; background: #fffefb; text-align: center; }
.day.hist { background: repeating-linear-gradient(135deg, #fffefb 0 8px, #f7f2e8 8px 16px); }
.day.wet { border-color: #9db7d6; }
.day .dw { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.day .dd { font-size: 0.8rem; color: var(--muted); }
.day .ic { font-size: 1.5rem; line-height: 1.6; }
.day .hi { font-weight: 800; font-variant-numeric: tabular-nums; }
.day .lo { color: var(--muted); font-variant-numeric: tabular-nums; }
.day .rain { font-size: 0.76rem; color: #2f5d8a; min-height: 1.2em; }
.summary { margin: 6px 0 0; font-size: 0.96rem; }
.summary:empty { display: none; }
.guess { margin-top: 10px; padding: 12px; border-radius: 12px; background: #f3efe6; }
.guess .msg { margin-top: 0; }
.guess .check-row { margin-top: 10px; }
.bar { height: 8px; border-radius: 99px; background: #ece3d2; overflow: hidden; margin-bottom: 8px; }
.bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.25s ease; }
.sec { margin-top: 10px; }
.sec h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 4px; display: flex; justify-content: space-between; }
.sec h3 span { font-weight: 500; letter-spacing: 0; text-transform: none; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 30px 52px 1fr 34px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ok); margin: 0 auto; }
.item .qty { text-align: center; padding: 4px; min-height: 34px; border-color: transparent; background: transparent; font-weight: 700; font-variant-numeric: tabular-nums; }
.item .qty:hover, .item .qty:focus { border-color: var(--line); background: #fff; }
.item .name { font-weight: 600; }
.item .why { display: block; font-weight: 400; color: var(--muted); font-size: 0.84rem; }
.item.packed .name { text-decoration: line-through; text-decoration-color: rgba(47,125,79,0.6); color: var(--muted); }
.icon-btn { min-height: 32px; width: 32px; padding: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.1rem; }
.icon-btn:hover { background: #f1eadc; color: #a3321d; }
.removed-note { font-size: 0.86rem; color: var(--muted); margin-top: 8px; }
.add-item { display: flex; gap: 8px; margin-top: 14px; }
.add-item input { flex: 1; }
.gauge { height: 18px; border-radius: 99px; background: #ece3d2; overflow: hidden; position: relative; }
.gauge span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.3s ease, background 0.3s; }
.gauge.snug span { background: #d19a1c; }
.gauge.over span { background: var(--accent); }
.fit-line { margin: 8px 0 0; font-weight: 700; }
.staples { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.staples summary { cursor: pointer; font-weight: 600; }
.staple-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.staple-list li { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--sky); font-size: 0.9rem; font-weight: 600; }
.staple-list button { min-height: 26px; width: 26px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: min(520px, calc(100vw - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(20, 24, 32, 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.trips { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; }
.trip { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 6px 0; }
.trip:first-child { border-top: 0; }
.trip button.open { flex: 1; text-align: left; background: transparent; border: 0; padding: 6px 4px; }
.trip .meta { display: block; color: var(--muted); font-size: 0.84rem; }
.trip.current { background: #f6efe1; border-radius: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 10; font-size: 0.92rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.foot { max-width: 860px; margin: 0 auto; padding: 0 18px 28px; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 560px) {
  .top { padding-top: 14px; }
  .brand h1 { font-size: 1.25rem; }
  .sub { font-size: 0.84rem; }
  .step { padding: 14px 12px 16px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .item { grid-template-columns: 28px 46px 1fr 32px; gap: 4px; }
}
@media (min-width: 1100px) {
  .top, .foot { max-width: 1220px; }
  main { max-width: 1220px; display: grid; grid-template-columns: 400px minmax(0, 1fr); column-gap: 22px; align-items: start; }
  .banner, .titlebar { grid-column: 1 / -1; }
  .col-a, .col-b { display: block; min-width: 0; }
  .col-a { grid-column: 1; }
  .col-b { grid-column: 2; }
  #step-list #sections { columns: 2; column-gap: 26px; }
  #step-list .sec { break-inside: avoid; }
  #step-list .sec:first-child h3 { margin-top: 4px; }
}
@media print {
  body { background: #fff; }
  .top-actions, .banner, #step-trip, #step-weather, #step-bag, .add-item, .list-actions, .foot, .icon-btn, .bar { display: none !important; }
  .step { box-shadow: none; border: 0; padding: 0; }
  main { display: block; }
}
