/* Calendar Notification Setup (Story 2327).
   The web twin of the desktop's Calendar Notification Setup form: the same
   CalendarNotification rows, phone-first.

   Pinned chrome -- .cn-list is the ONLY scroller, so the icon band, the black
   header, and the filter row never scroll off. Shell height is 100dvh (with a
   100vh fallback first) because on a phone 100vh is the URL-bar-expanded
   height and a 100vh shell scrolls the toolbar away. */

body { background: #F2F2F4; margin: 0; }

.cn-shell {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden;
}

#lwIconBand, .ct-header, .cn-filters, .cn-status { flex: 0 0 auto; }
.cn-list { flex: 1; overflow: auto; padding: 10px 12px 24px; }

/* ---- header (shared .ct-header convention) ---- */
.ct-header {
    background: #3C3C3C; color: #fff;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
}
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.ct-header button {
    background: transparent; color: #fff;
    border: 1px solid #6A6A6A; border-radius: 3px;
    padding: 5px 12px; cursor: pointer; font: inherit;
}
.ct-header button:hover { background: #5A5A5A; }

/* ---- filter row ---- */
.cn-filters {
    background: #fff; border-bottom: 1px solid #DDDDE0;
    padding: 10px 12px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.cn-filters label { font-size: 11pt; color: #333; }
.cn-filters select {
    flex: 1 1 160px; min-width: 140px;
    padding: 8px 10px; font: inherit;
    border: 1px solid #C4C4CC; border-radius: 6px; background: #fff;
}
.cn-toggle {
    padding: 8px 14px; font: inherit; cursor: pointer;
    background: #F0F0F2; color: #555;
    border: 1px solid #D0D0D4; border-radius: 6px;
}
.cn-toggle.on { background: #3C3C3C; color: #fff; border-color: #3C3C3C; }

/* ---- list ---- */
.cn-card {
    background: #fff; border: 1px solid #DDDDE0; border-radius: 8px;
    padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.cn-card:hover { border-color: #9BB8DC; }
.cn-card-title { font-size: 12pt; font-weight: 600; color: #1A1A1A; }
.cn-card-line  { font-size: 10pt; color: #666; margin-top: 3px; }
.cn-badges { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.cn-badge {
    font-size: 9pt; padding: 2px 8px; border-radius: 10px;
    background: #EEF2F8; color: #33507A; border: 1px solid #D6E0EE;
}
.cn-badge.muted { background: #F2F2F2; color: #777; border-color: #E2E2E2; }
.cn-empty { color: #777; font-style: italic; padding: 24px 4px; }

/* ---- status ---- */
.cn-status {
    background: #F0F0F2; border-top: 1px solid #E6E6E8;
    padding: 5px 14px; font-size: 10pt; color: #666;
}

/* ---- edit sheet ---- */
/* Story 5744: the notification editor is a centered modal, not a sheet pinned to the bottom. */
.cn-backdrop {
    position: fixed; inset: 0; z-index: 700;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box;
}
.cn-sheet {
    background: #fff; border-radius: 12px;
    width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto;
    padding: 18px 18px 20px; box-sizing: border-box;
    box-shadow: 0 10px 34px rgba(0,0,0,0.3);
}
.cn-sheet h2 { margin: 0 0 14px; font-size: 13pt; color: #222; }
.cn-field { margin-bottom: 12px; }
.cn-field label {
    display: block; font-size: 10pt; font-weight: 600; color: #555;
    margin-bottom: 4px;
}
.cn-field input[type=text],
.cn-field input[type=date],
.cn-field input[type=number],
.cn-field textarea,
.cn-field select {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px; font: inherit;
    border: 1px solid #C4C4CC; border-radius: 6px; background: #FBFBFD;
}
.cn-field textarea { min-height: 70px; resize: vertical; }
.cn-two { display: flex; gap: 10px; }
.cn-two > * { flex: 1; }

.cn-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cn-mode {
    padding: 9px 12px; font-size: 10pt; cursor: pointer;
    background: #F0F0F2; color: #555;
    border: 1px solid #D0D0D4; border-radius: 6px;
}
.cn-mode.on { background: #0A66C2; color: #fff; border-color: #0A66C2; }

.cn-error {
    background: #FDECEC; border: 1px solid #F3C2C2; color: #9B2A2A;
    border-radius: 6px; padding: 9px 12px; margin-bottom: 12px; font-size: 10pt;
}

.cn-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    border-top: 1px solid #E6E6E8; padding-top: 14px; margin-top: 6px;
}
.cn-actions button {
    flex: 1 1 90px; padding: 11px 12px; border-radius: 6px; cursor: pointer;
    font: 600 11pt "Segoe UI", system-ui, sans-serif;
    border: 1px solid #C9C9CC; background: #F5F5F7; color: #333;
}
.cn-actions button.primary { background: #3C3C3C; color: #fff; border-color: #3C3C3C; }
.cn-actions button.danger  { background: #fff; color: #9B2A2A; border-color: #E2B6B6; }

/* Story 3483: while a save or delete is in flight the sheet buttons go dead
   and visibly grey, so a slow connection cannot collect a second tap and
   write a second notification. */
.cn-actions button:disabled,
.cn-actions button:disabled.primary,
.cn-actions button:disabled.danger {
    cursor: default;
    opacity: 0.55;
    background: #EDEDF0;
    color: #8A8A8A;
    border-color: #D8D8DE;
}

/* Story 5628: health appointments, read live from the health records */
.cn-health { margin-top: 18px; }
.cn-health-title { font-size: 15px; font-weight: 700; color: #134E4A; margin: 0 0 4px; }
.cn-health-sub { font-size: 12px; color: #666; margin-bottom: 8px; }
.cn-health-card { display: block; text-decoration: none; color: inherit; border-left: 4px solid #0D9488; }

/* ---- Story 5744: the alarm on Google Calendar ---- */
.cn-seg { display: inline-flex; gap: 0; }
.cn-seg .cn-toggle { border-radius: 0; }
.cn-seg .cn-toggle:first-child { border-radius: 4px 0 0 4px; }
.cn-seg .cn-toggle:last-child  { border-radius: 0 4px 4px 0; margin-left: -1px; }
.cn-alarm { background: #FFF6F4; border: 1px solid #F2C9C0; border-radius: 6px; padding: 10px; }
.cn-alarm-google { display: flex; align-items: flex-end; }
.cn-alarm-google .cn-toggle { width: 100%; }
#btnGoogle.on { background: #C0392B; border-color: #C0392B; color: #fff; }
.cn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cn-chip { border: 1px solid #C9C9CC; background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 10.5pt; cursor: pointer; }
.cn-chip.on { background: #C0392B; border-color: #C0392B; color: #fff; }
.cn-hint { font-size: 10pt; color: #666; margin-top: 6px; }
.cn-badge.google { background: #FDECEA; color: #A93226; border-color: #F2C9C0; }

/* ---- Story 5757: folds, Fold All and the roll-up (shared with Calendar Subscriptions) ---- */
.cn-rollrow { flex: 0 0 auto; background: #fff; border-bottom: 1px solid #EEEEF0; padding: 2px 12px; }
.cn-rollbar {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: none; border: 0; padding: 6px 0; cursor: pointer;
    font: inherit; font-size: 10.5pt; color: #444; text-align: left;
}
.cn-rollbar .ef-caret { width: 12px; color: #64748B; font-size: 11px; }
.cn-rollbar:hover .ef-caret { color: #0A66C2; }
.cn-shell.ef-tools-collapsed .cn-filters { display: none; }
.cn-foldall[hidden] { display: none; }

/* The scroll area holds the bands; the list inside it no longer scrolls on its own. */
.cn-scroll { flex: 1; overflow: auto; padding: 10px 12px 24px; }
.cn-scroll .cn-list { overflow: visible; padding: 0; }
.cn-scroll .cn-health { margin-top: 0; }
.cn-band { margin-bottom: 12px; }
.cn-band[hidden] { display: none; }
.cn-band-head {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 2px; cursor: pointer; user-select: none;
    font-size: 12pt; font-weight: 700; color: #333;
}
.cn-band-title { flex: 0 1 auto; }
.cn-band-n { font-size: 10pt; font-weight: 600; color: #777; }
.cn-band.collapsed .cn-band-body { display: none; }
.cn-chev, .cn-cchev { display: inline-block; width: 14px; color: #64748B; font-size: 11px; text-align: center; flex: 0 0 auto; }
.cn-chev::before, .cn-cchev::before { content: "\25BE"; }
.cn-band.collapsed .cn-chev::before, .cn-card.collapsed .cn-cchev::before { content: "\25B8"; }
.cn-card-head { display: flex; align-items: center; gap: 6px; }
.cn-card-head .cn-card-title, .cn-card-head .cs-card-title { flex: 1; min-width: 0; }
.cn-cchev { cursor: pointer; padding: 4px 2px; margin: -4px 0; }
.cn-cchev:hover { color: #0A66C2; }
.cn-card.collapsed .cn-card-body { display: none; }

/* ---- Story 6864: where each notification stands (resolved or not) ---- */
.cn-pill { flex: none; font-size: 9pt; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.cn-pill.open { background: #FFF4DC; color: #8A5A00; border: 1px solid #F0D58E; }
.cn-pill.done { background: #E6F5EA; color: #1E7A3A; border: 1px solid #BFE3C9; }
.cn-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
             margin: 8px 0 4px; padding: 8px 10px; border-radius: 6px; background: #FAFAF7; border: 1px solid #ECEBE4;
             font-size: 10pt; color: #555; }
.cn-status b { color: #8A5A00; }
.cn-done { color: #1E7A3A; font-weight: 600; }
.cn-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.cn-act { font-size: 10pt; padding: 5px 12px; border-radius: 6px; border: 1px solid #C9CED8; background: #fff; color: #33507A; cursor: pointer; }
.cn-act.primary { background: #2E6DB4; border-color: #2E6DB4; color: #fff; }
.cn-act:disabled { opacity: 0.5; cursor: default; }
