* { box-sizing: border-box; }
body {
  margin: 0;
  padding: clamp(4px, 2.5vw, 22px);
  background: #f2f6f8;
  font: 14px/1.4 system-ui, sans-serif;
  color: var(--foreground, #20252a);
}
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--ring, #006aa2); outline-offset: 2px; }
.app {
  --surface: #fff; --text: #222; --secondary: #535b62; --line: #e4e8eb;
  --quiet: #f3f5f6; --hover: #e9edf0; --blue: #006aa2; --blue-soft: #e4f2fb;
  --green: #135940; --green-soft: #e0f2e8; --amber: #714511; --amber-soft: #fbefdc;
  container-type: inline-size;
  width: 100%; max-width: 780px; margin: 0 auto; padding: 0 8px 8px; border-radius: 15px;
  color: var(--text); background: #0082c9;
}
.topbar {
  display: flex; align-items: center; gap: 9px; color: #fff; margin: 0 -8px;
  min-height: 52px; padding: 8px 13px;
  background: linear-gradient(100deg, #005e91 15%, #0071ae 82%, #0082c9);
  border-radius: 15px 15px 0 0;
}
.topbar h1 { font-size: 16px; font-weight: 680; line-height: 1.2; margin: 0; }
.calendar-icon { position: relative; flex: none; width: 20px; height: 19px; border: 2px solid; border-radius: 4px; }
.calendar-icon::before { content: ""; position: absolute; inset: 4px 0 auto; border-top: 2px solid; }
.calendar-icon::after { content: ""; position: absolute; left: 4px; top: 9px; width: 4px; height: 3px; border: solid; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.panel { padding: 13px; border-radius: 12px; background: var(--surface); }
.panel button:focus-visible { outline-color: var(--blue); outline-offset: -2px; }
.week { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding-bottom: 11px; }
.week h2 { margin: 0; font-size: clamp(15px, 4cqw, 21px); font-weight: 680; line-height: 1.2; }
.week-number { margin: 3px 0 0; color: var(--secondary); font-size: 12px; }
.controls { display: flex; gap: 4px; }
.controls button {
  min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; border-radius: 22px;
  background: var(--quiet);
}
.controls button:hover:not(:disabled) { background: var(--hover); }
.controls .arrow { font-size: 24px; line-height: 1; }
.controls .today { color: var(--blue); background: var(--blue-soft); font-weight: 650; }
.controls .today:disabled { color: var(--secondary); background: var(--quiet); }
.plan { table-layout: fixed; border-collapse: collapse; width: 100%; }
.plan col { width: 25%; }
.plan thead th { padding: 7px 2px; background: var(--quiet); font-size: 13px; }
.plan thead th:first-child { border-radius: 8px 0 0 8px; text-align: left; padding-left: 7px; }
.plan thead th:last-child { border-radius: 0 8px 8px 0; }
.plan tbody th, .plan td { padding: 4px 2px; border-bottom: 1px solid var(--line); }
.plan tbody th { padding-left: 6px; text-align: left; font-weight: 400; }
.plan tbody tr:last-child > * { border-bottom: 0; }
.day { display: block; font-weight: 680; font-size: 13px; line-height: 1.25; }
time { color: var(--secondary); font-size: 12px; }
.short-day { display: none; text-decoration: none; }
tr[data-today="true"] th { box-shadow: inset 3px 0 var(--blue); background: var(--blue-soft); }
.day-status { display: block; font-size: 11px; color: var(--secondary); line-height: 1.2; }
.day-status[data-status="away"] { color: var(--amber); }
.cell {
  width: 100%; min-height: 46px; padding: 4px 2px; border: 0; border-radius: 8px;
  background: var(--quiet); color: var(--secondary); line-height: 1.2; font-size: 13px;
}
.cell:hover { box-shadow: inset 0 0 0 1px var(--blue); }
.cell[data-state="visit"] { background: var(--green-soft); color: var(--green); font-weight: 680; }
.cell[data-state="away"] { background: var(--amber-soft); color: var(--amber); }
.cell[data-state="cancelled"] { background: var(--quiet); color: var(--secondary); }
.skip {
  display: block; width: fit-content; min-height: 27px; padding: 3px 0; border: 0;
  background: transparent; color: var(--blue); font-size: 11px; line-height: 1.15; text-align: left;
}
.skip:hover { text-decoration: underline; }
.skip[hidden] { display: none; }
.parents-days { margin: 0; padding: 0; list-style: none; }
.parents-day {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line);
}
.parents-day:last-child { border-bottom: 0; }
.parents-day[data-today="true"] { box-shadow: inset 3px 0 var(--blue); background: var(--quiet); }
.parents-day-info { min-width: 0; overflow-wrap: anywhere; }
.parents-day-date { color: var(--secondary); font-size: 14px; }
.parents-day-date time { font-size: inherit; white-space: nowrap; }
.parents-visit { margin: 2px 0 0; font-size: 17px; font-weight: 680; line-height: 1.2; }
.parents-visit[data-planned="true"] { color: var(--green); }
.parents-skip {
  flex-shrink: 0; width: clamp(128px, 48%, 190px); min-height: 54px;
  padding: 7px 8px; border: 1px solid var(--blue); border-radius: 10px;
  color: var(--blue); background: var(--blue-soft);
  font-size: 15px; font-weight: 700; line-height: 1.15; text-align: center; text-wrap: balance;
}
.parents-skip:hover { background: var(--quiet); text-decoration: none; }
.note { margin: 9px 0 0; color: var(--secondary); font-size: 12px; }
@container (max-width: 414px) {
  .panel { padding: 9px 6px; }
  .week { padding-inline: 2px; }
  .short-day { display: inline; }
  .full-day { display: none; }
}
@container (max-width: 344px) {
  .week { grid-template-columns: 1fr; }
  .controls { justify-content: start; }
  .cell { font-size: 12px; }
}
@media (prefers-color-scheme: dark) {
  body { background: #181b1e; }
  .app {
    --surface: #202326; --text: #f3f5f7; --secondary: #bdc5ca; --line: #363c41;
    --quiet: #2c3136; --hover: #373f46; --blue: #8dcfff; --blue-soft: #1d3c52;
    --green: #a3e8c2; --green-soft: #234735; --amber: #f7d899; --amber-soft: #4b3924;
  }
}

.topbar h1 { flex: 1; }
.logout button {
  min-height: 38px; border: 1px solid #ffffff70; border-radius: 20px;
  padding: 4px 9px; background: #004d78; color: #fff; font-size: 12px;
}
th.own-column { background: var(--blue-soft); color: var(--blue); }
span.cell {
  display: grid; place-items: center; text-align: center;
  background: transparent;
}
span.cell:hover { box-shadow: none; }
.auth-panel { padding: clamp(14px, 4vw, 27px); }
.auth-panel h2 { margin: 0 0 8px; font-size: 21px; }
.auth-form { display: grid; gap: 13px; max-width: 380px; }
.auth-form label { display: grid; gap: 4px; }
.auth-form input, .auth-form select {
  min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; background: var(--quiet); color: var(--text); font: inherit;
}
.auth-form button {
  justify-self: start; min-height: 44px; border: 0; border-radius: 22px;
  padding: 6px 16px; background: var(--blue); color: var(--surface); font-weight: 660;
}
.feedback { margin: 7px 0 0; padding: 7px 9px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); }
.parents-link { margin-top: 13px; padding-top: 8px; border-top: 1px solid var(--line); }
.parents-link summary { color: var(--blue); cursor: pointer; }
.parents-link label { display: block; margin-top: 8px; }
.parents-link input {
  display: block; width: 100%; padding: 8px; margin: 4px 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--quiet); color: var(--text);
}
.parents-link button {
  min-height: 37px; padding: 4px 9px; border: 0; border-radius: 18px;
  background: var(--blue-soft); color: var(--blue);
}
