/* Protos - start page styles.
   Colour comes from CSS custom properties so a page theme is one data-scheme
   attribute plus an accent value. */

:root {
  /* Dark themes by default, so native controls (select popups, scrollbars,
     date pickers) render dark and stay readable. Flipped per scheme below. */
  color-scheme: dark;
  --accent: #4f8cff;
  /* Text drawn on top of --accent. Every accent preset sets its own, chosen for
     at least 4.5:1 contrast, so switching preset changes the font colour too. */
  --on-accent: #0b1226;
  /* The accent when used as text/links: nudged towards the body text colour so
     it stays legible on dark *and* light schemes. */
  --accent-ink: var(--accent);
  --bg: #1c2230;
  --bg-image: none;
  --panel: rgba(28, 34, 48, 0.82);
  --widget: rgba(37, 45, 63, 0.9);
  --widget-head: rgba(255, 255, 255, 0.05);
  --text: #eef2f9;
  --muted: #9aa6be;
  --border: rgba(255, 255, 255, 0.12);
  --danger: #ff6b6b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --gap: 14px;
  /* Solid backdrop for form controls, so a <select> and its popup agree. */
  --field: #232b3c;
}

/* Accent presets. Kept in step with THEME_ACCENTS in public/js/theme.js. */
[data-accent='blue'] { --accent: #4f8cff; --on-accent: #0b1226; }
[data-accent='indigo'] { --accent: #4f46e5; --on-accent: #ffffff; }
[data-accent='teal'] { --accent: #0f766e; --on-accent: #ffffff; }
[data-accent='amber'] { --accent: #f2a417; --on-accent: #2b1d02; }
[data-accent='rose'] { --accent: #e11d48; --on-accent: #ffffff; }

@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root { --accent-ink: color-mix(in srgb, var(--accent) 78%, var(--text)); }
}

[data-scheme='light'] {
  color-scheme: light;
  --field: #ffffff;
  --bg: #eef1f6;
  --panel: rgba(255, 255, 255, 0.9);
  --widget: rgba(255, 255, 255, 0.96);
  --widget-head: rgba(0, 0, 0, 0.03);
  --text: #1b2230;
  --muted: #63708a;
  --border: rgba(20, 30, 50, 0.12);
  --shadow: 0 8px 24px rgba(20, 30, 50, 0.12);
}

[data-scheme='paper'] {
  color-scheme: light;
  --field: #fffdf8;
  --bg: #f6f2e9;
  --panel: rgba(255, 253, 248, 0.92);
  --widget: rgba(255, 255, 255, 0.97);
  --widget-head: rgba(120, 90, 40, 0.06);
  --text: #2f2a22;
  --muted: #7b7364;
  --border: rgba(80, 60, 30, 0.16);
  --shadow: 0 8px 22px rgba(80, 60, 30, 0.12);
}

[data-scheme='midnight'] {
  --bg: #07090f;
  --panel: rgba(12, 16, 26, 0.88);
  --widget: rgba(18, 23, 36, 0.92);
  --widget-head: rgba(255, 255, 255, 0.04);
  --text: #e6ecf7;
  --muted: #8592ab;
  --border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  font: 15px/1.45 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

.boot { padding: 48px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ buttons */

button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--widget-head);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: rgba(127, 127, 127, 0.18); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .widget:focus-visible, [contenteditable]:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.icon { padding: 5px 8px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* A <select>'s popup is drawn by the browser, not by this stylesheet: it follows
   `color-scheme` and the option colours, so both are set from the theme. Without
   this Chrome shows a white list under light text. */
select, option, optgroup {
  background-color: var(--field);
  color: var(--text);
}

input[type='text'], input[type='email'], input[type='password'], input[type='url'],
input[type='number'], input[type='search'], select, textarea {
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Accent presets: each swatch is painted with the accent and shows "Aa" in the
   text colour that accent uses, so the pairing is visible before choosing it. */
.accent-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.accent-swatch {
  width: 50px; height: 36px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--swatch, var(--accent));
  color: var(--swatch-ink, var(--on-accent));
  font-size: 13px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.accent-swatch:hover { filter: brightness(1.06); }
.accent-swatch[aria-pressed='true'] { border-color: var(--text); }
.accent-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.field-row { display: flex; gap: 8px; align-items: center; }
.hint { color: var(--muted); font-size: 13px; }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ------------------------------------------------------------------- header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

/* The band at the very top of the page: page title on the left, account on the
   right, with the search bar and page tools on the row beneath it. */
.page-header {
  display: flex;
  gap: 6px 16px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Page title: plain text, 30% larger than the original 19px. */
.page-title { margin: 0; font-size: 24.7px; font-weight: 600; letter-spacing: 0.2px; }

.page-header-user { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.page-header-user .who { font-size: 13px; }

.header-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.searchbar { display: flex; flex: 1 1 320px; min-width: 240px; gap: 6px; }
.searchbar select { width: auto; max-width: 150px; }
.searchbar input { flex: 1; }

.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------- tabs */

.tabbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.tab {
  border: 1px solid var(--border);
  background: var(--widget-head);
  border-radius: 8px 8px 0 0;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab[aria-selected='true'] {
  color: var(--text);
  background: var(--widget);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tab.drag-over { outline: 2px dashed var(--accent); }
.tab .tab-tools { display: none; gap: 2px; }
.tab[aria-selected='true'] .tab-tools { display: inline-flex; }
.tab .mini { border: none; background: transparent; cursor: pointer; padding: 0 2px; color: var(--muted); }
.tab .mini:hover { color: var(--text); }

/* ------------------------------------------------------------------- canvas */

.canvas-wrap { padding: 16px; }

.canvas.grid {
  display: grid;
  gap: var(--gap);
  align-items: start;
  /* minmax(0, 1fr) rather than 1fr: nowrap headlines would otherwise set a
     min-content floor and push the grid wider than the viewport. */
  grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
}
/* Each column is a positioning context one track wide. Widgets are absolutely
   positioned by the measured layout pass (see layoutGrid in public/js/render.js)
   so a widget can span several columns while every column keeps flowing on its
   own — no shared row heights, so no gaps. */
.canvas.grid .column { position: relative; min-height: 120px; min-width: 0; }
.canvas.grid .column > .widget,
.canvas.grid .column > .widget-placeholder { position: absolute; left: 0; top: 0; width: 100%; }
.canvas.grid .column.drop-target { background: rgba(127, 127, 127, 0.08); border-radius: var(--radius); }

.canvas.freeform { position: relative; min-height: 70vh; }

.widget {
  background: var(--widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.canvas.freeform .widget { position: absolute; }
.widget.dragging { opacity: 0.5; }
.widget-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  min-height: 60px;
  background: rgba(79, 140, 255, 0.08);
}

.widget-head {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Half the old height with the title unchanged: the padding and the tool
     buttons carry the reduction, not the text. */
  padding: 2px 8px;
  min-height: 22px;
  background: var(--widget-head);
  border-bottom: 1px solid var(--border);
  cursor: grab;
}
/* The ✎/✕ buttons shrink to sit inside the shorter bar. */
.widget-tools { gap: 2px; }
.widget-tools .btn { padding: 1px 5px; font-size: 12px; line-height: 1.4; border-radius: 5px; }
.canvas.grid .widget-head { cursor: grab; }
.readonly .widget-head { cursor: default; }
.widget-title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-tools { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.widget:hover .widget-tools, .widget:focus-within .widget-tools { opacity: 1; }
.readonly .widget-tools { display: none; }
.widget-body { padding: 10px; overflow: auto; flex: 1; min-height: 40px; }

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--border) 50%);
}
.canvas.grid .resize-handle { display: none; }

/* ---------------------------------------------------------------- widgets */

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.link-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--widget-head);
  border: 1px solid transparent;
  overflow: hidden;
}
.link-tile:hover { border-color: var(--accent); }
.link-tile img, .link-tile .letter {
  width: 20px; height: 20px; border-radius: 4px; flex: 0 0 20px;
}
.link-tile .letter {
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.link-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.link-tile.dragging { opacity: 0.45; }

/* Compact presentation: a plain multi-column list of favicon + label.
   Small type and narrow columns so four of them fit a normal widget; a very
   narrow widget drops to two or three columns without any configuration. */
.link-list { columns: 92px 4; column-gap: 8px; }
.link-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  break-inside: avoid;
  overflow: hidden;
}
.link-row img, .link-row .letter { width: 11px; height: 11px; border-radius: 2px; flex: 0 0 11px; }
.link-row .letter { font-size: 8px; }
.link-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row:hover span { color: var(--accent-ink); text-decoration: underline; }
.link-row.dragging { opacity: 0.45; }

/* Reorder controls in the bookmark editor. */
.move-group { display: flex; gap: 2px; flex: 0 0 auto; }
.item-row .btn.icon { padding: 4px 7px; line-height: 1.1; }

.todo-list, .note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.todo-item input[type='checkbox'] { width: auto; }
.todo-item .todo-text { flex: 1; word-break: break-word; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-add { display: flex; gap: 6px; margin-top: 8px; }

.note-body {
  min-height: 60px;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}
.note-body[contenteditable='true']:empty::before { content: 'Write a note…'; color: var(--muted); }

.feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Headlines stay on one row and use the same type size as the compact
   bookmarks list, so the two widgets sit together visually. */
.feed-list li { min-width: 0; overflow: hidden; }
.feed-list a {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.feed-list a:hover { text-decoration: underline; }
.feed-list .meta { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-status { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-status > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-icon { font-size: 34px; line-height: 1; }
.weather-temp { font-size: 30px; font-weight: 600; }
.weather-meta { color: var(--muted); font-size: 13px; }
.weather-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; margin-top: 10px; }
.weather-day { text-align: center; font-size: 12px; color: var(--muted); }
.weather-day .d-icon { font-size: 18px; display: block; }

/* ------------------------------------------------------------------ clock */

/* Seven-segment LCD panel. The unlit segments stay visible, which is what
   makes it read as a display rather than text. */
.clock-lcd {
  /* The display follows the page theme. The panel is the theme's control surface
     mixed towards the page background (so a dark scheme still reads as an LCD),
     and the dots are painted in the theme's text colour — light schemes get dark
     dots on a light panel instead of a black slab. The glow picks up the accent. */
  --lcd-bg: var(--field);
  --lcd-dot: var(--text);
  --lcd-glow: rgba(127, 127, 127, 0.35);
  position: relative;
  container-type: inline-size;
  padding: 10px 12px 8px;
  background: var(--lcd-bg);
  box-shadow: inset 0 1px 0 rgba(127, 127, 127, 0.16), inset 0 -18px 30px rgba(0, 0, 0, 0.18);
  border-top: 3px solid var(--accent);
  color: var(--lcd-dot);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* The clock's panel is edge-to-edge, so its widget body carries no padding —
   the card's own radius then clips the panel's corners. */
.widget-clock .widget-body { padding: 0; }

.clock-digits { display: flex; align-items: center; gap: 3px; }
.clock-seconds { position: absolute; right: 10px; bottom: 24px; display: flex; align-items: center; gap: 2px; }

/* Dot-matrix glyphs: a 5x7 (or 1x7 for the colon) grid of dots. Unlit dots are
   still painted, which is what makes it read as a display rather than text. */
.dot-glyph {
  display: block;
  width: 22px; /* fallback where container queries are unavailable */
  /* Half the original size, capped so it stays modest in a very wide widget. */
  width: min(6.5cqw, 34px);
  height: auto;
}
.dot-glyph.small { width: 11px; width: min(3cqw, 16px); }
.dot-glyph.period { width: 9px; width: min(2.4cqw, 13px); }
/* The colon's viewBox is a single column, so it gets a single cell's width. */
.dot-glyph.colon { width: 4.4px; width: min(1.3cqw, 6.8px); }
.dot-glyph.colon.small { width: 2.2px; width: min(0.6cqw, 3.2px); }
.dot-glyph circle { fill: rgba(127, 127, 127, 0.12); fill: color-mix(in srgb, var(--lcd-dot, var(--text)) 9%, transparent); }
.dot-glyph circle.on {
  fill: var(--lcd-dot, var(--text));
  filter: drop-shadow(0 0 1.5px var(--lcd-glow, rgba(127, 127, 127, 0.35)));
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .clock-lcd {
    --lcd-bg: color-mix(in srgb, var(--field) 62%, var(--bg));
    --lcd-glow: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, var(--lcd-dot) 10%, transparent),
      inset 0 -18px 30px color-mix(in srgb, var(--bg) 55%, transparent);
  }
}

.clock-ampm {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.clock-ampm:empty { display: none; }

.clock-meta { color: var(--muted); font-size: 10px; letter-spacing: 0.3px; text-align: center; }

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

.calendar { display: flex; flex-direction: column; gap: 6px; }
.calendar-head { display: flex; align-items: center; gap: 4px; }
.calendar-title { flex: 1; text-align: center; font-weight: 600; font-size: 14px; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.calendar-weekday {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.calendar-day { padding: 3px 0; border-radius: 6px; }
.calendar-day.empty { visibility: hidden; }
.calendar-day.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.empty-state { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
}
.modal h2 { margin: 0 0 4px; font-size: 18px; }
/* A section break inside a dialog (the account dialog's backup area). */
.modal h3 { margin: 18px 0 8px; font-size: 14px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.type-card {
  border: 1px solid var(--border);
  background: var(--widget-head);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
}
.type-card:hover { border-color: var(--accent); }
.type-card strong { display: block; }
.type-card small { color: var(--muted); }

.item-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.item-row { display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ toasts */

.toasts { position: fixed; right: 14px; bottom: calc(var(--footer-height) + 8px); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: var(--widget);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  max-width: 320px;
}
.toast.error { border-left-color: var(--danger); }

/* Full text of a headline that had to be clipped. */
.hover-popup {
  position: fixed;
  z-index: 90;
  max-width: min(560px, calc(100vw - 24px));
  background: var(--widget);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.hover-popup.visible { opacity: 1; }
[data-scheme='light'] .hover-popup,
[data-scheme='paper'] .hover-popup { background: #fff; }

/* ------------------------------------------------------------------ footer */

/* Height of the fixed footer bar: also reserves room for content and toasts. */
:root { --footer-height: 58px; }

.page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.page-footer .item { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }
.page-footer .stamp { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.page-footer .sep { opacity: 0.6; }
.page-footer .spacer { flex: 1 1 auto; min-width: 8px; }
.page-footer .btn { font-size: 13px; flex: 0 0 auto; }

/* Keep the last row of widgets clear of the bar. */
.app-page { padding-bottom: var(--footer-height); }

@media (max-width: 520px) {
  :root { --footer-height: 84px; }
  /* Two rows: the labels, then the button once it no longer fits. */
  .page-footer { flex-wrap: wrap; white-space: normal; row-gap: 4px; }
  .page-footer .btn { margin-left: auto; }
}

/* -------------------------------------------------------------- auth / 404 */

.centered { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card {
  background: var(--widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  width: min(420px, 100%);
}
.card h1 { margin: 0 0 6px; font-size: 22px; }
.card p.hint { margin-top: 0; }
.card .row { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 14px; }
.page-locked { text-align: center; }
.badge { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }

@media (max-width: 720px) {
  .canvas.grid { grid-template-columns: minmax(0, 1fr); }
  .searchbar { flex-basis: 100%; }
  /* The name stays in the header, just narrower. */
  .page-header-user { margin-left: 0; }
  .page-header .who { max-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
