@font-face {
    font-family: "Josefin Sans";
    src: url("JosefinSans.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: "Righteous";
    src: url("Righteous.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
:root {
    color-scheme: light;
    font-family: "Josefin Sans", "Trebuchet MS", Arial, sans-serif;
    font-size: 16px;
    color: #31251d;
    background: #fff5e1;
    --heading-font: "Righteous", "Josefin Sans", sans-serif;
    --ink: #31251d;
    --coffee: #594e3e;
    --accent: #795138;
    --focus: #9b693f;
    --rail: #f5e1c4;
    --panel: #fff5e1;
    --field: #fffdf7;
    --line: #dbc8a9;
    --pressed: #f5e1c4;
    --muted: #6c5a49;
    --topbar-height: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, summary, select, input[type="checkbox"], input[type="color"] { cursor: pointer; }
button, input, select, textarea { min-width: 0; }
button:disabled { opacity: .53; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
button, a { -webkit-tap-highlight-color: transparent; }
[data-icon] { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; }
[data-icon] svg { width: 100%; height: 100%; }
h1, h2, p { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 18px;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 13px; font-weight: 700; white-space: nowrap; }
.brand img { display: block; width: clamp(124px, 17vw, 177px); height: auto; border-radius: 3px; }
.brand span { border-left: 1px solid var(--line); padding-left: 13px; color: var(--coffee); }
.top-actions { display: flex; gap: 12px; align-items: center; }
.top-link, .green-button, .primary {
    border: 0;
    border-radius: 5px;
    font-weight: 700;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}
.top-link { background: var(--field); color: var(--coffee); border: 1px solid var(--line); }
.green-button { background: var(--pressed); color: var(--ink); }
.primary { background: var(--coffee); color: #fffdf7; }
.primary:hover { background: #47372a; }
.login-area {
    min-height: calc(100dvh - var(--topbar-height));
    display: grid;
    place-items: center;
    padding: 28px 18px;
    background: var(--panel);
}
.login-card {
    width: min(100%, 410px);
    display: grid;
    gap: 14px;
    padding: clamp(24px, 5vw, 40px);
    background: var(--field);
    border: 1px solid #eae5dd;
    border-radius: 18px;
    box-shadow: 0 12px 36px #36281b0d;
}
.login-card h1 { margin: 0; font-size: clamp(1.55rem, 4vw, 1.9rem); }
.login-copy { margin: 0 0 7px; color: #57534d; }
.login-card label { display: grid; gap: 6px; font-size: .92rem; font-weight: 700; }
.login-card input { border: 1px solid #bfbab1; background: #fff; padding: 11px; border-radius: 7px; }
.login-card a { justify-self: center; font-size: .9rem; color: var(--accent); }
.error { margin: 0 0 12px; padding: 10px 12px; background: #fee8e8; color: #781b25; border-radius: 5px; font-size: .88rem; }

.workspace {
    display: grid;
    grid-template-columns: 67px minmax(280px, 358px) minmax(0, 1fr);
    height: calc(100dvh - var(--topbar-height));
}
.rail {
    display: flex;
    flex-direction: column;
    background: var(--rail);
    border-right: 1px solid var(--line);
    overflow: auto;
}
.rail button {
    display: grid;
    gap: 6px;
    justify-items: center;
    border: 0;
    color: var(--coffee);
    background: none;
    padding: 12px 2px 8px;
    min-height: 59px;
    font-size: .7rem;
}
.rail button[aria-current], .rail button:hover { color: var(--ink); background: #ffe5a8; }
.rail [data-icon] { width: 26px; height: 26px; }
.side-panel {
    min-width: 0;
    overflow: auto;
    background: var(--panel);
    color: var(--ink);
    border-right: 1px solid var(--line);
    scrollbar-color: #bda485 var(--panel);
}
.panel-head {
    position: sticky;
    z-index: 1;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 53px;
    padding: 8px 14px;
    background: var(--panel);
}
.panel-head h1 { margin: 0; font-size: 1.18rem; font-weight: 600; }
.list-content, .settings-form { padding: 3px 13px 18px; }
.add-event, .side-search {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 5px;
    background: var(--field);
}
.add-event { padding: 8px 10px; min-height: 40px; color: #fffdf7; background: var(--coffee); font-size: 1rem; }
.add-event:hover { background: #47372a; }
.side-search { margin: 10px 0 12px; padding: 8px 10px; min-height: 36px; color: var(--ink); border: 1px solid var(--line); }
.side-filters { display: flex; gap: 6px; margin-bottom: 10px; }
.side-filters button {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--coffee);
    padding: 8px 10px;
    font-size: .8rem;
}
.side-filters button[aria-pressed="true"] { background: var(--pressed); color: var(--ink); }
.event-list, .side-group { display: grid; gap: 1px; border-radius: 5px; overflow: hidden; }
.event-list { gap: 6px; margin-bottom: 14px; }
.event-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 13px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    text-align: left;
}
.event-row { border-radius: 6px; }
.event-row:hover { background: var(--pressed); }
.event-thumb { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.empty-thumb { background: var(--pressed); color: var(--coffee); padding: 8px; }
.event-row-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.event-row-title, .event-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row small, .event-row-more, .side-hint { color: var(--muted); }
.event-row-more { font-weight: 700; }
.side-hint { margin: 0; padding: 12px 15px; font-size: .88rem; }
.empty-list { background: var(--field); border: 1px solid var(--line); }
.editor-head { display: grid; grid-template-columns: 1fr auto 1fr; }
.editor-head button { justify-self: start; border: 0; padding: 7px 0; background: transparent; color: var(--accent); }
.editor-head button:last-child { justify-self: end; }
.editor-content { padding: 0 16px 22px; }
.field-group { margin-bottom: 12px; background: var(--field); border-radius: 8px; border: 1px solid var(--line); }
.field-row, .field-group summary {
    display: flex;
    gap: 7px;
    flex-direction: column;
    padding: 9px 11px;
    min-height: 41px;
}
.field-group > :not(:last-child) { border-bottom: 1px solid #eadcc6; }
.field-row input:not([type="checkbox"], [type="color"]), .field-row select, .field-row textarea {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    padding: 5px 0;
}
.field-row textarea { resize: vertical; }
.field-row ::placeholder { color: var(--muted); opacity: 1; }
.field-row select { text-align: end; }
.field-row select option { background: var(--field); color: var(--ink); }
.horizontal { align-items: center; justify-content: space-between; flex-direction: row; }
.field-row.horizontal select { width: min(62%, 215px); }
.field-row.horizontal input[type="number"] { width: 62px; padding: 4px; text-align: end; }
.field-row.horizontal input[type="text"], .field-row.horizontal input[type="password"] {
    width: 57%;
    padding: 7px;
    color: var(--ink);
    border-color: var(--line);
}
.switch {
    appearance: none;
    margin: 0;
    height: 24px;
    width: 44px;
    flex: 0 0 44px;
    border-radius: 20px;
    background: #a88f6f;
    position: relative;
}
.switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(20px); }
summary { display: flex; align-items: center; list-style: none; }
summary::-webkit-details-marker { display: none; }
.field-group summary { flex-direction: row; gap: 11px; }
.field-group summary span { margin-left: auto; color: var(--accent); }
.section-caption { margin: 0 0 13px; color: var(--muted); font-size: .82rem; font-weight: 500; text-transform: uppercase; overflow-wrap: anywhere; }
.detail-fields { padding: 0 17px 16px; display: grid; gap: 10px; }
.detail-fields label { display: grid; gap: 6px; font-size: .88rem; }
.detail-fields label.horizontal { display: flex; }
.detail-fields input:not([type="color"], [type="checkbox"]) {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 7px;
    background: var(--panel);
}
.detail-fields input::file-selector-button { border: 0; border-radius: 3px; padding: 5px 7px; margin-right: 8px; color: #111; background: var(--pressed); }
.detail-fields > div:empty { display: none; }
.editor-media { display: flex; flex-wrap: wrap; gap: 5px; }
.editor-media img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.editor-media p { margin: 0; }
.inline-link, .danger { padding: 8px 0; border: 0; background: transparent; color: var(--accent); }
.danger { color: #8d2e21; }
.settings-form .primary { width: 100%; }

.preview { min-width: 0; overflow: auto; }
.preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px clamp(12px, 3%, 38px);
    color: var(--coffee);
    background: var(--field);
    border-bottom: 1px solid var(--line);
    font-size: .78rem;
}
.preview-bar button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--coffee); background: var(--field); }
#previewCalendar { min-height: calc(100% - 45px); }
.preview .calendar { padding-top: 20px; }
.preview .sample-label { margin-bottom: 14px; }

.calendar {
    --column-count: 3;
    --card-color: var(--field);
    background: var(--calendar-background, var(--panel));
    padding: 18px max(44px, 4%) 26px;
    min-height: 100%;
    container-type: inline-size;
}
.calendar-heading {
    margin: 0 auto 17px;
    text-align: center;
    color: var(--ink);
    font: 400 clamp(1.5rem, 3.2cqw, 2.55rem)/1.18 var(--heading-font);
    letter-spacing: .012em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.sample-label { color: #6d574a; font-size: .83rem; margin: 0 0 10px; }
.calendar-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.calendar-select, .calendar-search {
    color: var(--ink);
    min-height: 37px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--field);
}
.calendar-select { padding: 6px 9px; max-width: min(100%, 210px); }
.calendar-search { display: flex; align-items: center; gap: 9px; margin-left: auto; width: min(100%, 200px); padding: 0 9px; }
.calendar-search input { width: 100%; border: 0; background: transparent; color: #1d1d1d; padding: 6px 3px; }
.calendar-search input:focus-visible { outline-offset: 0; }
.search-icon { color: #777; width: 19px; height: 19px; }
.event-grid { display: grid; grid-template-columns: repeat(var(--column-count), minmax(0, 1fr)); gap: clamp(14px, 2cqw, 26px); }
.event-card {
    min-width: 0;
    background: var(--card-color);
    color: #151412;
    border: 1px solid #e4d5bd;
    border-radius: 12px;
    overflow: hidden;
}
.poster { position: relative; aspect-ratio: 1.74; background: #e4d9cc; overflow: hidden; }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster-placeholder {
    display: grid;
    align-items: end;
    padding: 15px 22px;
    background: radial-gradient(ellipse at 75% 115%, #c17c50 0 35%, transparent 36%),
        radial-gradient(ellipse at 93% 85%, #e7b985 0 38%, transparent 39%), #675145;
    color: #fff7ea;
}
.poster-brand { font: 400 clamp(1rem, 2.7cqw, 1.9rem) var(--heading-font); text-shadow: 0 1px 3px #3d2519; }
.date-badge {
    position: absolute;
    inset: 0 auto auto 0;
    display: grid;
    justify-items: center;
    min-width: 47px;
    width: 17%;
    padding: 7px 5px 8px;
    border-radius: 0 0 12px 0;
    color: #fff6e5;
    background: #59412e;
    font: 700 clamp(.58rem, .92cqw, .76rem)/1.12 "Josefin Sans", sans-serif;
    text-transform: uppercase;
}
.date-badge strong { font-size: clamp(1.35rem, 2.5cqw, 2rem); line-height: 1; margin-bottom: 4px; }
.card-body { padding: clamp(12px, 1.5cqw, 19px); }
.event-type { margin: 0 0 5px; color: var(--accent); font-size: .78rem; letter-spacing: .045em; text-transform: uppercase; overflow-wrap: anywhere; }
.event-title { margin: 0; font-size: clamp(1.03rem, 1.65cqw, 1.37rem); font-weight: 700; line-height: 1.28; }
.event-title-button { padding: 0; border: none; background: none; text-align: left; color: inherit; font: inherit; overflow-wrap: anywhere; }
.event-title-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.event-tags { margin: 4px 0 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.event-info { display: flex; flex-wrap: wrap; align-items: flex-start; flex-direction: column; gap: 5px; margin: 9px 0 0; }
.pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 7px;
    border-radius: 20px;
    background: #0000000b;
    max-width: 100%;
    font-size: .92rem;
}
.pill-icon { width: 15px; height: 15px; }
.pill-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-more {
    display: block;
    margin-top: 6px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 5px;
    color: inherit;
    background: transparent;
    font-size: .82rem;
    line-height: 1.3;
}
.event-more:hover { background: #8080801a; }
.event-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.42; }
.card-body .event-description { font-size: .91rem; margin: 9px 0 0; }
.public-button { display: inline-block; color: #fff; background: #49362b; text-decoration: none; padding: 9px 13px; border-radius: 5px; }
.card-body .public-button { margin-top: 17px; }
.calendar-message { margin: 0; padding: 40px 15px; text-align: center; color: #575047; }

dialog { border: 1px solid #d0c6bb; border-radius: 13px; width: min(calc(100% - 30px), 625px); max-height: 90dvh; padding: 26px; color: #181614; background: #fff; }
dialog::backdrop { background: #0008; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-header h2 { font-size: 1.35rem; }
.dialog-header button { border: 0; border-radius: 5px; background: #eee; font-size: 1.3rem; min-width: 34px; padding: 2px 8px; }
.detail-links { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 15px 0; }
.gallery img { width: 100%; height: 155px; object-fit: cover; border-radius: 8px; }
.embed-dialog textarea { width: 100%; margin: 8px 0 12px; resize: vertical; font: .85rem/1.4 monospace; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.notice { position: fixed; right: 16px; bottom: 16px; z-index: 2; background: #242424; color: #fff; border-radius: 7px; padding: 12px 16px; max-width: calc(100% - 32px); box-shadow: 0 8px 20px #0003; }

@container (max-width: 850px) {
    .event-grid { grid-template-columns: repeat(min(2, var(--column-count)), minmax(0, 1fr)); }
}
@container (max-width: 510px) {
    .event-grid { grid-template-columns: 1fr; }
    .event-title { font-size: 1.27rem; }
    .date-badge strong { font-size: 2.15rem; }
}
@media (max-width: 1100px) {
    .workspace { grid-template-columns: 61px minmax(280px, 350px) minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .workspace { grid-template-columns: 1fr; height: auto; }
    .rail { flex-direction: row; border: 0; border-bottom: 1px solid var(--line); }
    .rail button { flex: 1; min-width: 56px; padding: 10px 3px; min-height: 55px; }
    .rail [data-icon] { width: 21px; height: 21px; }
    .side-panel { max-height: none; overflow: visible; }
    .panel-head { position: static; min-height: 58px; }
    .editor-head { position: sticky; }
    .preview .calendar { padding-top: 24px; }
    .preview { overflow: visible; }
    .list-content { padding: 3px 16px 20px; }
    .event-list { margin-bottom: 16px; }
}
@media (max-width: 525px) {
    .topbar { height: auto; min-height: 64px; padding: 11px 12px; flex-wrap: wrap; gap: 8px; }
    .brand { gap: 10px; font-size: .94rem; }
    
    .top-actions { gap: 5px; }
    .top-link, .green-button { padding: 8px 6px; font-size: .73rem; }
    .calendar { padding-inline: 16px; }
    .calendar-search { margin-left: 0; flex: 1 1 100%; width: 100%; }
    .calendar-heading { margin-top: 10px; }
}

.calendar-views {
    display: flex;
    gap: 5px;
    width: max-content;
    padding: 4px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
}
.calendar-views button {
    border: 0;
    border-radius: 6px;
    padding: 7px 12px;
    background: transparent;
    color: #49382d;
}
.calendar-views button[aria-pressed="true"] { color: white; background: var(--coffee); }
.event-card.dark-card, .dark-card .event-type, .dark-card .event-tags { color: #fff9f0; }
.dark-card .pill { background: #0004; }
.event-description a, .detail-place a { color: var(--accent); overflow-wrap: anywhere; }
.detail-place span { display: block; margin-top: 4px; }
.repeat-days { flex-wrap: wrap; margin: 0; min-inline-size: 0; border: 0; }
.repeat-days legend { padding: 0 4px; }
.repeat-days label { display: flex; gap: 4px; align-items: center; }

/* Dashboard preferences and reusable event information. */
.preview-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.preview-bar button[aria-pressed="true"] { background: var(--pressed); border-color: var(--line); color: var(--ink); }
#previewCalendar:has(.mobile-preview) { background: #f3e7d3; padding: 12px; }
.mobile-preview { width: min(100%, 390px); border: 1px solid #d4cec9; border-radius: 16px; }
.catalog-entry {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; text-align: left; color: var(--ink); background: var(--field); border: 0;
}
.catalog-entry:hover, .catalog-name:hover { background: var(--pressed); }
.catalog-entry span { font-size: 1.32rem; color: var(--muted); }
.catalog-head { justify-content: flex-start; gap: 12px; }
.catalog-back, .catalog-name, .catalog-move { border: 0; color: var(--ink); background: transparent; }
.catalog-back { color: var(--accent); padding: 5px; }
.catalog-list { margin-top: 18px; border-radius: 6px; background: var(--field); }
.catalog-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px 32px; align-items: center; gap: 4px; padding-right: 6px; }
.catalog-row + .catalog-row { border-top: 1px solid var(--line); }
.catalog-name { padding: 11px 10px; text-align: left; overflow-wrap: anywhere; }
.catalog-move { min-height: 32px; border-radius: 4px; font-size: 1rem; }
.catalog-move:not(:disabled):hover { background: var(--pressed); }
.catalog-move:disabled { cursor: default; opacity: .32; }
.settings-form { padding-bottom: 32px; }
.settings-accordion summary::after {
    content: '›'; margin-left: auto; font-size: 1.2rem; color: var(--muted);
}
.settings-accordion[open] summary::after { transform: rotate(90deg); }
.settings-accordion summary { cursor: pointer; }
.settings-form .field-row input[type="url"] { width: 57%; padding: 7px; color: var(--ink); border-color: var(--line); }
.settings-form .field-row.horizontal input[type="number"] { width: 76px; border-color: #666; }
.detail-fields select {
    width: 100%; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 7px;
}
.editor-type-options { max-height: 205px; overflow-y: auto; }
.editor-type-options label.type-choice {
    display: flex; align-items: center; gap: 7px; padding: 5px 0; color: var(--ink);
}
.editor-type-options input { accent-color: var(--accent); }
.preference-tiles {
    margin-inline: 0; min-inline-size: 0; border: 0; padding: 12px;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px;
}
.preference-tiles > .preference-tile {
    position: relative; display: grid; justify-items: center; align-content: center;
    gap: 7px; min-height: 65px; padding: 6px 2px; border: 1px solid transparent;
    border-radius: 6px; cursor: pointer; color: var(--muted); text-align: center; font-size: .78rem;
}
.preference-tile:has(:checked) { border-color: var(--accent); color: var(--ink); background: var(--pressed); }
.preference-tile:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.tile-icon { display: grid; width: 42px; height: 37px; gap: 2px; color: #a0836a; }
.tile-icon i { display: block; border-radius: 1px; background: currentColor; }
.preference-tile:has(:checked) .tile-icon { color: var(--accent); }
.tile-list { grid-template-rows: repeat(3, 1fr); width: 29px; }
.tile-grid, .tile-masonry { grid-template-columns: repeat(3, 1fr); }
.tile-masonry { grid-template-rows: repeat(3, 1fr); }
.tile-masonry i:nth-child(3n + 1) { grid-row: span 2; }
.tile-carousel { grid-template-columns: repeat(3, 1fr); height: 20px; margin-block: 8px; }
.tile-slider { height: 27px; margin-block: 4px; }
.tile-month, .tile-week, .tile-day {
    display: grid; place-items: center; border-top: 5px dotted #353535; border-radius: 3px;
    background: #aaa; color: #262626; font-size: 1.05rem;
}
.preference-tile:has(:checked) :is(.tile-month, .tile-week, .tile-day) { color: #fffdf7; background: var(--accent); }
.preference-tile .tile-icon[style] {
    width: min(100%, 66px); height: 54px; padding: 4px 6px; gap: 2px; border-radius: 6px;
    background: var(--tile-bg); color: #433327; grid-template-rows: auto auto 4px 4px;
}
.preference-tile .tile-icon[style] strong { background: var(--tile-card); color: inherit; text-align: left; padding-left: 4px; }
.preference-tile .tile-icon[style] small { text-align: left; font-size: .53rem; }
.preference-tile .tile-icon[style] i { opacity: .45; width: 75%; }
.preference-tile .tile-icon:is(.tile-dark, .tile-dark-outline, .tile-deep) strong,
.preference-tile .tile-icon:is(.tile-dark, .tile-dark-outline) { color: #fff2e7; }

/* The public widget and its dashboard preview share these layouts. */
.calendar { --event-gap: clamp(10px, 2cqw, 24px); margin-inline: auto; }
.calendar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.calendar-date-label { display: flex; align-items: center; gap: 5px; font-size: .83rem; }
.calendar-date { width: min(150px, 56vw); }
.filter-dialog .calendar-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); margin: 0 0 20px; }
.filter-dialog .calendar-select { width: 100%; }
.filter-dialog .calendar-date-label { display: grid; }
.filter-dialog .public-button { cursor: pointer; border: 0; }
.calendar-control {
    background: #fff; color: #433327; border: 1px solid #cdbeb2; border-radius: 7px;
    min-height: 37px; padding: 5px 11px;
}
.calendar-control:disabled { opacity: .4; cursor: default; }
.period-navigation button { font-size: 1.45rem; line-height: 1; min-width: 40px; }
.calendar .event-grid { --visible-events: var(--column-count); gap: var(--event-gap); }
.calendar.layout-grid .event-grid { grid-template-columns: repeat(var(--visible-events), minmax(0, 1fr)); }
.calendar:is(.layout-carousel, .layout-slider) .event-grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--visible-events) - 1) * var(--event-gap)) / var(--visible-events));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.calendar:is(.layout-carousel, .layout-slider) .event-card { scroll-snap-align: start; }
.calendar.layout-slider .event-grid { grid-auto-columns: 100%; }
.calendar.layout-slider .poster { aspect-ratio: 2.25; }
.calendar:is(.layout-list, .layout-month, .layout-week, .layout-day) .event-grid { grid-template-columns: minmax(0, 1fr); }
.calendar.layout-list .event-card { display: grid; grid-template-columns: minmax(130px, 28%) minmax(0, 1fr); }
.calendar.layout-list .poster { height: 100%; aspect-ratio: initial; min-height: 155px; }
.calendar.layout-masonry .event-grid { display: block; columns: var(--visible-events); column-gap: var(--event-gap); }
.calendar.layout-masonry .event-card { break-inside: avoid; margin-bottom: var(--event-gap); }
.calendar .poster-date-only, .calendar.layout-list .poster-date-only {
    aspect-ratio: auto; min-height: 62px; background: transparent;
}
.poster-date-only .date-badge { min-width: 58px; width: auto; padding: 4px 9px 6px; line-height: 1; border-radius: 0 0 14px 0; }
.poster-date-only .date-badge strong { font-size: 1.25rem; margin-bottom: 1px; }
.layout-list .poster-date-only { height: auto; }
.period-navigation { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-bottom: 9px; }
.period-navigation strong { text-align: center; }
.date-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 17px; }
.day-label { font-size: .8rem; text-align: center; }
.date-cell {
    min-height: 37px; border: 1px solid #ded5cb; border-radius: 6px; background: #fbf7f0;
    color: #47372c; padding: 3px; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.date-cell.adjacent-period { opacity: .35; }
.date-cell:disabled { cursor: default; }
.date-cell[aria-pressed="true"] { border-color: #935f35; background: #f2dcc6; }
.date-count { color: white; background: #695044; border-radius: 8px; min-width: 14px; padding: 1px 3px; font-size: .64rem; }
.theme-outline .event-card { border-color: #97877b; }
.theme-dark-outline .event-card { border-color: #948c9b; }
.theme-dark-background .calendar-heading, .theme-dark-background .calendar-message,
.theme-dark-background .calendar-date-label, .theme-dark-background .sample-label,
.theme-dark-background .calendar-period { color: #fff4e9; }

@container (max-width: 815px) {
    .calendar .event-grid { --visible-events: min(2, var(--column-count)); }
}
@container (max-width: 570px) {
    .calendar .event-grid { --visible-events: var(--mobile-columns); }
    .calendar .beyond-mobile-limit { display: none; }
    .calendar .event-card { border-radius: 16px; }
    .calendar .card-body { padding: clamp(7px, 3cqw, 16px); }
    .calendar .event-title { font-size: clamp(.83rem, 3.8cqw, 1.22rem); }
    .calendar :is(.event-type, .event-tags, .pill, .card-body .event-description) { font-size: clamp(.72rem, 3.2cqw, .93rem); }
    .calendar .event-info, .calendar .card-body .event-description { margin-top: 10px; }
    .calendar .date-badge { min-width: 29px; padding: 4px 3px 6px; font-size: clamp(.5rem, 2.2cqw, .72rem); border-radius: 0 0 12px 0; }
    .calendar .date-badge strong { font-size: clamp(.9rem, 5cqw, 1.9rem); }
    .calendar.layout-list .event-card { grid-template-columns: minmax(82px, 29%) minmax(0, 1fr); }
    .calendar-toolbar { margin-bottom: 15px; }
    .calendar-search { margin-left: 0; flex: 1 1 100%; width: 100%; }
    .calendar .pill { padding: 4px 6px; }
    .calendar .pill-icon { width: 12px; height: 12px; }
}

.tile-inline { grid-template-columns: repeat(3, 1fr); height: 14px; align-self: center; margin-block: 11px; }
.tile-popup { grid-template-rows: repeat(3, 1fr); border: 2px solid currentColor; border-radius: 4px; padding: 5px; }
.tile-radio { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.preview .mobile-preview { padding: 22px 16px 24px; }
@container (max-width: 570px) {
    .calendar .card-body .event-description {
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
    }
}

/* Shared canvas, with controls beside the carousel instead of a bottom bar. */
.panel-head h1, .login-card h1, .dialog-header h2 { font-family: var(--heading-font); font-weight: 400; }
.top-link, .green-button, .primary { padding: 8px 11px; }
.preview { background: var(--panel); }
#publicCalendar { min-height: 100dvh; }
#publicCalendar .calendar { min-height: 100dvh; }
.carousel-frame { position: relative; min-width: 0; }
.carousel-frame [aria-roledescription="carousel"]:focus-visible { outline-offset: -2px; }
.carousel-frame [aria-roledescription="carousel"]::-webkit-scrollbar { display: none; }
.track-controls {
    position: absolute;
    inset: clamp(50px, 8cqw, 136px) -42px auto;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.calendar-control.carousel-arrow {
    display: grid;
    place-items: center;
    padding: 0;
    width: 35px;
    height: 35px;
    min-height: 35px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--field);
    color: var(--coffee);
    box-shadow: 0 2px 7px #594e3e1a;
    pointer-events: auto;
}
.carousel-arrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateX(1px) rotate(-135deg);
}
.carousel-arrow.arrow-next::before { transform: translateX(-1px) rotate(45deg); }
.carousel-arrow:not(:disabled):hover { background: var(--pressed); }
.calendar .card-body .event-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.theme-books .event-card { box-shadow: inset 0 -2px #f5e1c4; }
.theme-books .event-card:not(.dark-card) .pill { background: #f4e9d6; }
.theme-books .public-button { background: var(--coffee); }

@container (max-width: 570px) {
    .calendar .track-controls { inset: clamp(45px, 15cqw, 90px) 0 auto; }
    .calendar .carousel-frame:has(.track-controls:not([hidden])) { padding-inline: 30px; }
    .calendar .carousel-arrow { width: 28px; height: 34px; min-height: 34px; border-radius: 7px; }
    .calendar .event-card { border-radius: 10px; }
    .calendar .calendar-heading { margin: 0 auto 13px; }
    .calendar .card-body .event-description { -webkit-line-clamp: 3; }
}
@media (max-width: 760px) {
    .side-panel { border-right: 0; }
    .preview .calendar { padding-top: 16px; }
    .preview .mobile-preview { padding-block: 16px 22px; }
}
@media (max-width: 525px) {
    .topbar { min-height: 58px; }
    .brand span { padding-left: 9px; font-size: .83rem; }
    .calendar-select, .calendar-search { font-size: .92rem; }
    .calendar { padding-inline: 10px; }
}

/* The invitation preserves the poster artwork and uses the event color as a paper tint. */
.event-dialog {
    --invite-paper: color-mix(in srgb, var(--invite-color, var(--panel)) 13%, #fffdf7);
    --invite-wash: color-mix(in srgb, var(--invite-color, var(--panel)) 31%, #fff5e1);
    --invite-rule: color-mix(in srgb, var(--invite-color, var(--panel)) 40%, #bba384);
    --invite-ink: color-mix(in srgb, var(--invite-color, var(--panel)) 20%, #3b2718);
    width: min(680px, calc(100% - 32px));
    max-height: min(90dvh, 840px);
    padding: 0;
    border: 1px solid var(--invite-rule);
    border-radius: 17px;
    color: var(--ink);
    background: var(--invite-paper);
    box-shadow: 0 24px 65px #2e1f2355;
    overflow: hidden;
}
.event-dialog[open] { display: flex; }
.event-dialog.has-poster { width: min(930px, calc(100% - 32px)); }
.event-dialog::backdrop { background: #32281fcc; }
.invitation-close {
    position: absolute;
    inset: 12px 13px auto auto;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--invite-rule);
    border-radius: 50%;
    background: var(--invite-paper);
    color: var(--ink);
    font-size: 1.55rem;
    line-height: 1;
}
.invitation-close:hover { background: var(--invite-wash); }
.event-detail {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 17px 25px;
    border-top: 6px solid var(--invite-rule);
    padding: clamp(18px, 3.2vw, 32px);
    overflow: auto;
    overscroll-behavior: contain;
}
.has-poster .event-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.58fr); }
.has-poster .invitation-header, .has-poster .invitation-content { grid-column: 2; }
.has-poster .invitation-header { grid-row: 1; }
.has-poster .invitation-content { grid-row: 2; }
.invitation-header { padding-right: 31px; }
.invitation-header h2 {
    margin: 0;
    color: var(--ink);
    font: 400 clamp(1.65rem, 3.5vw, 2.55rem)/1.14 var(--heading-font);
    overflow-wrap: anywhere;
}
.invitation-type {
    margin: 0 0 7px;
    color: var(--invite-ink);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .075em;
}
.invitation-poster {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: 0;
    margin: 0;
    padding: 9px;
    border: 1px solid var(--invite-rule);
    border-radius: 11px;
    background: var(--invite-wash);
}
.invitation-poster-link {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding-bottom: 3px;
    color: var(--invite-ink);
    font-size: .85rem;
    font-weight: 700;
    text-underline-offset: 3px;
}
.invitation-poster img { display: block; width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 6px; }
.invitation-facts {
    margin: 0;
    padding: 0 13px;
    border: 1px solid var(--invite-rule);
    border-radius: 10px;
    background: var(--invite-wash);
}
.invitation-fact { padding: 9px 0; }
.invitation-fact + .invitation-fact { border-top: 1px solid var(--invite-rule); }
.invitation-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    color: var(--invite-ink);
    font-size: .77rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.invitation-icon { width: 15px; height: 15px; }
.invitation-fact dd { margin: 0 0 0 22px; font-size: .96rem; line-height: 1.32; overflow-wrap: anywhere; }
.invitation-fact a, .invitation-description a { color: var(--invite-ink); text-underline-offset: 3px; }
.invitation-time, .invitation-address { display: block; margin-top: 3px; }
.invitation-zone, .invitation-address { color: var(--muted); font-size: .88rem; }
.invitation-description { margin-top: 18px; }
.invitation-description h3 {
    margin: 0 0 7px;
    font: 400 1.18rem/1.28 var(--heading-font);
}
.invitation-description .event-description { margin: 0; font-size: 1rem; line-height: 1.48; }
.invitation-content .detail-links { margin-top: 14px; }
.invitation-content .public-button { background: var(--invite-ink); }

@media (max-width: 660px) {
    .event-dialog, .event-dialog.has-poster { width: calc(100% - 20px); max-height: 92dvh; }
    .has-poster .event-detail { grid-template-columns: minmax(0, 1fr); }
    .has-poster .invitation-header, .has-poster .invitation-content, .invitation-poster { grid-column: auto; grid-row: auto; }
    .invitation-poster { position: static; }
    .invitation-poster img { max-height: 46dvh; }
    .invitation-close { inset: 10px 10px auto auto; }
    .event-detail { gap: 13px; }
}

.calendar-fallback .public-button { border: 0; font: inherit; }
.calendar-direct-link { display: inline-block; margin: 7px 10px; color: var(--accent); }


/* Abhigyaan website calendar embed. */
:root.abhigyaan-calendar {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: #173e2b;
    background: #f7fbf2;
    --heading-font: Georgia, "Times New Roman", serif;
    --ink: #123d2b;
    --coffee: #14623d;
    --accent: #14623d;
    --focus: #216846;
    --rail: #eef6e9;
    --panel: #f7fbf2;
    --field: #fff;
    --line: #cbdfd1;
    --pressed: #e7f1e4;
    --muted: #52665c;
}
.abhigyaan-calendar :is(.calendar-heading, .event-title, .invitation-header h2) {
    font-family: var(--heading-font);
    font-weight: 700;
}
.abhigyaan-calendar :is(.calendar-control, .calendar-views button:not([aria-pressed="true"]), .calendar-message, .date-cell) {
    color: var(--ink);
    border-color: var(--line);
}
.abhigyaan-calendar .theme-abhigyaan .event-card { border-color: var(--line); }
.abhigyaan-calendar .event-card:not(.dark-card) { color: var(--ink); }
.abhigyaan-calendar .event-card:not(.dark-card) .pill { background: var(--rail); }
.abhigyaan-calendar .date-badge {
    color: #fff;
    background: var(--coffee);
    font-family: inherit;
}
.abhigyaan-calendar :is(.date-count, .public-button) { background: var(--coffee); }
.abhigyaan-calendar .date-cell { background: var(--field); }
.abhigyaan-calendar .date-cell[aria-pressed="true"] { background: var(--pressed); }
.abhigyaan-calendar .event-dialog {
    --invite-paper: color-mix(in srgb, var(--invite-color, var(--panel)) 13%, #fbfdf7);
    --invite-wash: color-mix(in srgb, var(--invite-color, var(--panel)) 24%, #eef6e9);
    --invite-rule: color-mix(in srgb, var(--invite-color, var(--panel)) 27%, #aac7b0);
    --invite-ink: #123d2b;
}


/* Limit embedded height to the calendar's content and keep dialog controls accessible. */
.bb-calendar-embed #publicCalendar,
.bb-calendar-embed #publicCalendar .calendar {
    min-height: 0;
}
.bb-calendar-embed #publicCalendar .calendar { padding-bottom: 12px; }
.bb-calendar-embed #publicCalendar .event-grid { align-items: start; }
.bb-calendar-embed #publicCalendar .card-body { padding-block-end: 10px; }
.bb-calendar-embed body:has(dialog[open]) #publicCalendar { min-height: 580px; }

/* The Abhigyaan page already supplies this heading above the frame. */
:root.abhigyaan-calendar.bb-calendar-embed #publicCalendar .calendar-heading {
    display: none;
}

/* Align the public calendar filters with Search on narrow layouts. */
@container (max-width: 570px) {
    #publicCalendar .calendar-toolbar > .calendar-filters {
        display: grid;
        flex: 1 1 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        align-items: stretch;
    }
    #publicCalendar .calendar-toolbar > .calendar-filters .calendar-select {
        width: 100%;
        max-width: 100%;
        min-height: 40px;
    }
    #publicCalendar .calendar-toolbar > .calendar-filters > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    #publicCalendar .calendar-toolbar > .calendar-filters > .calendar-date-label {
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
    }
    #publicCalendar .calendar-toolbar > .calendar-search {
        min-height: 40px;
    }
}

/* Expanded invitation email statistics */
.email-statistics{margin-top:22px;padding:18px;border:1px solid #d9c7ad;border-radius:12px;background:#fff9ee}
.email-stat{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid #e9ddce;font-size:14px}
.email-stat strong{text-align:right}.email-stat-note{font-size:12px;line-height:1.5;opacity:.8;margin-top:12px}

/* Email statistics refresh control and fetch timestamp */
.email-stat-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.email-stat-heading h3{margin:0}
.email-stat-refresh{border:1px solid #bca184;border-radius:8px;background:#fff;color:#4c382b;padding:8px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.email-stat-refresh:hover:not(:disabled){background:#f6ead8}
.email-stat-refresh:disabled{opacity:.6;cursor:wait}
.email-stat-updated{font-size:12px;opacity:.75;margin:10px 0 0}
