/* 北海道家族旅行 2026 — warm cream and lavender, 430px phone column. */

:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --ink: #2e2a26;
  --muted: #7c736a;
  --line: #e7dfd3;
  --accent: #7a6aa8;
  --accent-soft: #ece8f6;
  --danger: #b23b3b;
  --danger-soft: #fbeaea;
  --warn: #a6762a;
  --warn-soft: #fbf2e2;
  --info: #3d6b8e;
  --info-soft: #e8f0f6;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b19;
    --surface: #26241f;
    --ink: #f0ebe3;
    --muted: #a79d90;
    --line: #3a352e;
    --accent: #b3a3e0;
    --accent-soft: #322c46;
    --danger: #f09a9a;
    --danger-soft: #3d2323;
    --warn: #e6bd76;
    --warn-soft: #3a2f1c;
    --info: #9fc4e0;
    --info-soft: #22303b;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Hiragino Sans", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.view {
  max-width: 430px;
  margin: 0 auto;
  padding: 12px 16px calc(84px + env(safe-area-inset-bottom));
}

h1 { font-size: 1.45rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
a { color: var(--accent); }

.muted { color: var(--muted); font-size: 0.88rem; }
.empty { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ cards */

.card, .section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 12px;
}
.section { background: transparent; border: 0; padding: 0; }
.section > h2 { padding: 0 2px; }

.screen-head, .day-head { padding: 4px 2px 12px; }
.day-date { color: var(--accent); font-weight: 600; }
.day-title { font-size: 1.35rem; }

/* ------------------------------------------------------------------ alerts */

.alerts { display: grid; gap: 8px; margin-bottom: 12px; }

.alert {
  border-radius: var(--radius);
  padding: 11px 13px;
  border-left: 4px solid;
}
.alert-title { font-weight: 700; }
.alert-body { font-size: 0.92rem; }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert-warn   { background: var(--warn-soft);   border-color: var(--warn);   color: var(--warn); }
.alert-info   { background: var(--info-soft);   border-color: var(--info);   color: var(--info); }
.alert-danger .alert-body, .alert-warn .alert-body, .alert-info .alert-body { color: var(--ink); }

/* ------------------------------------------------------------------ groups */

.groups-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 8px; }

.group-card { padding: 0; overflow: hidden; }
.group-card.is-mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 13px 14px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.group-name { font-weight: 700; white-space: nowrap; }
.group-summary { flex: 1; color: var(--muted); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { margin-left: auto; color: var(--muted); }
.chip {
  margin-left: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.group-body { padding: 0 14px 12px; }

/* ------------------------------------------------------------------ schedule */

.anytime, .timeline { list-style: none; margin: 0; padding: 0; }

.anytime { margin-bottom: 10px; }
.anytime .item { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.anytime .item:last-child { border-bottom: 0; }

/* The rail and the time gutter exist ONLY on .timeline, so a day with no timed items has
   neither. That is the whole "layout picks itself" behaviour, in CSS. */
.timeline { position: relative; padding-left: 62px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 52px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline .item { position: relative; padding: 8px 0; }
.timeline .item::before {
  content: "";
  position: absolute;
  left: -14px; top: 16px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.item-time {
  position: absolute;
  left: -62px;
  top: 8px;
  width: 46px;
  text-align: right;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}
.item-title { font-weight: 500; }
.item-note { color: var(--muted); font-size: 0.86rem; }

/* ------------------------------------------------------------------ fields */

.field { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field-label { color: var(--muted); font-size: 0.86rem; min-width: 78px; flex-shrink: 0; }
.field-value { flex: 1; word-break: break-word; }

.tel { font-weight: 600; }

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: middle;
}
.tag-unverified { background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn); }
.tag-missing { background: transparent; color: var(--muted); border: 1px dashed var(--line); }

.gap { color: var(--warn); font-size: 0.84rem; margin-top: 8px; }
.warn-note { color: var(--warn); font-size: 0.88rem; }

/* ------------------------------------------------------------------ meals */

.meal-card.is-unverified { border-style: dashed; background: transparent; }
.meal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meal-name { font-weight: 700; font-size: 1.05rem; }
.meal-time { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.meal-note { color: var(--muted); font-size: 0.88rem; }
.diet {
  margin-top: 10px;
  background: var(--info-soft);
  color: var(--info);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ------------------------------------------------------------------ lists */

.plain { list-style: none; margin: 0; padding: 0; }
.plain > li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.plain > li:last-child { border-bottom: 0; }
.contact { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }

.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.day-row-date { color: var(--accent); font-weight: 700; min-width: 72px; }
.day-row-body { flex: 1; display: block; }
.day-row-title { display: block; font-weight: 500; }
.day-row-hotel { display: block; color: var(--muted); font-size: 0.84rem; }
.day-row-alert { display: block; color: var(--danger); font-size: 0.84rem; font-weight: 700; }

.deadline-list { list-style: none; margin: 0; padding: 0; }
.deadline { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.deadline:last-child { border-bottom: 0; }
.deadline.is-today { color: var(--danger); font-weight: 700; }
.deadline-date { min-width: 52px; font-weight: 700; color: var(--accent); }

.car-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.car-row:last-of-type { border-bottom: 0; }
.car-row-danger { color: var(--danger); font-weight: 700; }

.check-card { border-left: 4px solid var(--line); }
.check-danger { border-left-color: var(--danger); }
.check-warn { border-left-color: var(--warn); }
.check-info { border-left-color: var(--info); }
.check-head { display: flex; gap: 9px; align-items: baseline; }
.check-box { font-size: 1.15rem; }
.check-text { font-weight: 700; }
.check-detail { font-size: 0.9rem; margin-top: 4px; }
.per-person > li { border-bottom: 0; padding: 2px 0; font-size: 0.9rem; }

.flight-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.flight-code { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; }
.flight-leg { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.leg { flex: 1; }
.leg-time { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.leg-place { font-size: 0.9rem; }
.leg-term { font-size: 0.8rem; }
.leg-arrow { color: var(--muted); }

.phrases { list-style: none; margin: 0; padding: 0; }
.phrases > li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.phrases > li:last-child { border-bottom: 0; }
.phrase-zh { font-weight: 600; }
.phrase-ja { font-size: 1.05rem; }

.ja { color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; }
.hotel-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.golf-row { padding: 6px 0; }

/* ------------------------------------------------------------------ controls */

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent); font: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn {
  display: inline-block;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 10px;
  padding: 9px 16px; margin: 8px 8px 0 0;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-small { padding: 4px 10px; font-size: 0.82rem; }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }

.identity-chip {
  display: flex; gap: 10px; align-items: baseline; justify-content: space-between;
  color: var(--muted); font-size: 0.84rem;
  padding: 0 2px 10px;
}
.back { padding: 4px 2px 12px; }

/* ------------------------------------------------------------------ banners and tabs */

#banner { position: sticky; top: 0; z-index: 20; }
.banner {
  max-width: 430px; margin: 0 auto;
  padding: 8px 16px;
  font-size: 0.86rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-update { background: var(--accent-soft); color: var(--accent); }
.banner-update .btn { margin: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1;
  background: none;
  border: 0;
  text-align: center;
  padding: 11px 2px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.tabs button.is-active { color: var(--accent); }

/* ------------------------------------------------------------------ identity sheet */

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-inner {
  width: 100%; max-width: 430px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
}
.group-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.group-picker .btn { margin: 0; }
