/* Elizabeth notepad — girly/colorful/cat theme, mobile-first, no overflow 320-1280px. */

:root {
  color-scheme: light dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;

  --bg: #fef6f9;
  --bg-raised: #ffffff;
  --text: #2e1a2b;
  --text-muted: #7d5c76;
  --border: #f0d4e4;
  --accent: #c2185b;
  --accent-contrast: #ffffff;
  --accent-soft: #fce4ec;
  --accent-light: #f48fb1;
  --focus-ring: #7c3aed;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --danger: #b71c1c;
  --danger-bg: #ffebee;

  --radius-sm: 0.6rem;
  --radius-md: 1rem;
  --radius-lg: 1.4rem;
  --shadow-sm: 0 1px 3px rgba(194, 24, 91, 0.06), 0 1px 2px rgba(194, 24, 91, 0.04);
  --shadow-md: 0 4px 16px rgba(194, 24, 91, 0.10);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: clamp(1rem, 3vw, 1.5rem);
  --space-4: clamp(1.5rem, 5vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c0f1a;
    --bg-raised: #2a1a27;
    --text: #f5ecf3;
    --text-muted: #c9a8c2;
    --border: #432e3e;
    --accent: #f48fb1;
    --accent-contrast: #1a0514;
    --accent-soft: #3a1e2e;
    --accent-light: #f48fb1;
    --focus-ring: #c084fc;
    --success: #66bb6a;
    --success-bg: #1b2e1c;
    --danger: #ef9a9a;
    --danger-bg: #3e1a1a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100svh;
}

img, picture, video, canvas, svg { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 150ms ease-out;
}
.skip-link:focus {
  top: 0.5rem;
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Header ---- */
.app-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 3.5rem;
  padding-block: var(--space-1);
}
.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.app-header__cat { flex: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease-out, transform 150ms ease-out, opacity 150ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn--primary:hover { opacity: 0.88; }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-weight: 500;
}
.btn--ghost:hover { background: var(--accent-soft); }

/* ---- Main layout ---- */
main.container {
  padding-block: var(--space-3) var(--space-4);
}

/* ---- Login view ---- */
.login-card {
  max-width: 24rem;
  margin-inline: auto;
  margin-block-start: clamp(2rem, 10vh, 6rem);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-3);
  text-align: center;
}
.login-card__cat {
  display: block;
  width: clamp(80px, 20vw, 120px);
  height: auto;
  margin: 0 auto var(--space-2);
  border-radius: 50%;
}
.login-card h1 {
  margin-block: 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
}
.login-card__hint {
  color: var(--text-muted);
  margin-block: 0 var(--space-2);
  font-size: 0.95rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-block-end: var(--space-2);
  text-align: left;
}
.field label {
  font-weight: 600;
  font-size: 0.9rem;
}
input[type="password"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}
input[type="password"]:focus,
textarea:focus {
  border-color: var(--accent-light);
}
input[type="password"] { min-height: 44px; }
textarea {
  resize: vertical;
  min-height: 6rem;
}

.field-error,
#entry-error {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  margin-block: 0.5rem 0;
  overflow-wrap: break-word;
}

/* ---- Entry box ---- */
.entry-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
  margin-block-end: var(--space-3);
}
.entry-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-block-start: var(--space-1);
}
.entry-box__row > * {
  min-width: 0;
}
.entry-box__row #entry-error {
  flex: 1 1 100%;
  order: -1;
}

/* ---- Multi-section editor (S441) ---- */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.section-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  background: var(--bg);
  min-width: 0;
}
.section-item__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-block-end: 0.4rem;
}
.section-item__title {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-weight: 600;
  font-size: 0.92rem;
}
.section-item__title:focus {
  border-color: var(--accent-light);
}
.section-item__actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: none;
}
.btn--icon {
  min-height: 36px;
  min-width: 36px;
  padding: 0.3rem;
  font-size: 0.85rem;
  line-height: 1;
}
.btn--icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.section-item__body {
  margin: 0;
}
.btn--add-section {
  width: 100%;
  justify-content: center;
  margin-block-start: var(--space-1);
  border-style: dashed;
}

/* ---- Attachments (compose) ---- */
.entry-box__attachments {
  margin-block-start: var(--space-2);
  padding-block-start: var(--space-1);
  border-top: 1px dashed var(--border);
}
.attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.btn--file-label {
  cursor: pointer;
}
.attach-status {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.pending-attachments {
  list-style: none;
  margin: var(--space-1) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pending-attachment-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  font-size: 0.8rem;
  max-width: 100%;
}
.pending-attachment-chip__thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.pending-attachment-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}
.pending-attachment-chip__remove {
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  min-height: auto;
}
.pending-attachment-chip__remove:hover {
  color: var(--danger);
}

