:root {
  color-scheme: light dark;
  --paper: #f6f4ed;
  --panel: #fffdf8;
  --ink: #203f32;
  --soft: #586454;
  --line: #ded9cd;
  --accent: #203f32;
  --wash: #ececde;
  --gold: #86601f;
  --red: #a23c38;
  --shadow: 0 3px 16px rgba(32, 63, 50, .035);
  font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  font-synthesis: none;
  --muted: #657064;
  --gold-soft: #faf1df;
  --red-soft: #fbecea;
  --heading-font: "Iowan Old Style", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .46;
}

button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

input,select,textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  min-height: 44px;
  padding: 9px 12px;
  font-size: 16px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--soft);
  margin: 17px 0;
}

input[type=file] {
  font-size: 12px;
}

button {
  border: 0;
}

a {
  color: var(--accent);
}

h1,h2,h3,p {
  margin-top: 0;
}

h1 {
  font-family: var(--heading-font);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}

h2 {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  margin-bottom: 7px;
}

p {
  color: var(--soft);
}

small {
  font-size: 12px;
}

.kicker {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  margin: 0 0 10px;
}

.boot {
  padding: 20vh 25px;
  text-align: center;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--panel);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}

.gate {
  max-width: 460px;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px 32px;
}

.gate>p {
  font-size: 14px;
  line-height: 1.6;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.gate .card {
  margin-top: 20px;
}

.card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--panel);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.btn.full {
  width: 100%;
}

.btn.secondary {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.text-btn {
  background: none;
  color: var(--accent);
  padding: 8px 0;
  font-size: 12px;
  min-height: 44px;
}

.danger {
  color: var(--red);
}

.fine {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--wash);
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0;
  overflow-wrap: anywhere;
}

.notice.error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid color-mix(in srgb,var(--red) 20%,transparent);
}

.notice.warning {
  background: var(--gold-soft);
  color: var(--gold);
}

.notice p {
  color: inherit;
  margin: 0;
}

.notice .text-btn {
  color: inherit;
}

.install-steps {
  padding-left: 20px;
  font-size: 14px;
  color: var(--soft);
}

.install-steps li {
  margin: 12px 0;
}

.install-steps strong {
  color: var(--ink);
}

details>summary {
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
  padding: 11px 0;
  color: var(--ink);
}

details .fine {
  margin-top: 10px;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top)) 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.topbar>div {
  display: flex;
  color: var(--accent);
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
}

.topbar .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 10px;
  font-size: 16px;
  margin: 0;
}

.topbar button {
  font-size: 12px;
  background: none;
  color: var(--soft);
  padding: 8px 0 8px 12px;
  min-height: 44px;
  min-width: 44px;
}

.heading {
  margin-bottom: 12px;
}

.heading h1 {
  font-size: 28px;
  overflow-wrap: anywhere;
  text-wrap: balance;
  line-height: 1.25;
  margin: 4px 0 0;
}

.heading p {
  margin: 0;
  font-size: 12px;
}

.date-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px;
}

.date-line label {
  margin: 0;
  flex: 1;
  max-width: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.date-line>div {
  font-size: 12px;
  color: var(--soft);
  text-align: right;
}

.date-line strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 0;
  border-radius: 14px;
}

.stats>div {
  text-align: center;
  border-right: 1px solid var(--line);
}

.stats>div:last-child {
  border-right: 0;
}

.stats span {
  display: block;
  font-size: 12px;
  color: var(--soft);
}

.stats strong {
  display: block;
  font-family: var(--heading-font);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.2;
}

.stats .remaining {
  color: var(--gold);
}

.date-line input {
  min-width: 0;
  max-width: 180px;
  flex: 1;
  padding: 8px 9px;
}

.roster-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin: 4px 0 6px;
}

