/* 1code Calendar. The chrome is ink and paper (the studio palette); red only for danger. Event and calendar
   colours are the person's own and are decided in one place (paint() in js/store.js). Night by default. */
:root {
  --page: #0a0a0a;
  --panel: #131313;
  --raised: #1c1c1c;
  --line: #2a2a2a;
  --ink: #fafafa;
  --faint: #8f8f8f;
  --danger: #e5484d;
  --hover: rgba(255, 255, 255, 0.06);
  --sel: rgba(255, 255, 255, 0.1);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line);
  --gutter: 56px;
  --radius: 12px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --page: #f6f6f6;
  --panel: #ffffff;
  --raised: #f2f2f2;
  --line: #e3e3e3;
  --ink: #0a0a0a;
  --faint: #6b6b6b;
  --hover: rgba(0, 0, 0, 0.04);
  --sel: rgba(0, 0, 0, 0.07);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.14), 0 0 0 1px var(--line);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.45 InterVariable, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#app { height: 100%; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.block { display: block; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.gap, .stack.gap { gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { margin: auto; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- controls ---------- */
.tool { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--faint); flex: none; text-decoration: none; }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool.sm { width: 26px; height: 26px; }
.tool.sm svg.i { width: 15px; height: 15px; }
.tool.danger-hover:hover { color: var(--danger); }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.pill:hover { background: var(--hover); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; text-decoration: none; background: var(--panel); white-space: nowrap; }
.btn:hover { background: var(--raised); }
.btn.primary { background: var(--ink); color: var(--page); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { opacity: 0.88; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn.danger-outline { color: var(--danger); }
.btn.wide { width: 100%; padding: 10px; }
.btn svg.i { width: 15px; height: 15px; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--faint); }
textarea { resize: vertical; width: 100%; }
input.num { width: 70px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; }
.pill.faint { color: var(--faint); }

/* ---------- top bar ---------- */
.bar { height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--page); flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 15px/1 InterVariable, Inter, system-ui, sans-serif; color: var(--ink); text-decoration: none; margin-right: 4px; }
.brand img { width: 24px; height: 24px; filter: invert(1); }
html[data-theme="light"] .brand img, html[data-theme="light"] .signin-mark { filter: none; }
.divider { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.range { font-size: 16px; font-weight: 600; margin: 0 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
.searchbox { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; height: 32px; color: var(--faint); }
.searchbox input.search { background: none; border: 0; padding: 0; width: 140px; color: var(--ink); border-radius: 0; }
.searchbox input.search:focus { width: 200px; }
.searchbox input.search::-webkit-search-cancel-button { display: none; }
.views { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg { padding: 4px 11px; border-radius: 999px; font-size: 13px; color: var(--faint); }
.seg.on { background: var(--ink); color: var(--page); }
.seg:not(.on):hover { color: var(--ink); }
.theme { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); flex: none; margin-left: 2px; }
.theme:hover { background: var(--hover); }
.theme svg.i { width: 16px; height: 16px; }
.only-phone { display: none !important; }
@media (max-width: 1080px) {
  .searchbox { padding: 0 7px; cursor: text; }
  .searchbox input.search { width: 0; }
  .searchbox:focus-within input.search { width: 150px; }
  .range { font-size: 15px; }
}

/* ---------- body and side bar ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.side { width: 248px; flex: none; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; border-right: 1px solid var(--line); }
.create { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 10px 18px 10px 14px; border-radius: 999px; background: var(--ink); color: var(--page); font-weight: 600; }
.create:hover { opacity: 0.9; }
.mini-head { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; }
.mini-title { flex: 1; font-weight: 600; font-size: 13px; padding-left: 4px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; gap: 1px; }
.mini-grid span { padding: 4px 0; }
.mini-grid button { height: 28px; border-radius: 999px; font-size: 12px; }
.mini-grid button:hover { background: var(--hover); }
.mini-grid button.other { color: var(--faint); }
.mini-grid button.sel { background: var(--sel); }
.mini-grid button.today { background: var(--ink); color: var(--page); font-weight: 700; }
.cals-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; padding: 0 4px; margin-bottom: 2px; }
.cal { display: flex; align-items: center; border-radius: 8px; }
.cal:hover { background: var(--hover); }
.cal .ghost { opacity: 0; }
.cal:hover .ghost, .cal .ghost:focus-visible { opacity: 1; }
.cal-check { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; min-width: 0; }
.cal-check .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-check input { appearance: none; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--c); margin: 0; flex: none; display: grid; place-items: center; }
.cal-check input:checked { background: var(--c); }
.cal-check input:checked::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.keys-link { margin-top: auto; text-align: left; padding: 4px; }
.feedback-side { align-self: flex-start; margin-top: auto; }
@media (max-width: 720px) { .feedback-side + .keys-link { margin-top: 0; } }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
.scrim-side { display: none; }

/* ---------- events ---------- */
.ev { border-radius: 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.ev .t { font-weight: 600; }
.ev.past { opacity: 0.55; }
.ev.tentative { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 8px) !important; }
.ev.lifted { opacity: 0.35; }
.ev.ghost { opacity: 0.92; box-shadow: var(--shadow); pointer-events: none; }
/* Ink only: four fills told apart without colour. */
.ev.ink { color: var(--ink); border: 1px solid var(--ink); }
.ev.ink0 { background: var(--ink); color: var(--page); }
.ev.ink1 { background: var(--raised); }
.ev.ink2 { background: var(--panel); }
.ev.ink3 { background: repeating-linear-gradient(135deg, var(--sel) 0 3px, var(--panel) 3px 7px); }

/* ---------- day and week ---------- */
.grid { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.grid-head { display: grid; border-bottom: 1px solid var(--line); flex: none; }
.zone { align-self: end; padding: 0 4px 6px; text-align: right; overflow: hidden; white-space: nowrap; }
.dayhead { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; gap: 2px; border-radius: 10px; }
.dayhead:hover { background: var(--hover); }
.dayhead .dow { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.dayhead .num { font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; }
.dayhead.today .num { background: var(--ink); color: var(--page); font-weight: 700; }
.dayhead.today .dow { color: var(--ink); font-weight: 600; }
.dayhead.pastday .num { color: var(--faint); }
.allday { display: grid; grid-template-columns: var(--gutter) 1fr; border-bottom: 1px solid var(--line); flex: none; }
.allday .gutter { padding: 6px 4px; text-align: right; }
.allday-cells { display: grid; grid-template-rows: repeat(var(--rows, 1), 22px); padding: 2px 0 4px; row-gap: 2px; min-height: 28px; position: relative; }
.allday-cells .cell { grid-row: 1 / -1; border-left: 1px solid var(--line); }
.ev.abar { margin: 0 4px; padding: 3px 8px; white-space: nowrap; text-overflow: ellipsis; position: relative; z-index: 1; }
.more { font-size: 12px; color: var(--faint); text-align: left; padding: 0 8px; position: relative; z-index: 1; }
.more:hover { color: var(--ink); }
.grid-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.grid-body { display: grid; position: relative; }
.hours { position: relative; }
.hour { height: var(--hour); text-align: right; padding-right: 8px; transform: translateY(-8px); font-size: 11px; }
.col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour));
  touch-action: pan-y;
}
.ev.block { position: absolute; padding: 3px 7px; display: flex; flex-direction: column; box-shadow: 0 0 0 1px var(--panel); }
.ev.block .w { opacity: 0.85; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.block.short { flex-direction: row; align-items: baseline; gap: 0; padding-top: 1px; white-space: nowrap; }
.ev.block .t { overflow: hidden; text-overflow: ellipsis; }
.resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--ink); z-index: 40; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 999px; background: var(--ink); }
.selection { position: absolute; left: 1px; right: 3px; background: var(--ink); color: var(--page); border-radius: 6px; font-size: 12px; padding: 3px 7px; z-index: 30; pointer-events: none; opacity: 0.9; }

