/* Contactbook — self-contained stylesheet (no build step, no external CSS). */

/* ---------------------------------- tokens --------------------------------- */
:root {
  color-scheme: light;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --surface-3: #e7e9f1;
  --text: #16181f;
  --text-muted: #62687a;
  --border: #dfe2ec;
  --border-strong: #c7cbda;

  --accent: #003c71;
  --accent-strong: #00203d;
  --accent-soft: #7db2e1;
  --success: #0f766e;
  --success-soft: #e6f5f1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #92400e;
  --warning-soft: #fef4e6;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-md: 0 8px 24px -12px rgb(16 24 40 / 0.25);
  --ring: 0 0 0 3px rgb(79 70 229 / 0.18);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.85em; }

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  line-height: 1.5;
  white-space: pre;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

::selection { background: var(--accent-soft); }

.shell {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
}

.main { padding-block: 28px 48px; }
.muted { color: var(--text-muted); }
.icon { flex: none; display: inline-block; vertical-align: -0.18em; }

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

.is-hidden { display: none !important; }

/* ---------------------------------- topbar --------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: #e4002b;
  box-shadow: var(--shadow-sm);
}
.brand__mark img { display: block; width: 31px; height: 31px; }

.brand__name { font-size: 16px; }

.topnav { display: flex; align-items: center; gap: 4px; margin-inline-start: 8px; }

.topnav__link {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}
.topnav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.topbar__actions { margin-inline-start: auto; display: flex; gap: 8px; }

/* ---------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn--primary:hover { background: var(--accent-strong); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: transparent; }

.btn--success { color: var(--success); }
.btn--success:hover { background: var(--success-soft); border-color: transparent; }

.btn--sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn--icon { padding: 6px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------- flashes -------------------------------- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.flash p { flex: 1; margin: 0; }
.flash--notice { border-left-color: var(--success); background: var(--success-soft); }
.flash--alert { border-left-color: var(--danger); background: var(--danger-soft); }
.flash .icon { color: var(--text-muted); margin-top: 2px; }

.flash__close {
  background: none; border: 0; padding: 4px; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
}
.flash__close:hover { background: var(--surface-3); }

/* -------------------------------- page header ------------------------------ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}
.page-head p { color: var(--text-muted); margin-top: 4px; }

.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

/* ----------------------------------- stats --------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat__value { display: block; font-size: 24px; font-weight: 680; letter-spacing: -0.02em; }
.stat__label { color: var(--text-muted); font-size: 13px; }

/* --------------------------------- toolbar --------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.toolbar__search {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}
.toolbar__search .icon {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.toolbar__search .input { padding-inline-start: 36px; }

.toolbar__select { flex: 0 1 auto; }
.toolbar__select .input { min-width: 150px; }

/* ---------------------------------- forms ---------------------------------- */
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  appearance: none;
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 32px;
}
textarea.input { resize: vertical; min-height: 96px; }

.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.input::placeholder { color: var(--text-muted); opacity: 0.75; }

.label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.field { min-width: 0; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--span-2 { grid-column: span 2; }
.field--span-3 { grid-column: span 3; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  cursor: pointer;
}
.checkbox input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--accent);
  margin: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ---------------------------------- panels --------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.panel__title { font-size: 16px; font-weight: 640; letter-spacing: -0.01em; }
.panel__description { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.panel__body { padding: 18px; }
.panel__body > * + * { margin-top: 16px; }
.panel__body--flush { padding: 0; }

/* ---------------------------------- badges --------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge--live { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.badge--draft { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.badge--muted { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip .icon { color: var(--text-muted); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 550;
}

/* ------------------------------- contact list ------------------------------ */
.contact-list { display: grid; gap: 10px; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 140ms ease, border-color 140ms ease;
}
.contact-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.contact-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
}
.contact-card__identity:hover { text-decoration: none; }

.contact-card__name-block { min-width: 0; display: grid; gap: 2px; }
.contact-card__name { font-weight: 620; font-size: 15.5px; letter-spacing: -0.01em; }
.contact-card__meta { color: var(--text-muted); font-size: 13px; }

.contact-card__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.contact-card__side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.contact-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }

.contact-card__actions { display: flex; align-items: center; gap: 2px; }

@media (max-width: 860px) {
  .contact-card { flex-direction: column; align-items: stretch; }
  .contact-card__side { justify-content: space-between; }
  .contact-card__actions { flex-wrap: wrap; }
}

/* --------------------------------- avatars --------------------------------- */
.avatar {
  width: var(--avatar-size, 48px);
  height: var(--avatar-size, 48px);
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}

/* ------------------------------- profile page ------------------------------ */
.profile__head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.profile__identity { flex: 1 1 320px; min-width: 0; }
.profile__identity h1 { font-size: 26px; letter-spacing: -0.02em; }
.profile__subtitle { color: var(--text-muted); margin-top: 3px; }
.profile__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.profile__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.profile__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .profile__grid { grid-template-columns: minmax(0, 1fr); }
}

.detail-list { display: grid; gap: 12px; }
.detail-list__item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.detail-list__icon { color: var(--text-muted); padding-top: 2px; }
.detail-list__label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-list__value { overflow-wrap: anywhere; }
.detail-list__value a { word-break: break-word; }
.detail-list .notes { white-space: pre-wrap; }

.address-lines { color: var(--text); }
.address-lines span { display: block; }

/* ------------------------------ public profile ----------------------------- */
.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 65%),
    var(--bg);
}