/* ---- Note sections + attachments (feed) ---- */
.note-card__sections {
  margin-block-end: 0.5rem;
}
.note-section + .note-section {
  margin-block-start: 0.6rem;
  padding-block-start: 0.6rem;
  border-top: 1px dashed var(--border);
}
.note-section__title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
  /* See .note-section__body for why both overflow-wrap:anywhere AND
     overflow-x:hidden are needed (S441 same-session finding). */
  overflow-wrap: anywhere;
  overflow-x: hidden;
}
.note-section__body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* Hard backstop: even with overflow-wrap:anywhere, an extreme pathological
     single unbroken run (no spaces at all -- e.g. a giant pasted URL/hash;
     reproduced in this session with a 2,097,152-char single-token test note)
     was observed to still report a multi-million-pixel scrollWidth in at
     least one Chromium-family engine, ballooning every ancestor up to
     <html>. overflow-x:hidden makes this element establish its own box for
     width-propagation purposes regardless of that engine quirk, so it can
     never blow out the page's horizontal layout. Confirmed effective via a
     same-session render-and-measure check (S441). */
  overflow-x: hidden;
}

.note-card__attachments {
  margin-block-end: var(--space-1);
}
.attachment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-end: 0.4rem;
}
.attachment-thumb-link {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}
.attachment-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  display: block;
  background: var(--accent-soft);
}
.attachment-file-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}
.attachment-file-chip:hover {
  text-decoration: underline;
}
.attachment-audio {
  margin-block-end: 0.4rem;
}
.attachment-audio audio {
  width: 100%;
  max-width: 100%;
  display: block;
}

.feed-status {
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-block-end: var(--space-1);
}

/* ---- Feed ---- */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.note-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
  min-width: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .note-card {
    animation: note-in 220ms ease-out;
  }
}
@keyframes note-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.note-card__time {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-block-end: var(--space-2);
}

/* ---- Slots grid (thumbnail cards) ---- */
.slots-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1);
}
@media (min-width: 640px) {
  .slots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.slot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  .slot-card {
    transition: transform 150ms ease-out, box-shadow 150ms ease-out;
  }
}
.slot-card[data-status="filled"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
@media (prefers-reduced-motion: reduce) {
  .slot-card[data-status="filled"]:hover {
    transform: none;
  }
}

.slot-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.slot-card__link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
  border-radius: var(--radius-md);
}

.slot-card__thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  background: var(--accent-soft);
}

.slot-card__info {
  padding: 0.5rem 0.6rem 0.6rem;
}

.slot-card__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-block-end: 0.3rem;
  color: var(--text-muted);
  background: var(--border);
}
.slot-card[data-status="filled"] .slot-card__badge {
  color: var(--accent-contrast);
  background: var(--accent);
}
.slot-card[data-status="error"] .slot-card__badge {
  color: var(--danger);
  background: var(--danger-bg);
}

.slot-card__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slot-card__teaser {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slot-card[data-status="pending"] .slot-card__title,
.slot-card[data-status="pending"] .slot-card__teaser {
  color: var(--text-muted);
  font-style: italic;
}

@media (prefers-reduced-motion: no-preference) {
  .slot-card[data-status="pending"] .slot-card__badge {
    animation: pulse 1.6s ease-in-out infinite;
  }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ---- Empty state ---- */
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-4) var(--space-2);
}
.empty-state__cat {
  display: block;
  width: clamp(100px, 25vw, 160px);
  height: auto;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-md);
}
.empty-state__text {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* ---- Article page ---- */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-block-end: var(--space-3);
  min-height: 44px;
  padding: 0.4rem 0;
}
.article-back:hover {
  text-decoration: underline;
}

.article-column {
  max-width: 65ch;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.article-header {
  margin-block-end: var(--space-3);
  padding-block-end: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.article-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.2;
  color: var(--accent);
  margin: 0 0 0.4rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.article-header__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-body {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  line-height: 1.75;
  overflow-wrap: break-word;
  word-break: break-word;
}
.article-body p {
  margin: 0 0 1.2em;
}

.article-state {
  text-align: center;
  padding: var(--space-4);
  color: var(--text-muted);
}
.article-state__cat {
  display: block;
  width: clamp(100px, 25vw, 160px);
  height: auto;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-md);
}
.article-state__heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.article-state__text {
  font-size: 1rem;
  max-width: 40ch;
  margin-inline: auto;
}
.article-state__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  text-decoration: underline;
  margin-block-start: var(--space-2);
  min-height: 44px;
  padding: 0.4rem 0;
}

/* =====================================================================
   S514 -- Home / Site building section tabs + the Site Building Guidance
   page (sites.html). Mobile-first; every box that can hold long text
   wraps or scrolls inside itself so nothing overflows 320-1280px.
   ===================================================================== */

