/* CrossPost interface. Tokens live in tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-ui);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

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

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

h1, h2, h3, p { margin: 0; }
q { quotes: "“" "”"; }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.86em; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
/* Icons default to a modest size; components set their own below. */
svg[viewBox] { width: 20px; height: 20px; flex: none; }
.row > svg:last-child { width: 16px; height: 16px; color: var(--text-3); }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-xs); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.shell { min-height: 100dvh; }

.sidebar { display: none; }

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--fast) var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--separator); }
.topbar-title {
  font-weight: 600;
  font-size: 16px;
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.topbar.scrolled .topbar-title { opacity: 1; }
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 4px; }
.topbar-end { justify-content: flex-end; }

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
}
.tab:hover { text-decoration: none; }
.tab svg { width: 25px; height: 25px; }
.tab.active { color: var(--accent); }
.tab .count-badge { position: absolute; top: 0; left: calc(50% + 6px); }

body.composing .tabbar { display: none; }

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 9px var(--gutter);
  font-size: 13px;
  color: var(--amber);
  background: var(--amber-soft);
  border-bottom: 0.5px solid var(--separator);
}
.banner p { display: flex; align-items: center; gap: 7px; }
.banner p:has(.btn) { flex: 1; gap: 10px; }
.banner .btn { flex: none; }
.banner svg { width: 15px; height: 15px; flex: none; }

#app {
  padding: 8px var(--gutter) calc(96px + env(safe-area-inset-bottom));
  max-width: var(--content);
  margin: 0 auto;
}

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  #app { padding: 36px var(--gutter) 72px; }
  body.composing #app { max-width: 1240px; }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 12px 14px;
    background: var(--bg-sunken);
    border-right: 0.5px solid var(--separator);
    overflow-y: auto;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  color: var(--text);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand img { width: 26px; height: 26px; border-radius: 7px; }

.sidebar .compose { margin: 0 4px 16px; justify-content: center; }

.nav-label {
  padding: 16px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { text-decoration: none; background: var(--fill); }
.nav-item svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.nav-item.active { background: var(--fill-strong); }
.nav-item.active svg { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item .count-badge { margin-left: auto; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 0.5px solid var(--separator); }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text);
}
.me:hover { background: var(--fill); text-decoration: none; }
.me-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.me-role { font-size: 12px; color: var(--text-3); text-transform: capitalize; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft-strong);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- page heading ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 6px 0 22px;
}
.large-title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.page-sub { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; margin-bottom: 8px; }
.back-link svg { width: 16px; height: 16px; }

@media (min-width: 900px) {
  .large-title { font-size: 36px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), opacity var(--fast) var(--ease);
  user-select: none;
}
.btn:hover { background: var(--fill-strong); text-decoration: none; }
.btn:active { opacity: 0.8; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-tinted { background: var(--accent-soft); color: var(--accent); }
.btn-tinted:hover { background: var(--accent-soft-strong); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); filter: saturate(1.4); }
.btn-plain { background: transparent; color: var(--accent); padding: 0 8px; }
.btn-plain:hover { background: var(--accent-soft); }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: transparent; color: var(--text-2); }
.btn-icon:hover { background: var(--fill); color: var(--text); }
.btn-icon svg { width: 20px; height: 20px; }

.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--accent-ink) var(--accent-ink) transparent transparent;
  animation: spin 0.7s linear infinite;
}
.btn:not(.btn-primary)[aria-busy="true"]::after { border-color: var(--text-2) var(--text-2) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- form controls ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }

.input, .select, textarea.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--focus); }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea.input { resize: vertical; line-height: 1.5; }

.code-input {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.35em;
  text-align: center;
  padding-left: 0.35em;
}

