/* add-event dialog */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px } .day-head .icon-btn { margin: -4px -8px -4px 0 }
.ph-actions { display: flex; align-items: center; gap: 12px }
.fld { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 } .fld .field { width: 100% } .fld textarea.field { height: auto; padding: 12px 16px; resize: vertical; font: inherit }
.dialog form { max-height: 80vh; overflow-y: auto; padding-right: 4px }
.fld-row { display: flex; gap: 16px } .fld-row .fld { flex: 1 } .fld.sw { flex: 0 0 auto; align-items: flex-start } .fld.sw .switch { margin-top: 12px }
#event-error { color: var(--error) }

/* Calendar: month grid card + day panel. */
.cal { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start }
.cal-nav { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 20px }
.cal-nav div { display: flex; align-items: center; gap: 4px }
#status { display: flex; align-items: center; gap: 12px }

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px 8px 8px }
.dow { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 500; color: var(--on-surface-variant) }
.cell { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; min-height: 92px; min-width: 0; padding: 4px; border-radius: 12px; font-size: 12px; cursor: pointer; overflow: hidden; transition: background .15s }
.cell:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent) }
.cell.sel { background: var(--secondary-container); color: var(--on-secondary-container) }
.cell:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px }
.cell.dim { color: var(--outline) }
.cell .n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-weight: 500; align-self: flex-start }
.cell.today .n { background: var(--primary); color: var(--on-primary) }
/* event chips keep each Google calendar's own colour, so you can tell calendars apart */
.chip { --c: var(--primary); background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); padding: 1px 6px; border-radius: 4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--on-surface) }
.more { color: var(--on-surface-variant); padding-left: 6px }
/* earnings dates: dashed outline in the tertiary colour, so they never pass for real Google events */
.chip.earn { display: flex; align-items: center; gap: 3px; background: transparent; border: 1px dashed var(--tertiary); color: var(--tertiary); padding: 0 5px; font-weight: 500 } .chip.earn .ms { font-size: 13px }
/* dividends: the same dashed style in the primary colour */
.chip.divc { display: flex; align-items: center; gap: 3px; background: transparent; border: 1px dashed var(--primary); color: var(--primary); padding: 0 5px; font-weight: 500 } .chip.divc .ms { font-size: 13px }
.div-ev .ev-ic { flex: none; width: 10px; font-size: 16px; color: var(--primary); display: grid; place-items: center }
.div-ev .time { width: 72px } .div-ev .ev-title { display: flex; flex-direction: column; line-height: 1.3 } .div-ev .ev-title small { font-weight: 400; font-size: 12px }
.earn-ev .ev-ic { flex: none; width: 10px; font-size: 16px; color: var(--tertiary); display: grid; place-items: center } .earn-ev .time { width: 72px } .earn-ev .ev-title { display: flex; flex-direction: column; line-height: 1.3 } .earn-ev .ev-title small { font-weight: 400; font-size: 12px }
/* M3 filter chip (header toggle) */
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; margin-right: 4px; border: 1px solid var(--outline); border-radius: 8px; background: transparent; color: var(--on-surface-variant); font: inherit; font-weight: 500; cursor: pointer }
.filter-chip .ms { font-size: 18px } .filter-chip.on { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent }

.day { padding: 16px 8px 8px }
.day h2 { padding: 0 16px 8px }
.day p { padding: 6px 16px }
.row { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 6px 16px; border-radius: 24px }
a.row:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent) }
.row .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--primary) }
.row .time { flex: none; color: var(--on-surface-variant); font-size: 12px }
/* an event row: the link to Google Calendar plus, for calendars you can edit, a delete button shown on hover (always on touch screens) */
.ev { display: flex; align-items: center; border-radius: 24px } .ev:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent) }
.ev .row { flex: 1; min-width: 0 } .ev a.row:hover { background: none } .ev-title { min-width: 0; overflow: hidden; text-overflow: ellipsis }
.ev .del { flex: none; margin-right: 4px; opacity: 0; transition: opacity .15s } .ev .del + .del { margin-left: -4px } .ev:hover .del, .ev .del:focus-visible { opacity: 1 }
@media (hover: none) { .ev .del { opacity: 1 } }
#event-note { margin: 4px 0 0 } #delete-error { color: var(--error) } #delete-text { margin-top: 8px }

/* narrow screens: grid on top, chips become a dot under the day number */
@media (max-width: 900px) {
  .cal { grid-template-columns: 1fr }
  .cell { min-height: 56px; padding: 2px }
  .chip, .more { display: none }
  .cell .n { position: relative }
  .cell.has .n::after { content: ""; position: absolute; bottom: -1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--primary) }
  .cell.today.has .n::after { background: var(--on-primary) }
}