/* ---------- month ---------- */
.month { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.mheads { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.mhead { padding: 6px 8px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); min-height: 0; }
.mcell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 4px 2px; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.other { background: var(--page); }
.mcell.other .mnum { color: var(--faint); }
.mcell.drop { background: var(--sel); }
.mnum { align-self: center; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.mnum:hover { background: var(--hover); }
.mcell.today .mnum { background: var(--ink); color: var(--page); font-weight: 700; }
.ev.mbar { padding: 2px 6px; white-space: nowrap; text-overflow: ellipsis; flex: none; }
.ev.mbar.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ev.mchip { display: flex; align-items: center; gap: 5px; padding: 1px 4px; background: none !important; color: var(--ink) !important; white-space: nowrap; flex: none; border: 0; }
.ev.mchip:hover { background: var(--hover) !important; }
.ev.mchip .w { color: var(--faint); font-size: 11px; }
.ev.mchip .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--ink); }
.dot.ink1, .dot.ink2, .dot.ink3 { background: transparent; border: 2px solid var(--ink); }

/* ---------- holidays, second zone, year ---------- */
.ev.holiday { background: transparent; color: var(--ink); border: 1px dashed var(--faint); }
.swatch.holiday { background: transparent; border: 1px dashed var(--faint); }
.zone.two { display: flex; justify-content: space-between; gap: 2px; padding-left: 2px; }
.grid.second-zone { --gutter: 96px; }
.hours.two .hour { display: flex; justify-content: space-between; padding-left: 4px; }
.hours.two .second { opacity: 0.7; }
.year { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 28px; padding: 16px 20px 28px; align-content: start; }
.ytitle { font-weight: 600; padding: 2px 4px; margin-bottom: 4px; border-radius: 6px; }
.ytitle:hover { background: var(--hover); }
.year .mini-grid button { position: relative; }
.year .mini-grid button.busy::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 999px; background: var(--ink); }
.year .mini-grid button.hol { text-decoration: underline dashed; text-underline-offset: 3px; }
.year .mini-grid button.today.busy::after { background: var(--page); }
.danger-text { color: var(--danger); }
.pill .x { margin-left: 6px; color: var(--faint); }
.trash-row { border-bottom: 1px solid var(--line); padding: 6px 0; }

