:root {
  /* Apple system grays (light) */
  --bg: #f2f2f7;          /* systemGray6 */
  --surface: #ffffff;     /* systemBackground */
  --surface-muted: #e5e5ea; /* systemGray5 */
  --text: #1c1c1e;        /* label */
  --text-muted: #8e8e93;  /* systemGray */
  --border: #d1d1d6;      /* systemGray4 */

  --brand: rgb(31, 156, 67);
  --brand-strong: rgb(24, 124, 53);
  --brand-soft: #e1f4e7;
  --brand-ink: #ffffff;

  --weekend: #d64545;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.04);
  --shadow-lg: 0 1px 2px rgba(20, 22, 28, 0.04),
    0 16px 40px rgba(20, 22, 28, 0.07);

  --font: "Google Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "YS Text", "Helvetica Neue", "Inter", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Apple system grays (dark) */
    --bg: #1c1c1e;          /* systemGray6 dark */
    --surface: #2c2c2e;     /* secondarySystemBackground dark */
    --surface-muted: #3a3a3c; /* systemGray5 dark */
    --text: #f2f2f7;        /* label dark */
    --text-muted: #8e8e93;  /* systemGray (одинаковый в обеих темах) */
    --border: #38383a;      /* systemGray4 dark */

    --brand: rgb(64, 192, 102);
    --brand-strong: rgb(95, 210, 130);
    --brand-soft: rgba(31, 156, 67, 0.18);
    --brand-ink: #1c1c1e;

    --weekend: #ff7a7a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4),
      0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: clamp(16px, 2.4vw, 18px);
  background: radial-gradient(
      1200px 600px at 100% -10%,
      var(--brand-soft) 0%,
      transparent 55%
    ),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 28px)
    max(24px, env(safe-area-inset-bottom));
  display: grid;
  gap: clamp(16px, 3vw, 22px);
}

/* ── Hero ────────────────────────────────────────────────────── */

.hero {
  padding: 4px 2px 0;
}

.hero__eyebrow {
  margin: 0 0 10px;
  font-size: clamp(12px, 2vw, 14px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-strong);
  font-weight: 700;
}

.hero__title {
  margin: 0 0 14px;
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(17px, 3vw, 21px);
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
  font-weight: 400;
}

.hero__subtitle b {
  color: var(--text);
  font-weight: 700;
}

.hero__subtitle .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 0.94em;
  letter-spacing: 0;
}

.hero__subtitle .pill--muted {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.hero__subtitle .pill--holiday {
  background: var(--weekend);
  color: #fff;
}

/* ── Cards ───────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(16px, 3.5vw, 24px);
}

.card--calendar {
  padding: clamp(14px, 3vw, 20px);
}

/* ── Legend ──────────────────────────────────────────────────── */

.legend__title {
  margin: 0 0 12px;
  font-size: clamp(18px, 2.8vw, 22px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.legend__text,
.legend__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(16px, 2.4vw, 18px);
  line-height: 1.55;
  font-weight: 400;
}

.legend__hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.legend__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.legend__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(16px, 2.4vw, 18px);
  color: var(--text);
  font-weight: 400;
}

.legend__list b {
  font-weight: 700;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ── Approval block ──────────────────────────────────────────── */

.approval {
  margin-top: 22px;
  padding: 18px 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  position: relative;
  text-align: left;
}

.approval__label {
  margin: 0 0 4px;
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.approval__signature {
  display: block;
  max-width: min(220px, 60%);
  height: auto;
  margin: 6px 0 -4px;
  mix-blend-mode: multiply;
  transform: rotate(-3deg);
  transform-origin: left center;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .approval__signature {
    mix-blend-mode: screen;
    filter: invert(1) hue-rotate(180deg);
  }
}

.approval__name {
  margin: 6px 0 2px;
  font-size: clamp(15px, 2.4vw, 17px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}

.approval__title {
  margin: 0;
  font-size: clamp(13px, 2.2vw, 15px);
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

.approval--no-signature .approval__signature {
  display: none;
}

/* ── Footer ──────────────────────────────────────────────────── */

.footer {
  text-align: center;
  font-size: clamp(13px, 2vw, 14px);
  color: var(--text-muted);
  padding: 8px 0 4px;
  font-weight: 400;
}
