.calendar-toolbar,.calendar-navigation {display:flex;align-items:center;gap:12px;}
.calendar-toolbar {justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;}
.calendar-navigation h3 {margin:0;text-transform:capitalize;min-width:150px;text-align:center;}
.brew-page .calendar-toolbar button {margin:0;}
.calendar-weekdays,.calendar-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;}
.calendar-weekdays {text-align:center;margin-bottom:6px;font-size:var(--font-label);}
.brew-page .reminder-calendar button.calendar-date {display:block;position:relative;min-width:0;min-height:104px;margin:0;padding:10px;text-align:left;align-content:start;background:#fff;color:var(--text);border:1px solid var(--border);border-radius:6px;font:inherit;cursor:pointer;overflow:hidden;}
.calendar-day-number {font-weight:700;}
.calendar-count {float:right;background:#dcebd6;border-radius:12px;padding:1px 7px;font-size:12px;}
.calendar-preview {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;margin-top:6px;padding:3px;background:#edf2e9;border-radius:3px;}
.brew-page .reminder-calendar button.calendar-current {border:2px solid #6e8b68;}
.brew-page .reminder-calendar button.calendar-outside {background:#f4f5f1;color:#777;}
.brew-page .reminder-calendar button.calendar-date:hover {background:#edf2e9;}
.brew-page .reminder-calendar button.calendar-date:focus-visible {outline:3px solid #7194ab;outline-offset:1px;}
.calendar-subscription {margin-top:16px!important;}
.calendar-event {padding:0 0 16px;margin:0 0 16px;border-bottom:1px solid var(--border);}
.calendar-event:last-child {padding:0;margin:0;border:0;}
.calendar-event h3 {margin:0 0 8px;}
.calendar-event p {white-space:pre-line;overflow-wrap:anywhere;}
.calendar-event .brew-actions {align-items:center;}
.calendar-event form {margin:0;}
.calendar-day-dialog {width:min(620px,calc(100vw - 24px));}
.calendar-subscription input[type=url] {width:100%;}
@media(max-width:700px){.calendar-weekdays,.calendar-grid {gap:3px;}.brew-page .reminder-calendar button.calendar-date {min-height:72px;padding:5px;font-size:13px;}.calendar-preview {display:none;}.calendar-count {float:none;display:block;width:max-content;margin-top:8px;}.calendar-navigation {gap:6px;}.calendar-navigation h3 {min-width:130px;}.calendar-toolbar {gap:8px;}.calendar-day-dialog {height:auto;max-height:90dvh;border-radius:6px;}}

/* Keep day details content-sized even when other mobile dialogs fill the screen. */
.brew-dialog.calendar-day-dialog {position:fixed;inset:0;margin:auto;width:min(480px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:fit-content;min-height:0;max-height:calc(100dvh - 32px);border:1px solid var(--border);border-radius:8px;text-align:center;}
.brew-dialog.calendar-day-dialog .dialog-header {display:grid;grid-template-columns:38px minmax(0,1fr) 38px;gap:8px;padding:10px 12px;}
.brew-dialog.calendar-day-dialog .dialog-header h2 {grid-column:2;font-size:16px;line-height:1.35;text-align:center;}
.brew-dialog.calendar-day-dialog .dialog-header button {grid-column:3;}
.brew-dialog.calendar-day-dialog .dialog-body {flex:0 1 auto;padding:12px 16px;}
.brew-dialog.calendar-day-dialog .calendar-event {padding:10px 0;margin:0;line-height:1.35;}
.brew-dialog.calendar-day-dialog .calendar-event:first-child {padding-top:0;}
.brew-dialog.calendar-day-dialog .calendar-event:last-child {padding-bottom:0;}
.brew-dialog.calendar-day-dialog .calendar-event h3 {margin:0 0 4px;font-size:16px;}
.brew-dialog.calendar-day-dialog .calendar-event p {margin:4px 0;font-size:14px;}
.brew-dialog.calendar-day-dialog .calendar-event .brew-actions {justify-content:center;gap:12px;margin:8px 0 0;}
.brew-dialog.calendar-day-dialog .calendar-event a {color:#45674c;font-size:14px;text-underline-offset:3px;}