.public-topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
}
.public-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.public-topbar__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-main { flex: 1; padding-block: 34px 52px; }
.public-card { max-width: 880px; margin-inline: auto; }

.public-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 18px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}
.public-hero__photo {
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-sm);
}
.public-hero__body { flex: 1 1 360px; min-width: 0; }
.public-eyebrow {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.public-hero__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 3px;
}
.public-hero__heading h1 {
  min-width: 0;
  margin-top: 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.public-hero__brand {
  display: block;
  flex: none;
  width: clamp(150px, 18vw, 190px);
  height: auto;
}
.public-hero__brand--mobile { display: none; }
.public-hero__summary { margin-top: 6px; color: var(--text-muted); font-size: 16px; }
.public-hero__meta { margin-top: 2px; color: var(--text-muted); font-size: 14px; }
.public-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.public-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.public-hint { margin-top: 10px; color: var(--text-muted); font-size: 12.5px; }
.public-hint a { font-weight: 600; }

.public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.public-column { display: grid; gap: 18px; align-content: start; }
.public-column .panel { margin-bottom: 0; }

.public-contact-list { display: grid; gap: 10px; }
.public-contact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.public-contact__icon { color: var(--text-muted); padding-top: 3px; }
.public-contact__body { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.public-contact__label {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.public-contact__value {
  color: var(--text);
  font-weight: 550;
  overflow-wrap: anywhere;
}
a.public-contact__value:hover { color: var(--accent); text-decoration: underline; }
.public-contact__action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.public-contact--address .public-contact__body { gap: 5px; }
.public-address-lines { display: grid; gap: 1px; color: var(--text); }

.public-facts { display: grid; gap: 13px; margin: 0; }
.public-fact { display: grid; gap: 1px; }
.public-fact dt {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.public-fact dd { margin: 0; overflow-wrap: anywhere; }
.public-fact .notes { white-space: pre-wrap; }

.public-footer {
  margin-top: 0;
  border-top: 1px solid var(--border);
  padding-block: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.public-footer__inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .public-main { padding-block: 22px 36px; }
  .public-hero {
    flex-direction: column;
    gap: 16px;
    padding: 24px 18px;
    text-align: center;
  }
  .public-hero__photo { width: 112px; height: 112px; }
  .public-hero__heading { justify-content: center; gap: 12px; }
  .public-hero__brand--desktop { display: none; }
  .public-hero__brand--mobile { display: block; width: clamp(150px, 42vw, 190px); }
  .public-actions { justify-content: center; }
  .public-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .public-contact { flex-wrap: wrap; }
  .public-contact__action { margin-left: 27px; }
  .public-topbar__label { display: none; }
}

/* --------------------------------- sharing --------------------------------- */
.share-row {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.share-row:first-child { border-top: 0; padding-top: 0; }
.share-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.share-row__label { font-size: 13px; font-weight: 580; }
.share-row__value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.share-row__actions { display: flex; gap: 6px; flex-wrap: wrap; }

.share-photo { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------- nested --------------------------------- */
.nested__list { display: grid; gap: 10px; }
.nested__item + .nested__item { margin-top: 0; }
.nested__grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.nested__grid--address { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nested__grid--address .nested__wide { grid-column: span 3; }
.nested__remove { align-self: start; }
.field__error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }

.form-section + .form-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 620;
  margin-bottom: 10px;
}
.form-section__title .icon { color: var(--text-muted); }

.nested__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.input--auto { width: auto; min-width: 140px; }

@media (max-width: 720px) {
  .nested__grid, .nested__grid--address { grid-template-columns: minmax(0, 1fr); }
  .nested__grid--address .nested__wide { grid-column: auto; }
}

.panel__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* -------------------------------- photo field ------------------------------ */
.photo-field { display: flex; gap: 18px; flex-wrap: wrap; }
.photo-field__frame {
  width: 104px; height: 104px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex: none;
}
.photo-field__image { width: 100%; height: 100%; object-fit: cover; }
.photo-field__placeholder { color: var(--text-muted); }
.photo-field__controls { flex: 1 1 260px; min-width: 0; }

/* --------------------------------- dropzone -------------------------------- */
.dropzone {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 28px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone--active { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { color: var(--text-muted); }
.dropzone p { color: var(--text-muted); font-size: 13px; }
.dropzone__filename { font-weight: 600; color: var(--text); }

/* ------------------------------- empty state ------------------------------- */
.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-state .icon { color: var(--text-muted); }
.empty-state h2 { font-size: 17px; }
.empty-state p { color: var(--text-muted); max-width: 44ch; }
.empty-state__actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* --------------------------------- details --------------------------------- */
details.source { margin-top: 4px; }
details.source summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--text-muted);
  padding: 4px 0;
}
details.source summary:hover { color: var(--text); }
details.source pre { margin-top: 10px; max-height: 340px; }

/* ----------------------------------- auth ---------------------------------- */
.auth { max-width: 25rem; margin: 3rem auto 0; }
.auth__panel { box-shadow: var(--shadow-md); }
.auth__title { font-size: 1.25rem; letter-spacing: -0.01em; }
.auth__form { display: grid; gap: 14px; }
.auth__submit { width: 100%; }
.auth__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth__warning {
  font-size: 13.5px;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.topbar__account { display: flex; align-items: center; gap: 8px; }
.topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 16ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 13.5px;
}
.inline-form { display: inline; margin: 0; }

/* ---------------------------------- footer --------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 20px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer__inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .field-grid, .field-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .field--span-2, .field--span-3 { grid-column: auto; }
  .topnav { display: none; }
}
