:root {
  color-scheme: light;
  font: 16px/1.55 "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1b3046;
  background: #eef3f8;
  --blue: #244fa0;
  --muted: #50657b;
  --line: #dbe5ef;
  --green: #235e49;
  --red: #8b352c;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell, .login { margin-inline: auto; padding: 24px 16px 48px; }
.shell { max-width: 1072px; }
.login { max-width: 454px; padding-top: clamp(40px, 11vh, 112px); }
.login .brand { margin-bottom: 20px; }
.login form { margin-top: 24px; }
.login button { width: 100%; margin-top: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: .91rem; font-weight: 650; }
.brand img { display: block; }
.masthead, .titlebar, .card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.masthead { border-bottom: 1px solid #cbd9e7; padding-bottom: 14px; }
.titlebar { margin: 25px 0 16px; align-items: end; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.42rem, 4.9vw, 2.36rem); line-height: 1.22; font-weight: 700; }
h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; }
.login h1 { font-size: 1.6rem; }
.login .muted { margin-top: 8px; }
.dashboard { display: grid; gap: 14px; align-items: start; }
.card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 17px; }
.card-heading { min-height: 38px; }
.time-zone { font-size: .78rem; }
.date, td { font-variant-numeric: tabular-nums; }
.date { display: block; color: var(--muted); font-size: .92rem; margin-top: 1px; }
.current { margin: 20px 0 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 13px; }
.current-status { font-size: 1.7rem; line-height: 1.25; font-weight: 700; }
.current-status[data-status="taken"] { color: var(--green); }
.current-status[data-status="missed"] { color: var(--red); }
.current-dose { font-size: 1.03rem; font-weight: 650; color: var(--muted); }
.muted { color: var(--muted); }
.hint { font-size: .84rem; margin-top: 9px; }
button, .secondary, .quiet {
  font: inherit;
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.primary { color: white; background: var(--blue); }
.secondary { color: var(--blue); background: white; border-color: #a4b8ce; }
.quiet { color: var(--blue); background: transparent; }
.primary:hover { background: #1e438a; }
.secondary:hover, .quiet:hover { background: #f0f5fc; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #557cca; outline-offset: 3px; }
.today-actions { margin-top: 18px; display: grid; gap: 8px; }
details { margin-top: 17px; padding-top: 12px; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--blue); font-size: .86rem; font-weight: 650; padding-block: 6px; }
.settings-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 8px; }
label { display: block; font-size: .84rem; font-weight: 650; margin-bottom: 4px; }
input, select {
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #a4b8ce;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 9px;
  width: 100%;
  min-width: 0;
}
table { width: 100%; border-collapse: collapse; text-align: left; margin-top: 9px; }
th { font-weight: 600; color: var(--muted); font-size: .76rem; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 4px; white-space: nowrap; }
td { font-size: .83rem; height: 50px; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; text-align: right; }
td .quiet { padding-inline: 5px; }
td.dose { color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  color: #405770;
  background: #edf2f7;
  border-radius: 5px;
  padding: 2px 5px;
}
.badge[data-status="taken"] { color: var(--green); background: #e7f4ed; }
.badge[data-status="missed"] { color: var(--red); background: #f9eeeb; }
.empty { margin: 17px 0 6px; font-size: .87rem; }
.history nav { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.message { color: var(--green); font-size: .86rem; margin: 6px 0 12px; }
.message:empty { display: none; }
.message.error { color: var(--red); }
dialog {
  width: min(420px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
dialog::backdrop { background: #162d45a3; }
dialog label { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 760px) {
  .shell { padding: 36px 30px 60px; }
  .dashboard { grid-template-columns: minmax(285px, .86fr) minmax(0, 1.35fr); gap: 22px; }
  .card { padding: 23px; }
  .titlebar { margin-top: 32px; }
  td { font-size: .9rem; }
}
@media (max-width: 359px) {
  .shell { padding-inline: 10px; }
  .card { padding-inline: 12px; }
}