/* iOS-style switch built on a real checkbox. */
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--fill-strong);
  cursor: pointer;
  transition: background var(--medium) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform var(--medium) var(--ease);
}
.switch:checked { background: var(--green); }
.switch.danger:checked { background: var(--red); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { box-shadow: var(--focus); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* Segmented control. */
.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: 10px;
  background: var(--fill);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}
.segmented .seg-count { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed="true"] .seg-count { color: var(--accent); }

/* Network marks: plain letterforms in brand color, not logos. */
.net {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font: 700 11px/1 var(--font-ui);
  letter-spacing: -0.02em;
  color: #fff;
  flex: none;
}
.net-facebook { background: #1b6ef2; font-size: 13px; }
.net-linkedin { background: #0b66c2; }
.net.off { background: var(--fill-strong); color: var(--text-3); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px 0 8px;
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.chip[aria-pressed="false"] { color: var(--text-3); background: transparent; }
.chip[aria-pressed="false"] .net { background: var(--fill-strong); color: var(--text-3); }
.chip:disabled { cursor: default; opacity: 0.6; }

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status.pill { padding: 3px 10px 3px 9px; border-radius: var(--r-pill); background: var(--fill); }
.s-draft { color: var(--text-2); }
.s-pending, .s-sending { color: var(--accent); }
.s-pending.pill, .s-sending.pill { background: var(--accent-soft); }
.s-approved, .s-published { color: var(--green); }
.s-approved.pill, .s-published.pill { background: var(--green-soft); }
.s-rejected, .s-partial { color: var(--amber); }
.s-rejected.pill, .s-partial.pill { background: var(--amber-soft); }
.s-scheduled { color: var(--apricot); }
.s-scheduled.pill { background: var(--apricot-soft); }
.s-failed { color: var(--red); }
.s-failed.pill { background: var(--red-soft); }

/* ---------- surfaces and grouped lists ---------- */

.panel {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  padding: 18px;
}
.panel + .panel { margin-top: 14px; }
.panel-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.group { margin-bottom: 28px; }
.group-title {
  padding: 0 4px 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.group-foot { padding: 7px 4px 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.list {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 16px;
  color: var(--text);
  position: relative;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  border-top: 0.5px solid var(--separator);
}
a.row:hover, button.row:hover { background: var(--fill); text-decoration: none; }
button.row { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.row-main { flex: 1; min-width: 0; }
.row-label { font-size: 15px; font-weight: 500; }
.row-sub { font-size: 13px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.row-detail { color: var(--text-2); font-size: 14.5px; text-align: right; }
.row-chevron { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
}
.row-icon svg { width: 18px; height: 18px; }
.row-icon.red { background: var(--red-soft); color: var(--red); }
.row-icon.green { background: var(--green-soft); color: var(--green); }
.row-icon.amber { background: var(--amber-soft); color: var(--amber); }
.row .select { width: auto; min-height: 34px; font-size: 14.5px; padding-top: 5px; padding-bottom: 5px; }
.row.danger .row-label { color: var(--red); }

/* ---------- post list ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--text-3); }
.search .input { padding-left: 32px; min-height: 36px; font-size: 15px; background: var(--fill); border-color: transparent; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 26px 4px 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}
.section-title:first-child { margin-top: 0; }
.section-title .faint { font-weight: 500; }

.post-list { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-lift); overflow: hidden; }
.post-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  color: var(--text);
  position: relative;
  transition: background var(--fast) var(--ease);
}
.post-row + .post-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 78px;
  right: 0;
  border-top: 0.5px solid var(--separator);
}
.post-row:hover { background: var(--fill); text-decoration: none; }
.post-row.needs-me { background: var(--accent-soft); }
.post-row.needs-me:hover { background: var(--accent-soft-strong); }

.thumb {
  width: 48px;
  height: 48px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--fill);
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 22px; height: 22px; }

.post-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.post-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-title.untitled { color: var(--text-3); font-weight: 500; font-style: italic; }
.post-time { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-excerpt {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}
.post-meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.post-meta .nets { display: inline-flex; gap: 3px; }
.post-meta .net { width: 16px; height: 16px; border-radius: 4px; font-size: 10px; }
.post-meta .net-facebook { font-size: 11.5px; }
.post-meta .who { font-size: 12.5px; color: var(--text-3); }

.empty {
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.empty-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.empty p { color: var(--text-2); max-width: 420px; margin: 0 auto 18px; }

.skeleton { display: grid; gap: 1px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-lift); }
.skeleton div {
  height: 74px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--fill) 50%, var(--surface) 100%) var(--surface);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton div { animation: none; } }

/* ---------- composer ---------- */

.composer { display: grid; gap: 22px; align-items: start; }
@media (min-width: 1100px) {
  .composer { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  .composer-side { position: sticky; top: 24px; }
}

.post-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.post-head-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }

.sheet-paper {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.paper-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--separator);
  flex-wrap: wrap;
}
.paper-bar .grow { flex: 1; }
.paper-label { font-size: 12.5px; color: var(--text-3); font-weight: 560; margin-right: 2px; }

.post-text {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 20px 22px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 17px/1.6 var(--font-ui);
  letter-spacing: -0.008em;
  resize: none;
  overflow: hidden;
}
.post-text::placeholder { color: var(--text-3); }
.post-text:focus { box-shadow: none; }
.post-text[readonly] { color: var(--text); cursor: default; }

.meter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 16px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.meter { flex: 1; height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; max-width: 220px; }
.meter > span { display: block; height: 100%; background: var(--text-3); border-radius: 2px; transition: width var(--medium) var(--ease), background var(--fast); }
.meter-row.warn { color: var(--amber); }
.meter-row.warn .meter > span { background: var(--amber); }
.meter-row.over { color: var(--red); font-weight: 600; }
.meter-row.over .meter > span { background: var(--red); }
.meter-row .save-state { margin-left: auto; }

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  padding: 16px;
  border-top: 0.5px solid var(--separator);
}
.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--fill);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .photo-index {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  line-height: 20px;
  text-align: center;
}
.photo .alt-flag {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.photo.dragging { opacity: 0.35; }
.photo.drop-target { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo.pending img { opacity: 0.55; }
.photo.pending .progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.photo.pending .progress > span { display: block; height: 100%; background: #fff; transition: width var(--fast) linear; }
.photo.failed { outline: 1.5px solid var(--red); }
.photo.failed .photo-error {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
}
.photo.deleted { cursor: default; background: repeating-linear-gradient(135deg, var(--fill), var(--fill) 7px, transparent 7px, transparent 14px); }

.photo-add {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--separator-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.photo-add svg { width: 22px; height: 22px; }
.photo-add:hover, .photos.drag-over .photo-add { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.photos.drag-over { background: var(--accent-soft); }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.45;
  background: var(--fill);
  color: var(--text);
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.notice ul { margin: 0; padding-left: 18px; }
.notice.info { background: var(--accent-soft); }
.notice.info svg { color: var(--accent); }
.notice.ok { background: var(--green-soft); }
.notice.ok svg { color: var(--green); }
.notice.warn { background: var(--amber-soft); }
.notice.warn svg { color: var(--amber); }
.notice.error { background: var(--red-soft); }
.notice.error svg { color: var(--red); }
.notices { display: grid; gap: 8px; margin-bottom: 14px; }
.notices:empty { display: none; }

/* Where the post is in its journey. */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 18px; }
.flow-step { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.flow-bar { height: 4px; border-radius: 2px; background: var(--fill-strong); }
.flow-step.done .flow-bar { background: var(--green); }
.flow-step.current .flow-bar { background: var(--accent); }
.flow-step.problem .flow-bar { background: var(--red); }
.flow-name { font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-step.done .flow-name, .flow-step.current .flow-name { color: var(--text); }

.action-panel { padding: 18px; }
.action-main { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-why { margin-top: 12px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.countdown { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

@media (max-width: 899px) {
  .actionbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 25;
    display: flex;
    gap: 8px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--chrome);
    -webkit-backdrop-filter: saturate(1.8) blur(20px);
    backdrop-filter: saturate(1.8) blur(20px);
    border-top: 0.5px solid var(--separator);
  }
  .actionbar .btn { flex: 1; min-height: 44px; }
  .actionbar .btn-icon { flex: none; width: 44px; background: var(--fill); }
}
@media (min-width: 900px) {
  .actionbar { display: none; }
}

/* ---------- preview ---------- */

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.preview-note { margin-top: 10px; font-size: 12px; color: var(--text-3); text-align: center; }

.pv {
  background: #ffffff;
  color: #1c1e21;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(30, 25, 10, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Armenian", Helvetica, Arial, sans-serif;
  font-size: 15px;
}
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 6px; }
.pv-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1d3557; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.pv-linkedin .pv-avatar { border-radius: 4px; background: #0b66c2; }
.pv-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.pv-sub { color: #65676b; font-size: 12.5px; }
.pv-text { padding: 4px 14px 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.pv-more { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: #65676b; cursor: pointer; }
.pv-linkedin .pv-more { color: #666; font-weight: 500; }
.pv-grid { display: grid; gap: 2px; }
.pv-cell { position: relative; overflow: hidden; background: #e4e6eb; }
.pv-cell img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.pv-grid-1 .pv-cell img { aspect-ratio: auto; max-height: 460px; object-fit: contain; background: #f0f2f5; }
.pv-grid-2, .pv-grid-4 { grid-template-columns: 1fr 1fr; }
.pv-grid-3 { grid-template-columns: 1fr 1fr; }
.pv-grid-3 .pv-cell:first-child { grid-column: 1 / -1; }
.pv-grid-3 .pv-cell:first-child img { aspect-ratio: 2 / 1; }
.pv-grid-5 { grid-template-columns: repeat(6, 1fr); }
.pv-grid-5 .pv-cell:nth-child(-n + 2) { grid-column: span 3; }
.pv-grid-5 .pv-cell:nth-child(n + 3) { grid-column: span 2; }
.pv-plus { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.42); color: #fff; font-size: 26px; font-weight: 700; }
.pv-stats { display: flex; justify-content: space-between; padding: 8px 14px; color: #65676b; font-size: 12.5px; }
.pv-foot { display: flex; justify-content: space-around; border-top: 1px solid #e4e6eb; margin: 0 10px; padding: 6px 0 8px; color: #65676b; font-size: 13.5px; font-weight: 600; }
.pv-empty { padding: 28px 16px 30px; text-align: center; color: #8a8d91; font-size: 14px; }

/* ---------- deliveries and history ---------- */

.deliveries { display: grid; gap: 10px; }
.delivery { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.delivery .net { width: 26px; height: 26px; border-radius: 7px; font-size: 14px; }
.delivery .net-facebook { font-size: 17px; }
.delivery-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; }
.delivery-body { font-size: 13.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.delivery-body .error { color: var(--red); }

details.disclosure { margin-top: 8px; }
details.disclosure summary { cursor: pointer; font-size: 13px; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary svg { width: 14px; height: 14px; transition: transform var(--fast) var(--ease); }
details.disclosure[open] summary svg { transform: rotate(90deg); }
.code {
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-2);
}

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding-bottom: 14px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--separator-strong); margin-top: 7px; margin-left: 2px; }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 2px; width: 1px; background: var(--separator); }
.timeline li:last-child::after { display: none; }
.timeline li.key::before { background: var(--accent); }
.timeline li.good::before { background: var(--green); }
.timeline li.bad::before { background: var(--red); }
.timeline time { display: block; font-size: 12px; color: var(--text-3); }
.timeline q { color: var(--text-2); }

/* ---------- sheets (dialogs) ---------- */

dialog.sheet {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-float);
  overflow: auto;
}
dialog.sheet::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
dialog.sheet[open] { animation: sheet-in var(--medium) var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@media (max-width: 599px) {
  dialog.sheet {
    margin: auto 0 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}
.sheet-head { padding: 22px 22px 6px; }
.sheet-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-text { margin-top: 8px; color: var(--text-2); font-size: 15px; line-height: 1.5; white-space: pre-line; }
.sheet-body { padding: 14px 22px 4px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; flex-wrap: wrap; }
@media (max-width: 599px) {
  .sheet-actions { flex-direction: column-reverse; }
  .sheet-actions .btn { width: 100%; min-height: 46px; }
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 0.5px solid var(--separator-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.option + .option { margin-top: 8px; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input[type="radio"] { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.option-title { font-weight: 600; font-size: 15px; }
.option-text { font-size: 13.5px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.option .input { margin-top: 10px; }

.photo-large { border-radius: var(--r-md); overflow: hidden; background: var(--fill); margin-bottom: 14px; }
.photo-large img { width: 100%; max-height: 46vh; object-fit: contain; }

/* ---------- menus ---------- */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  padding: 6px;
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-float);
  animation: sheet-in var(--fast) var(--ease);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--fill); box-shadow: none; }
.menu button svg { width: 17px; height: 17px; color: var(--text-2); }
.menu button.danger { color: var(--red); }
.menu button.danger svg { color: var(--red); }
.menu hr { border: 0; border-top: 0.5px solid var(--separator); margin: 5px 6px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 12px 11px 18px;
  border-radius: var(--r-pill);
  background: #1e1d1a;
  color: #f5f2ec;
  font-size: 14.5px;
  box-shadow: var(--shadow-float);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--medium) var(--ease), opacity var(--medium) var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.error { background: var(--red); color: #fff; }
.toast .btn { min-height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.16); color: inherit; font-size: 13.5px; }
.toast:not(:has(.btn)) { padding-right: 18px; }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + var(--sidebar) / 2); } }
:root[data-theme="dark"] .toast:not(.error) { background: #f2efe8; color: #1c1b18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast:not(.error) { background: #f2efe8; color: #1c1b18; } }
:root[data-theme="dark"] .toast:not(.error) .btn { background: rgba(0, 0, 0, 0.08); }

/* ---------- auth screens ---------- */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px var(--gutter) 48px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-weight: 650; color: var(--text); }
.auth-brand img { width: 32px; height: 32px; border-radius: 8px; }
.auth-brand:hover { text-decoration: none; }
.auth-title { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 8px; }
.auth-sub { color: var(--text-2); margin-bottom: 26px; font-size: 15.5px; }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.form-error { color: var(--red); font-size: 14px; margin: -4px 0 14px; }
.form-error:empty { display: none; }

.steps { counter-reset: step; display: grid; gap: 22px; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft-strong);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.step-title { font-weight: 650; margin-bottom: 4px; }
.step-text { color: var(--text-2); font-size: 14.5px; margin-bottom: 12px; }
.qr-setup {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
}
.qr-setup .step-text { margin-bottom: 10px; }
/* Always black on white, in dark mode too: many scanners can't read inverted codes. */
.qr-frame {
  background: #fff;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 0.5px var(--separator);
  overflow: hidden;
}
svg.qr { display: block; width: 100%; height: auto; }
@media (max-width: 420px) {
  .qr-setup { grid-template-columns: 1fr; justify-items: start; }
  .qr-frame { width: 168px; }
}
.secret-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--fill);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  word-break: break-all;
}

/* ---------- tables, meters, misc ---------- */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px 10px; white-space: nowrap; }
.table td { padding: 10px; border-top: 0.5px solid var(--separator); vertical-align: top; }
.table.wide { min-width: 820px; }
.table .detail { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); max-width: 360px; overflow-wrap: anywhere; }

.quota { display: grid; gap: 14px; }
.quota-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.quota-label { font-size: 14.5px; font-weight: 500; }
.quota-value { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.quota-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.quota-bar.warn > span { background: var(--amber); }
.quota-bar.over > span { background: var(--red); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--fill);
  font-family: var(--font-mono);
  font-size: 12.5px;
  word-break: break-all;
}

.two { display: grid; gap: 18px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } }

.spacer { flex: 1; }
.mt { margin-top: 14px; }

/* ---------- responsive helpers ---------- */

.grow { flex: 1; min-width: 0; }
.desktop-only { display: none !important; }
@media (min-width: 900px) { .desktop-only { display: inline-flex !important; } }
@media (min-width: 1100px) { .only-narrow { display: none !important; } }

/* On narrower screens the composer shows writing or the preview, not both. */
@media (max-width: 1099px) {
  .composer[data-view="preview"] .composer-main { display: none; }
  .composer[data-view="write"] .composer-side { display: none; }
}

.settings-hub { max-width: 680px; }
#app .group { max-width: 760px; }
/* Focus moves to the content region after navigation for screen readers;
   it shouldn't draw a ring around the whole page. */
#app:focus, #app:focus-visible { box-shadow: none; }

/* ---------- introduction: tour, welcome, getting started ---------- */

.tour { position: fixed; inset: 0; z-index: 100; opacity: 0; transition: opacity var(--medium) var(--ease); }
.tour.open { opacity: 1; }
.tour.leaving { opacity: 0; pointer-events: none; }
.tour-blocker { position: absolute; inset: 0; }
/* The spotlight is a hole: a rounded box whose giant shadow is the dimming. */
.tour-hole {
  position: absolute;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 200vmax var(--tour-scrim), 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  transition: left 380ms var(--ease), top 380ms var(--ease), width 380ms var(--ease), height 380ms var(--ease), border-radius 380ms var(--ease);
}
/* With nothing to point at, the blocker does the dimming instead. */
.tour-blocker { transition: background-color 380ms var(--ease); }
.tour.no-target .tour-blocker { background: var(--tour-scrim); }
.tour.no-target .tour-hole { opacity: 0; }
.tour-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(340px, calc(100vw - 24px));
  padding: 18px 18px 14px;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity var(--medium) var(--ease), transform var(--medium) var(--ease), left 380ms var(--ease), top 380ms var(--ease);
}
.tour-card.in { opacity: 1; transform: none; }
@media (max-width: 599px) { .tour-card { width: calc(100vw - 24px); } }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }
.tour-progress, .welcome-dots { display: flex; gap: 5px; }
.tour-progress { margin-bottom: 12px; }
.tour-progress span, .welcome-dots span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--fill-strong);
  transition: width var(--medium) var(--ease), background-color var(--medium) var(--ease);
}
.tour-progress span.done { background: var(--accent-soft-strong); }
.tour-progress span.on, .welcome-dots span.on { width: 18px; background: var(--accent); }
.tour-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; }
.tour-text { font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.tour-actions { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.tour-skip { color: var(--text-2); margin-left: -8px; }

dialog.welcome-sheet { overflow: hidden; }
@media (min-width: 600px) { dialog.welcome-sheet { width: min(480px, calc(100vw - 24px)); } }
.welcome-stage { display: grid; padding: 24px 24px 0; overflow: hidden; }
.welcome-page { grid-area: 1 / 1; }
.welcome-page:not(.active) { visibility: hidden; }
.welcome-page.from-right { animation: page-from-right var(--medium) var(--ease); }
.welcome-page.from-left { animation: page-from-left var(--medium) var(--ease); }
@keyframes page-from-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes page-from-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.welcome-art {
  height: 196px;
  margin-bottom: 22px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.welcome-title { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.welcome-text { margin-top: 10px; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.welcome-dots { justify-content: center; padding: 18px 0 0; }
.welcome-actions { align-items: center; padding-top: 12px; }
@media (max-width: 599px) {
  .welcome-stage { padding: 20px 20px 0; }
  .welcome-art { height: 184px; }
  .wa { padding: 14px; }
  .wa-stack { gap: 8px; }
  .wa-row { padding: 8px 12px; }
  .welcome-title { font-size: 23px; }
}

/* Welcome illustrations, drawn from the app's own pieces. */
.wa { width: 100%; padding: 18px; display: grid; place-items: center; gap: 14px; }
.wa-steps { display: flex; align-items: flex-start; }
.wa-step { display: grid; justify-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-3); animation: wa-text 600ms var(--ease) both; }
.wa-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  color: var(--text-3);
  animation: wa-dot 600ms var(--ease) both;
}
.wa-dot svg { width: 20px; height: 20px; }
.wa-line { width: 26px; height: 2px; margin: 20px 3px 0; border-radius: 1px; background: var(--separator-strong); animation: wa-line 600ms var(--ease) both; transform-origin: left; }
.wa-d0, .wa-d0 .wa-dot { animation-delay: 150ms; }
.wa-d1, .wa-d1 .wa-dot { animation-delay: 550ms; }
.wa-d2, .wa-d2 .wa-dot { animation-delay: 950ms; }
.wa-d3, .wa-d3 .wa-dot { animation-delay: 1350ms; }
.wa-line.wa-d1 { animation-delay: 400ms; }
.wa-line.wa-d2 { animation-delay: 800ms; }
.wa-line.wa-d3 { animation-delay: 1200ms; }
@keyframes wa-dot { from { background: var(--surface); color: var(--text-3); transform: scale(0.9); } to { background: var(--accent); color: var(--accent-ink); transform: none; } }
@keyframes wa-text { from { color: var(--text-3); } to { color: var(--text); } }
@keyframes wa-line { from { background: var(--separator-strong); } to { background: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .wa-step, .wa-dot, .wa-line { animation-duration: 1ms; animation-delay: 0ms !important; } }
.wa-nets { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.wa-sep { width: 1px; height: 14px; background: var(--separator-strong); margin: 0 6px; }
.wa-card, .wa-stack { width: min(320px, 100%); }
.wa-stack { display: grid; gap: 10px; place-items: stretch; }
.wa-post { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-lift); }
.wa-thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.wa-lines { display: grid; gap: 7px; flex: 1; min-width: 0; }
.wa-bar { height: 7px; border-radius: 4px; background: var(--fill-strong); }
.wa-bar.w80 { width: 80%; }
.wa-bar.w55 { width: 55%; }
.wa-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.wa-meta .status { margin-right: 4px; }
.wa-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.wa-nav .count-badge { margin-left: auto; }
.wa-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-lift); font-size: 14px; font-weight: 500; }
.wa-row-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.wa-row-icon.red { background: var(--red); color: #fff; }
.wa-row-icon svg { width: 16px; height: 16px; }
.wa-row-detail { margin-left: auto; color: var(--text-3); }
.wa-switch { margin-left: auto; width: 36px; height: 21px; border-radius: 11px; background: var(--fill-strong); position: relative; }
.wa-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.wa-switch.on { background: var(--green); }
.wa-switch.on::after { left: 17px; }
.wa-list { place-items: stretch; gap: 12px; padding: 18px 22px; }
.wa-item { display: flex; gap: 12px; align-items: center; }
.wa-item-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-lift); color: var(--accent); flex: none; }
.wa-item-icon svg { width: 17px; height: 17px; }
.wa-item-title { font-size: 14px; font-weight: 600; }
.wa-item-text { font-size: 12.5px; color: var(--text-2); }

/* Getting started */
.checklist-host:empty { display: none; }
.checklist-host { transition: opacity var(--medium) var(--ease); }
.checklist-host.leaving { opacity: 0; }
.getting-started { margin-bottom: 20px; padding: 16px 16px 8px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lift); }
.gs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 8px; }
.gs-heading { font-size: 16px; font-weight: 650; }
.gs-sub { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.gs-progress { height: 4px; margin: 12px 8px 6px; border-radius: 2px; background: var(--fill-strong); overflow: hidden; }
.gs-progress span { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 500ms var(--ease); }
.getting-started:has(.gs-list) { padding-bottom: 6px; }
.getting-started:not(:has(.gs-list)) .gs-progress { margin-bottom: 10px; }
.gs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 10px; }
.gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.gs-item:hover { background: var(--fill); }
.gs-item.done { cursor: default; }
.gs-item.done:hover { background: none; }
.gs-item > svg:last-child { width: 16px; height: 16px; color: var(--text-3); }
.gs-check { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--separator-strong); border-radius: 50%; }
.gs-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.gs-check svg { width: 14px; height: 14px; stroke-width: 2.4; }
.gs-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.gs-title { font-size: 14.5px; font-weight: 600; }
.gs-text { font-size: 12.5px; color: var(--text-2); }
.gs-item.done .gs-title { color: var(--text-3); font-weight: 500; }
.gs-item.done .gs-text { display: none; }

.install-steps { display: grid; gap: 9px; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.install-steps li::marker { color: var(--text-3); font-weight: 600; }
.install-desktop { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
@media (max-width: 420px) {
  .install-desktop { grid-template-columns: 1fr; }
  .install-desktop .qr-frame { width: 168px; }
}

/* Password-only setup: one step, no number. */
.steps.single .step { grid-template-columns: 1fr; }
.steps.single .step::before { display: none; }

/* Demo server: sample accounts on the sign-in page. */
.demo-accounts { margin-bottom: 22px; }
.demo-title { font-size: 15px; font-weight: 650; }
.demo-sub { margin-top: 4px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.demo-list { margin-top: 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lift); overflow: hidden; }
.demo-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.demo-account + .demo-account { border-top: 0.5px solid var(--separator); }
.demo-account:hover { background: var(--fill); }
.demo-account[aria-busy="true"] { opacity: 0.6; }
.demo-account .avatar { width: 38px; height: 38px; font-size: 14px; }
.demo-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.demo-name { font-weight: 600; font-size: 15.5px; }
.demo-role { font-size: 13px; color: var(--text-2); }
.demo-account > svg:last-child { width: 16px; height: 16px; color: var(--text-3); }
.demo-own { margin-top: 4px; }
.demo-own form { margin-top: 14px; }

.form-error.prompt { color: var(--text-2); }
