:root {
  color-scheme: light;
  --ink: #19211e;
  --muted: #68706c;
  --paper: #fffdf8;
  --cream: #f5f0e7;
  --line: #ddd7ca;
  --green: #1f5a46;
  --green-soft: #dce9df;
  --coral: #e2725b;
  --shadow: 0 18px 45px rgba(39, 47, 43, 0.09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(226, 114, 91, 0.14), transparent 28rem),
    radial-gradient(circle at 92% 90%, rgba(31, 90, 70, 0.12), transparent 32rem),
    var(--cream);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
header {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 5vw 30px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
h1 { margin: 4px 0 6px; font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 4.8rem); font-weight: 500; line-height: .95; }
h2 { margin: 5px 0 12px; font-size: 1.25rem; }
p { color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--coral); font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.primary, .secondary, .danger, .today-button, .url-box button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
}
.primary { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(31,90,70,.2); }
.secondary, .today-button { background: var(--green-soft); color: var(--green); }
.danger { background: #f7ded9; color: #a63624; }
.full { width: 100%; }
main { max-width: 1440px; margin: 0 auto; padding: 0 5vw 70px; display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(290px, .8fr); gap: 24px; }
.calendar-card, .side-card { background: rgba(255,253,248,.9); border: 1px solid rgba(221,215,202,.8); box-shadow: var(--shadow); }
.calendar-card { border-radius: 28px; padding: 24px; }
.calendar-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.calendar-toolbar h2 { min-width: 160px; margin: 0; text-align: center; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.icon-button, .close-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.25rem; }
.icon-button:hover, .close-button:hover { background: var(--green-soft); }
.today-button { margin-left: auto; padding: 8px 14px; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { padding: 8px; text-align: center; color: var(--muted); font-size: .78rem; font-weight: 700; }
.day {
  position: relative;
  min-height: 112px;
  padding: 9px;
  overflow: hidden;
  border: solid var(--line);
  border-width: 1px 0 0 1px;
  background: rgba(255,255,255,.45);
  cursor: pointer;
}
.day:nth-child(7n) { border-right-width: 1px; }
.day:nth-last-child(-n+7) { border-bottom-width: 1px; }
.day.outside { color: #aca99f; background: rgba(239,235,226,.45); }
.day.today .day-number { color: white; background: var(--coral); }
.day-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .82rem; font-weight: 700; }
.event-pill { width: 100%; margin-top: 4px; padding: 5px 7px; overflow: hidden; border: 0; border-left: 3px solid var(--coral); border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: .72rem; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
aside { display: flex; flex-direction: column; gap: 24px; }
.side-card { border-radius: 22px; padding: 24px; }
.side-card p { margin: 5px 0 14px; font-size: .9rem; }
.side-card ol { padding-left: 20px; color: var(--muted); font-size: .85rem; line-height: 1.8; }
.side-card small { display: block; color: #8b8175; line-height: 1.5; }
.url-box { display: flex; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.url-box input { min-width: 0; width: 100%; border: 0; padding: 10px 12px; color: var(--muted); outline: 0; }
.url-box button { border-radius: 0; color: white; background: var(--coral); }
.agenda-heading { display: flex; align-items: center; justify-content: space-between; }
.agenda-heading h2 { margin: 0; }
.agenda-heading span { color: var(--muted); font-size: .8rem; }
.agenda-item { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.agenda-item:last-child { border: 0; }
.agenda-date { text-align: center; color: var(--coral); font-weight: 800; }
.agenda-date strong { display: block; font-size: 1.35rem; }
.agenda-date span { font-size: .66rem; }
.agenda-item h3 { margin: 1px 0 3px; font-size: .9rem; }
.agenda-item p { margin: 0; font-size: .75rem; line-height: 1.4; }
.empty { padding: 28px 0; color: var(--muted); text-align: center; }
dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 25px 70px rgba(15,30,24,.25); }
dialog::backdrop { background: rgba(24,31,28,.45); backdrop-filter: blur(3px); }
form { padding: 28px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; }
.dialog-heading h2 { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 500; }
label { display: grid; gap: 7px; margin: 15px 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,90,70,.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: auto; accent-color: var(--green); }
.form-error { min-height: 20px; margin: 0; color: #a63624; font-size: .8rem; }
.dialog-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; align-items: center; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 10; padding: 10px 18px; border-radius: 999px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  aside { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  header { align-items: start; padding-top: 30px; }
  header p { display: none; }
  main { padding-inline: 12px; }
  .calendar-card { padding: 12px; border-radius: 18px; }
  .day { min-height: 78px; padding: 4px; }
  .event-pill { padding: 3px; font-size: .62rem; }
  aside { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .dialog-actions { grid-template-columns: auto 1fr auto; }
  .dialog-actions .primary { grid-column: 1 / -1; }
}
