/*
 * Screen styles for the app shell. Deliberately minimal at M0 -- the real
 * interface arrives at M3, and the print stylesheet (M1) is a separate,
 * exactly-measured thing that must not inherit from this.
 */

:root {
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --rule: #d9d9de;
  --bg: #fbfbfa;
  --accent: #3a4b8f;
  --alert: #8f2f2f;
  --ok: #2f6b3f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* The editor needs the sheet's full 1191px. */
body:has(.editor-canvas) main { max-width: 78rem; }

/*
 * The deck sticks to the top of the window, so anything scrolled to by
 * keyboard has to clear it -- WCAG 2.2 SC 2.4.11 asks that a focused
 * component not be entirely hidden by author content, and names sticky
 * headers as the way to fail it.
 */
html { scroll-padding-top: 5rem; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; letter-spacing: -0.01em; }

a { color: var(--accent); }

.hint { color: var(--muted); font-size: 0.875rem; }

code {
  background: #efefed;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.875em;
}

.flash {
  padding: 0.6rem 0.85rem;
  border-radius: 5px;
  border: 1px solid;
  font-size: 0.9rem;
}
.flash.alert  { color: var(--alert); border-color: #e3bdbd; background: #fdf3f3; }
.flash.notice { color: var(--ok);    border-color: #bddcc4; background: #f3faf5; }

.auth { max-width: 20rem; margin: 12vh auto 0; }

.stack { display: flex; flex-direction: column; gap: 0.6rem; }

input[type="email"],
input[type="password"] {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font: inherit;
  background: #fff;
}

input[type="submit"] {
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

ul { padding-left: 1.1rem; }
li { margin: 0.35rem 0; }

.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- sidebar --------------------------------------------------------- */

/*
 * The app's navigation, down the left of every signed-in page. Sticky to
 * the window rather than fixed, so it takes its own column and nothing has
 * to be padded out of its way.
 */
body:has(> .sidebar) {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  min-height: 100vh;
}
/* Its own column now, so the page centres in what is left. */
body:has(> .sidebar) main { width: 100%; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 0.6rem;
  border-right: 1px solid var(--rule);
  background: #f4f4f2;
  font-size: 0.9rem;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.5rem;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.sidebar__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
}

.sidebar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.sidebar__list li { margin: 0; }
.sidebar__list--account { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.sidebar__form { margin: 0; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.sidebar__link:hover { background: #e9e9e6; }
.sidebar__link[aria-current="page"] { background: #e3e6f2; color: var(--accent); font-weight: 600; }
.sidebar__link:focus-visible, .sidebar__brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.sidebar__icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/*
 * The grid pages, in a window too narrow for the sheet's 1191px and a
 * labelled sidebar both. The grid is the printed page and cannot give up a
 * pixel (docs/UI_OPTIONS.md §0), so the sidebar does: it becomes a rail of
 * icons, the names kept for screen readers and as tooltips.
 *
 * 89.5rem is the widest window that needs it: 11.5rem of sidebar, 1191px of
 * sheet, 2.5rem of padding and a scroll bar. The rail is 3rem and the page
 * padding tightens to 0.75rem, which fits the sheet beside it from a
 * 1280px window up.
 */
@media screen and (min-width: 60.01rem) and (max-width: 89.5rem) {
  body:has(> .sidebar):has(.editor-canvas) { grid-template-columns: 3rem minmax(0, 1fr); }
  body:has(> .sidebar):has(.editor-canvas) main { padding-left: 0.75rem; padding-right: 0.75rem; }
  body:has(.editor-canvas) .sidebar { padding: 1.25rem 0.35rem; align-items: center; }
  body:has(.editor-canvas) .sidebar__brand,
  body:has(.editor-canvas) .sidebar__link { justify-content: center; padding: 0.3rem; }
  body:has(.editor-canvas) .sidebar__link { width: 2.2rem; min-height: 2.2rem; }
  body:has(.editor-canvas) .sidebar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/*
 * A small window or a phone: the sidebar would cost a third of the screen,
 * so it lies across the top of the page instead, still on every page.
 * Not sticky here -- the deck already is.
 */
@media screen and (max-width: 60rem) {
  body:has(> .sidebar) { display: block; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar__brand { padding: 0; }
  .sidebar__list, .sidebar__list--account {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.25rem;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar__link { width: auto; min-height: 1.75rem; gap: 0.35rem; padding: 0.2rem 0.4rem; }
  .sidebar__icon { width: 0.95rem; height: 0.95rem; }
}

@media print {
  .sidebar { display: none; }
  body:has(> .sidebar) { display: block; }
}

/* ---- home ------------------------------------------------------------ */

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}
.bar h1 { margin: 0; }
/* Wrap between links, never inside one: with enough of them the nav runs
   out of room, and "Change / password" on two lines reads as two links. */
.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: flex-end;
  font-size: 0.875rem;
}
.bar nav > * { white-space: nowrap; }

.jump {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}
.jump input[type="date"] {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font: inherit;
  background: #fff;
}
.jump input[type="submit"] { padding: 0.4rem 0.8rem; }

.empty { color: var(--muted); }

.days { list-style: none; padding: 0; margin: 0; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; }
.days li { margin: 0; border-top: 1px solid var(--rule); }
.days li:first-child { border-top: 0; }
.days li.today { background: #fdfbef; }

.days a {
  display: grid;
  grid-template-columns: 7rem 5rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.days li.today a { background: transparent; }
.days a:hover { background: #f4f5fa; }

.days .day { font-weight: 600; }
.days__today {
  justify-self: end; padding: 0 0.45rem; border-radius: 999px;
  background: #f3e7a8; color: #6b5a10; font-size: 0.75rem; font-weight: 600;
}

/* The Sheets page: a year in months, each month in its weeks. */
.month { margin-bottom: 2rem; }
.month h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.month__week { margin: 0 0 0.9rem; }
.month__week-link {
  display: inline-block; margin: 0 0 0.3rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); text-decoration: none;
}
.month__week-link:hover { color: var(--accent); text-decoration: underline; }
.days .date, .days .counts { color: var(--muted); font-size: 0.875rem; }

.jump__hint { color: var(--muted); font-size: 0.8rem; }
.jump__hint kbd {
  font: inherit;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3rem;
  background: #fff;
}
/* The hint is for someone with a keyboard in front of them. */
@media (pointer: coarse) { .jump__hint { display: none; } }

.count { color: var(--muted); font-size: 0.875rem; margin: 0 0 1.5rem; }

/* The keyboard cursor over a checklist cell (decision 27). Outlined rather
   than filled: the cell already carries a tick box, a label and two buttons,
   and a background would fight all of them. */
.item--cursor {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-radius: 3px;
}

/* ---- "this day does not take calendar items" ------------------------- */

.calendars-switch {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}
.calendars-switch:hover { background: #f4f5fa; }
/* Off is the state worth noticing: it means the page is not showing you
   something it holds. */
.calendars-switch--off {
  border-color: var(--alert);
  color: var(--alert);
  background: #fdf5f5;
}
.calendars-switch--off:hover { background: #fbeded; }
.calendars-switch form { margin: 0; display: inline; }

/* ---- the Sheets page's year switcher -------------------------------- */

.years {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.years__current { font-weight: 600; }

/* ---- no sheet for that date ------------------------------------------ */

.missing h2 { margin: 0 0 0.5rem; }
.missing__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1.25rem 0;
}
.missing__note { color: var(--muted); font-size: 0.875rem; }
/* `button_to` renders a <button>, which the input[type="submit"] rule above
   does not reach. */
.missing__actions .primary {
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.missing__actions form { margin: 0; }

/* ---- what happened that day ------------------------------------------ */

.history__day { font-size: 1rem; margin: 0 0 1rem; }

.history { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.history__entry {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
}
.history__entry:first-child { border-top: 0; }
.history__entry time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}
/* The detail sits under the line it belongs to, not in the time column. */
.history__detail {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.8rem;
}
.history__hand {
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: help;
}
.history__entry--deleted .history__what { color: var(--alert); }
.history__entry--generated .history__what { color: var(--muted); }
.history__note { color: var(--muted); font-size: 0.875rem; }

/* ---- editor ---------------------------------------------------------- */

.editor-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}
.editor-bar h1 { display: inline; font-size: 1.2rem; margin: 0 0.5rem 0 0; }
.editor-bar .back { display: block; font-size: 0.8rem; margin-bottom: 0.3rem; }
.editor-bar .when { color: var(--muted); font-size: 0.875rem; }
.editor-bar__right { display: flex; align-items: center; gap: 1rem; }
.editor-bar .progress { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.button {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #fff;
  text-decoration: none;
  font-size: 0.875rem;
}
.button:hover { background: #f4f5fa; }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: #2f3e78; }

.undo { display: inline-flex; gap: 0.25rem; }
.undo form { display: inline; }
.button--icon { padding: 0.35rem 0.6rem; font-size: 1rem; line-height: 1; cursor: pointer; }

/*
 * The sheet is a fixed 1191px wide and narrow windows scroll it sideways --
 * at the page level, not in a box of its own. An `overflow` here would make
 * this element a scroll container in *both* axes, and anything sticky inside
 * it would then stick to this box rather than to the window.
 */
/*
 * The sheet is the printed page and has a fixed width in sheet pixels. The
 * canvas it sits in scrolls rather than stretching: a window narrower than
 * the sheet used to widen the whole document to 1211px, which on a phone is
 * a zoomed-out desktop page with nothing readable on it (round-two finding
 * 21).
 *
 * Not inside a media query, because that is the trap this was in. Content
 * wider than the viewport makes the browser widen the *layout* viewport to
 * fit it, so `max-width: 60rem` never matched on the page that needed it:
 * the viewport reported 1203px. A scroll box at every width has no such
 * circularity, and on a desktop window wide enough for the sheet it shows
 * no scrollbar at all.
 *
 * Screen only. Clipping the sheet in print would cut the page in half.
 */
@media screen {
  .editor-canvas { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }

  /*
   * The sheet's top padding is the printed page's top margin, measured off
   * the originals (sheet.css, --top). In the print view it belongs; on a
   * page of the app it was 125px of nothing between the controls and the
   * sheet. The week grid already keeps its own for paper alone.
   *
   * The template thumbnails too, where it was worse: --top is a length, not
   * a multiple of --u, so shrinking a sheet to a thumbnail kept the whole
   * 125px and pushed the cards to the bottom of the box.
   *
   * Here rather than in sheet.css because this file is never loaded by the
   * print view or the PDF, so paper cannot be moved by it.
   */
  .editor-canvas .sheet { padding-top: 0; }
}

@media print {
  .editor-canvas { min-width: min-content; }
}

/* ---- timeline status ------------------------------------------------- */

.status { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.status__quiet { color: var(--muted); }
.status__clash { color: var(--alert); }
.status__alert { color: var(--alert); font-weight: 600; }

/* ---- the deck -------------------------------------------------------- */

/*
 * One row that holds the status line, and the block editor in its place when
 * a block is selected.
 *
 * In the flow rather than floating: the editor used to be laid out above the
 * grid, so opening it pushed the whole calendar down and closing it let the
 * calendar snap back -- the block you were aiming at moved while you were
 * aiming at it. Docking it to the window fixed the shift but put a bar over
 * the bottom of the grid.
 *
 * Keeping it in the flow at a *fixed height* fixes both: the row is always
 * there, so nothing ever moves, and swapping its contents cannot resize it.
 * It costs no extra space because the status line already lived on that row.
 * Sticky, because the grid is about twice the height of the window and an
 * editor anchored to the top of the document is no use in the afternoon.
 */
.deck {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  /*
   * The gap below the bar is padding rather than margin, so the deck's own
   * background covers it. As margin it was transparent, and the grid scrolled
   * up through the gap between the bar and the day names.
   *
   * 5.25rem is 3.5 of content and 1.75 of clearance: enough that "7 days
   * generated" and the editor are not sitting on top of SUNDAY.
   */
  min-height: 5.25rem;
  padding-bottom: 1.75rem;
  background: var(--bg);
}
/* A hairline between the bar and the grid, with a little air on each side. */
.deck::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  height: 1px;
  background: var(--rule);
}
.deck turbo-frame { display: contents; }

/* The editor replaces the status line rather than joining it, so the row
   keeps its height and its contents never fight for width. */
.deck:has(.panel) .status { display: none; }

/* ---- block details panel --------------------------------------------- */

/*
 * Docked to the bottom of the window, not laid out above the grid.
 *
 * In the flow it pushed the whole calendar down as it opened and let it snap
 * back as it closed, so the block you were aiming at moved while you were
 * aiming at it. Fixed, it occupies no layout at all, and being in the same
 * place every time there is nowhere to look for it.
 */
/*
 * Never wraps. A second line would make the deck taller, which is the one
 * thing the deck exists to prevent, so a narrow window scrolls the controls
 * sideways instead.
 */
.panel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  /*
   * Never scrolls. A scrollbar in the deck means controls you cannot see
   * without dragging a bar, which is worse than the layout shift this
   * replaced -- so anything that does not fit is dropped instead, by
   * .panel--pasting below.
   */
  overflow: hidden;
  border: 1px solid #b9c0d8;
  border-left: 4px solid var(--block-color, var(--accent));
  border-radius: 7px;
  background: #fff;
  padding: 0.5rem 0.75rem;
  /* Enough lift to read as a bar over the page rather than part of it, and
     a tint of the selected block's colour down its edge to say what it is
     about. */
  box-shadow: 0 1px 2px rgba(20, 24, 50, 0.1), 0 0 0 3px rgba(58, 75, 143, 0.07);
}
/*
 * The form is display:contents, so its children are the panel's flex items
 * but not its DOM children -- `.panel > *` alone misses them, they shrink,
 * the swatches wrap to a second line and the deck grows by 25px, which is
 * the layout shift all of this exists to avoid.
 */
.panel > *,
.panel__form > * { flex: none; }
.panel .swatches { flex-wrap: nowrap; }
.panel__form { display: contents; }

.panel__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.panel__copy {
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.panel__copy:hover { background: #f4f5fa; }

.panel__close {
  border: 0;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  padding: 0.2rem 0.3rem;
  cursor: pointer;
}
.panel__close:hover { color: var(--ink); }

/* What a grid looks like while there is something on the clipboard. */

.panel__label {
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  min-width: 14rem;
  /*
   * A textarea, for names of more than one line -- but lines only where
   * they were typed. Left to wrap, a long name would grow the field, and
   * the deck must not change height.
   */
  resize: none;
  display: block;
  white-space: pre;
  overflow: hidden;
}
/*
 * Two lines fit the deck only a little smaller and tighter (38px inside the
 * panel's padding), so that is what a name of more than one line gets, and
 * past two it scrolls inside the field.
 */
.panel__label[data-lines="many"] {
  font-size: 0.875rem;
  line-height: 1.15;
  padding-block: 0.1rem;
  max-height: calc(2.3em + 0.2rem + 2px);
  overflow-y: auto;
}

.panel__when { color: var(--muted); font-size: 0.875rem; }
.panel__dim { opacity: 0.7; }

.panel__delete {
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #fff;
  color: var(--alert);
  font: inherit;
  font-size: 0.875rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.panel__delete:hover { background: #fdf3f3; }

.swatches { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #fff;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.swatch--on { border-color: var(--accent); background: #f4f5fa; font-weight: 600; }

/*
 * Only the chosen category is named; the rest are dots with a title. Seven
 * names cost about 400px, which was enough to push Delete off the end of a
 * deck that must not wrap. You can always read what the block is, and the
 * colours are the point of the others.
 */
.panel .swatch__name { display: none; }
.panel .swatch--on .swatch__name { display: inline; }
.swatch:hover { background: #f4f5fa; }

/* ---- the day window -------------------------------------------------- */

.window {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  font-size: 0.8rem;
}
.window input[type="time"] {
  font: inherit;
  padding: 0.2rem 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
}
.window__dash { color: var(--muted); }
.window__set {
  font: inherit;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.window__set:hover { background: #f4f5fa; }
.window__note {
  color: var(--muted);
  border: 1px dashed var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}
.editor-note { margin-top: 1rem; }

/* The week planner's window control carries a scope as well as two times. */
.window__scope {
  font: inherit;
  padding: 0.2rem 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
}
.window__also { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); }

/* Above the grid, not below 1500px of it: how to add a block is the one thing
   you need to be told, so it cannot live where you have to scroll to find it. */
.planner-hints { margin: 0 0 0.75rem; }

/* Pasting: what is on screen is about pasting, and nothing else fits. */
.panel--pasting .swatches,
.panel--pasting .panel__when { display: none; }
.panel--pasting { border-left-color: var(--ok); }

.panel__hint { color: var(--ink); font-size: 0.875rem; }
.panel__hint kbd {
  font: inherit;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3em;
  background: #f7f7f6;
}

.status__jump { color: inherit; }
.status__jump + .status__jump { margin-left: 0.3rem; }

/* ---- the keyboard crib ----------------------------------------------- */

.keys { font-size: 0.875rem; color: var(--muted); margin-top: 0.4rem; }
.keys summary { cursor: pointer; width: max-content; }
.keys dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0.6rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fff;
  max-width: 44rem;
}
.keys dt { font-weight: 600; color: var(--ink); white-space: nowrap; }
.keys dd { margin: 0; }
.keys kbd {
  font: inherit;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3em;
  background: #f7f7f6;
}

/* ---- calendar feeds -------------------------------------------------- */

.feeds { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.feed {
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fff;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
}
.feed--off { opacity: 0.6; }
.feed__form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.feed__name { font: inherit; font-weight: 600; padding: 0.3rem 0.5rem;
              border: 1px solid var(--rule); border-radius: 5px; min-width: 9rem; }
.feed__url { color: var(--muted); font-size: 0.8rem; font-family: ui-monospace, monospace; }
.feed__select { font: inherit; padding: 0.25rem; border: 1px solid var(--rule); border-radius: 5px; }
.feed__check { display: inline-flex; align-items: center; gap: 0.3rem;
               color: var(--muted); font-size: 0.875rem; }
.feed__actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.feed__remove { color: var(--alert); }
.feed__state { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.8rem; }
.feeds__add { font-size: 1rem; margin: 1.5rem 0 0.6rem; }
.feed__new { max-width: 32rem; }
.feed__new input[type="text"] { padding: 0.5rem 0.65rem; border: 1px solid var(--rule);
                                border-radius: 5px; font: inherit; }

/* A block whose calendar has changed its mind since it was imported. */
.panel__upstream {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #7a5a12;
  background: #fdf6e3;
  border: 1px solid #e8d9a8;
  border-radius: 999px;
  padding: 0.15rem 0.3rem 0.15rem 0.6rem;
  white-space: nowrap;
}
.panel__accept {
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid #d8c488;
  border-radius: 999px;
  background: #fff;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
}
.panel__accept:hover { background: #fffdf6; }

/* ---- the calendar how-to --------------------------------------------- */

.howto { margin: 0 0 1.25rem; font-size: 0.9rem; }
.howto summary { cursor: pointer; width: max-content; color: var(--accent); }
.howto > :not(summary) { max-width: 42rem; }
.howto h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
            color: var(--muted); margin: 1.1rem 0 0.4rem; }
.howto ol, .howto ul { margin: 0; padding-left: 1.2rem; }
.howto li { margin: 0.25rem 0; }
.howto .hint { margin: 0.4rem 0 0; }
.howto code { font-size: 0.85em; }

.feed__label { display: block; color: var(--muted); font-size: 0.875rem; }
.feed__note { margin: 0.1rem 0 0; }

/* ---- settings -------------------------------------------------------- */

.settings { max-width: 32rem; }
.settings__row { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 1.1rem; }
.settings__label { font-weight: 600; }
.settings__select, .settings__text { font: inherit; padding: 0.35rem 0.5rem;
                    border: 1px solid var(--rule); border-radius: 5px; background: #fff; }
.settings__text { width: 9rem; min-width: 0; }
.settings .hint { margin: 0.3rem 0 0; }
.settings input[type="submit"] { margin-top: 1.5rem; }

/* ---- templates ------------------------------------------------------- */

/* Two thirds of a sheet pixel, which puts 1191 of them inside the column
   the preview has. Nothing else changes: it is the same layout at a third
   scale, the way print and screen already are. */
.preview { --u: 0.68px; }
.preview .sheet { margin: 0; }

/* ---- editing a template ---------------------------------------------- */

.tform { max-width: 34rem; }
.tform__row { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0; }
.tform__label { font-weight: 600; min-width: 5.5rem; }
.tform input[type="text"], .tform input[type="time"], .tform input[type="date"],
.tform input[type="number"], .tform select {
  font: inherit; padding: 0.3rem 0.45rem; border: 1px solid var(--rule);
  border-radius: 5px; background: #fff;
}
.tform__group { border: 1px solid var(--rule); border-radius: 7px; padding: 0.75rem 0.9rem;
                margin: 1.25rem 0; background: #fff; }
.tform__group legend { font-weight: 600; padding: 0 0.4rem; }
.tform__choice { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
                 margin: 0.4rem 0; }
.tform__number { width: 4rem; }
.tform__dates { min-width: 14rem; }
.tform__days { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tform__days th { text-align: left; font-weight: 600; padding: 0.3rem 0.4rem 0.3rem 0; }
.tform__days thead th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.tform__days td { padding: 0.2rem 0.4rem 0.2rem 0; }
.tform__day { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
              color: var(--muted); margin: 1rem 0 0.3rem; }
.tform__block { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
                margin: 0.3rem 0; }
.tform__inherited { margin: 0.2rem 0; color: var(--muted); font-size: 0.9rem; }
.tform__remove { display: inline-flex; align-items: center; gap: 0.25rem;
                 color: var(--alert); font-size: 0.8rem; }

.tform__grid { border-collapse: collapse; width: 100%; margin-top: 0.5rem; }
.tform__grid td { padding: 0.1rem 0.15rem 0.1rem 0; }
.tform__grid input { width: 100%; font-size: 0.875rem; }
.tform .swatch input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------------------
 * Editing a template.
 *
 * The grid is the editor (docs/TEMPLATE_UI.md); this is only the handful of
 * things that are genuinely not on it, so it is a strip rather than a page.
 * ------------------------------------------------------------------------ */
.settings-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #f7f8fb;
  border: 1px solid #e2e5ee;
  border-radius: 6px;
}
.settings-strip__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.settings-strip__row--full { flex-basis: 100%; }

.field { display: grid; gap: 0.2rem; font-size: 0.8rem; color: #555; }
.field > span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
.field--narrow { max-width: 9rem; }
.field__text, .field__select, .field__number {
  font: inherit; font-size: 0.875rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #c9ccd6; border-radius: 4px; background: #fff;
}
.field__text--wide { min-width: 18rem; }
.field__number { width: 3.5rem; }
.field__legend { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
                 color: #6b7280; align-self: center; }

.applies { align-items: center; gap: 0.5rem 0.9rem; }
.applies .choice { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.875rem; }
.applies__every, .applies__dates { display: inline-flex; align-items: center; gap: 0.4rem;
                                   font-size: 0.875rem; }
.applies__every[hidden], .applies__dates[hidden] { display: none; }

/* The rule, read back as you edit it -- which is the thing that makes
   Google's recurrence dialog checkable rather than a guess. */
.applies__sentence {
  flex: 1 1 14rem;
  font-size: 0.85rem; color: #3a4b8f; font-style: italic;
  padding-left: 0.6rem; border-left: 2px solid #ccd2e8;
}

/* A card template's schedule (day_templates/_card_settings). Each shape's
   fields show only while that shape is chosen -- no script, `:has()` on the
   selected option. */
.card-schedule { flex-direction: column; align-items: stretch; }
.card-schedule .settings-strip__row { align-items: center; gap: 0.5rem 0.9rem; }
.card-schedule .choice { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.875rem; }
.card-schedule__shape { display: none; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.875rem; }
.card-schedule:has(option[value="month_day"]:checked) .card-schedule__shape--month_day,
.card-schedule:has(option[value="month_weekday"]:checked) .card-schedule__shape--month_weekday,
.card-schedule:has(option[value="weeks"]:checked) .card-schedule__shape--weeks,
.card-schedule:has(option[value="year"]:checked) .card-schedule__shape--year,
.card-schedule:has(option[value="dates"]:checked) .card-schedule__shape--dates { display: inline-flex; }
.card-schedule__said { margin: 0; max-width: 60rem; }
.card-schedule input[type="submit"] { align-self: flex-start; }

.settings-strip__more { flex-basis: 100%; font-size: 0.85rem; }
.settings-strip__more summary { cursor: pointer; color: #3a4b8f; }
.settings-strip__days { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0 0.2rem; }
.settings-strip__days .field { max-width: none; }
.settings-strip__days .field__text { width: 7.5rem; }

.legend { padding: 0 0.3rem; border-radius: 2px; font-style: italic; }
.legend--inherited { background: repeating-linear-gradient(135deg, #eceef5 0 4px, #f7f8fb 4px 8px);
                     border: 1px solid #dfe3ee; }

/* What a layer has taken away. Not on the grid -- removing something frees
   its space, and drawing it there says otherwise -- so it is said here, with
   the way back next to it. */
.status__removed { margin-left: 0.75rem; color: #8a5a2b; }
.status__removed s { opacity: 0.7; }
.status__restore {
  display: inline; margin-left: 0.3rem; padding: 0 0.35rem;
  font: inherit; font-size: 0.8rem;
  border: 1px solid #d9c3a3; border-radius: 3px; background: #fdf6e3; color: #6b4a1f;
  cursor: pointer;
}
.status__restore:hover { background: #f7ead0; }
.status__removed form { display: inline; }

/*
 * The panel never scrolls and never wraps, so anything that will not fit is
 * clipped -- and on a template's panel the thing being clipped was the right
 * hand end, which is where Copy and Delete live. The Delete button sat 88px
 * past the edge of a 1500px window: present in the markup, pressable by a
 * test, and unreachable by a person.
 *
 * So the prose gives way and the controls do not. Everything in .panel is
 * flex:none by default; these two may shrink, and ellipsize when they do.
 */
.panel__upstream,
.panel__when {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The buttons inside the provenance line are not prose and must not shrink. */
.panel__upstream form,
.panel__upstream .panel__accept { flex: none; }

/* Standing state about a layer, outside the deck so the block panel cannot
   hide it. Empty most of the time, and taking no room when it is. */
.removed-strip { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0 0 0.6rem; }
.removed-strip:empty { display: none; }
.removed-strip .status__removed { margin-left: 0; font-size: 0.85rem; }

/* ---------------------------------------------------------------------------
 * Connections: what may reach this account without being a person.
 * ------------------------------------------------------------------------ */
.connections { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9rem; }
.connections th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280; border-bottom: 1px solid #e2e5ee;
  padding: 0.3rem 0.5rem;
}
.connections td { padding: 0.5rem; border-bottom: 1px solid #f0f2f7; vertical-align: top; }
.connections__kind {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280; background: #f2f4fa; border-radius: 3px; padding: 0 0.3rem; margin-left: 0.4rem;
}
.connections__row--revoked { opacity: 0.5; }
.connections__gone { color: #8a5a2b; font-size: 0.85rem; }
.connections__actions { white-space: nowrap; }
.connections__actions form { display: inline; }
.connections__actions .button { font-size: 0.78rem; padding: 0.15rem 0.5rem; }

/* The editor for one connection, opened by the link in its row. */
.connections__edit { display: none; }
.connections__edit:target { display: table-row; }
.connections__new { max-width: 46rem; }

/*
 * Choosing a level.
 *
 * Every level lists what it grants, rather than carrying a name you have to
 * interpret -- and the things no level grants are on the same card, because
 * what a permission rules out is the half that makes it trustworthy.
 */
.levels { border: 1px solid #e2e5ee; border-radius: 6px; padding: 0.75rem; margin: 0 0 1rem; }
.levels legend { font-size: 0.8rem; color: #6b7280; padding: 0 0.4rem; }
.levels__option {
  display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.5rem;
  align-items: baseline; padding: 0.5rem; border-radius: 5px; cursor: pointer;
}
.levels__option:hover { background: #f7f8fb; }
.levels__option--on { background: #eef1fa; box-shadow: inset 0 0 0 1px #c9d2ee; }
.levels__option input { grid-row: 1 / span 3; align-self: start; margin-top: 0.3rem; }
.levels__title { font-weight: 600; }
.levels__summary { grid-column: 2; font-size: 0.85rem; color: #4b5563; }
.levels__grants { grid-column: 2; margin: 0.25rem 0 0; padding-left: 1.1rem;
                  font-size: 0.85rem; color: #4b5563; }
.levels__grants li { margin: 0.1rem 0; }

.levels__never {
  margin: 0.75rem 0 0; padding: 0.6rem 0.75rem; font-size: 0.85rem;
  background: #fdf6f4; border: 1px solid #f0ddd6; border-radius: 5px; color: #6b4a3f;
}
.levels__no { display: block; margin-top: 0.2rem; }
.levels__no::before { content: "✗ "; color: #a4553f; }

.field--window { margin-top: 0.85rem; }
.field__note { display: block; font-size: 0.78rem; color: #6b7280; font-style: normal; }

/* The one moment a secret exists anywhere we could print it. */
.secret {
  margin: 0 0 1.25rem; padding: 0.85rem 1rem; font-size: 0.9rem;
  background: #fdf6e3; border: 1px solid #e8d9ae; border-radius: 6px;
}
.secret__value, .secret__use {
  display: block; margin-top: 0.5rem; padding: 0.4rem 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem;
  background: #fff; border: 1px solid #e8d9ae; border-radius: 4px;
  overflow-wrap: anywhere;
}
.secret__use { color: #6b7280; font-size: 0.78rem; }

/*
 * What the date window governs.
 *
 * Named levels__window, not window: that one is already the grid-hours
 * control and is inline-flex, which laid this out as three columns.
 */
.levels__window { display: grid; gap: 0.4rem; margin-top: 0.85rem; max-width: 40rem; }
.levels__window .field__note { max-width: none; }

/* The note that only matters at the top level. :has() is already
   load-bearing in the deck, so it is fair game here. */
.levels__schedule { display: none; }
.levels:has(input[value="manage_schedule"]:checked) .levels__schedule { display: block; }
.levels__schedule {
  padding: 0.5rem 0.65rem;
  background: #f7f8fb; border-left: 2px solid #c9d2ee; border-radius: 0 4px 4px 0;
}

/* Granting something access. A page of its own, because it is the only
   moment the decision gets made and it should not look like a dialogue to
   be clicked past. */
.consent { max-width: 44rem; margin: 2rem auto; }
.consent__who h1 { font-size: 1.3rem; margin: 0 0 0.3rem; }
.consent__uri { margin: 0 0 0.3rem; color: #3a4b8f; font-size: 0.9rem; }
.consent__id { margin: 0 0 1.2rem; font-size: 0.82rem; color: #6b7280; }
.consent__id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f2f4fa; border-radius: 3px; padding: 0 0.25rem; overflow-wrap: anywhere;
}
.consent__asked { margin: 0 0 0.75rem; font-size: 0.92rem; }
.consent__actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; }
.consent__actions form { display: inline; }
.consent__after { margin-top: 1.25rem; font-size: 0.85rem; color: #6b7280; }
.consent__refusal {
  padding: 0.75rem 1rem; margin: 0 0 1rem;
  background: #fdf6f4; border: 1px solid #f0ddd6; border-radius: 6px; color: #6b4a3f;
}

/* A grid whose last change did not reach the server. What is on screen is
   now a guess, so it says so rather than looking settled. */
.grid--stale { outline: 2px solid rgba(164, 85, 63, 0.5); outline-offset: 2px; }

/* ---- narrow screens -------------------------------------------------- */

/*
 * The sheet is the printed page: 1191 sheet pixels wide, at the same
 * geometry on screen as on paper, which is the whole point of it. A phone is
 * 390 CSS pixels wide, and `.editor-canvas { min-width: min-content }` let
 * the sheet stretch the document to 1211px -- so the day editor arrived as a
 * zoomed-out desktop page where nothing could be read and the controls were
 * four pixels tall (round-two finding 21).
 *
 * The fix is to stop the sheet governing the page. The page's own furniture
 * -- bar, navigation, status, settings, hints -- reflows to the screen, and
 * the sheet scrolls sideways inside its own box. That is the "ordinary
 * controls reflow independently of the two-dimensional calendar" the review
 * asked for; what it is not is a touch-first agenda view, which is a design
 * piece rather than a fix (docs/codex-design/07-mobile-and-accessibility.md).
 *
 * Screen only. Every rule here is inside a screen media query, so the print
 * stylesheet's geometry is untouched -- the one thing this must not move.
 */
@media screen and (max-width: 60rem) {
  main { padding: 1.25rem 0.75rem 3rem; }
  body:has(.editor-canvas) main { max-width: 100%; }

  /* Room for the scroll bar, so it does not sit on the last row. */
  .editor-canvas { padding-bottom: 0.5rem; }

  /* The bar stacks: a title, a date, then the controls on their own line. */
  .editor-bar { align-items: flex-start; gap: 0.5rem; }
  .editor-bar__right { flex-wrap: wrap; gap: 0.5rem; row-gap: 0.5rem; }
  .editor-bar h1 { display: block; margin-bottom: 0.2rem; }

  /*
   * The deck is sticky and fixed-height on a wide screen because the panel
   * must not resize it. On a narrow one the panel is the only thing in it
   * worth the room, so the deck grows instead of hiding half of it.
   */
  .deck { min-height: 0; padding-bottom: 1rem; }
  .panel { flex-wrap: wrap; gap: 0.5rem; }
  .panel .swatches { flex-wrap: wrap; }

  /* The window controls are a row of time fields and a button: they wrap
     rather than making the bar 447px wide. */
  .window { display: flex; flex-wrap: wrap; margin-left: 0; row-gap: 0.35rem; }
  .window__dash { display: none; }

  /* A select is as wide as its widest option unless told otherwise, and
     "America/Argentina/Buenos_Aires" is wider than a phone. */
  select, .settings__select { max-width: 100%; }
  .settings__row { flex-wrap: wrap; }

  /* The preview sheet is scaled down by the unit; it still gets a box of
     its own rather than nine pixels of document. */
  .preview { max-width: 100%; }

  /* "Which day?", a date, a checkbox and a button: four things on one line
     is one line too many at 390px. */
  .jump { flex-wrap: wrap; row-gap: 0.4rem; }
}

/*
 * A phone, as against a small window. The sheet still scrolls; what changes
 * is that nothing else competes with it for width.
 */
@media screen and (max-width: 30rem) {
  .editor-bar__right, .bar nav { width: 100%; }
  .editor-bar__right .button, .bar nav .button { flex: 1 1 auto; text-align: center; }
  h1 { font-size: 1.15rem; }
}

/* The panel's own time and date fields (finding 21): small, but real
   targets, and the only way to say "move this to Thursday at nine" without
   a steady hand on a 15-minute grid. */
.panel__time, .panel__date {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  min-height: 24px;
}
.panel__when label { font-size: 0.8rem; }

/* The fields are the one thing in the panel that must not be clipped to an
   ellipsis, so this row may shrink its text and not its controls. */
.panel__when { display: flex; align-items: center; gap: 0.3rem; overflow: visible; }

/* ---- dropdowns and icons, anywhere ------------------------------------ */

/* A <details> whose list floats under its button. Closing it on a click
   elsewhere is app/javascript/dropdowns.js. */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; line-height: 1.2; }
.menu summary::-webkit-details-marker { display: none; }
.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  /* Over the deck (40), which sits right under the editors' header bar: a
     menu opened from that bar falls straight onto it, and drawn beneath it
     the deck took every click meant for the menu. */
  z-index: 50;
  display: grid;
  min-width: 12rem;
  padding: 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.menu__list form { display: block; margin: 0; }
.menu__list button {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 4px;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.menu__list button:hover:not(:disabled) { background: #f1f2f7; }

/* A menu whose choices each say what they do: a bold name, a line under it. */
.menu__list--described { width: 18rem; }
.menu__list--described button { display: grid; gap: 0.1rem; padding: 0.45rem 0.6rem; white-space: normal; }
.menu__list--described button span { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.menu__note { margin: 0.2rem 0.6rem 0.3rem; color: var(--muted); font-size: 0.75rem; }

.regenerate summary { display: inline-flex; align-items: center; gap: 0.25rem; }
.regenerate[open] summary { background: #eef0f6; }
.menu__list button:disabled { color: #b0b0b6; cursor: not-allowed; }

/* An inline stroke icon, sized and coloured by the text around it. */
.icon {
  width: 1em; height: 1em; vertical-align: -0.15em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- block name suggestions ----------------------------------------- */

/*
 * What a block might be called, under its name field. The browser's own
 * datalist list did this while the field was an <input>; a textarea cannot
 * have one, so label_field_controller.js draws this instead. Fixed and on the
 * body, because both fields sit in boxes that clip what overflows them.
 */
.label-menu {
  position: fixed;
  z-index: 100;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-width: 24rem;
  background: #fff;
  border: 1px solid #b9c0d8;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(20, 24, 50, 0.16);
  font-size: 0.875rem;
}
.label-menu [role="option"] {
  padding: 0.3rem 0.7rem;
  white-space: pre-line;
  cursor: pointer;
}
.label-menu [role="option"]:hover { background: #f1f3fa; }
.label-menu [role="option"][aria-selected="true"] { background: var(--accent); color: #fff; }

/* ---- calendar events deleted from a sheet ----------------------------- */

.deleted-events { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.35rem; max-width: 44rem; }
.deleted-event {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
}
.deleted-event__when { color: var(--muted); font-size: 0.875rem; }
.deleted-event__name { font-weight: 600; overflow-wrap: anywhere; }
.deleted-event__from { color: var(--muted); font-size: 0.875rem; }
.deleted-event form { margin: 0; }
@media (max-width: 40rem) {
  .deleted-event { grid-template-columns: minmax(0, 1fr) auto; }
  .deleted-event__when, .deleted-event__from { grid-column: 1; }
}

/* ---- export and import (docs/IMPORT_EXPORT.md) ------------------------- */

.port { display: grid; gap: 0.5rem; max-width: 40rem; margin: 0.75rem 0 1.25rem; padding: 0.85rem 1rem;
        border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.port h2, .port h3 { margin: 0.2rem 0 0; font-size: 1rem; }
.port .hint { margin: 0; }
.port__choice { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: start; font-size: 0.9rem; }
.port__choice input { margin-top: 0.25rem; }
.port .button { justify-self: start; }
.port--undo form { display: inline-block; margin-right: 0.75rem; }
.port--preview { max-width: 48rem; }
.port__lines { margin: 0; padding-left: 1.2rem; }
.port__lines li { margin: 0.15rem 0; }
.port__clashes { border-collapse: collapse; font-size: 0.9rem; }
.port__clashes th, .port__clashes td { padding: 0.3rem 0.75rem 0.3rem 0; text-align: left; border-top: 1px solid var(--rule); }
.port__kind { color: var(--muted); font-weight: normal; font-size: 0.8rem; }
.port__all { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; font-size: 0.9rem; }
.port__go { display: flex; gap: 1rem; align-items: center; margin-top: 0.5rem; }
/* From a link: whose file it is, said plainly, and a link asking to replace
   everything said louder. */
.port__source { margin: 0; }
.port__url { display: block; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.port__or { display: grid; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
.port__url-field { width: 100%; max-width: 32rem; font: inherit; padding: 0.3rem 0.4rem; }
.port__warning { margin: 0; padding: 0.5rem 0.7rem; color: var(--alert); border: 1px solid #e3bdbd;
  background: #fdf3f3; border-radius: 4px; font-size: 0.9rem; }

/* ---- signing in (docs/LOGIN.md) ----------------------------------------- */
.auth--wide { max-width: 28rem; }
.auth .button { justify-content: center; }
.auth label { display: grid; gap: 0.3rem; font-size: 0.9rem; }
.auth select { font: inherit; padding: 0.4rem; }
.auth__code { font-size: 1.6rem; letter-spacing: 0.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.auth__password { margin-top: 1.5rem; font-size: 0.9rem; }
.auth__password summary { cursor: pointer; color: var(--muted); }
.auth__password .stack { margin-top: 0.6rem; }
.auth__inline-form { display: inline; }
.auth__inline { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-decoration: underline; cursor: pointer; }
.devices { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 40rem; }
.devices__item { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.devices__item .button { white-space: nowrap; }
.devices__this { margin-left: 0.4rem; font-size: 0.75rem; color: var(--ok); }
.auth__google { width: 100%; justify-content: center; }
.auth form.button_to { margin: 0; }
.auth__or { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.85rem; margin: 0.9rem 0; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.settings__google { margin: 0.8rem 0; }
/* button_to renders <button>, which doesn't inherit the page's font. */
.auth button.button, .devices button.button, .settings__section button.button { font: inherit; }
.passkeys { margin: 1rem 0; }
.passkeys h3 { font-size: 0.95rem; margin: 0 0 0.4rem; }
.passkeys__name { display: grid; gap: 0.2rem; }
.passkeys__name input { font: inherit; padding: 0.25rem 0.4rem; max-width: 18rem; }
.passkey-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.7rem 0.9rem;
  margin-bottom: 1rem; border: 1px solid var(--rule); border-radius: 6px; background: #f6f7fb; font-size: 0.9rem; }
.passkey-nudge button.button { font: inherit; }
