:root {
  color-scheme: light;
  --ink: #24302b;
  --muted: #728078;
  --line: #e5ebe6;
  --surface: #ffffff;
  --page: #f5f8f5;
  --accent: #276e52;
  --accent-soft: #e8f2ec;
  --absence: #e9a6a3;
  --absence-dark: #934c4b;
  --busy: #f4dfa1;
  --busy-dark: #80651d;
  --free: #dcefdc;
  --shadow: 0 18px 45px rgba(37, 69, 52, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 85% 0%, #e9f4eb 0, transparent 34rem), var(--page); }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 34px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; line-height: 1; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.subhead { margin: 0; color: var(--muted); font-size: 15px; }
.share-card { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; min-width: 310px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.share-label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 700; }
.share-card code { align-self: center; overflow: hidden; color: var(--accent); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.button, .icon-button { border: 0; color: white; background: var(--accent); transition: transform .15s ease, opacity .15s ease; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button { padding: 11px 17px; border-radius: 10px; font-weight: 750; }
.button-small { padding: 8px 11px; font-size: 12px; }
.button-ghost { margin-left: 7px; color: var(--accent); background: var(--accent-soft); }
.icon-button { width: 35px; height: 35px; border-radius: 50%; font-size: 18px; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; }
.month-control { display: flex; align-items: center; gap: 11px; }
.month-control h2 { min-width: 185px; text-align: center; text-transform: capitalize; }
.legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 12px; font-weight: 650; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.absence { background: var(--absence); }.legend-dot.busy { background: var(--busy); }.legend-dot.booking { background-color: #f7dfa1; background-image: repeating-linear-gradient(135deg, transparent 0, transparent 3px, rgba(0,0,0,.28) 3px, rgba(0,0,0,.28) 4px); }.legend-dot.free { background: var(--free); border: 1px solid #c5e0c5; }
.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: #fbfcfb; }
.calendar-weekdays span { padding: 13px 14px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.day { min-height: 143px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.day:nth-child(7n) { border-right: 0; }.day:nth-last-child(-n+7) { border-bottom: 0; }
.day.outside { background: #fafcfb; }.day.outside .day-number { color: #b7c1ba; }
.day.weekend { background: #fcfdfc; }
.day.today .day-number { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; color: white; border-radius: 50%; background: var(--accent); }
.day-number { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
.day-weekday { display: none; }
.day-content > :last-child { margin-bottom: 0; }
.day-free { min-height: 70px; padding: 10px 8px; border-radius: 10px; background: var(--free); color: #46704f; font-size: 11px; line-height: 1.4; }
.entry { position: relative; margin-bottom: 6px; padding: 8px 9px 8px 10px; border-radius: 9px; font-size: 11px; line-height: 1.3; }
.entry::before { position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: currentColor; content: ""; }
.entry.absence { color: var(--absence-dark); background: #f8dfde; }.entry.busy { color: var(--busy-dark); background: #fff2c9; }
.entry.booking { color: #3c3a2f; background-color: #f7dfa1; background-image: repeating-linear-gradient(135deg, transparent 0, transparent 7px, rgba(0,0,0,.28) 7px, rgba(0,0,0,.28) 9px); }
.entry-title { display: block; padding-left: 4px; font-weight: 800; }.entry-time { display: block; padding-left: 4px; margin-top: 3px; opacity: .85; }.entry-topic { display: block; padding-left: 4px; margin-top: 4px; font-size: 10px; opacity: .85; }
.delete-entry { position: absolute; top: 4px; right: 5px; padding: 0 2px; border: 0; color: inherit; background: transparent; opacity: .55; }
.delete-entry:hover { opacity: 1; }
.command-panel { margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.booking-panel { margin-top: 16px; padding: 22px; border: 1px solid #eadcae; border-radius: 18px; background: #fffdf4; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 17px; }
.access-badge { padding: 6px 9px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.command-row { display: flex; gap: 9px; }.command-row input { min-width: 0; flex: 1; padding: 12px 13px; border: 1px solid #d7e1d9; border-radius: 10px; color: var(--ink); outline: 0; }.command-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39,110,82,.12); }
.booking-fields { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 12px; }.booking-fields input, .booking-fields select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #d7e1d9; border-radius: 10px; color: var(--ink); background: white; }.booking-fields input:focus, .booking-fields select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(39,110,82,.12); }.identity-fields { grid-template-columns: 1fr 1fr auto; align-items: end; margin-top: 14px; }.identity-fields .button { height: 43px; }.private-label { color: var(--accent); font-size: 10px; font-weight: 500; }
.booking-badge { color: #80651d; background: #fff1bd; }
.form-hint, .form-result { margin: 9px 0 0; color: var(--muted); font-size: 12px; }.form-result { min-height: 18px; }.form-result.error { color: #a24f4d; }.form-result.success { color: var(--accent); }
.notice { margin: -12px 0 20px; padding: 11px 14px; border-radius: 10px; color: #70591b; background: #fff2c9; font-size: 13px; }
.login-panel { margin-bottom: 20px; padding: 22px; border: 1px solid #d8e5dc; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.narrow-shell { max-width: 620px; }.cancel-card h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 42px); }.cancel-card .button { margin-top: 22px; }
.footer-note { display: flex; justify-content: space-between; gap: 15px; margin-top: 17px; color: var(--muted); font-size: 11px; }.footer-note a { color: var(--accent); }
@media (max-width: 760px) {
  .shell { width: min(100% - 16px, 620px); padding-top: 18px; }
  .topbar { display: block; margin-bottom: 22px; }
  h1 { font-size: 32px; }
  .share-card { min-width: 0; margin-top: 16px; }
  .controls { display: grid; gap: 13px; }
  .month-control { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 8px; }
  .month-control h2 { min-width: 0; text-align: center; }
  .month-control .button-ghost { grid-column: 1 / -1; width: 100%; margin: 0; }
  .legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; margin-top: 0; }
  .calendar-card { overflow: hidden; border-radius: 16px; }
  .calendar-weekdays { display: none; }
  .calendar-grid { display: block; min-width: 0; }
  .day { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 82px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .day.outside { display: none; }
  .day-number { justify-content: center; gap: 5px; width: 64px; margin: 0; padding: 8px 7px; border-radius: 13px; color: #52665a; background: #f1f5f2; font-size: 14px; }
  .day-weekday { display: inline; color: #75857b; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .day.weekend .day-weekday { color: var(--absence-dark); }
  .day.today .day-number { width: 64px; height: auto; padding: 8px 7px; border-radius: 13px; color: white; }
  .day.today .day-weekday { color: rgba(255,255,255,.8); }
  .day-content { display: grid; gap: 8px; min-width: 0; }
  .day-free, .entry { width: 100%; min-height: 0; margin: 0; padding: 11px 13px; border-radius: 12px; font-size: 13px; line-height: 1.35; }
  .entry::before { top: 10px; bottom: 10px; width: 4px; }
  .entry-title, .entry-time, .entry-topic { padding-left: 6px; }
  .command-row { display: grid; grid-template-columns: 1fr; }
  .booking-fields, .identity-fields { grid-template-columns: 1fr; }
  .identity-fields .button { width: 100%; }
  .icon-button { width: 42px; height: 42px; }
  .button { min-height: 43px; }
  .command-panel, .booking-panel, .login-panel { padding: 17px; border-radius: 16px; }
  .footer-note { display: block; }
  .footer-note a { display: inline-block; margin-top: 6px; }
}