/* ---- Section tabs (Home | Site building) ---- */
.app-tabs { border-top: 1px solid var(--border); }
.app-tabs[hidden] { display: none; }
.app-tabs__inner {
  display: flex;
  gap: 0.25rem;
}
.app-tabs__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.app-tabs__link:hover { color: var(--accent); }
.app-tabs__link[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Shared text bits ---- */
.sb-status { color: var(--text-muted); }
.sb-h1 {
  margin-block: 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  line-height: 1.2;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.sb-h1:focus { outline: none; }
.sb-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent);
}
.sb-lead { margin-block: 0 var(--space-2); color: var(--text-muted); }
.sb-muted { color: var(--text-muted); margin-block: 0.4rem var(--space-2); }
.sb-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.sb-req { font-weight: 500; color: var(--text-muted); font-size: 0.85rem; }

/* ---- Site tab strip ---- */
.sb-tabs { margin-block-end: var(--space-2); }
.sb-tabs__scroller {
  display: flex;
  gap: 0.5rem;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.sb-tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  max-width: 14rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-tab:hover { background: var(--accent-soft); }
.sb-tab[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.sb-tab--new { border-style: dashed; color: var(--accent); }
.sb-tab--new[aria-current="page"] { color: var(--accent-contrast); }

/* ---- Badges ---- */
.sb-badge {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
}
.sb-badge--agents_updated { background: var(--success-bg); color: var(--success); }

/* ---- All-sites grid ---- */
.sb-grid {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-2);
}
.sb-grid[hidden] { display: none; }
.sb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  padding: var(--space-2);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.sb-card__link {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sb-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sb-card:hover { border-color: var(--accent-light); }
.sb-card__url,
.sb-card__activity {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.sb-empty { text-align: center; margin-block: var(--space-3); color: var(--text-muted); }
.sb-empty[hidden] { display: none; }
.sb-empty__cat { width: clamp(80px, 25vw, 140px); height: auto; border-radius: 50%; }
.sb-start { text-decoration: none; }

/* ---- Forms ---- */
.sb-reuse { margin-block-end: var(--space-2); display: flex; flex-direction: column; gap: 0.35rem; }
.sb-reuse[hidden] { display: none; }
.sb-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
}
.sb-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.sb-label { font-weight: 600; font-size: 0.95rem; }
.sb-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}
textarea.sb-input { resize: vertical; min-height: 5rem; }
.sb-input:focus { border-color: var(--accent-light); }
.sb-input[aria-invalid="true"] { border-color: var(--danger); }
.sb-form__actions { display: flex; justify-content: flex-end; }
.sb-msg {
  margin: 0;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  background: var(--accent-soft);
  color: var(--text);
}
.sb-msg[hidden] { display: none; }
.sb-msg--ok { background: var(--success-bg); color: var(--success); }
.sb-msg--error { background: var(--danger-bg); color: var(--danger); }

/* ---- One site ---- */
.sb-site-head { margin-block-end: var(--space-2); }
.sb-site-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-block: 0.2rem;
}
.sb-site-url { min-width: 0; overflow-wrap: anywhere; }
.sb-site-url a { color: var(--accent); }
.sb-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
  margin-block-end: var(--space-3);
  min-width: 0;
}
.sb-block[hidden] { display: none; }
.sb-block .sb-form { border: 0; box-shadow: none; padding: 0; }
.sb-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

/* ---- Agent update timeline ---- */
.sb-timeline { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sb-timeline:empty { display: none; }
.sb-update {
  border-left: 4px solid var(--accent-light);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.7rem 0.9rem;
  min-width: 0;
}
.sb-update--question { border-left-color: var(--accent); }
.sb-update--done { border-left-color: var(--success); }
.sb-update__head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; }
.sb-kind { font-weight: 700; font-size: 0.85rem; color: var(--accent); }
.sb-update--done .sb-kind { color: var(--success); }
.sb-update__time { font-size: 0.82rem; color: var(--text-muted); }
.sb-update__title { margin: 0.3rem 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.sb-update__body { margin: 0.3rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sb-update__meta { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--text-muted); overflow-wrap: anywhere; }

/* ---- Earlier guidance ---- */
.sb-history { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.sb-history__item details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0.5rem 0.8rem;
}
.sb-history__item summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.sb-dl { margin: 0.4rem 0 0.8rem; }
.sb-dl dt { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }
.sb-dl dd { margin: 0 0 0.6rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Home: "Your sites" panel ---- */
.home-sites {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
  margin-block-end: var(--space-3);
}
.home-sites[hidden] { display: none; }
.home-sites__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1); }
.home-sites__title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; color: var(--accent); }
.home-sites__list > li { min-width: 0; max-width: 100%; }
.home-sites__list { list-style: none; margin: var(--space-1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.home-sites__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-sites__chip:hover { background: var(--accent-soft); }
.home-sites__chip--waiting { border-color: var(--accent-light); }
.home-sites__empty { margin: var(--space-1) 0 0; color: var(--text-muted); }
.home-sites__new { text-decoration: none; }

@media (min-width: 768px) {
  .sb-form { padding: var(--space-3); }
  .sb-block { padding: var(--space-3); }
}
