:root {
  color-scheme: light;
  --ink: #153f4c;
  --muted: #4b6972;
  --blue: #006a83;
  --blue-dark: #00546a;
  --line: #c9dde2;
  --water: #edf8fa;
  --error: #a32d35;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f7fafb;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button { min-height: 44px; border: 0; border-radius: 12px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #c86630; outline-offset: 4px; }
[hidden] { display: none !important; }
.journal { width: min(100%, 560px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 19px; font-weight: 750; white-space: nowrap; }
.brand img { border-radius: 12px; }
.quiet-button { background: #e7eff2; color: var(--ink); padding: 8px 12px; font-size: 14px; font-weight: 600; }
.quiet-button:hover { background: #d7e7ec; }
.checkin { background: var(--water); border-radius: 26px; overflow: hidden; border: 1px solid #d6eaee; }
.welcome-copy { padding: 28px 28px 0; }
h1 { margin: 0; font-size: 32px; line-height: 1.4; letter-spacing: -.025em; font-weight: 750; }
.welcome-copy p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.swim-scene { display: block; width: 100%; height: auto; margin: -4px 0 -12px; }
.checkin-action { padding: 12px 24px 22px; background: #d8f0f3; position: relative; }
.schedule { font-size: 14px; margin: 0 0 14px; color: #295965; text-align: center; }
.primary-button { background: var(--blue); color: white; font-weight: 650; padding: 13px 20px; transition: background .18s, transform .18s; }
.primary-button:hover { background: var(--blue-dark); }
.primary-button:active { transform: translateY(1px); }
.checkin-button { width: 100%; font-size: 18px; min-height: 58px; border-radius: 16px; }
.checkin-button span { font-size: 24px; vertical-align: -1px; margin-right: 6px; font-weight: 400; }
.checkin-button.is-done { background: #245c63; }
.hint { font-size: 12px; line-height: 1.6; margin: 12px 0 0; color: #3c616a; text-align: center; }
.lesson-summary { display: grid; grid-template-columns: 1fr 1fr; margin: 26px 0 36px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.lesson-summary > div { padding-left: 20px; }
.lesson-summary > div:first-child { border-right: 1px solid var(--line); padding-left: 8px; }
.stat-label { font-size: 14px; color: var(--muted); }
.lesson-summary p { margin: 5px 0 0; display: flex; align-items: baseline; gap: 8px; }
.lesson-summary strong { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; }
.lesson-summary p span { font-size: 13px; color: var(--muted); }
.summary-setting { grid-column: 1 / -1; color: var(--blue); background: transparent; font-size: 13px; justify-self: center; margin-top: 6px; }
.lesson-summary .overrun { grid-column: 1 / -1; display: block; color: var(--error); font-size: 13px; text-align: center; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin: 0; }
.text-button { color: var(--blue); background: transparent; font-size: 14px; font-weight: 650; padding: 8px 4px; }
.text-button:hover, .danger-text:hover { text-decoration: underline; }
.empty { text-align: center; padding: 30px 12px 36px; }
.empty-ripples { display: block; font-size: 48px; color: var(--blue); line-height: 1; }
h3 { font-size: 16px; margin: 16px 0 8px; font-weight: 600; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.records { list-style: none; padding: 0; margin: 10px 0 28px; }
.record { display: grid; grid-template-columns: 48px minmax(0, 1fr) 44px; gap: 12px; align-items: start; padding: 20px 0; border-bottom: 1px solid #dfe9ec; }
.record-stamp { background: #e3f2f5; color: var(--blue-dark); padding: 8px 2px; border-radius: 12px; text-align: center; }
.record-stamp span { display: block; font-size: 11px; }
.record-stamp strong { display: block; font-size: 22px; line-height: 1.35; }
.record-date { display: block; font-size: 15px; font-weight: 650; margin: 2px 0 6px; }
.record-notes { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.record-edit { background: transparent; color: var(--blue); font-size: 13px; padding: 2px; }
.device-note { border-top: 1px solid var(--line); padding-top: 20px; }
.device-note p:first-child { font-size: 13px; color: var(--ink); font-weight: 600; margin: 0 0 8px; }
.device-note p, .install-help p { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 8px 0; }
.install-help { margin-top: 14px; }
.install-help summary { color: var(--blue); min-height: 44px; padding: 12px 0; font-size: 13px; cursor: pointer; }
footer { color: var(--muted); font-size: 12px; text-align: center; margin: 28px 0 64px; }
.alert { background: #fff0ed; border: 1px solid #d2a39b; color: #842b24; padding: 14px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; line-height: 1.7; }
.alert p { margin: 0; }
.alert .text-button { color: #842b24; }
.connection { padding: 10px 12px; background: #fff1d4; color: #694512; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.feedback { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); background: #153f4c; color: white; box-shadow: 0 8px 24px #153f4c26; padding: 10px 16px; border-radius: 14px; font-size: 14px; display: flex; gap: 12px; align-items: center; z-index: 3; }
.feedback button { color: #d0f8ff; background: transparent; padding: 0; font-size: 14px; font-weight: 650; white-space: nowrap; }
dialog { color: var(--ink); background: #fff; border: 0; border-radius: 24px; padding: 24px; width: min(464px, calc(100% - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto; box-shadow: 0 20px 70px #153f4c33; }
dialog::backdrop { background: #153f4c70; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.close-button { font-size: 28px; font-weight: 400; background: #eef4f6; color: var(--muted); width: 44px; flex-shrink: 0; }
.form-intro { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 8px 0 24px; }
label { display: block; font-size: 15px; font-weight: 650; margin: 20px 0 8px; }
.optional { font-size: 12px; font-weight: 400; margin-left: 6px; color: var(--muted); }
input, textarea { display: block; width: 100%; max-width: 100%; min-width: 0; border: 1px solid #a6c2ca; padding: 12px; border-radius: 10px; background: #fcfefe; color: var(--ink); font-size: 16px; min-height: 48px; }
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
textarea { resize: vertical; }
::placeholder { color: #56747d; opacity: 1; }
.field-hint { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 10px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.form-actions .primary-button { flex: 1; }
.danger-text { color: var(--error); background: transparent; font-size: 14px; padding: 8px 0; }
.form-error { background: #fff0ed; color: #842b24; padding: 12px; border-radius: 8px; font-size: 14px; line-height: 1.6; }
.delete-confirmation { margin-top: 18px; padding: 12px; background: #fff0ed; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.delete-confirmation p { margin-top: 0; }
.button-row { display: flex; gap: 12px; }
.danger-button { color: white; background: var(--error); padding: 10px 16px; }
@media (min-width: 760px) {
  .journal { margin-top: 24px; padding: 28px 40px; background: white; border: 1px solid #dfebef; border-radius: 32px; margin-bottom: 32px; }
}
@media (max-width: 360px) {
  .journal { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 17px; gap: 7px; }
  h1 { font-size: 29px; }
  .welcome-copy { padding-left: 24px; }
  .checkin-action { padding-left: 16px; padding-right: 16px; }
  .feedback { font-size: 13px; gap: 8px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