/* ---------- agenda and search ---------- */
.agenda { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }
.agenda.empty { display: grid; place-items: center; }
.aday { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.adate { display: flex; align-items: baseline; gap: 6px; align-self: start; padding: 4px 6px; border-radius: 8px; text-align: left; }
.adate .num { font-size: 20px; font-weight: 600; }
.aday.today .adate .num { text-decoration: underline; text-underline-offset: 4px; }
.aitems { display: flex; flex-direction: column; }
.arow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; width: 100%; }
.arow:hover { background: var(--hover); }
.arow.past { opacity: 0.55; }
.arow .when { width: 120px; flex: none; font-size: 13px; }
.arow .t { font-weight: 500; }
.results .arow { border-bottom: 1px solid var(--line); border-radius: 0; }

/* ---------- panels ---------- */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
#layer > * { pointer-events: auto; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); }
.scrim.clear { background: transparent; }
.panel { position: fixed; background: var(--panel); color: var(--ink); border-radius: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow-y: auto; }
.panel.popover { width: 400px; padding: 14px 16px 16px; }
.panel.modal { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); padding: 18px 20px 20px; }
.panel.sheet { left: 0; right: 0; bottom: 0; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); animation: up 0.18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.panel h2 { font-size: 18px; margin: 0; font-weight: 600; }
.panel h3 { font-size: 13px; margin: 12px 0 2px; }
.panel p { margin: 6px 0; }
.choose { display: flex; flex-direction: column; gap: 14px; min-width: 300px; }
.radios { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.card-tools { display: flex; justify-content: flex-end; gap: 2px; margin: -6px -8px 4px 0; }
.card-title { display: flex; align-items: flex-start; gap: 12px; }
.card-title h2 { font-size: 20px; overflow-wrap: anywhere; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 5px; background: var(--ink); }
.swatch.ink { border: 2px solid var(--ink); }
.card .card-when { margin-left: 26px; }
.row-i { display: flex; gap: 12px; align-items: flex-start; }
.row-i svg.i { margin-top: 1px; color: var(--faint); }
.notes span { white-space: pre-wrap; overflow-wrap: anywhere; }
.quick { display: flex; flex-direction: column; gap: 10px; }
.title-input { background: none !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; font-size: 18px; padding: 6px 2px !important; width: 100%; }
.title-input:focus { border-bottom-color: var(--ink) !important; }
.title-input.big { font-size: 22px; }
.field { display: flex; align-items: center; gap: 12px; }
.field.top { align-items: flex-start; }
.field.top > svg.i { margin-top: 8px; }
.field > svg.i { color: var(--faint); }
.field > input, .field > select, .field > textarea { flex: 1; }
.field { flex-wrap: wrap; }
.field > select { min-width: 150px; }
.field > .swatches { flex: 1 1 260px; }
.field.inline { gap: 8px; }
.field.col { flex-direction: column; align-items: stretch; gap: 4px; }
.editor, .settings, .feed { display: flex; flex-direction: column; gap: 14px; }
.editor-head { display: flex; align-items: center; gap: 8px; }
.editor-head > :first-child { flex: 1; }
.when-rows { display: flex; flex-direction: column; gap: 8px; }
.when-rows select.zone { max-width: 230px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.custom { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.days { gap: 6px; }
.day { width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.day.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 20px; height: 20px; border-radius: 999px; }
.sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.editor-actions { padding-top: 6px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; margin: 0; transition: background 0.15s; }
.switch-row input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--faint); transition: transform 0.15s; }
.switch-row input:checked { background: var(--ink); }
.switch-row input:checked::after { transform: translateX(16px); background: var(--page); }
.signed { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.cal-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.steps { border-top: 1px solid var(--line); padding-top: 4px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.keys dt { text-align: right; }
.keys dd { margin: 0; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font: 12px ui-monospace, Menlo, monospace; }

.first-hint { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow); white-space: nowrap; z-index: 20; font-size: 13px; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.main { position: relative; }
.fab { position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 999px; background: var(--ink); color: var(--page); box-shadow: var(--shadow); place-items: center; z-index: 90; }
.fab svg.i { width: 24px; height: 24px; stroke-width: 2.2; }
@media (max-width: 720px) { .first-hint { white-space: normal; text-align: center; border-radius: 14px; width: calc(100% - 48px); } }

/* ---------- messages ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--page); border-radius: 12px; padding: 10px 16px; display: flex; gap: 16px; align-items: center; z-index: 200; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
#toast .link { color: var(--page); font-weight: 600; }
#reminders { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 150; }
.reminder { display: flex; align-items: flex-start; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); max-width: 380px; }
.reminder-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reminder-text { text-align: left; font-weight: 500; color: var(--ink); }
.reminder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reminder-actions .pill { background: none; cursor: pointer; padding: 3px 10px; }
.reminder.ring { animation: ring 0.5s ease-in-out 2; }
@keyframes ring { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .reminder.ring { animation: none; outline: 2px solid var(--ink); } }
@media (max-width: 720px) { #reminders { left: 16px; } .reminder { max-width: none; } }
.custom-reminder .num { width: 72px; }

/* ---------- sign in ---------- */
.signin { flex: 1; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.signin-mark { width: 56px; height: 56px; filter: invert(1); }
.signin-card h1 { margin: 0; font-size: 28px; }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  :root { --gutter: 44px; }
  .not-phone { display: none !important; }
  .only-phone { display: inline-grid !important; }
  .view-select { display: inline-block !important; padding: 5px 6px; width: auto; }
  .bar .pill { padding: 5px 10px; }
  .bar { gap: 2px; padding: 0 6px; }
  .brand span { display: none; }
  .range { font-size: 15px; }
  .side { position: fixed; top: 48px; bottom: 0; left: 0; z-index: 60; background: var(--panel); transform: translateX(-100%); transition: transform 0.18s; width: 280px; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .side.open + .scrim-side { display: block; position: fixed; inset: 48px 0 0 0; background: rgba(0, 0, 0, 0.45); z-index: 59; }
  .dayhead .num { font-size: 16px; width: 30px; height: 30px; }
  .ev.block { padding: 2px 4px; }
  .mcell { padding: 2px 1px; }
  .ev.mchip .w { display: none; }
  .ev.mbar, .ev.mchip { font-size: 10px; }
  .aday { grid-template-columns: 56px 1fr; }
  .arow .when { width: 92px; font-size: 12px; }
  .panel.popover, .panel.modal { width: auto; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------- print: the current view, on paper, without the app around it ---------- */
@media print {
  :root, html[data-theme="light"], html[data-theme="dark"] { --page: #fff; --panel: #fff; --raised: #f2f2f2; --line: #d0d0d0; --ink: #000; --faint: #555; color-scheme: light; }
  @page { size: landscape; margin: 10mm; }
  body { overflow: visible; background: #fff; }
  #app { height: auto; display: block; }
  .bar .tool, .bar .pill, .bar .theme, .bar .views, .bar .searchbox, .bar .view-select, .bar .divider, .side, .scrim-side, .fab, #toast, #reminders, #layer, .first-hint, .resize, .now { display: none !important; }
  .bar { border: 0; height: auto; padding: 0 0 8px; }
  .body, .main { display: block; overflow: visible; }
  .grid-scroll, .agenda, .year { overflow: visible; height: auto; }
  .grid { zoom: 0.6; }
  .month { height: 180mm; }
  .ev { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.connect-cal { align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.connect-cal .swatch { margin-top: 0; }
