:root {
  --cream: #fbf6ea;
  --card: #fffdf7;
  --ink: #1d2b29;
  --muted: #5d6b68;
  --line: #e6dcc6;
  --teal: #0f4c45;
  --teal-2: #17655b;
  --orange: #e8772e;
  --orange-soft: #fde7d3;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
}

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

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--orange); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Header */
.site-header { background: var(--teal); color: #fdf8ee; border-bottom: 1px solid rgba(255,255,255,.12); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }
.badge { font-size: .8rem; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--teal) 0%, var(--teal-2) 100%); color: #fdf8ee; padding: 28px 0 40px; }
.hero-inner { text-align: center; }
.hero-date { font-size: .9rem; opacity: .8; text-transform: capitalize; }
.hero-title { font-size: clamp(1.4rem, 4.5vw, 2.1rem); font-weight: 650; margin-top: 6px; line-height: 1.2; }
.hero-count { display: flex; flex-direction: column; align-items: center; margin-top: 20px; }
.big-number { font-size: clamp(5rem, 24vw, 10rem); font-weight: 800; line-height: 1; color: #ffb780; font-variant-numeric: tabular-nums; }
.big-suffix { font-size: clamp(1rem, 3.5vw, 1.4rem); margin-top: 4px; }
.deadline { margin-top: 6px; opacity: .85; font-size: .95rem; }
.deadline strong { color: #ffb780; }

.mini-counters { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.mini { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); padding: 10px 22px; min-width: 140px; display: flex; flex-direction: column; }
.mini-number { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mini-label { font-size: .82rem; opacity: .8; }

.progress-block { max-width: 560px; margin: 26px auto 0; text-align: left; }
.progress-head { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; }
progress { width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.2); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: rgba(255,255,255,.2); }
progress::-webkit-progress-value { background: var(--orange); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--orange); border-radius: 999px; }

.share { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.btn-accent { font: inherit; font-weight: 650; background: var(--orange); color: #fff; border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer; transition: filter .15s, transform .1s; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-accent:active { transform: translateY(1px); }
.copy-status { min-height: 1.3em; font-size: .88rem; color: #ffd9b8; }
.summary-details { width: 100%; max-width: 560px; text-align: left; font-size: .88rem; }
.summary-details summary { cursor: pointer; opacity: .85; text-align: center; }
.summary-details textarea { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; resize: vertical; }

/* Content */
.content { padding-top: 28px; padding-bottom: 36px; display: grid; gap: 22px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; }
.panel h2 { font-size: 1.25rem; color: var(--teal); }

/* Week */
.week-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.week-label { color: var(--muted); font-size: .92rem; }
.week-controls { display: flex; gap: 6px; }
.week-controls button { font: inherit; min-width: 44px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--teal); cursor: pointer; font-weight: 600; }
.week-controls button:hover { background: var(--orange-soft); border-color: var(--orange); }

.week-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.day-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.day-name { font-weight: 700; color: var(--teal); }
.day-date { color: var(--muted); font-size: .85rem; }
.today-tag { display: none; margin-left: auto; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--orange); color: #fff; padding: 2px 8px; border-radius: 999px; }
.is-today { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }
.is-today .today-tag { display: inline-block; }
.day-body { display: flex; flex-direction: column; gap: 6px; }

.lesson { --subject-color: #d9ecea; background: var(--subject-color); border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 1px; border-left: 4px solid rgba(0,0,0,.18); }
.lesson-time { font-size: .76rem; color: rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.lesson-name { font-size: .9rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.empty-day, .day-note { font-size: .85rem; color: var(--muted); }
.day-note { font-style: italic; }

.day-card.holiday { background: #fdeede; border-color: #f2c79f; }
.day-card.recess { background: #eaf2ef; border-color: #bcd5cd; }
.day-card.holiday .day-name { color: #b3541a; }

/* Weekend compact */
.day-card.weekend, .day-card:nth-child(n+6) { padding: 8px 12px; background: #faf5e8; }
.day-card:nth-child(n+6) .day-body { gap: 2px; }

/* Subjects */
.subject-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.subject-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; min-width: 0; }
.subject-name { font-weight: 650; overflow-wrap: anywhere; }
.subject-count { font-size: 1.6rem; font-weight: 800; color: var(--orange); line-height: 1.1; }
.subject-count span { font-size: .82rem; font-weight: 500; color: var(--muted); }
.subject-card { border-top: 4px solid var(--subject-color, var(--line)); }
.subject-last { font-size: .82rem; color: var(--muted); }
.subject-card progress { height: 8px; background: var(--line); }
.subject-card progress::-webkit-progress-bar { background: var(--line); }
.subject-card progress::-webkit-progress-value { background: var(--teal-2); }
.subject-card progress::-moz-progress-bar { background: var(--teal-2); }

/* Holidays */
.holidays-list { display: grid; gap: 8px; margin-top: 12px; }
.holiday-item { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.holiday-date { font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.holiday-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.holiday-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--orange); }
.holiday-name { font-weight: 600; overflow-wrap: anywhere; }
.holiday-note { font-size: .83rem; color: var(--muted); }

/* Footer */
.site-footer { background: #efe6d0; border-top: 1px solid var(--line); padding: 20px 0 28px; font-size: .85rem; color: var(--muted); }

/* Tablet */
@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .panel { padding: 24px; }
  .subject-list { grid-template-columns: repeat(2, 1fr); }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: 5 weekday columns, weekend cards share a row */
@media (min-width: 1024px) {
  .week-grid { grid-template-columns: repeat(10, 1fr); }
  .day-card { grid-column: span 2; }
  .day-card:nth-child(n+6) { grid-column: span 5; }
  .subject-list { grid-template-columns: repeat(3, 1fr); }
  .holidays-list { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 44px 0 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
