:root {
    --bg: #f5f5f2;
    --surface: #ffffff;
    --surface-muted: #f0f0ed;
    --text: #151515;
    --text-muted: #686863;
    --line: #ddddda;
    --line-strong: #c9c9c4;
    --primary: #111111;
    --primary-hover: #2b2b2b;
    --danger: #9f2d2d;
    --danger-bg: #fff0f0;
    --success: #217346;
    --warning: #8a5a00;
    --personal: #dfe8ff;
    --work: #e5dfef;
    --health: #dcefe5;
    --other: #f2e5d7;
    --shadow: 0 18px 50px rgba(16, 16, 16, .08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 11px;
    --focus: 0 0 0 3px rgba(17, 17, 17, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; box-shadow: var(--focus); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(221, 221, 218, .9);
    background: rgba(245, 245, 242, .94);
    backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
    overflow: hidden; flex: 0 0 auto; background: #f2c94c;
    box-shadow: inset 0 0 0 1px rgba(151, 103, 0, .18);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--text-muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.status-badge {
    display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 13px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9b9b96; }
.status-badge.is-online .status-dot { background: var(--success); }
.status-badge.is-offline .status-dot { background: var(--warning); }
.status-badge.is-error .status-dot { background: var(--danger); }

.button, .icon-button, .text-button, .filter-chip, .footer-link {
    border: 0; border-radius: 999px; transition: .18s ease; -webkit-tap-highlight-color: transparent;
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; font-weight: 700; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.button-secondary { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.button-secondary:hover { border-color: var(--line-strong); background: #fafafa; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover { filter: brightness(.92); }
.button-large { min-height: 50px; padding: 13px 22px; }
.button-full { width: 100%; }

.main-content { flex: 1; width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(18px, 4vw, 56px) 48px; }
.intro-panel {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
    margin-bottom: 24px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #fff 0%, #f0f0ed 100%);
}
.intro-panel h1 { margin: 7px 0 10px; max-width: 760px; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; letter-spacing: -.04em; }
.intro-panel p { max-width: 760px; margin: 0; color: var(--text-muted); font-size: 16px; }
.intro-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { display: inline-block; color: var(--text-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .7fr); gap: 24px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.calendar-card { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); }
.month-navigation { display: flex; align-items: center; gap: 14px; }
.month-navigation h2 { min-width: 210px; margin: 0; font-size: 24px; letter-spacing: -.02em; text-transform: capitalize; }
.text-button { padding: 0; color: var(--text-muted); background: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.icon-button {
    display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
    border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 21px; font-weight: 700;
}
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.icon-button-dark { border-color: var(--primary); color: #fff; background: var(--primary); }
.category-filters { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.filter-chip { min-height: 34px; padding: 7px 12px; color: var(--text-muted); background: var(--surface-muted); font-size: 12px; font-weight: 700; }
.filter-chip:hover, .filter-chip.is-active { color: #fff; background: var(--primary); }

.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { border-bottom: 1px solid var(--line); background: #fafafa; }
.weekday-row span { padding: 12px 8px; text-align: center; color: var(--text-muted); font-size: 12px; font-weight: 800; }
.calendar-day {
    position: relative; min-height: 126px; padding: 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: #fff; color: inherit; text-align: left; overflow: hidden;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: #fafafa; }
.calendar-day.is-other-month { background: #f8f8f6; color: #a0a09a; }
.calendar-day.is-selected { box-shadow: inset 0 0 0 2px var(--primary); z-index: 1; }
.calendar-day.is-today .day-number { background: var(--primary); color: #fff; }
.day-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 13px; }
.day-events { display: grid; gap: 5px; margin-top: 7px; }
.day-event {
    display: block; max-width: 100%; padding: 4px 7px; border-radius: 7px; color: #2a2a2a; font-size: 11px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day-event.personal { background: var(--personal); }
.day-event.work { background: var(--work); }
.day-event.health { background: var(--health); }
.day-event.other { background: var(--other); }
.day-more { color: var(--text-muted); font-size: 10px; font-weight: 700; }

.agenda-card { position: sticky; top: 96px; overflow: hidden; }
.agenda-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.agenda-header h2 { margin: 4px 0 0; font-size: 23px; }
.agenda-list { display: grid; gap: 12px; min-height: 420px; max-height: 670px; padding: 18px; overflow: auto; }
.agenda-item { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.agenda-item:hover { border-color: var(--line-strong); }
.agenda-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agenda-item h3 { margin: 7px 0 5px; font-size: 16px; line-height: 1.25; }
.agenda-item p { margin: 0; color: var(--text-muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.agenda-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }
.category-dot { width: 9px; height: 9px; border-radius: 50%; }
.category-dot.personal { background: #6688d5; }
.category-dot.work { background: #7d64a4; }
.category-dot.health { background: #559774; }
.category-dot.other { background: #b58350; }
.status-label { padding: 3px 7px; border-radius: 999px; background: var(--surface-muted); font-size: 10px; font-weight: 800; }
.item-menu { display: flex; gap: 6px; }
.mini-button { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; background: #fff; color: var(--text); font-size: 12px; }
.mini-button:hover { background: var(--surface-muted); }
.mini-button-danger { color: var(--danger); }
.agenda-footer { padding: 13px 18px; border-top: 1px solid var(--line); background: #fafafa; }
.save-status { color: var(--text-muted); font-size: 12px; }
.save-status.is-success { color: var(--success); }
.save-status.is-warning { color: var(--warning); }
.save-status.is-error { color: var(--danger); }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 370px; padding: 30px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: var(--surface-muted); font-size: 24px; font-weight: 800; }
.empty-state h3 { margin: 16px 0 6px; }
.empty-state p { max-width: 290px; margin: 0 0 18px; color: var(--text-muted); font-size: 13px; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); color: var(--text-muted); }
.footer strong, .footer span { display: block; }
.footer strong { color: var(--text); }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-link { padding: 0; background: transparent; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }

.modal-root:empty { display: none; }
.modal-overlay {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
    background: rgba(12, 12, 12, .62); backdrop-filter: blur(7px);
}
.modal {
    width: min(620px, 100%); max-height: min(88vh, 900px); overflow: auto;
    border: 1px solid rgba(255,255,255,.2); border-radius: 24px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25);
}
.modal-small { width: min(460px, 100%); }
.modal-large { width: min(820px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 0; font-size: 24px; }
.modal-header p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
.modal-close { border: 1px solid var(--line); border-radius: 50%; width: 38px; height: 38px; background: #fff; font-size: 20px; }
.modal-body { padding: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: #fafafa; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; gap: 7px; }
.form-field-full { grid-column: 1 / -1; }
.form-field label, .field-label { font-size: 13px; font-weight: 800; }
.form-field input, .form-field textarea, .form-field select {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; color: var(--text);
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-hint { color: var(--text-muted); font-size: 11px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.checkbox-row input { width: 18px; height: 18px; }
.form-error { margin: 0 0 15px; padding: 11px 13px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.auth-note { margin: 0 0 18px; padding: 13px; border-radius: 12px; background: var(--surface-muted); color: var(--text-muted); font-size: 13px; }
.tools-list { display: grid; gap: 12px; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.tool-row h3 { margin: 0 0 4px; font-size: 16px; }
.tool-row p { margin: 0; color: var(--text-muted); font-size: 12px; }
.trash-list { display: grid; gap: 10px; }
.trash-item { display: flex; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.trash-item h3 { margin: 0 0 4px; font-size: 15px; }
.trash-item p { margin: 0; color: var(--text-muted); font-size: 12px; }
.legal-content h3 { margin: 24px 0 8px; }
.legal-content h3:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: #4f4f4b; font-size: 14px; }
.legal-placeholder { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #fafafa; }

.cookie-banner {
    position: fixed; left: 18px; right: 18px; bottom: 18px; z-index: 90;
    display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(1000px, calc(100% - 36px)); margin: 0 auto;
    padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.18);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner strong { display: block; margin-bottom: 3px; }
.cookie-banner p { margin: 0; color: var(--text-muted); font-size: 13px; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 130; width: min(380px, calc(100% - 40px));
    padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); font-size: 13px;
}
.toast.is-error { border-color: #efc3c3; color: var(--danger); }
.toast.is-success { border-color: #b9ddc8; color: var(--success); }

@media (max-width: 1100px) {
    .workspace { grid-template-columns: 1fr; }
    .agenda-card { position: static; }
    .agenda-list { min-height: 240px; max-height: none; }
    .calendar-toolbar { align-items: flex-start; flex-direction: column; }
    .category-filters { justify-content: flex-start; }
}

@media (max-width: 760px) {
    .topbar { align-items: flex-start; }
    .brand small { display: none; }
    .topbar-actions { gap: 7px; }
    .status-badge { width: 100%; order: 3; justify-content: center; }
    .main-content { padding-top: 20px; }
    .intro-panel { align-items: stretch; flex-direction: column; padding: 22px; }
    .intro-actions { justify-content: stretch; }
    .intro-actions .button { flex: 1 1 100%; }
    .calendar-toolbar { padding: 16px; }
    .month-navigation { width: 100%; justify-content: space-between; }
    .month-navigation h2 { min-width: 0; font-size: 20px; text-align: center; }
    .category-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter-chip { flex: 0 0 auto; }
    .weekday-row span { padding: 10px 2px; font-size: 10px; }
    .calendar-day { min-height: 88px; padding: 6px; }
    .day-number { width: 27px; height: 27px; font-size: 12px; }
    .day-event { padding: 3px 5px; font-size: 9px; }
    .day-events .day-event:nth-child(n+2) { display: none; }
    .day-more { font-size: 9px; }
    .footer { align-items: flex-start; flex-direction: column; }
    .modal-overlay { align-items: end; padding: 0; }
    .modal { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field-full { grid-column: auto; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .button { width: 100%; }
    .tool-row, .trash-item { align-items: stretch; flex-direction: column; }
    .cookie-banner { align-items: stretch; flex-direction: column; bottom: 8px; left: 8px; right: 8px; width: calc(100% - 16px); }
    .cookie-actions .button { flex: 1; }
}

@media (max-width: 480px) {
    .topbar { padding: 12px; }
    .brand strong { font-size: 14px; }
    .brand-mark { width: 38px; height: 38px; }
    .button { min-height: 40px; padding: 9px 13px; font-size: 13px; }
    .main-content { padding-left: 10px; padding-right: 10px; }
    .intro-panel { border-radius: 18px; }
    .card { border-radius: 18px; }
    .calendar-day { min-height: 76px; }
    .day-events { margin-top: 3px; }
    .day-event { max-width: 44px; }
    .agenda-header, .agenda-list { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Calendar 1.2.0: month/week modes and mini calendar */
.calendar-toolbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.calendar-period-title { min-width: 230px; }
.calendar-period-title h2 { min-width: 0; text-transform: none; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); }
.view-switch-button { min-height: 32px; padding: 6px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 800; }
.view-switch-button:hover { color: var(--text); }
.view-switch-button.is-active { color: #fff; background: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.calendar-view[hidden], .week-view[hidden] { display: none !important; }
.weekday-row .is-weekend { color: #9f4b4b; background: #fff8f8; }
.calendar-day.is-weekend { background: #fffafa; }
.calendar-day.is-weekend.is-other-month { background: #faf5f5; }
.calendar-day.is-weekend:hover { background: #fff5f5; }

.week-view { background: #fff; }
.week-grid { overflow: hidden; }
.week-date-strip { display: none; }
.week-header-grid,
.week-all-day-grid,
.week-timeline-grid {
    display: grid;
    grid-template-columns: 64px repeat(var(--week-columns), minmax(92px, 1fr));
}
.week-header-grid { position: relative; z-index: 4; border-bottom: 1px solid var(--line); background: #fff; }
.week-time-corner { display: flex; align-items: end; justify-content: center; min-height: 70px; padding: 8px 4px; border-right: 1px solid var(--line); color: var(--text-muted); font-size: 9px; font-weight: 800; }
.week-day-heading { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 70px; padding: 8px 4px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--text); }
.week-day-heading:last-child { border-right: 0; }
.week-day-heading:hover { background: #fafafa; }
.week-day-heading.is-weekend { background: #fff8f8; color: #904747; }
.week-day-heading.is-selected { box-shadow: inset 0 -3px 0 var(--primary); }
.week-day-heading.is-today .week-day-number { color: #fff; background: var(--primary); }
.week-day-name { color: var(--text-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.week-day-heading.is-weekend .week-day-name { color: #a65b5b; }
.week-day-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 19px; font-weight: 800; }

.week-all-day-grid { border-bottom: 1px solid var(--line); background: #fafafa; }
.week-all-day-label { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 6px; border-right: 1px solid var(--line); color: var(--text-muted); font-size: 9px; font-weight: 800; text-align: center; }
.week-all-day-cell { display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap; min-height: 42px; padding: 5px; border-right: 1px solid var(--line); background: #fff; }
.week-all-day-cell:last-child { border-right: 0; }
.week-all-day-cell.is-weekend { background: #fffafa; }
.week-all-day-event { max-width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; color: #292929; font-size: 10px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-all-day-event.personal { background: var(--personal); }
.week-all-day-event.work { background: var(--work); }
.week-all-day-event.health { background: var(--health); }
.week-all-day-event.other { background: var(--other); }

.week-timeline-scroll { max-height: 720px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.week-timeline-grid { position: relative; align-items: stretch; height: 960px; background: #fff; }
.week-time-axis { position: relative; height: 960px; border-right: 1px solid var(--line); background: #fafafa; }
.week-time-label { position: absolute; right: 8px; z-index: 2; transform: translateY(-50%); color: var(--text-muted); font-size: 10px; font-weight: 700; }
.week-time-label:first-child { transform: translateY(2px); }
.week-day-column {
    position: relative;
    height: 960px;
    border-right: 1px solid var(--line);
    background-color: #fff;
    background-image:
        repeating-linear-gradient(to bottom, transparent 0, transparent 19px, rgba(221,221,218,.72) 19px, rgba(221,221,218,.72) 20px),
        repeating-linear-gradient(to bottom, transparent 0, transparent 39px, rgba(181,181,176,.72) 39px, rgba(181,181,176,.72) 40px);
}
.week-day-column:last-child { border-right: 0; }
.week-day-column.is-weekend { background-color: #fffafa; }
.week-day-column.is-today { background-color: #fbfcff; }
.week-day-column.is-weekend.is-today { background-color: #fff7f8; }
.week-event {
    position: absolute;
    z-index: 2;
    display: block;
    min-height: 24px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 7px;
    color: #242424;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.week-event:hover { z-index: 5; filter: brightness(.98); box-shadow: 0 5px 14px rgba(0,0,0,.15); }
.week-event strong, .week-event span { display: block; overflow: hidden; text-overflow: ellipsis; }
.week-event strong { font-size: 10px; line-height: 1.2; white-space: nowrap; }
.week-event span { margin-top: 2px; font-size: 9px; line-height: 1.15; white-space: nowrap; opacity: .78; }
.week-event.personal { background: #cfdcff; border-left: 3px solid #6688d5; }
.week-event.work { background: #ddd1ed; border-left: 3px solid #7d64a4; }
.week-event.health { background: #cfe7d9; border-left: 3px solid #559774; }
.week-event.other { background: #ecd9c4; border-left: 3px solid #b58350; }
.week-event.is-done { opacity: .65; text-decoration: line-through; }
.week-event.is-cancelled { opacity: .52; text-decoration: line-through; }
.current-time-line { position: absolute; left: 0; right: 0; z-index: 4; height: 2px; background: #d14b4b; pointer-events: none; }
.current-time-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d14b4b; }

.mini-calendar { padding: 18px 18px 16px; border-bottom: 1px solid var(--line); background: #fafafa; }
.mini-calendar-header { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-calendar-header strong { text-align: center; font-size: 14px; text-transform: capitalize; }
.mini-nav-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--text); }
.mini-nav-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.mini-weekdays, .mini-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mini-weekdays span { padding: 4px 0; color: var(--text-muted); font-size: 9px; font-weight: 800; text-align: center; }
.mini-weekdays .is-weekend { color: #a65b5b; }
.mini-calendar-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 11px; font-weight: 700; }
.mini-calendar-day:hover { background: var(--surface-muted); }
.mini-calendar-day.is-other-month { color: #aaa9a4; }
.mini-calendar-day.is-weekend { color: #9f4b4b; }
.mini-calendar-day.is-selected { color: #fff; background: var(--primary); }
.mini-calendar-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px var(--primary); }
.mini-calendar-day.has-events:not(.is-selected) { background: var(--event-bg, var(--surface-muted)); box-shadow: inset 0 0 0 1px var(--event-border, var(--line)); }
.mini-calendar-day.has-events:not(.is-selected):hover { filter: brightness(.97); }
.mini-calendar-day.has-events.is-selected { box-shadow: inset 0 0 0 2px var(--event-border, #f2c94c), 0 0 0 1px #fff; }
.agenda-card .agenda-list { max-height: 520px; }

@media (max-width: 1260px) {
    .calendar-toolbar-controls { align-items: flex-start; flex-direction: column; }
    .category-filters { justify-content: flex-start; }
}

@media (max-width: 1100px) {
    .calendar-toolbar-controls { width: 100%; }
    .view-switch { align-self: flex-start; }
    .agenda-card .agenda-list { max-height: none; }
}

@media (max-width: 760px) {
    .calendar-period-title { min-width: 0; text-align: center; }
    .calendar-toolbar-controls { gap: 10px; }
    .view-switch { width: 100%; }
    .view-switch-button { flex: 1; }
    .week-date-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #fafafa; }
    .week-strip-day { display: grid; place-items: center; gap: 1px; min-width: 0; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font-size: 9px; text-transform: uppercase; }
    .week-strip-day strong { font-size: 13px; }
    .week-strip-day.is-weekend { color: #9f4b4b; }
    .week-strip-day.is-selected { color: #fff; background: var(--primary); }
    .week-strip-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px var(--primary); color: var(--text); }
    .week-header-grid, .week-all-day-grid, .week-timeline-grid { grid-template-columns: 54px minmax(0, 1fr); min-width: 0; }
    .week-time-corner { min-height: 58px; }
    .week-day-heading { min-height: 58px; }
    .week-day-number { width: 30px; height: 30px; font-size: 17px; }
    .week-timeline-scroll { max-height: 68vh; }
    .week-time-label { right: 5px; font-size: 9px; }
    .week-event strong { font-size: 11px; }
    .week-event span { font-size: 9px; }
    .mini-calendar { padding: 14px; }
}

/* Calendar 1.3.0: compact seven-day planner */
:root {
    --event-blue-bg: #c8d8fb;
    --event-blue-border: #6688d5;
    --event-lavender-bg: #ded2ef;
    --event-lavender-border: #7d64a4;
}

.main-content { width: min(1780px, 100%); padding: 18px clamp(14px, 2.4vw, 38px) 42px; }
.planner-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 18px;
    background: rgba(255,255,255,.82); box-shadow: 0 8px 28px rgba(16,16,16,.045);
}
.planner-strip h1 { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.1; letter-spacing: -.025em; }
.planner-strip p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.planner-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.workspace { grid-template-columns: minmax(0, 1fr) 264px; gap: 16px; }
.calendar-card { min-width: 0; }
.sidebar-card { position: sticky; top: 88px; overflow: hidden; }
.sidebar-filters { display: grid; gap: 13px; padding: 17px; border-top: 1px solid var(--line); background: #fff; }
.sidebar-filters h2 { margin: 3px 0 0; font-size: 18px; }
.sidebar-filters .category-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sidebar-filters .filter-chip { min-width: 0; padding: 7px 6px; }
.sidebar-note { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.sidebar-status { padding: 13px 17px; border-top: 1px solid var(--line); background: #fafafa; }

.calendar-toolbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    gap: 14px; padding: 15px 17px;
}
.month-navigation { min-width: 0; gap: 10px; }
.calendar-period-title { min-width: 0; width: min(440px, 100%); }
.calendar-period-title h2 {
    min-width: 0; margin: 0; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.16;
    overflow-wrap: anywhere;
}
.calendar-toolbar-controls { flex-wrap: nowrap; }
.view-switch { flex: 0 0 auto; }
.view-switch-button { min-width: 76px; }

.week-grid { overflow: hidden; }
.week-scroll-shell {
    max-height: min(720px, calc(100vh - 248px));
    overflow: auto;
    overscroll-behavior: auto;
    scrollbar-gutter: stable;
    background: #fff;
}
.week-canvas { position: relative; min-width: 760px; }
.week-header-grid,
.week-all-day-grid,
.week-timeline-grid {
    display: grid;
    grid-template-columns: 64px repeat(var(--week-columns), minmax(92px, 1fr));
    width: 100%;
}
.week-header-grid {
    position: sticky; top: 0; z-index: 12;
    border-bottom: 1px solid var(--line); background: #fff;
}
.week-all-day-grid {
    position: sticky; top: 70px; z-index: 11;
    border-bottom: 1px solid var(--line); background: #fafafa;
}
.week-time-corner,
.week-all-day-label,
.week-time-axis { width: auto; min-width: 0; }
.week-time-corner { align-items: center; min-height: 70px; }
.week-all-day-label { min-height: 46px; }
.week-all-day-cell {
    align-content: flex-start; min-height: 46px; padding: 4px;
    overflow: hidden;
}
.week-all-day-event {
    display: block; width: 100%; max-width: 100%; min-height: 24px; padding: 4px 7px;
    border-left: 3px solid transparent; text-align: left;
}
.week-timeline-grid { position: relative; height: 960px; align-items: stretch; background: #fff; }
.week-time-axis { position: relative; height: 960px; border-right: 1px solid var(--line); background: #fafafa; }
.week-time-label { right: 7px; }
.week-day-column { touch-action: pan-y; user-select: none; }
.week-event { cursor: pointer; }
.week-event strong { font-size: 11px; }
.week-event span { font-size: 9px; }
.week-drag-selection {
    position: absolute; left: 2px; right: 2px; z-index: 8;
    min-height: 20px; border: 1px solid #4f70be; border-radius: 7px;
    background: rgba(122, 154, 225, .32); box-shadow: 0 4px 12px rgba(35,67,133,.16);
    pointer-events: none;
}
.week-drag-selection span { display: block; padding: 4px 6px; color: #29457f; font-size: 10px; font-weight: 800; }
.current-time-line { z-index: 7; }

.week-summary { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: #fafafa; }
.week-summary:empty { display: none; }
.week-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.week-summary-header h3 { margin: 0; font-size: 14px; }
.week-summary-header span { color: var(--text-muted); font-size: 11px; }
.week-summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.week-summary-item {
    display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px;
    border: 1px solid rgba(0,0,0,.07); border-radius: 10px; background: #fff; color: var(--text); text-align: left;
}
.week-summary-item strong { flex: 0 0 auto; font-size: 11px; }
.week-summary-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.mini-calendar { padding: 14px 14px 12px; }
.mini-calendar-header { margin-bottom: 7px; }
.mini-calendar-header strong { font-size: 13px; }
.mini-calendar-day { font-size: 10px; border-radius: 8px; }

.modal-event { width: min(540px, 100%); }
.modal-event .modal-header { padding: 17px 19px; }
.modal-event .modal-header h2 { font-size: 21px; }
.modal-event .modal-body { padding: 18px 19px; }
.modal-event .modal-actions { padding: 13px 19px; }
.modal-event .form-grid { gap: 12px; }
.modal-event .form-field textarea { min-height: 88px; }

.event-color-field { display: grid; gap: 8px; }
.color-palette { display: flex; flex-wrap: wrap; gap: 7px; }
.color-swatch {
    position: relative; width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%;
    background: var(--swatch); box-shadow: 0 0 0 1px var(--line-strong);
}
.color-swatch:hover { transform: scale(1.06); }
.color-swatch.is-active::after {
    content: ''; position: absolute; left: 10px; top: 5px; width: 7px; height: 12px;
    border-right: 2px solid #111; border-bottom: 2px solid #111; transform: rotate(45deg);
}

.quick-popover-layer { position: fixed; inset: 0; z-index: 120; background: transparent; }
.quick-popover {
    position: fixed; z-index: 121; width: min(360px, calc(100vw - 24px));
    border: 1px solid var(--line); border-radius: 17px; background: #fff;
    box-shadow: 0 22px 70px rgba(0,0,0,.23); overflow: hidden;
}
.quick-popover-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 16px 8px; }
.quick-popover-title { margin: 0; font-size: 16px; }
.quick-popover-subtitle { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.quick-popover-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface-muted); font-size: 18px; }
.quick-popover-body { display: grid; gap: 12px; padding: 9px 16px 15px; }
.quick-title-input {
    width: 100%; min-height: 42px; padding: 9px 11px; border: 0; border-bottom: 2px solid var(--line-strong);
    background: #fff; color: var(--text); font-size: 17px; font-weight: 700;
}
.quick-title-input:focus { box-shadow: none; border-color: var(--primary); }
.quick-category { display: flex; gap: 6px; }
.quick-category button { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; }
.quick-category button.is-active { color: #fff; background: var(--primary); border-color: var(--primary); }
.quick-popover-actions { display: flex; justify-content: flex-end; gap: 8px; }
.quick-error { margin: 0; color: var(--danger); font-size: 12px; }
.event-detail-description { margin: 0; color: var(--text-muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.event-detail-meta { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; }
.event-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.context-color-popover { width: min(292px, calc(100vw - 24px)); }
.context-color-popover .quick-popover-body { padding-top: 13px; }

.day-event { border-left: 3px solid transparent; }
.week-event, .week-all-day-event, .day-event, .week-summary-item { color: #202020; }

@media (max-width: 1100px) {
    .workspace { grid-template-columns: minmax(0, 1fr) 238px; }
    .sidebar-card { position: sticky; }
    .calendar-toolbar { align-items: center; flex-direction: initial; }
    .calendar-toolbar-controls { width: auto; }
}

@media (max-width: 860px) {
    .workspace { grid-template-columns: 1fr; }
    .sidebar-card { position: static; display: grid; grid-template-columns: minmax(250px, .8fr) minmax(280px, 1.2fr); }
    .mini-calendar { border-bottom: 0; border-right: 1px solid var(--line); }
    .sidebar-status { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .topbar { align-items: center; gap: 10px; padding: 10px 12px; }
    .brand { gap: 8px; min-width: 0; }
    .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
    .brand strong { font-size: 15px; white-space: nowrap; }
    .brand small { display: none; }
    .topbar-actions { flex: 0 1 auto; flex-wrap: nowrap; gap: 5px; }
    .topbar-actions .button { min-height: 38px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
    .status-badge { width: auto; order: initial; min-height: 38px; padding: 8px 10px; }
    .status-badge span:last-child { display: none; }

    .main-content { padding: 10px 8px 28px; }
    .planner-strip { margin-bottom: 9px; padding: 11px 12px; border-radius: 15px; }
    .planner-strip p { display: none; }
    .planner-strip h1 { font-size: 18px; }
    .planner-actions .button { min-height: 38px; padding: 8px 11px; font-size: 12px; }
    .planner-actions .button-secondary { display: none; }

    .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
    .month-navigation { width: auto; gap: 5px; }
    .month-navigation .icon-button { width: 34px; height: 34px; font-size: 17px; }
    .calendar-period-title { width: auto; text-align: left; }
    .calendar-period-title h2 { max-width: 148px; font-size: 15px; line-height: 1.15; }
    .calendar-period-title .text-button { font-size: 11px; }
    .calendar-toolbar-controls { width: auto; gap: 0; }
    .view-switch { width: auto; padding: 2px; }
    .view-switch-button { flex: none; min-width: 61px; min-height: 30px; padding: 5px 8px; font-size: 10px; }

    .week-date-strip { position: sticky; top: 59px; z-index: 15; }
    .week-scroll-shell { max-height: 68vh; scrollbar-gutter: auto; }
    .week-canvas { min-width: 0; }
    .week-header-grid, .week-all-day-grid, .week-timeline-grid { grid-template-columns: 54px minmax(0, 1fr); min-width: 0; }
    .week-header-grid { top: 0; }
    .week-all-day-grid { top: 58px; }
    .week-time-corner, .week-day-heading { min-height: 58px; }
    .week-all-day-label, .week-all-day-cell { min-height: 44px; }
    .week-summary { padding: 11px; }
    .week-summary-list { grid-template-columns: 1fr; }

    .sidebar-card { display: block; }
    .mini-calendar { border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar-filters .category-filters { grid-template-columns: repeat(3, 1fr); }
    .sidebar-note { display: none; }
    .footer { align-items: flex-start; flex-direction: column; padding: 22px 14px; }

    .modal-overlay { align-items: end; padding: 8px; }
    .modal-event { width: 100%; max-height: 88vh; border-radius: 20px 20px 14px 14px; }
    .quick-popover { width: calc(100vw - 16px); left: 8px !important; right: 8px; bottom: 8px !important; top: auto !important; }
}

@media (max-width: 430px) {
    .syncButton { display: none; }
    .planner-actions .button { padding-left: 10px; padding-right: 10px; }
    .calendar-period-title h2 { max-width: 118px; }
    .view-switch-button { min-width: 54px; padding-left: 6px; padding-right: 6px; }
}

@media (max-width: 500px) {
    #networkBadge { display: none; }
    #syncButton:not([hidden]) { width: 40px; min-width: 40px; padding: 0; font-size: 0; }
    #syncButton:not([hidden])::before { content: '↻'; font-size: 19px; line-height: 1; }
}

/* Calendar 1.4.0: focused navigation, compact editor and important events */
.workspace { grid-template-columns: minmax(0, 1fr) 228px; }

.month-navigation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}
.period-nav-buttons { display: inline-flex; align-items: center; gap: 6px; }
.period-nav-buttons .icon-button { width: 38px; height: 38px; font-size: 18px; }
.calendar-period-title { width: auto; max-width: 440px; }
.calendar-period-title h2 { min-width: 0; }

/* Спокойное выделение времени сна: 03:00–10:00. */
.week-time-axis::before,
.week-day-column::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 120px;
    height: 280px;
    z-index: 0;
    background: rgba(45, 48, 54, .055);
    pointer-events: none;
}
.week-day-column.is-weekend::before { background: rgba(102, 54, 54, .055); }
.week-time-axis::before { background: rgba(45, 48, 54, .075); }

.week-drag-selection.is-pending {
    opacity: .66;
    border-style: dashed;
    background: rgba(122, 154, 225, .22);
    box-shadow: none;
}
.week-draft-all-day {
    opacity: .62;
    border: 1px dashed #6688d5;
    background: rgba(200, 216, 251, .72) !important;
    pointer-events: none;
}

.important-events {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.important-events-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.important-events-header h2 { margin: 3px 0 0; font-size: 17px; }
.important-events-count {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: 11px;
    font-weight: 800;
}
.important-events-list {
    display: grid;
    gap: 7px;
    max-height: 350px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.important-event-item {
    display: grid;
    grid-template-columns: 47px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(0,0,0,.06);
    border-left: 3px solid transparent;
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    text-align: left;
}
.important-event-item:hover { filter: brightness(.98); transform: translateY(-1px); }
.important-event-date {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: lowercase;
}
.important-event-content { display: block; min-width: 0; }
.important-event-content strong,
.important-event-content small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.important-event-content strong { font-size: 12px; }
.important-event-content small { margin-top: 2px; color: rgba(30,30,30,.68); font-size: 9px; }
.important-events-empty { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.45; }

.modal-event { width: min(620px, 100%); }
.event-form { display: grid; gap: 14px; }
.event-form .form-error { margin-bottom: 0; }
.event-form-main,
.event-time-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-schedule-section {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(250px, 1.2fr);
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafafa;
}
.event-schedule-section.is-all-day { grid-template-columns: 1fr; }
.event-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}
.event-toggle-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: #111; }
.event-toggle-row span { display: block; min-width: 0; }
.event-toggle-row strong,
.event-toggle-row small { display: block; }
.event-toggle-row strong { font-size: 12px; }
.event-toggle-row small { margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.25; }
.event-important-toggle { background: #fbfbf8; }
.event-color-field {
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 2px 0;
}
.event-description-field textarea { min-height: 82px !important; }
.event-form .form-field input,
.event-form .form-field select { min-height: 42px; }

.account-summary {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #fafafa, #f0f0ed);
}
.account-summary h3 { margin: 4px 0; font-size: 21px; }
.account-summary p { margin: 0; color: var(--text-muted); font-size: 12px; }
.account-tools-list .tool-row { min-height: 76px; }

@media (max-width: 1100px) {
    .workspace { grid-template-columns: minmax(0, 1fr) 214px; }
}

@media (max-width: 860px) {
    .workspace { grid-template-columns: 1fr; }
    .important-events { border-top: 0; border-left: 1px solid var(--line); }
}

@media (max-width: 760px) {
    .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
    .month-navigation { gap: 7px; }
    .period-nav-buttons { gap: 4px; }
    .period-nav-buttons .icon-button { width: 32px; height: 32px; font-size: 16px; }
    .calendar-period-title h2 { max-width: 128px; }
    .important-events { border-left: 0; border-top: 1px solid var(--line); }
    .important-events-list { max-height: 250px; }
    .event-form-main,
    .event-time-row,
    .event-schedule-section { grid-template-columns: 1fr; }
    .event-color-field { grid-template-columns: 1fr; }
    .event-schedule-section { padding: 10px; }
    .event-toggle-row { min-height: 44px; }
    .account-tools-list .tool-row { align-items: stretch; flex-direction: column; }
    .account-tools-list .tool-row .button { width: 100%; }
}

@media (max-width: 430px) {
    .calendar-period-title h2 { max-width: 104px; }
    .period-nav-buttons .icon-button { width: 30px; height: 30px; }
}

/* Calendar 1.5.0: drag-and-drop, repeat rules and stable all-day editor */
.week-event.is-draggable,
.week-all-day-event.is-draggable { cursor: grab; touch-action: pan-y; }
.week-event.is-dragging,
.week-all-day-event.is-dragging { opacity: .28; cursor: grabbing; }
.week-event-drag-preview {
    z-index: 12 !important;
    pointer-events: none;
    opacity: .82;
    border-style: dashed !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.18) !important;
}
.week-event-drag-preview.is-invalid { opacity: .32; }
.week-all-day-drag-preview {
    width: 100%;
    pointer-events: none;
    opacity: .78;
    border: 1px dashed rgba(0,0,0,.34) !important;
}

.mini-calendar-day.has-important::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--important-dot, currentColor);
    box-shadow: 0 0 0 1px rgba(255,255,255,.92);
    opacity: 1;
}
.mini-calendar-day.has-important.is-selected::after {
    background: #fff;
    box-shadow: 0 0 0 1px var(--important-dot, #111);
}

.event-schedule-section.is-all-day {
    grid-template-columns: minmax(180px, .8fr) minmax(250px, 1.2fr);
}
.event-time-row {
    min-width: 0;
    transition: opacity .15s ease;
}
.event-time-row.is-disabled {
    opacity: .42;
}
.event-time-row.is-disabled input {
    color: var(--text-muted);
    background: #f1f1ef;
    cursor: not-allowed;
}

.event-repeat-section {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(250px, 1.2fr);
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafafa;
}
.event-repeat-panel {
    display: grid;
    gap: 9px;
    min-width: 0;
}
.event-repeat-panel[hidden] { display: none !important; }
.repeat-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 5px;
}
.repeat-weekdays button {
    min-height: 34px;
    padding: 5px 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-muted);
    background: #fff;
    font-size: 11px;
    font-weight: 800;
}
.repeat-weekdays button:hover { border-color: var(--line-strong); color: var(--text); }
.repeat-weekdays button.is-active { border-color: var(--primary); color: #fff; background: var(--primary); }
.repeat-weekdays.is-disabled { opacity: .48; }
.repeat-weekdays button:disabled {
    cursor: not-allowed;
    border-color: var(--line);
    color: var(--text-muted);
    background: #f1f1ef;
}
.repeat-weekdays button.is-active:disabled {
    border-color: var(--line-strong);
    color: var(--text-muted);
    background: #e7e7e3;
}
.field-label.is-disabled { opacity: .52; }
.repeat-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.35;
}
.event-series-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #eadca5;
    border-radius: 11px;
    background: #fff9df;
}
.event-series-note strong { font-size: 12px; }
.event-series-note span { color: var(--text-muted); font-size: 10px; }

@media (max-width: 760px) {
    .event-schedule-section,
    .event-schedule-section.is-all-day,
    .event-repeat-section { grid-template-columns: 1fr; }
    .repeat-weekdays { grid-template-columns: repeat(7, minmax(30px, 1fr)); }
    .event-series-note { align-items: flex-start; flex-direction: column; }
}

/* Calendar 1.6.1: full-width TaskWeb banner, UTM links and all-day statistics */
.course-banner {
    position: relative;
    z-index: 35;
    width: 100%;
    min-height: 66px;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid rgba(117, 85, 0, .28);
    border-radius: 0;
    color: #fff;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 222, 105, .22), transparent 31%),
        repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0, rgba(255,255,255,.025) 2px, transparent 2px, transparent 8px),
        linear-gradient(105deg, #292820 0%, #1d1d1a 58%, #2c281b 100%);
    box-shadow: 0 8px 24px rgba(20, 20, 18, .12);
}
.course-banner[hidden] { display: none !important; }
.course-banner-inner {
    position: relative;
    width: min(1500px, 100%);
    min-height: 66px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 56px);
}
.course-banner-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 66px;
    padding: 10px 52px 10px 0;
    color: #fff;
    text-decoration: none;
}
.course-banner-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .18s ease;
}
.course-banner-link:hover::before { background: rgba(255, 255, 255, .035); }
.course-banner-badge,
.course-banner-title,
.course-banner-action { position: relative; z-index: 1; }
.course-banner-badge {
    padding: 4px 10px;
    border: 1px solid rgba(242, 201, 76, .55);
    border-radius: 999px;
    color: #ffe78f;
    background: rgba(242, 201, 76, .08);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.course-banner-title {
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
}
.course-banner-action {
    color: #f2c94c;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.course-banner-close {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: clamp(18px, 4vw, 56px);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.06);
    font-size: 20px;
    transform: translateY(-50%);
}
.course-banner-close:hover { color: #fff; background: rgba(255,255,255,.14); }

.statistics-button { white-space: nowrap; }

.calendar-day { cursor: pointer; }
.calendar-day:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary), var(--focus); z-index: 2; }
.day-more {
    justify-self: start;
    padding: 2px 4px;
    border: 0;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    font-size: 10px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.day-more:hover { color: var(--text); background: rgba(0,0,0,.05); }

.month-day-events-list { display: grid; gap: 8px; }
.month-day-event-item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid rgba(0,0,0,.08);
    border-left: 4px solid transparent;
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    text-align: left;
}
.month-day-event-item:hover { filter: brightness(.98); transform: translateY(-1px); }
.month-day-event-time { font-size: 10px; font-weight: 800; color: rgba(20,20,20,.68); }
.month-day-event-content { min-width: 0; }
.month-day-event-content strong,
.month-day-event-content small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-day-event-content strong { font-size: 13px; }
.month-day-event-content small { margin-top: 2px; color: rgba(20,20,20,.62); font-size: 10px; }

.statistics-modal { display: grid; gap: 16px; }
.statistics-intro {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafaf7;
}
.statistics-intro p { margin: 0; color: var(--text); font-size: 13px; }
.statistics-intro small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 11px; }
.statistics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.statistics-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.statistics-total { display: block; margin: 5px 0 13px; font-size: 24px; line-height: 1.1; }
.statistics-rows { display: grid; gap: 11px; }
.statistics-row { display: grid; gap: 5px; }
.statistics-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 11px; }
.statistics-row-top strong { color: var(--text); font-size: 11px; }
.statistics-track { height: 7px; overflow: hidden; border-radius: 999px; background: #ecece8; }
.statistics-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; }
.statistics-fill.is-personal { background: #6688d5; }
.statistics-fill.is-work { background: #7d64a4; }

.legal-content { max-width: 720px; margin: 0 auto; }
.legal-content h3 { font-size: 17px; }
.legal-content p { line-height: 1.65; }
.legal-content a { color: var(--text); font-weight: 700; text-underline-offset: 3px; }

.footer {
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    padding: 24px clamp(14px, 4vw, 56px) 30px;
    text-align: center;
}
.footer p { margin: 0; color: var(--text-muted); font-size: 12px; }
.footer nav { justify-content: center; gap: 10px 16px; }
.footer-link {
    display: inline;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}
a.footer-link { border-radius: 0; }

@media (max-width: 760px) {
    .course-banner, .course-banner-inner { min-height: 58px; }
    .course-banner-inner { padding: 0 10px; }
    .course-banner-link { justify-content: flex-start; min-height: 58px; gap: 9px; padding: 8px 42px 8px 0; }
    .course-banner-badge { display: none; }
    .course-banner-title { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
    .course-banner-action { margin-left: auto; font-size: 10px; }
    .course-banner-close { right: 10px; width: 30px; height: 30px; }
    .statistics-button { min-width: 38px; width: 38px; padding: 0 !important; font-size: 0 !important; }
    .statistics-button::before { content: 'Σ'; font-size: 16px; font-weight: 900; }
    .statistics-grid { grid-template-columns: 1fr; }
    .footer { align-items: center; padding: 20px 12px 26px; text-align: center; }
    .footer nav { justify-content: center; }
}

/* Calendar 1.7.0: day view, local backups, printing and month-cell actions */
.mini-calendar-toggle { display: none; }
.mini-calendar-body[hidden] { display: none !important; }

.calendar-day.is-empty::after {
    content: '+';
    position: absolute;
    inset: 38px 8px 8px;
    display: grid;
    place-items: center;
    border: 1px dashed transparent;
    border-radius: 12px;
    color: #8d8d88;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    opacity: 0;
    transform: scale(.94);
    transition: opacity .16s ease, transform .16s ease, background .16s ease, border-color .16s ease;
    pointer-events: none;
}
.calendar-day.is-empty:hover::after,
.calendar-day.is-empty:focus-visible::after {
    border-color: #d8d8d3;
    background: rgba(245,245,242,.76);
    opacity: .72;
    transform: scale(1);
}
.calendar-day.has-events:hover { background: #fbfbf9; }

.important-event-date {
    font-size: 9px;
    font-weight: 650;
}
.important-event-content strong {
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
}
.important-event-content small {
    font-size: 8.5px;
    font-weight: 400;
}

.sidebar-data-tools {
    display: grid;
    gap: 12px;
    padding: 17px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.sidebar-data-tools h2 { margin: 3px 0 0; font-size: 16px; }
.sidebar-data-tools > p { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.sidebar-data-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.sidebar-action-button {
    min-height: 38px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: #fafafa;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
}
.sidebar-action-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.sidebar-action-print { grid-column: 1 / -1; }

.print-sheet { display: none; }

@media (max-width: 760px) {
    .mini-calendar { padding: 10px 12px; }
    .mini-calendar-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 40px;
        padding: 8px 11px;
        border: 1px solid var(--line);
        border-radius: 11px;
        color: var(--text);
        background: #fff;
        font-size: 12px;
        font-weight: 800;
    }
    .mini-calendar-toggle::after { content: '⌄'; color: var(--text-muted); font-size: 15px; }
    .mini-calendar-toggle[aria-expanded="true"]::after { content: '⌃'; }
    .mini-calendar-body { margin-top: 10px; }
    .view-switch-button { min-width: 56px; }
    .sidebar-data-actions { grid-template-columns: 1fr 1fr; }
}

@media print {
    @page { margin: 14mm; }
    body { min-width: 0; background: #fff !important; color: #111; }
    body > *:not(.print-sheet) { display: none !important; }
    .print-sheet {
        display: block !important;
        color: #111;
        background: #fff;
        font-family: Arial, sans-serif;
        font-size: 10pt;
    }
    .print-header { margin-bottom: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; }
    .print-header h1 { margin: 0 0 4px; font-size: 20pt; }
    .print-header p { margin: 0; color: #555; font-size: 9pt; }
    .print-day { break-inside: avoid; margin: 0 0 14px; }
    .print-day h2 { margin: 0 0 6px; font-size: 13pt; }
    .print-event-list { display: grid; gap: 5px; }
    .print-event { padding: 7px 9px; border: 1px solid #bbb; border-radius: 5px; break-inside: avoid; }
    .print-event strong, .print-event span { display: block; }
    .print-event span { margin-top: 2px; color: #444; font-size: 9pt; }
    .print-event p { margin: 5px 0 0; white-space: pre-wrap; font-size: 9pt; }
    .print-empty { font-size: 11pt; }
}


/* Yandex Metrika fallback for browsers with JavaScript disabled. */
.yandex-metrika-noscript {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.yandex-metrika-noscript img {
    display: block;
    width: 1px;
    height: 1px;
}

/* Calendar 1.8.2 — goals integration */
.goals-button{text-decoration:none}.event-goal-field{margin-top:2px}.event-year-toggle{margin-top:0}.event-detail-links{display:flex;flex-wrap:wrap;gap:7px}.goal-link-badge{display:inline-flex;align-items:center;border:1px solid var(--border);background:#f6f4ed;border-radius:999px;padding:6px 9px;font-size:12px;font-weight:800}@media(max-width:760px){.topbar-actions .goals-button{order:1}.topbar-actions .statistics-button{display:none}}


/* Calendar 1.8.2: create a goal inside the event form */
.form-label-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.form-label-actions label{margin:0}
.inline-action-button{border:0;background:transparent;color:#665315;padding:2px 0;font-size:12px;font-weight:800;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.inline-action-button:hover{color:#111}
.nested-modal-overlay{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:20px;background:rgba(12,12,12,.48);backdrop-filter:blur(5px)}
.nested-goal-modal{max-height:min(90vh,900px);overflow:auto}
.goal-create-form{display:grid;gap:16px}
.goal-create-form .goal-value-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.goal-primary-toggle{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:16px;padding:14px}
.goal-primary-toggle input{width:22px;height:22px;accent-color:#111}
.goal-primary-toggle strong,.goal-primary-toggle small{display:block}
.goal-primary-toggle small{margin-top:3px;color:var(--text-muted);font-size:12px}
@media(max-width:760px){.nested-modal-overlay{padding:10px}.goal-create-form .goal-value-grid{grid-template-columns:1fr}.form-label-actions{align-items:flex-start}}


/* Calendar 1.9.1: category-aware goal creator */
.inline-goal-calculator{border:1px solid var(--line);border-radius:18px;padding:15px;background:#fafaf8;display:grid;gap:12px}
.inline-goal-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.inline-goal-note{margin:0;color:var(--text-muted);font-size:13px;line-height:1.45}
.goal-create-form-stage2 .goal-primary-toggle{margin-top:2px}
@media(max-width:700px){.inline-goal-fields{grid-template-columns:1fr}.inline-goal-calculator{padding:12px}}


/* Calendar 1.9.1: recent goals and compact footer tools */
.recent-goals{padding:18px 16px;border-top:1px solid var(--line)}.recent-goals-header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.recent-goals-header h2{margin:4px 0 0;font-size:18px}.recent-goals-list{display:grid;gap:8px;margin-top:13px}.recent-goal-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border:1px dashed #cfcbbd;border-radius:13px;color:inherit;text-decoration:none;background:#fff;transition:.15s ease}.recent-goal-item:hover{border-color:#a88415;background:#fffbed;transform:translateY(-1px)}.recent-goal-copy{min-width:0}.recent-goal-copy strong,.recent-goal-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recent-goal-copy strong{font-size:13px}.recent-goal-copy small{margin-top:3px;color:var(--text-muted);font-size:11px}.recent-goal-arrow{font-size:18px}.recent-goals-empty{margin:0;color:var(--text-muted);font-size:12px;line-height:1.45}
.footer-data-tools{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}.footer-data-button{border:1px solid #d5d2c8;background:#fff;border-radius:999px;padding:8px 13px;font:inherit;font-size:13px;cursor:pointer}.footer-data-button:hover{background:#111;color:#fff;border-color:#111}
@media(max-width:700px){.footer-data-tools{gap:6px}.footer-data-button{font-size:12px;padding:7px 10px}}

/* Calendar 1.9.4: compact sidebar, duplicate events, drag-resize and date-layout fixes */
.sidebar-filters h2,
.important-events-header h2,
.recent-goals-header h2 {
    margin: 0;
}
.important-events-header,
.recent-goals-header {
    align-items: center;
}
.important-events-count {
    width: 26px;
    min-width: 26px;
    padding: 0;
    flex: 0 0 26px;
}
.sidebar-filters,
.important-events,
.recent-goals {
    padding-top: 14px;
    padding-bottom: 14px;
}
.recent-goals-list { margin-top: 10px; }

.quick-popover-layer { pointer-events: none; }
.quick-popover { pointer-events: auto; }
.event-detail-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.event-detail-actions .button {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
}

.week-event {
    padding-bottom: 9px;
}
.week-event.is-active {
    z-index: 8;
    outline: 2px solid rgba(17, 17, 17, .72);
    outline-offset: 1px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .2);
}
.week-event-resize-handle {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 1px;
    height: 7px;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 999px;
    cursor: ns-resize;
    opacity: 0;
    touch-action: none;
    transition: opacity .12s ease;
}
.week-event-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: rgba(17, 17, 17, .62);
    transform: translateX(-50%);
}
.week-event:hover .week-event-resize-handle,
.week-event:focus-visible .week-event-resize-handle,
.week-event.is-active .week-event-resize-handle,
.week-event.is-resizing .week-event-resize-handle {
    opacity: 1;
}
.week-event.is-resizing {
    z-index: 10;
    cursor: ns-resize;
    filter: none;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .22);
}
.duplicate-event-form { display: grid; gap: 14px; }
.duplicate-event-hint { margin: 0; line-height: 1.45; }

@media (max-width: 430px) {
    .event-detail-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .event-detail-actions .button:first-child { grid-column: 1 / -1; }
}
.event-detail-resize-hint {
    margin: -3px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}


/* Calendar 1.9.4: duplicate date layout and robust hidden state */
.duplicate-date-row.is-single-date {
    grid-template-columns: minmax(0, 1fr);
}
.duplicate-date-row .form-field[hidden] {
    display: none !important;
}


/* Calendar 1.9.4: search, series actions and recent title suggestions */
.topbar-search-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    background: #fff;
}
.topbar-search-button svg { display: block; }
.event-series-badge {
    display: inline-flex;
    width: max-content;
    margin-top: 2px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1efe8;
    color: #4f4a3e;
    font-size: 11px;
    font-weight: 800;
}
.series-delete-copy p { line-height: 1.55; }
.modal-event .modal-actions { flex-wrap: wrap; }
.modal-event .modal-actions .button { min-width: 140px; }
.has-recent-title-suggestions { position: relative; z-index: 4; }
.recent-title-suggestions {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0,0,0,.16);
    padding: 6px;
}
.quick-popover-body.has-recent-title-suggestions .recent-title-suggestions {
    top: 48px;
}
.recent-title-heading {
    padding: 7px 9px 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.recent-title-row { display: grid; grid-template-columns: minmax(0,1fr) 34px; align-items: center; border-radius: 10px; }
.recent-title-row:hover { background: #f5f3ed; }
.recent-title-choose,
.recent-title-remove {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.recent-title-choose {
    min-width: 0;
    padding: 9px 10px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-title-remove {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #9b3c2d;
    font-size: 19px;
}
.recent-title-remove:hover { background: #fae9e5; }
.calendar-search { display: grid; gap: 12px; }
.calendar-search-input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 0 16px;
    font: inherit;
    font-size: 16px;
    outline: none;
}
.calendar-search-input:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.calendar-search-status { margin: 0; color: var(--text-muted); font-size: 13px; }
.calendar-search-results { display: grid; gap: 8px; max-height: min(52vh, 520px); overflow: auto; padding-right: 3px; }
.calendar-search-result {
    display: grid;
    grid-template-columns: 64px minmax(0,1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.calendar-search-result:hover { border-color: #111; background: #faf9f5; }
.calendar-search-kind {
    display: inline-flex;
    justify-content: center;
    padding: 5px 7px;
    border-radius: 999px;
    background: #f0eee7;
    font-size: 11px;
    font-weight: 800;
}
.calendar-search-copy { min-width: 0; }
.calendar-search-copy strong,
.calendar-search-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-search-copy small { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
@media (max-width: 760px) {
    .topbar-search-button { width: 38px; height: 38px; flex-basis: 38px; }
    .calendar-search-result { grid-template-columns: 52px minmax(0,1fr); padding: 10px; }
    .modal-event .modal-actions .button { min-width: 0; }
}


/* Calendar 1.9.6: compact suggestions and occupied-day mini-calendar states */
.recent-title-suggestions {
    max-height: 210px;
    border-radius: 12px;
    padding: 4px;
}
.recent-title-heading {
    padding: 5px 8px 3px;
    font-size: 10px;
}
.recent-title-row {
    grid-template-columns: minmax(0, 1fr) 28px;
    border-radius: 8px;
}
.recent-title-choose {
    padding: 7px 8px;
    font-size: 13px;
    line-height: 1.25;
}
.recent-title-remove {
    width: 25px;
    height: 25px;
    font-size: 16px;
}

/* Calendar 1.9.7: monthly repeat mode disables weekday controls and creates 12 linked instances. */
