/* Guangzhou Retreat Hub: the frame. Self-hosted fonts only. */
@font-face { font-family: "Source Serif"; src: url(/fonts/serif-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url(/fonts/serif-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(/fonts/sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(/fonts/sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f7f3ea; --paper-2: #efe9dc; --card: #fffdf8; --ink: #1d2321; --muted: #5a625d; --line: #d9d1c1;
  --jade: #1f5f4f; --jade-soft: #e1ece6; --verm: #ad3b27; --verm-soft: #f8e6e0; --ochre: #7d6224; --focus: #1f5f4f;
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --sans: "Source Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151917; --paper-2: #1c211e; --card: #1f2522; --ink: #ece6da; --muted: #a7aea9; --line: #343c38;
    --jade: #82c7b0; --jade-soft: #20342d; --verm: #f2917a; --verm-soft: #3a2420; --ochre: #d6b46a; --focus: #82c7b0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151917; --paper-2: #1c211e; --card: #1f2522; --ink: #ece6da; --muted: #a7aea9; --line: #343c38;
  --jade: #82c7b0; --jade-soft: #20342d; --verm: #f2917a; --verm-soft: #3a2420; --ochre: #d6b46a; --focus: #82c7b0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--sans); overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); margin-top: .8em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
a { color: var(--jade); text-underline-offset: 2px; }
p { margin: .5em 0; }
img { max-width: 100%; height: auto; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.narrow { max-width: 440px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Header and navigation */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand span { color: var(--jade); }
.top-actions { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.who { color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; padding-bottom: 6px; }
.nav a { padding: 10px 10px; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; font-weight: 600; font-size: .95rem; }
.nav a[aria-current="page"] { border-color: var(--jade); color: var(--jade); }
.filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.filter a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; min-height: 40px; display: inline-flex; align-items: center; }
.filter a[aria-current] { background: var(--jade); color: var(--paper); border-color: var(--jade); }
main { padding-bottom: 48px; }
main:focus { outline: none; }
.foot { color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }

/* Buttons and forms */
.btn, .btn-small, button.theme-toggle, .link-btn {
  font: inherit; cursor: pointer; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn { background: var(--jade); color: var(--paper); border: 0; padding: 10px 18px; min-height: 44px; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--jade); border: 1px solid var(--jade); }
.btn-danger { background: var(--verm); color: #fff; }
.btn-small { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 6px 12px; min-height: 40px; font-size: .9rem; }
button.theme-toggle { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 6px 10px; min-height: 40px; font-size: .85rem; }
.link-btn { background: none; border: 0; color: var(--jade); padding: 8px 4px; min-height: 40px; text-decoration: underline; font-size: .9rem; }
form.inline { display: inline; }
.stack { display: grid; gap: 12px; margin: 12px 0; }
.stack > .btn, .stack > .btn-small { justify-self: start; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.check-line, .checks label { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 40px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-height: 44px; font-weight: 400;
}
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--jade); flex: none; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; min-width: 0; }
fieldset.plain { border: 0; padding: 0; }
legend { font-weight: 600; padding: 0 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 0 16px; }
.help { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.req { color: var(--verm); }
progress { width: 100%; max-width: 320px; height: 10px; accent-color: var(--jade); }
@media (min-width: 700px) {
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form > label:has(textarea), .grid-form > fieldset, .grid-form > .btn, .grid-form > label:first-of-type { grid-column: 1 / -1; }
}

/* Flash, notices, banner */
.flash { padding: 10px 14px; border-radius: 8px; margin: 16px 0; }
.flash-ok { background: var(--jade-soft); }
.flash-err { background: var(--verm-soft); color: var(--ink); border-left: 4px solid var(--verm); }
.frozen-note { background: var(--paper-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; margin-top: 16px; font-size: .9rem; }
.banner { border: 1.5px dashed var(--verm); color: var(--ink); background: var(--verm-soft); border-radius: 10px; padding: 8px 14px; margin-top: 20px; }
.banner p { margin: 0; }
.notice { background: var(--paper-2); border-left: 4px solid var(--jade); padding: 8px 14px; border-radius: 0 8px 8px 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px 14px; margin: 24px 0; }
.panel.quiet { background: transparent; }
.panel.frozen { border-color: var(--verm); }

/* Welcome */
.hero { padding: 8px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--muted); margin-top: 24px; }
.hero h1 { margin-top: .2em; }
.countdown { font-size: 1.1rem; color: var(--verm); }
.countdown strong { font-family: var(--serif); font-size: 2.2rem; margin-right: 4px; }
.lede { font-size: 1.08rem; max-width: 60ch; }
.days-shape { list-style: none; padding: 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .days-shape { grid-template-columns: 1fr 1fr; } }
.days-shape li { border-top: 3px solid var(--jade); padding-top: 6px; }
.days-shape h3 { margin: .3em 0; }
.todo li, .changes li { margin: 6px 0; }
.changes { padding-left: 18px; }
.changes .is-new { font-weight: 600; }
.due { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.offline { margin-top: 32px; }

/* Tags */
.tag { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); margin: 2px 4px 2px 0; font-weight: 600; white-space: nowrap; }
.tag-tent { border: 1.5px dashed var(--verm); color: var(--verm); }
.tag-ok { background: var(--jade); color: var(--paper); border-color: var(--jade); }
.tag-kind { color: var(--muted); }
.tag-draft { background: var(--paper-2); color: var(--muted); }
.tag-warn { border-color: var(--ochre); color: var(--ochre); }
.tag-new { background: var(--verm); color: #fff; border-color: var(--verm); }

/* Agenda timeline */
.day { margin-top: 28px; scroll-margin-top: 12px; }
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-bottom: 2px solid var(--ink); }
.day-head h2 { margin: .6em 0 .3em; }
.timeline { list-style: none; padding: 0; margin: 0; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 4px 14px; padding: 14px 0 14px 12px; border-left: 4px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.item.kind-room { border-left-color: var(--jade); }
.item.kind-out { border-left-color: var(--ochre); }
.item.kind-meal, .item.kind-break, .item.kind-travel { border-left-color: var(--line); }
.item.is-tentative { outline: 1.5px dashed color-mix(in srgb, var(--verm) 45%, transparent); outline-offset: -1.5px; }
.item-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); padding-top: 2px; }
.item h3 { margin: 0 0 4px; }
.item .meta { margin: 2px 0 6px; }
.brief, .notes { max-width: 62ch; }
.notes { color: var(--muted); font-size: .95rem; }
.links { padding-left: 18px; }
@media (max-width: 520px) { .item { grid-template-columns: 1fr; } }

/* Editors (details/summary) */
details.editor, details.suggest, details.confirm { margin-top: 8px; }
details > summary { cursor: pointer; color: var(--jade); font-weight: 600; min-height: 40px; display: flex; align-items: center; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; margin-right: 6px; font-size: .8em; }
details[open] > summary::before { content: "▾"; }
details.editor[open] { background: var(--paper-2); border-radius: 10px; padding: 4px 14px 10px; }
details.confirm { display: inline-block; }
details.confirm > summary { color: var(--verm); }
details.confirm[open] form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.add > summary { color: var(--ink); }

/* Homework */
.tasks, .notes-list { list-style: none; padding: 0; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 12px; margin: 14px 0; scroll-margin-top: 12px; }
.task.is-done { border-color: var(--jade); }
.task h3 { margin-top: .6em; }
.note { border-left: 3px solid var(--jade); padding: 4px 12px; margin: 10px 0; background: var(--card); border-radius: 0 8px 8px 0; }
.note.is-hidden { opacity: .6; }
.note-by { margin: 4px 0; }

/* Details */
.form-section h2 { font-size: 1.2rem; border-top: 1px solid var(--line); padding-top: 14px; }
.field { margin: 12px 0; scroll-margin-top: 12px; }
.savebar { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.member-pick label { display: inline-flex; align-items: center; gap: 8px; }
.member-pick select { width: auto; }

/* Hotel and local */
.cards { display: grid; gap: 14px; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 12px; min-width: 0; scroll-margin-top: 12px; }
.card h3 { margin-top: .7em; }
.stamp { font-size: .82rem; color: var(--muted); }
.driver-card {
  display: block; width: 100%; text-align: left; cursor: zoom-in; margin: 16px 0; font: inherit;
  background: #fffef9; color: #111; border: 3px solid var(--jade); border-radius: 14px; padding: 18px;
}
.driver-label { display: block; font-size: .9rem; color: #555; }
.driver-zh { display: block; font-size: 2rem; font-weight: 700; line-height: 1.3; margin-top: 6px; }
.driver-addr { display: block; font-size: 1.4rem; line-height: 1.4; margin: 8px 0; }
.driver-en { display: block; font-size: .95rem; color: #333; }
.driver-hint { display: block; font-size: .8rem; color: #666; margin-top: 8px; }
.driver-card.is-full {
  position: fixed; inset: 0; z-index: 100; margin: 0; border-radius: 0; cursor: zoom-out;
  display: flex; flex-direction: column; justify-content: center; padding: 6vw; border-width: 6px;
}
.driver-card.is-full .driver-zh { font-size: min(12vw, 7rem); }
.driver-card.is-full .driver-addr { font-size: min(8vw, 4.5rem); }
.two-col { display: grid; gap: 0 28px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }
.contacts { padding-left: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--paper-2); }
.group-row th { background: var(--jade-soft); font-weight: 600; }
button.sort { background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; padding: 4px 0; min-height: 36px; }
button.sort::after { content: " ↕"; color: var(--muted); }
.pw-form input { width: 150px; display: inline-block; min-height: 40px; }

/* Admin */
.stats { display: grid; gap: 8px; }
@media (min-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.stat > summary { color: var(--ink); font-weight: 400; }
.stat strong { font-family: var(--serif); font-size: 1.4rem; margin-right: 6px; }
.stat.has strong { color: var(--verm); }
.diff dt { font-weight: 600; margin-top: 6px; }
.diff dd { margin: 0; display: grid; gap: 2px; font-size: .88rem; white-space: pre-wrap; }
.diff del { background: var(--verm-soft); text-decoration: line-through; }
.diff ins { background: var(--jade-soft); text-decoration: none; }
.log li { border-bottom: 1px solid var(--line); padding: 6px 0; list-style: none; }
.log { padding: 0; }

@media print {
  .top, .foot, details.editor, details.suggest, details.confirm, .filter, .savebar, .offline { display: none !important; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