.roster-feedback .save-status {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.roster-feedback .save-status.error {
  flex-basis: 100%;
}

.roster-feedback details {
  text-align: right;
}

.roster-feedback summary {
  font-size: 12px;
  color: var(--soft);
}

.roster-feedback details .text-btn {
  display: block;
  text-align: right;
}

.list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.list-tools input {
  min-width: 0;
  flex: 1;
  min-height: 44px;
  padding: 9px 10px;
}

.family {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 10px 0;
}

.family-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--wash);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--soft);
  gap: 10px;
}

.family-head strong {
  font-weight: 500;
  color: var(--ink);
}

.person {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.person:first-of-type {
  border-top: 0;
}

.person-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.person-title strong {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.person-title small {
  color: var(--gold);
}

.person-title small.set {
  color: var(--soft);
}

.marks {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
}

.mark {
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--soft);
  border-radius: 10px;
  font-size: 14px;
}

.mark.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
  font-weight: 650;
  border-width: 2px;
}

.mark.selected:disabled {
  opacity: 1;
}

.mark.selected[data-status=excused] {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold);
}

.mark.selected[data-status=absent] {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

.completion {
  margin: 20px 0 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
}

.completion h2 {
  font-size: 16px;
  margin: 0 0 9px;
}

.completion p {
  font-size: 14px;
  margin-bottom: 15px;
}

.save-status {
  min-height: 24px;
  display: block;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
}

.save-status.error {
  color: var(--red);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  z-index: 10;
}

.bottom-nav button {
  flex: 1;
  max-width: 240px;
  min-height: 48px;
  border-radius: 10px;
  background: transparent;
  color: var(--soft);
  font-size: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.bottom-nav button.active {
  background: var(--accent);
  color: var(--panel);
  font-weight: 600;
}

.bottom-nav svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-count {
  font-size: 12px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--panel);
  padding: 0 5px;
  min-width: 17px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  padding: 18px 0;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.history-row strong {
  font-size: 16px;
  display: block;
}

.history-row span {
  display: block;
  font-size: 12px;
  color: var(--soft);
  margin-top: 5px;
}

.history-row em {
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  color: var(--accent);
}

.visit-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.visit-fields textarea {
  resize: vertical;
  min-height: 100px;
}

.visit-selection,
.visit-confirm {
  padding: 16px;
}

.visit-selection h2,
.visit-confirm h2,
.visit-details h2 {
  font-size: 16px;
}

.visit-selection h2 small {
  margin-left: 6px;
  color: var(--soft);
  font-weight: 400;
}

.visit-choices {
  display: grid;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
  gap: 6px;
}

.visit-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.visit-section-heading h2 {
  margin: 0;
}

.visit-marks {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.visit-detail-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.visit-detail-person>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.visit-detail-person>strong {
  flex-shrink: 0;
  font-size: 14px;
}

.visit-details .visit-note-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.visit-actions {
  display: grid;
  gap: 12px;
}

.visit-history-row>div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sync-count {
  font-family: var(--heading-font);
  font-size: 36px;
  letter-spacing: -.04em;
  line-height: 1;
  margin: 18px 0 6px;
  font-variant-numeric: tabular-nums;
}

.sync-count small {
  font-size: 14px;
  color: var(--soft);
  margin-left: 7px;
}

.sync-hero {
  padding: 20px;
}

.sync-hero>p {
  font-size: 14px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.row>.btn {
  flex: 1;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--soft);
  font-size: 13px;
}

.transfer-code {
  font: 600 19px ui-monospace,monospace;
  overflow-wrap: anywhere;
  padding: 15px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  user-select: all;
  color: var(--ink);
  font-size: 18px;
}

.comparison {
  display: grid;
  gap: 7px;
  padding: 10px 0;
}

.comparison>div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 8px 0;
}

.comparison strong {
  font-weight: 500;
}

.privacy-footer {
  font-size: 12px;
  text-align: center;
  margin: 20px 0;
  color: var(--muted);
}

.lock-shield #app {
  visibility: hidden;
}

.lock-shield:after {
  content: '已锁定 · 本机资料已遮蔽';
  position: fixed;
  inset: 0;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 16px;
  z-index: 999;
}

.file-list {
  font-size: 12px;
  line-height: 1.8;
}

.status-badge {
  font-size: 12px;
  color: var(--accent);
  background: var(--wash);
  padding: 4px 8px;
  border-radius: 6px;
}

.support-note {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 20px;
}

.pending-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.phone-rule {
  font-size: 12px;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  color: var(--soft);
  margin: 15px 0;
}

input[readonly] {
  font-family: ui-monospace,monospace;
}

.error-block {
  padding: 30px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.error-block h1 {
  font-size: 24px;
}

.error-block p {
  font-size: 14px;
}

@media(min-width:700px) {

  .app-shell {
    padding-top: 12px;
  }

  .family .person {
    display: grid;
    grid-template-columns: 1fr 310px;
    align-items: center;
    gap: 18px;
  }

  .person-title {
    margin-bottom: 0;
  }

  .gate {
    padding-top: 70px;
  }
}

@media(max-width:360px) {

  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .marks {
    gap: 6px;
  }

  .person {
    padding: 12px;
  }
}

@media(prefers-color-scheme:dark) {

  :root {
    --paper: #15221c;
    --panel: #1c2d25;
    --ink: #f4f1e8;
    --soft: #c1cbc1;
    --line: #3c4c3f;
    --accent: #c5d6bb;
    --wash: #2b3d30;
    --gold: #e0c18a;
    --red: #efa69d;
    --shadow: none;
    --muted: #c1cbc1;
    --gold-soft: color-mix(in srgb, var(--gold) 12%, var(--panel));
    --red-soft: color-mix(in srgb, var(--red) 12%, var(--panel));
  }
}

@media(hover:hover) and (pointer:fine) {

  .btn:not(:disabled):hover {
    filter: brightness(1.06);
  }

  .mark:not(.selected):not(:disabled):hover,
  .bottom-nav button:not(.active):hover {
    background: var(--wash);
    color: var(--accent);
    border-color: var(--accent);
  }
}

@media(prefers-reduced-motion:no-preference) {

  .mark,.btn,.bottom-nav button {
    transition: background .13s,border-color .13s,color .13s,filter .13s;
  }
}

.mt-12 {
  margin-top: 12px;
}

.mt-20 {
  margin-top: 20px;
}

.week-guidance {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.week-next strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
  line-height: 1.4;
}

.week-next p {
  font-size: 14px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.week-guidance>.btn {
  margin-top: 10px;
}

.pending-row {
  align-items: center;
  font-size: 14px;
}

.pending-row>div {
  display: grid;
  gap: 4px;
}

.pending-row strong {
  font-weight: 550;
}

.pending-row .text-btn {
  flex-shrink: 0;
}

.gate fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.install-platform+.install-platform {
  border-top: 1px solid var(--line);
}

.install-platform summary {
  font-weight: 600;
  min-height: 48px;
}

.filter-btn {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.filter-btn[aria-pressed=true] {
  border-color: var(--accent);
  background: var(--wash);
  color: var(--accent);
}

.filter-btn span {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.completion {
  scroll-margin-block: 90px;
  margin: 20px 0 8px;
  padding: 16px;
  border-radius: 14px;
}

.completion:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.notice .text-btn {
  text-align: left;
}

/* Task-focused phone screens. The active record stays above the safe area. */
body {
  --nav-height: 65px;
}

.heading h1 {
  font-size: 26px;
}

.heading .kicker {
  font-size: 13px;
  margin-bottom: 2px;
}

.btn, .mark {
  min-height: 48px;
  font-size: 15px;
}

label, .fine, .save-status, .text-btn {
  font-size: 13px;
}

.heading>p:not(.kicker) {
  font-size: 14px;
  margin-top: 6px;
}

.bottom-nav {
  padding-top: 6px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav button {
  position: relative;
  flex-direction: column;
  gap: 3px;
  min-height: 52px;
  border-radius: 12px;
}

.bottom-nav button.active {
  background: var(--wash);
  color: var(--accent);
}

.nav-count {
  position: absolute;
  top: 0;
  left: calc(50% + 9px);
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
  border: 2px solid var(--panel);
  font-size: 11px;
}

.week-guidance {
  padding: 10px 12px;
  margin: 10px 0;
  background: var(--wash);
  border: 0;
  border-radius: 12px;
}

.week-next>div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.week-next strong {
  font-size: 15px;
}

.week-next span {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.week-next p {
  font-size: 12px;
  margin-top: 7px;
}

.week-next p:empty {
  display: none;
}

.week-next.attention strong {
  color: var(--gold);
}

.record-progress {
  display: block;
  width: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.record-progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 3px;
}

.record-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 3px;
}

.record-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 3px;
}

.date-line {
  margin: 8px 0 4px;
}

.date-line input {
  margin-left: auto;
  max-width: 200px;
}

.roster-feedback {
  margin: 0 0 6px;
  min-height: 28px;
}

.person-title small {
  flex-shrink: 0;
}

.completion .stats {
  margin: 12px 0;
  grid-column: 1 / -1;
}

.task-dock, .visit-save-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  width: min(100%, 760px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -4px 20px rgba(32, 63, 50, .04);
  z-index: 9;
}

.task-dock>span {
  font-size: 13px;
  color: var(--soft);
}

.task-dock .btn {
  min-width: 132px;
  flex-shrink: 0;
}

.has-week-dock .app-shell {
  padding-bottom: calc(168px + env(safe-area-inset-bottom));
}

.has-week-dock .person, .has-week-dock .completion {
  scroll-margin-bottom: calc(158px + env(safe-area-inset-bottom));
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  margin: -6px 0 2px;
}

.visit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.visit-heading>div {
  min-width: 0;
}

.record-state {
  display: inline-block;
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 8px;
  color: var(--soft);
  background: var(--wash);
  border-radius: 7px;
  font-style: normal;
}

.record-state.pending {
  color: var(--gold);
  background: var(--gold-soft);
}

.record-state.received {
  color: var(--accent);
  background: var(--wash);
}

.visit-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.visit-meta label {
  margin: 0;
  min-width: 0;
}

.visit-meta input, .visit-meta select {
  min-width: 0;
  max-width: 100%;
  padding: 9px 8px;
}

.visit-selection {
  padding: 14px 12px 0;
  overflow: hidden;
}

.visit-section-heading {
  min-height: 24px;
}

.visit-section-heading h2 {
  font-size: 17px;
}

.visit-selection .selection-hint {
  font-size: 13px;
  margin: 5px 0 12px;
}

.visit-choices {
  display: block;
  max-height: 340px;
  max-height: min(42svh, 390px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  margin: 0 -12px;
  padding: 0 12px;
  scroll-padding: 12px;
}

.visit-choice-row {
  padding: 8px 0 12px;
  border-top: 1px solid var(--line);
}

.visit-choice-row:first-child {
  border-top: 0;
}

.visit-choice-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 7px;
}

.visit-choice-name>div {
  min-width: 0;
}

.visit-choice-name strong {
  display: block;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.visit-choice-name small {
  display: block;
  color: var(--soft);
  margin-top: 2px;
}

.remove-person {
  min-width: 44px;
  flex-shrink: 0;
  color: var(--soft);
}

.mark.selected[data-visit-status=not_seen], .unseen {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.visit-note-label {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin: 18px 0 0;
}

.visit-note-label textarea {
  display: block;
  margin: 8px 0 5px;
}

.optional {
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

.visit-editing .bottom-nav {
  display: none;
}

.visit-editing .app-shell {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.visit-save-bar {
  bottom: 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  padding-top: 12px;
}

.visit-save-bar>div {
  min-width: 0;
}

.visit-save-bar strong, .visit-save-bar span {
  display: block;
}

.visit-save-bar strong {
  font-size: 14px;
}

.visit-save-bar span {
  font-size: 12px;
  color: var(--soft);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.visit-save-bar .btn {
  flex-shrink: 0;
  min-width: 108px;
}

.visit-history-row {
  align-items: flex-start;
  padding: 16px 0;
  gap: 10px;
}

.visit-history-row strong {
  font-size: 15px;
}

.visit-history-row em {
  max-width: 112px;
  white-space: normal;
}

.visit-detail-person .unseen {
  background: none;
}

.sync-hero {
  padding: 18px;
}

.sync-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sync-count {
  margin: 0;
  font-size: 48px;
}

.sync-count small {
  font-size: 13px;
}

.sync-breakdown {
  margin-top: 12px;
}

.sync-breakdown span {
  margin: 0 5px;
}

.sync-hero .sync-instruction {
  font-size: 13px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sync-hero .last-sync {
  font-size: 12px;
  margin: 6px 0 0;
}

.sync-hero .save-status {
  margin-top: 6px;
}

.sync-drafts h2, .sync-pending h2 {
  font-size: 16px;
  margin-bottom: 5px;
}

.sync-pending>.fine {
  margin: 12px 0 0;
  font-size: 12px;
}

.pending-row>div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.keyboard-done {
  display: none;
}

.entering-text .keyboard-done {
  display: inline-flex;
  align-items: center;
}

.entering-text .bottom-nav {
  display: none;
}

.entering-text .task-dock, .entering-text .visit-save-bar {
  position: static;
  transform: none;
  width: auto;
  margin: 16px -16px 0;
  padding-bottom: 12px;
  box-shadow: none;
}

.entering-text .app-shell {
  padding-bottom: 24px;
}

@media(min-width:700px) {
  .visit-choice-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
    align-items: center;
  }
  .visit-choice-name {
    margin: 0;
  }
}

@media(max-width:360px) {
  .visit-heading {
    align-items: flex-start;
  }
  .visit-heading .record-state {
    max-width: 98px;
  }
  .sync-total {
    align-items: flex-start;
  }
  .sync-total .record-state {
    margin-top: 8px;
  }
}

.week-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.week-heading .date-line {
  display: block;
  margin: 0;
}

.week-heading .date-line label {
  display: grid;
  gap: 3px;
}

.week-heading .date-line input {
  width: 100%;
  min-width: 0;
  margin: 0;
  max-width: none;
}

.week-heading h1 {
  font-size: 24px;
}

.visit-editing .topbar {
  display: none;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.visit-editing .editor-toolbar {
  padding-top: calc(4px + env(safe-area-inset-top));
}

.editor-toolbar .back-link {
  margin: 0;
}

.editor-toolbar>[data-action=lock] {
  min-width: 44px;
  color: var(--soft);
}

.visit-save-bar {
  gap: 8px;
}

.visit-save-bar>div {
  flex: 1;
}

.visit-save-bar .note-shortcut {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

@media(max-width:360px) {
  .week-heading {
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 8px;
  }
  .week-heading h1 {
    font-size: 22px;
  }
  .week-heading .kicker {
    font-size: 12px;
  }
  .visit-save-bar .btn {
    min-width: 96px;
    padding-inline: 10px;
  }
}

@media(max-height:650px) {
  .week-heading {
    margin-block: 6px;
  }
  .week-guidance {
    margin-block: 8px;
    padding-block: 8px;
  }
}


/* Daily attendance: large text, clear selections, three stable destinations. */
body { --nav-height: 78px; font-size: 17px; }
.bottom-nav button { min-height: 66px; font-size: 16px; gap: 5px; }
.bottom-nav svg { width: 23px; height: 23px; }
.week-heading { display: block; position: relative; margin: 16px 0; }
.week-heading h1 { font-size: 28px; margin-bottom: 7px; overflow-wrap: anywhere; }
.week-heading .kicker { font-size: 15px; }
.attendance-date-label { font-size: 19px; margin: 0; font-weight: 600; }
.attendance-tools { margin-top: 8px; }
.attendance-tools summary { width: fit-content; min-height: 44px; padding: 10px 0; font-size: 16px; color: var(--soft); }
.attendance-tools[open] { padding: 0 14px 12px; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.attendance-tools label { font-size: 16px; margin: 8px 0 12px; }
.attendance-tools input { max-width: 100%; min-width: 0; }
.attendance-tools .fine { margin: 6px 0 0; font-size: 15px; }
.date-notice { font-size: 17px; }
.date-notice .text-btn { display: block; font-size: 17px; }
.week-next strong { font-size: 21px; line-height: 1.4; }
.week-next>div { align-items: flex-start; }
.week-next>div>span { font-size: 16px; flex-shrink: 0; }
.week-next p { font-size: 17px; line-height: 1.6; margin-bottom: 0; }
.roster-feedback { margin-block: 12px; }
.roster-feedback .save-status { font-size: 16px; }
.list-tools { gap: 10px; }
.list-tools input { min-height: 52px; font-size: 18px; }
.list-tools .filter-btn { min-height: 52px; font-size: 16px; padding-inline: 12px; }
.family-head { font-size: 16px; padding: 12px 16px; }
.family-head strong { overflow-wrap: anywhere; }
.family .person { padding: 18px 16px; }
.family .person-title { margin-bottom: 12px; gap: 10px; }
.family .person-title strong { font-size: 23px; line-height: 1.4; }
.family .person-title small { font-size: 16px; white-space: nowrap; }
.family .marks { gap: 8px; }
.family .mark { min-height: 58px; font-size: 19px; padding: 10px 5px; border-width: 2px; font-weight: 600; }
.family .mark.selected:disabled { opacity: .8; }
.undo-mark { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; width: 100%; min-height: 52px; margin: 12px 0; padding: 12px; color: var(--accent); background: var(--wash); border-radius: 10px; text-align: left; font-size: 17px; }
.undo-mark span { color: var(--soft); font-size: 15px; overflow-wrap: anywhere; }
.completion h2 { font-size: 23px; }
.completion p, .completion label { font-size: 17px; }
.completion .stats span { font-size: 16px; }
.completion .btn, .task-dock .btn, .sync-hero .btn { min-height: 56px; font-size: 19px; }
.task-dock>span { font-size: 16px; }
.has-week-dock .app-shell { padding-bottom: calc(188px + env(safe-area-inset-bottom)); }
.has-week-dock .person, .has-week-dock .completion { scroll-margin-bottom: 180px; }
.more-menu { padding: 0 18px; }
.more-menu button { display: block; width: 100%; padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.more-menu button:last-child { border: 0; }
.more-menu strong, .more-menu span { display: block; }
.more-menu strong { font-size: 21px; }
.more-menu span { margin-top: 5px; color: var(--soft); font-size: 16px; }
.sync-hero .sync-instruction, .sync-hero .save-status { font-size: 17px; line-height: 1.6; }
.sync-hero .last-sync, .sync-pending>.fine { font-size: 15px; }
.sync-count small, .record-state { font-size: 15px; }
.sync-pending h2, .sync-drafts h2 { font-size: 20px; }
.transfer-steps { padding-left: 24px; }
.transfer-steps li { margin-bottom: 10px; }
#transfer-options summary, #storage-options summary { min-height: 48px; font-size: 17px; }
#receipt-form label, #storage-options label { font-size: 16px; }
#receipt-form .btn { min-height: 54px; font-size: 18px; }
.support-note { font-size: 16px; line-height: 1.7; }
@media(min-width:700px) {
  .family .person-title { margin-bottom: 0; }
  .family .person { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media(max-width:360px) {
  .family .person { padding-inline: 12px; }
  .family .person-title strong { font-size: 22px; }
  .family .person-title small { font-size: 15px; }
  .family .marks { gap: 6px; }
  .family .mark { font-size: 18px; }
  .list-tools { flex-wrap: wrap; }
  .list-tools input { width: 100%; flex-basis: 100%; }
  .week-next>div { flex-wrap: wrap; }
}
.entering-text .app-shell { padding-bottom: 24px; }
