:root {
  color-scheme: light;
  --blue: #1450f5;
  --pressed: #0d3dbd;
  --cyan: #32c7f9;
  --page: #edf6ff;
  --ink: #0e1728;
  --muted: #536783;
  --line: #d7e7f8;
  --strong-line: #c2dafa;
  --rose: #ad3549;
  --rose-bg: #fff1f4;
  --white: #fff;
  --shadow: 0 4px 14px #17447c0a, 0 1px 3px #17447c08;
  --card: 18px;
  --pill: 999px;
  --width: 680px;
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  width: 100%;
  max-width: var(--width);
  min-height: 100dvh;
  margin: 0 auto;
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  overflow-wrap: anywhere;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1 { font-size: 27px; line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; }
button, input, textarea, select { font: inherit; }
a { color: var(--pressed); text-decoration: none; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
main:focus { outline: none; }

.masthead {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 750; }
.brand small { padding-left: 7px; border-left: 2px solid var(--cyan); color: var(--blue); font-size: 10px; letter-spacing: .06em; }
.account { display: flex; min-width: 0; min-height: 44px; align-items: center; gap: 7px; }
.account-text { display: grid; min-width: 0; text-align: right; color: var(--ink); font-size: 12px; line-height: 1.4; }
.account-text strong { max-width: min(40vw, 180px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { color: var(--muted); font-size: 11px; }
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--page);
  color: var(--pressed);
  font-weight: 750;
}

main { display: grid; gap: 14px; padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); }
main > .button { justify-self: start; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.intro p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.paper { min-width: 0; border: 1px solid var(--line); border-radius: var(--card); background: var(--white); box-shadow: var(--shadow); }
.panel { display: grid; gap: 12px; padding: 16px; }
.panel > .button { justify-self: start; }
.stack, .form, .field { display: grid; min-width: 0; gap: 10px; }
.form > .button { justify-self: start; }
.field { gap: 4px; }
.field label { font-weight: 700; }
.field input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--strong-line);
  border-radius: 11px;
  padding: 8px 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
}
input[type="datetime-local"] { display: block; max-width: 100%; }
textarea { resize: vertical; }
dl { display: grid; gap: 10px; }
dt { color: var(--muted); font-size: 12px; }
dd { white-space: pre-wrap; }
.muted, .hint, .empty { color: var(--muted); }
.hint, .empty { font-size: 13px; }
.empty { padding: 11px 12px; }
.info, .error { border-radius: 12px; padding: 8px 10px; }
.info { background: var(--page); color: var(--pressed); }
.error { background: var(--rose-bg); color: var(--rose); }
.group + .group { margin-top: 14px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin: 0 2px 7px; }
.count { color: var(--muted); font-size: 12px; font-weight: 650; }
.item { min-width: 0; padding: 11px 12px; }
.item + .item { border-top: 1px solid var(--line); }
.item-meta, .item-time { margin-top: 3px; color: var(--muted); font-size: 12px; }
.item-time { color: var(--pressed); font-weight: 700; }
.item-time:empty { display: none; }
.text-link { color: inherit; }
.text-link:hover { text-decoration: underline; }
.pill { padding: 2px 7px; border-radius: var(--pill); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill.neutral { background: var(--page); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 6px; }
.button {
  display: inline-flex;
  min-height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--blue);
  border-radius: var(--pill);
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.button:hover { background: var(--pressed); }
.button.secondary { border-color: var(--strong-line); background: var(--white); color: var(--pressed); }
.button.secondary:hover { background: var(--page); }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 7px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.reminders, .demonstrations { min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.reminders { margin-top: 8px; }
.reminder-row + .reminder-row { margin-top: 6px; }
.demonstrations { border: 0; border-top: 1px solid var(--line); margin: 0; padding-inline: 0; }
.demonstrations legend { padding-right: 8px; font-weight: 700; }
.demonstrations input:disabled { cursor: default; }

.route { list-style: none; padding: 15px 13px; }
.station { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: start; gap: 9px; min-height: 25px; padding-bottom: 13px; }
.station:last-child { padding: 0; }
.station:not(:last-child)::before { position: absolute; inset: 13px auto -12px 11px; border-left: 2px solid var(--strong-line); content: ""; }
.stop { z-index: 0; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--strong-line); border-radius: 50%; background: var(--white); }
.stop::after { width: 7px; height: 7px; border-radius: 50%; background: var(--strong-line); content: ""; }
.station-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; padding-top: 1px; }
.station-title h2 { font-size: 15px; }
.today-list .group-heading { justify-content: start; }
.today-list .group-heading::before { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); content: ""; }
.today-list .group-tomorrow .group-heading::before { background: var(--cyan); }
.today-list .group-pending .group-heading::before { background: var(--strong-line); }
.stage-counts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; padding: 9px 3px; text-align: center; }
.stage-counts li { font-size: 11px; color: var(--muted); }
.stage-counts li + li { border-left: 1px solid var(--line); }
.stage-counts strong { display: block; color: var(--pressed); font-size: 21px; line-height: 1.3; }
.people-list .item + .item { margin-top: 7px; }
.person { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; }
.person-info { flex: 1; min-width: 90px; }
.person-actions { align-self: center; }
.member-row { display: grid; gap: 7px; min-width: 0; }
.member-row .form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.member-row .error { grid-column: 1 / -1; }
.member-row select { min-width: 0; }
.member-name { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; overflow-wrap: anywhere; }
.team-position { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.team-position li[aria-current] { font-weight: 700; }
.team-indent-1 { margin-inline-start: 8px; }
.team-indent-2 { margin-inline-start: 16px; }
.team-indent-3 { margin-inline-start: 24px; }
.team-indent-4 { margin-inline-start: 32px; }
.member-row .item-meta { overflow-wrap: anywhere; }
.copy-control:has(.copy-feedback:not([hidden])) { flex-basis: 100%; }
.copy-feedback { margin-top: 6px; }
.clipboard-proxy { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.tabs {
  position: fixed;
  z-index: 1;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(100%, var(--width));
  padding: 7px 16px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  border-radius: var(--card) var(--card) 0 0;
  background: var(--white);
  box-shadow: 0 -4px 18px #17447c0a;
}
.tab { display: grid; min-height: 48px; place-content: center; justify-items: center; gap: 2px; border-radius: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--pressed); background: var(--page); font-weight: 800; }
.tab svg { width: 17px; height: 17px; }
.toast {
  position: fixed;
  z-index: 2;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 28px);
  transform: translateX(-50%);
  border: 1px solid var(--strong-line);
  border-radius: var(--pill);
  padding: 8px 14px;
  background: var(--white);
  color: var(--pressed);
  box-shadow: var(--shadow);
  font-weight: 700;
}
@media (min-width: 620px) {
  main { padding-inline: 26px; }
  .masthead { padding-inline: 26px; }
}

.recordings { display: grid; gap: 9px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.recording-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.recording-item { min-width: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.recording-item audio { display: block; width: 100%; max-width: 360px; margin-top: 6px; }
.recordings input[type="file"] { max-width: 100%; min-width: 0; }

.growth-road .route { padding: 0; }
.growth-road > .item-meta { margin-bottom: 12px; }
.growth-training, .growth-list-settings { list-style: none; margin: 0; padding: 0; }
.growth-training { display: grid; gap: 5px; }
.growth-training li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.growth-row { min-width: 0; overflow-wrap: anywhere; }
.growth-row + .growth-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--strong-line); }
.growth-row .check { padding-inline: 0; }
.growth-row .check input { flex-shrink: 0; }
.growth-row .item-meta { margin-top: 4px; }

.growth-road .station { overflow-wrap: anywhere; }
.station-current .stop { border-color: var(--blue); }
.station-current .stop::after { background: var(--blue); }
.station-done .stop { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.station-done .stop::after { content: none; }
.pill.current { background: var(--blue); color: var(--white); white-space: normal; }
.growth-locked { justify-self: start; white-space: normal; }
