
:root {
  --ink: #24182c;
  --muted: #5c5168;
  --paper: #f4f0f7;
  --card: #ffffff;
  --line: #e3d9ec;
  --purple: #52247f;
  --purple-deep: #3b1860;
  --purple-soft: #f3eaf8;
  --gold: #8d7024;
  --gold-bright: #c6a15a;
  --holiday-bg: #fff1e4;
  --holiday-ink: #7a3412;
  --holiday-line: #e3b48a;
  --ok: #1d6b43;
  --ok-bg: #e8f6ee;
  --danger: #8d2434;
  --danger-bg: #fdecee;
  --shadow: 0 1px 2px rgba(36, 24, 44, 0.06);
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Liberation Sans", "Nimbus Sans", sans-serif;
  font-size: 1.02rem;
  line-height: 1.45;
}
a { color: var(--purple); }
a:hover { color: var(--purple-deep); }
.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: white;
  padding: 0.4rem 0.7rem;
  z-index: 5;
}
.skip:focus { top: 0.75rem; }
.topbar {
  background: var(--purple-deep);
  color: white;
  border-bottom: 4px solid var(--gold-bright);
}
.wrap { width: min(1120px, calc(100% - 1.5rem)); margin: 0 auto; }
.brand {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 0.95rem 0 0.7rem;
}
.brand a { color: white; text-decoration: none; }
.eyebrow {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}
.topbar .eyebrow { color: var(--gold-bright); }
.brand h1 { margin: 0.12rem 0 0; font-size: 1.45rem; font-weight: 680; letter-spacing: -0.02em; }
.who { text-align: right; font-size: 0.92rem; }
.who strong { font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 0.35rem; padding-bottom: 0.8rem; align-items: center; }
.nav .inline-form { margin-left: auto; }
.nav .inline-form label { min-width: 9rem; color: white; }
.nav .inline-form select { min-height: 2.5rem; }
.nav a, .nav-button, button.linkish {
  color: white;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font: inherit;
  cursor: pointer;
}
.nav a[aria-current="page"] { background: white; color: var(--purple-deep); }
.nav a:hover, .nav-button:hover { background: rgba(255, 255, 255, 0.12); }
main { padding: 1.15rem 0 3rem; }
footer {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0 2rem;
}
h2 { font-size: 1.25rem; margin: 0 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 0; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 0.9rem; }
.page-head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -0.02em; }
.toolbar, .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
  margin-bottom: 1rem;
}
.login-card { max-width: 28rem; margin: 1.5rem auto; padding: 1.3rem 1.2rem 1.4rem; }
.login-card h2 { font-size: 1.6rem; }
.login-card input[name="code"] {
  font-size: 1.8rem;
  letter-spacing: 0.35rem;
  text-align: center;
}
label { display: block; font-weight: 650; margin: 0 0 0.75rem; }
label span, .label { display: block; margin-bottom: 0.28rem; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  padding: 0.62rem 0.7rem;
  border: 1px solid #cdbfda;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
button, .button {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
}
button.primary, .button.primary {
  background: var(--purple);
  color: white;
  border: 0;
  padding: 0.68rem 1.15rem;
  font-weight: 700;
}
button.secondary, .button.secondary, a.button.secondary {
  background: white;
  color: var(--purple-deep);
  border: 1px solid #cdbfda;
  padding: 0.55rem 0.9rem;
  font-weight: 650;
}
button.danger { background: white; color: var(--danger); border: 1px solid #e3b4bc; padding: 0.55rem 0.9rem; font-weight: 700; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin: 0; }
.inline-form label { margin: 0; min-width: 10rem; }
.grid-2 { display: grid; gap: 0.8rem; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}
.banner { border-radius: 12px; padding: 0.75rem 0.9rem; margin: 0 0 1rem; }
.banner.ok { background: var(--ok-bg); color: #145233; }
.banner.error { background: var(--danger-bg); color: var(--danger); }
.banner.code { background: var(--purple-soft); border: 1px solid #d7c4ea; }
.code-value {
  font-family: "Liberation Mono", ui-monospace, monospace;
  font-size: 2rem;
  letter-spacing: 0.28rem;
  margin: 0.2rem 0;
}
.meta { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0; }
.group-desc, .notes, .ref { margin: 0.28rem 0; }
.ref { overflow-wrap: anywhere; font-size: 0.9rem; }
.holiday-badge, .holiday-alert {
  background: var(--holiday-bg);
  color: var(--holiday-ink);
  border: 1px solid var(--holiday-line);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  font-weight: 700;
  margin: 0.35rem 0;
}
.holiday-alert { font-size: 1rem; }
.progress { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.3rem 0 1rem; }
.chip {
  display: inline-block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}
.chip strong { color: var(--purple-deep); }
.calendar-layout { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .calendar-layout { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr); align-items: start; }
  .day-panel { position: sticky; top: 0.75rem; max-height: calc(100vh - 1.5rem); overflow: auto; }
}
.month-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.month-nav h3 { font-size: 1.2rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.28rem; }
.dow { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.15rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #faf8fb;
  border: 1px solid transparent;
  position: relative;
}
.day.empty { background: transparent; }
.day:hover { background: var(--purple-soft); }
.day.is-selected { background: var(--purple); color: white; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--gold-bright); }
.day.has-holiday:not(.is-selected) { background: var(--holiday-bg); }
.day .num { font-weight: 700; }
.day .count { font-size: 0.68rem; font-weight: 700; color: var(--purple); }
.day.is-selected .count, .day.is-selected .star { color: var(--gold-bright); }
.star { color: var(--holiday-ink); font-weight: 800; line-height: 1; }
.event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.event:first-of-type { border-top: 0; }
.event.is-done .event-title { text-decoration: line-through; }
.event.is-done { opacity: 0.78; }
.event-title { font-size: 1.05rem; white-space: pre-wrap; }
.done-form { margin: 0; }
.check {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9px;
  border: 2px solid var(--purple);
  background: white;
  color: var(--ok);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
}
.check.is-done { background: var(--ok); border-color: var(--ok); color: white; }
.group-block { margin: 0 0 1.2rem; }
.group-block h2 {
  background: var(--purple-soft);
  border-left: 4px solid var(--purple);
  padding: 0.35rem 0.6rem;
  font-size: 1.12rem;
}
.sheet-head { margin-bottom: 1rem; }
.sheet-head h2 { font-size: 1.7rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.82rem; color: var(--muted); }
.user-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.print-only { display: none; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
@media (max-width: 640px) {
  .brand, .page-head { flex-direction: column; align-items: flex-start; }
  .who { text-align: left; }
  .day { min-height: 2.75rem; font-size: 0.92rem; }
  .month-grid { gap: 0.15rem; }
}
@page { size: letter; margin: 0.55in; }
@media print {
  body { background: white; color: black; font-size: 11pt; }
  .topbar, .no-print, footer, .skip, .actions a.button { display: none !important; }
  .print-only { display: block !important; }
  a { color: black; text-decoration: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .event, .group-block h2 { break-inside: avoid; }
  .check {
    width: 0.95rem;
    height: 0.95rem;
    border: 1.5pt solid black;
    border-radius: 2px;
    color: black;
    background: white;
    font-size: 9pt;
    print-color-adjust: exact;
  }
  .holiday-badge, .holiday-alert { border: 1pt solid black; background: white; color: black; }
  .group-block h2 { background: white; border-left: 3pt solid black; }
}
