/* Calendar uses the same theme variables as the chat. */
#view-calendar { overflow: hidden; }
.ghb-calendar .ghb-cal-header { flex: none; gap: 12px; }
.ghb-calendar .ghb-cal-header h2 { margin: 0; font-size: 18px; }
.ghb-calendar .ghb-cal-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.ghb-calendar .ghb-cal-scroll > * { max-width: 720px; margin-inline: auto; }
.ghb-cal-monthbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 2px 10px; }
.ghb-cal-monthbar h3 { font-size: 19px; margin: 0; text-align: center; }
.ghb-cal-monthbar button { min-width: 40px; font-size: 26px; line-height: 1; padding: 8px; }
.ghb-cal-weekdays, .ghb-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ghb-cal-weekdays { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 7px; }
.ghb-cal-grid { gap: 3px; }
.ghb-cal-grid .ghb-cal-day { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; position: relative; min-width: 0; min-height: 68px; border: 1px solid transparent; border-radius: 10px; padding: 5px 3px 4px; color: var(--text); background: var(--surface); cursor: pointer; text-align: center; font: inherit; }
.ghb-cal-day-number { font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.ghb-cal-day.is-outside { background: transparent; color: var(--hint); }
.ghb-cal-day.is-outside .ghb-cal-day-labels { opacity: .65; }
.ghb-cal-day.is-today .ghb-cal-day-number { color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.ghb-cal-day.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ghb-cal-day-labels { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; min-width: 0; }
.ghb-cal-tiny { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: 9px; line-height: 1.35; }
.ghb-cal-tiny.ghb-cal-kind-birthday { color: var(--danger); }
.ghb-cal-tiny.ghb-cal-kind-holiday { color: var(--warn); }
.ghb-cal-tiny.ghb-cal-kind-cycle { color: var(--danger); font-style: italic; }
.ghb-cal-more { color: var(--hint); font-size: 9px; line-height: 1.1; }
.ghb-cal-privacy, .ghb-cal-timezone, .ghb-cal-field-hint { font-size: 11px; color: var(--muted); line-height: 1.5; margin-block: 8px 0; overflow-wrap: anywhere; }
.ghb-cal-timezone { margin-block: 3px 0; }
.ghb-cal-status { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ghb-cal-status:has(span:empty) { display: none; }
.ghb-cal-status > button { margin-inline-start: 8px; font-size: 12px; }
.ghb-cal-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-block: 14px 4px; }
.ghb-cal-actions > button { font-size: 13px; padding: 8px 12px; }
.ghb-cal-details h3, .ghb-cal-cycles h3, .ghb-cal-form h3 { font-size: 15px; margin-block: 16px 8px; }
.ghb-cal-empty { color: var(--muted); font-size: 13px; margin-block: 12px; }
.ghb-cal-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-block: 8px; overflow-wrap: anywhere; }
.ghb-cal-item h4 { font-size: 14px; margin: 0; font-weight: 650; }
.ghb-cal-item p { margin-block: 5px 0; }
.ghb-cal-item-meta { font-size: 11px; color: var(--muted); }
.ghb-cal-notes { font-size: 13px; white-space: pre-wrap; }
.ghb-cal-estimate-note { font-size: 11px; color: var(--muted); line-height: 1.6; }
.ghb-cal-source { font-size: 11px; color: var(--accent); }
.ghb-cal-item-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ghb-cal-item-actions > button { padding: 4px 8px; min-height: 32px; font-size: 12px; }
.ghb-cal-delete, .ghb-cal-remove-cycle { color: var(--danger); }
.ghb-cal-editor:empty { display: none; }
.ghb-cal-form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px 12px; margin-block: 12px; }
.ghb-cal-field { display: flex; flex-direction: column; gap: 4px; margin-block: 10px; font-size: 12px; }
.ghb-cal-field > input:not([type="checkbox"]), .ghb-cal-field > textarea, .ghb-cal-field > select { width: 100%; min-width: 0; max-width: 100%; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.ghb-cal-field > input[type="checkbox"] { align-self: flex-start; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ghb-cal-field > textarea { resize: vertical; }
.ghb-cal-field > input:disabled { opacity: .45; }
.ghb-cal-form-actions { display: flex; gap: 10px; margin-top: 12px; }
.ghb-cal-form-actions > button { font-size: 13px; padding: 8px 14px; }
.ghb-cal-form-status { font-size: 12px; color: var(--danger); margin-bottom: 0; overflow-wrap: anywhere; }
.ghb-cal-form-status:empty { display: none; }
.ghb-cal-sharing-summary, .ghb-cal-shared-owner { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ghb-cal-sharing-title { font-size: 14px; overflow-wrap: anywhere; }
.ghb-cal-sharing-count { font-size: 12px; color: var(--muted); margin-block: 12px 6px; }
.ghb-cal-sharing-list { list-style: none; padding: 0; margin-block: 0 12px; }
.ghb-cal-sharing-recipient { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px; border-bottom: 1px solid var(--line); }
.ghb-cal-sharing-recipient > span { min-width: 0; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.ghb-cal-sharing-remove { flex-shrink: 0; max-width: 65%; color: var(--danger); font-size: 12px; text-align: start; }
.ghb-cal-sharing-peer { max-width: 100%; text-align: start; overflow-wrap: anywhere; }
.ghb-cal-sharing-form button { min-height: 40px; white-space: normal; overflow-wrap: anywhere; }
.ghb-cal-sharing-form button:disabled, .ghb-cal-sharing-form select:disabled { opacity: .55; cursor: wait; }
.ghb-cal-sharing-form .ghb-cal-form-status > button { margin-inline-start: 8px; }
.ghb-cal-sharing-form .ghb-cal-form-status.is-success { color: var(--muted); }
.ghb-cal-cycle-record { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--line); padding-block: 10px; overflow-wrap: anywhere; }
.ghb-cal-cycle-record > strong { font-size: 13px; }
.ghb-cal-cycle-record > button { align-self: flex-start; padding: 5px 8px; text-align: start; font-size: 11px; }
#calendar-reminder-host[hidden] { display: none !important; }
#calendar-reminder-host { flex: none; min-width: 0; padding: 0; text-align: center; background: var(--bg); }
#calendar-reminder-host .ghb-cal-reminder { display: block; width: 100%; min-height: 26px; padding: 5px max(12px, env(safe-area-inset-right)) 5px max(12px, env(safe-area-inset-left)); background: var(--warn-soft, #fff1f0); background: color-mix(in srgb, var(--danger, #a32d2d) 12%, var(--surface)); border: 0; border-radius: 0; color: var(--danger, #a32d2d); color: color-mix(in srgb, var(--danger, #a32d2d) 75%, var(--text)); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { #calendar-reminder-host .ghb-cal-reminder:hover { background: color-mix(in srgb, var(--danger, #a32d2d) 18%, var(--surface)); } }
#calendar-open { width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 5px; }
#calendar-open svg { width: 18px; height: 18px; }
.ghb-calendar button:focus-visible, #calendar-reminder:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 600px) { .ghb-cal-grid .ghb-cal-day { min-height: 86px; padding: 7px; } .ghb-cal-tiny { font-size: 10px; } }
@media (max-width: 340px) { .ghb-cal-grid { gap: 1px; } .ghb-cal-grid .ghb-cal-day { min-height: 64px; border-radius: 7px; padding-inline: 1px; } .ghb-cal-tiny { font-size: 8px; } }
.ghb-cal-translation-spinner { display:inline-block; width:.8em; height:.8em; margin-inline-start:.4em; border:2px solid currentColor; border-inline-end-color:transparent; border-radius:50%; vertical-align:middle; animation:ghb-cal-spin .8s linear infinite; flex:none; }
.ghb-cal-translation-label { font-size:11px; font-weight:400; color:var(--muted); margin-inline-start:.4em; }
.ghb-cal-dual-time { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ghb-cal-dual-time p { margin:4px 0; }
.ghb-cal-translation-error { font-size:12px; color:var(--muted); }
.ghb-cal-translation-retry { margin-inline-start:8px; }
#calendar-reminder-host .ghb-cal-reminder { white-space:normal; overflow-wrap:anywhere; }
@keyframes ghb-cal-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ghb-calendar *, .ghb-cal-reminder, .ghb-cal-translation-spinner { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
