/* ================================================================
   Kindwall — app pages (public wall + owner dashboard)
   Reuses design tokens + note-card/chip/avatar/button styles from
   styles.css (linked first). Only app-specific layout lives here.
   ================================================================ */

.app-main {
  flex: 1 0 auto;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* --- Generic app header actions --- */
.app-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* --- Wall header (owner identity) --- */
.wall-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.wall-head__avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  overflow: hidden;
  flex: 0 0 auto;
}

.wall-head__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wall-head__name {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
}

.wall-head__handle {
  color: var(--color-ink-soft);
  font-weight: 600;
}

.wall-head__headline {
  color: var(--color-ink-soft);
  margin-top: 0.25rem;
}

/* Avatars may hold an <img> — make it fill the round frame everywhere. */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Wall content column (per spec: max 720px, generous whitespace) */
.app-main .container { max-width: 46rem; }

.wall-head__meta {
  color: var(--color-ink-soft);
  margin-top: 0.4rem;
  font-size: 0.92rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.wall-head__dot { opacity: 0.6; }

/* Larger owner avatar (88px) with cream ring */
.wall-head__avatar {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 1.5rem;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-line);
}

/* Private / locked card */
.wall-locked {
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 1.5rem;
}
.wall-locked__glyph { font-size: 1.6rem; display: block; margin-bottom: 0.5rem; }
.wall-locked__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* --- Notes grid: Pinterest-style masonry ---
   CSS multi-column flow so cards keep their natural height and stagger
   down each column (rather than aligning into rigid rows). Columns are
   added automatically as width allows. */
.notes-grid {
  column-width: 15rem;
  column-gap: 1.25rem;
}
.notes-grid .note-card {
  width: 100%;
  margin: 0 0 1.25rem;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.kw-note .note-card__text {
  font-size: 1.3rem;
}
/* Wall anatomy: text on top, author row beneath it. */
.notes-grid .note-card__text { margin-bottom: 0; }
.notes-grid .note-card__head { margin-top: 1rem; }

/* Moderation actions row inside a note card */
.kw-note__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-line);
}

.kw-note__actions .btn {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.btn--danger {
  background: #fbe9e7;
  color: #8a2b1a;
  border: 1px solid #f0c3ba;
}
.btn--danger:hover {
  border-color: #d9654f;
}

/* Status pill on dashboard note cards */
.kw-note__status {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kw-note__status--pending {
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
}
.kw-note__status--published {
  background: #e9f2ec;
  color: var(--color-verified);
}
.kw-note__status--hidden {
  background: #efeae3;
  color: var(--color-ink-soft);
}

/* --- Cards / panels --- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.panel__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.panel__hint {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* --- Forms --- */
.field {
  display: block;
  margin-bottom: 1rem;
}
.field__label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--color-ink);
  padding: 0.7rem 0.9rem;
}
.textarea {
  min-height: 7rem;
  resize: vertical;
  font-family: var(--font-note);
  font-size: 1.35rem;
  line-height: 1.35;
}
.input-group {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.input-group__prefix {
  align-self: center;
  padding-left: 0.9rem;
  color: var(--color-ink-soft);
  font-weight: 600;
  white-space: nowrap;
}
.input-group .input {
  border: 0;
  border-radius: 0;
}

.form-msg {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.form-msg--ok {
  color: var(--color-verified);
}
.form-msg--err {
  color: #8a2b1a;
}
.char-count {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin-top: 0.35rem;
}

/* --- Empty / status states --- */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-ink-soft);
}
.empty__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: 0.5rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-soft);
  margin: 2rem 0 0.9rem;
}

.loading {
  text-align: center;
  color: var(--color-ink-soft);
  padding: 3rem 1rem;
}

.stack {
  display: grid;
  gap: 1.25rem;
}

.muted {
  color: var(--color-ink-soft);
}

.center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* --- Auth (email/password + LinkedIn) --- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--color-ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-line);
}

.auth-toggle {
  margin-top: 1rem;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--color-accent-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.linklike:hover {
  opacity: 0.8;
}

/* --- Narrow container for auth / write pages --- */
.container--narrow {
  max-width: 34rem;
}

/* --- Themes: swap CSS variables only (chip stays identical, AA contrast) --- */
[data-theme="slate"] {
  --color-bg: #eef1f4;
  --color-ink: #23272e;
  --color-ink-soft: #565f6b;
  --color-surface: #ffffff;
  --color-line: #dbe1e8;
}
[data-theme="sage"] {
  --color-bg: #eef2ec;
  --color-ink: #26302a;
  --color-ink-soft: #55625a;
  --color-surface: #ffffff;
  --color-line: #d9e2d8;
}

/* --- Verified "in ✓" mark on the owner name --- */
.verified-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e9f2ec;
  border: 1px solid #bcd8c8;
  color: var(--color-verified);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}
.verified-mark .chip__in {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  background: var(--color-verified);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.private-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.wall-cta {
  margin-bottom: 1.5rem;
}

/* --- Email-only "connect LinkedIn" banner --- */
.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  background: var(--color-accent-soft);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

/* --- Dashboard note tabs --- */
.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.tab {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  cursor: pointer;
}
.tab.is-active {
  background: var(--color-ink);
  color: #fff;
  border-color: var(--color-ink);
}

/* --- Theme swatches --- */
.theme-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid var(--color-line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}
.theme-swatch::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.theme-swatch--cream::before { background: #faf7f2; }
.theme-swatch--slate::before { background: #eef1f4; }
.theme-swatch--sage::before { background: #eef2ec; }
.theme-swatch.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* --- Note card: timestamp, stable tilt, fade-up stagger --- */
.note-card__time {
  display: block;
  text-align: right;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-ink) 40%, transparent);
}
.note-card--tilt {
  transform: rotate(var(--tilt, 0deg));
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}
.note-card--tilt:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 14px 32px rgba(43, 38, 34, 0.14);
}
.notes-grid .note-card {
  animation: kw-fade-up 0.4s ease-out both;
  animation-delay: var(--stagger, 0ms);
}
@keyframes kw-fade-up {
  from { opacity: 0; transform: translateY(10px) rotate(var(--tilt, 0deg)); }
  to { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
}

/* --- Owner sticky bar --- */
.owner-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-top: 1px solid var(--color-line);
  z-index: 40;
}
.owner-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  gap: 1rem;
}
.vis-pill {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.vis-pill--public { background: var(--color-accent-soft); color: var(--color-accent-ink); }
.vis-pill--private { background: #e6e9ee; color: #3c4657; }

/* --- Modal composer --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--color-bg) 70%, rgba(20, 16, 12, 0.55));
  animation: kw-fade 0.2s ease-out;
}
@keyframes kw-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%;
  max-width: 34rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(43, 38, 34, 0.24);
  padding: 1.75rem;
}
.modal__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.modal__helper { margin-top: 0.6rem; margin-bottom: 0; }
.modal__close {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2rem; height: 2rem;
  padding: 0;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  background: var(--color-bg);
  color: var(--color-ink-soft);
  border: 1px solid var(--color-line);
}
.modal__close:hover { background: var(--color-line); color: var(--color-ink); }
.btn--block { width: 100%; justify-content: center; }

/* --- Toast --- */
.toast-host {
  position: fixed;
  left: 0; right: 0; bottom: 1.25rem;
  display: grid;
  place-items: center;
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: var(--color-surface);
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-in { opacity: 1; transform: translateY(0); }

/* ================================================================
   Dashboard — left rail + content
   ================================================================ */
.dash {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .dash { grid-template-columns: 15rem 1fr; align-items: start; }
  .app-main .container { max-width: 62rem; }
}

.dash-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
@media (min-width: 860px) {
  .dash-rail {
    position: sticky;
    top: 1.5rem;
    flex-direction: column;
    gap: 0.2rem;
  }
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--color-ink-soft);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.rail-item:hover { background: var(--color-surface); color: var(--color-ink); }
.rail-item.is-active { background: var(--color-ink); color: #fff; }
.rail-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #3a2a10;
  font-size: 0.72rem;
  font-weight: 800;
}
.rail-item.is-active .rail-badge { background: var(--color-accent); color: #3a2a10; }

.rail-chip {
  display: none;
}
@media (min-width: 860px) {
  .rail-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-line);
  }
}
.rail-chip__ava { width: 2.25rem; height: 2.25rem; font-size: 0.8rem; }
.rail-chip__name { font-weight: 700; font-size: 0.9rem; }
.rail-chip__out { font-size: 0.8rem; color: var(--color-accent-ink); text-decoration: none; }
.rail-chip__out:hover { text-decoration: underline; }

.dash-head { margin-bottom: 1.25rem; }
.dash-head__title { font-size: 1.6rem; font-weight: 800; }
.dash-head__desc { margin-top: 0.3rem; max-width: 42rem; }

/* --- Note rows (moderation) --- */
.note-rows { display: grid; gap: 0.75rem; }
.note-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.15rem;
}
@media (min-width: 680px) {
  .note-row { grid-template-columns: 14rem 1fr auto; align-items: center; }
}
.note-row__who { display: flex; align-items: center; gap: 0.6rem; }
.note-row__name { font-weight: 700; }
.note-row__role { font-size: 0.85rem; }
.note-row__text {
  font-family: var(--font-note);
  font-size: 1.25rem;
  line-height: 1.3;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row__text.is-expanded { -webkit-line-clamp: unset; }
.note-row__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.note-row__actions .btn { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.note-row--glow {
  animation: kw-glow 0.5s ease-out;
  border-color: var(--color-accent);
}
@keyframes kw-glow {
  0% { box-shadow: 0 0 0 0 var(--color-accent-soft); }
  50% { box-shadow: 0 0 0 6px var(--color-accent-soft); }
  100% { box-shadow: var(--shadow-card); }
}
.btn--ghost-accent { color: var(--color-accent-ink); border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-line)); }
.pill-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.4rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #3a2a10;
  font-size: 0.68rem;
  font-weight: 800;
}
.tab { display: inline-flex; align-items: center; }

/* --- Share --- */
.share-card { max-width: 40rem; }
.share-url {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 0.75rem;
}
.share-quote {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}
.codeblock {
  background: #2b2622;
  color: #f4efe8;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.8rem;
  padding: 0.9rem 1rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 0.75rem;
}
.embed-preview {
  width: 100%;
  height: 360px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  background: var(--color-bg);
}
.qr-canvas {
  width: 240px;
  height: 240px;
  max-width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
  image-rendering: pixelated;
}
.share-notice {
  margin-top: 0.75rem;
  color: var(--color-accent-ink);
  font-size: 0.88rem;
  font-weight: 600;
}

/* --- Appearance: theme preview cards --- */
.theme-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .theme-grid { grid-template-columns: repeat(3, 1fr); } }
.theme-card {
  display: block;
  border: 2px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 0.75rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.theme-card.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.theme-card__label { display: block; margin-top: 0.6rem; font-weight: 700; }

/* Mini wall preview inside a theme card (uses that theme's tokens) */
.theme-preview {
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
}
.theme-preview[data-theme="cream"] { --color-bg: #faf7f2; --color-surface: #fff; --color-line: #e7e0d6; --color-ink: #2b2622; }
.theme-preview[data-theme="slate"] { --color-bg: #eef1f4; --color-surface: #fff; --color-line: #dbe1e8; --color-ink: #23272e; }
.theme-preview[data-theme="sage"] { --color-bg: #eef2ec; --color-surface: #fff; --color-line: #d9e2d8; --color-ink: #26302a; }
.tp-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.tp-ava { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e8a33d; display: inline-block; }
.tp-name { font-weight: 800; font-size: 0.8rem; color: var(--color-ink); }
.tp-chip {
  margin-left: 0.3rem; font-size: 0.6rem; font-weight: 800;
  background: #e9f2ec; color: #2e7d55; border: 1px solid #bcd8c8;
  border-radius: 999px; padding: 0.02rem 0.3rem;
}
.tp-note {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 0.6rem;
}
.tp-note__text { font-family: var(--font-note); font-size: 0.95rem; color: var(--color-ink); line-height: 1.2; }
.tp-note__chip {
  display: inline-block; margin-top: 0.35rem;
  font-size: 0.58rem; font-weight: 800;
  background: #e9f2ec; color: #2e7d55; border-radius: 999px; padding: 0.02rem 0.35rem;
}

/* --- Settings: switch, readonly, danger --- */
.input--readonly { background: var(--color-bg); color: var(--color-ink-soft); cursor: not-allowed; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.switch-row__label { font-weight: 700; }
.switch {
  position: relative;
  width: 3rem; height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  background: #d9d2c7;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}
.switch.is-on { background: var(--color-accent); }
.switch__dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.switch.is-on .switch__dot { transform: translateX(1.3rem); }
.danger { border-color: #f0c3ba; }
.danger .panel__title { color: #8a2b1a; }

/* ================================================================
   Inline management on the owner's wall — rail (desktop), floating
   Manage button + bottom sheet (mobile), pending & overflow.
   ================================================================ */

/* First-line context sentence under the identity block. */
.wall-context { margin: -1.25rem 0 1.75rem; font-size: 0.95rem; }

/* --- Desktop rail, docked to the left; content shifts right to make room --- */
.wall-rail { display: none; }
@media (min-width: 1200px) {
  .wall-rail {
    display: block;
    position: fixed;
    top: 6rem;
    left: 1.5rem;
    width: 15rem;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0.85rem;
    z-index: 30;
  }
  .wall-rail.is-collapsed { width: auto; }
  .wall-rail.is-collapsed .wall-rail__nav,
  .wall-rail.is-collapsed .wall-rail__title,
  .wall-rail.is-collapsed .vis-pill { display: none; }
  body.has-wall-rail .app-main { padding-left: 17rem; }
}
.wall-rail__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.wall-rail__title { font-weight: 800; margin-right: auto; }
.wall-rail__toggle {
  border: 0; background: none; cursor: pointer;
  font-size: 1rem; color: var(--color-ink-soft); line-height: 1;
  padding: 0.15rem 0.35rem; border-radius: 6px;
}
.wall-rail__toggle:hover { background: var(--color-bg); }
.wall-rail__nav { display: flex; flex-direction: column; gap: 0.15rem; }
.wall-rail .rail-item { width: 100%; }

/* --- Mobile floating Manage button + bottom sheet --- */
.manage-fab { display: none; }
@media (max-width: 1199.98px) {
  .manage-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    border: 0;
    background: var(--color-accent);
    color: #3a2a10;
    font: inherit;
    font-weight: 800;
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    box-shadow: var(--shadow-card-lift);
    cursor: pointer;
  }
}
.manage-fab__badge {
  display: inline-grid; place-items: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem;
  border-radius: 999px; background: var(--color-ink); color: #fff;
  font-size: 0.72rem; font-weight: 800;
}
.manage-sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(43, 38, 34, 0.35);
  display: flex; align-items: flex-end;
}
.manage-sheet {
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border-radius: 18px 18px 0 0;
  padding: 0.75rem 1rem 1.5rem;
  animation: kw-sheet-up 0.2s ease-out;
}
@keyframes kw-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.manage-sheet__grip { width: 2.5rem; height: 0.3rem; border-radius: 999px; background: var(--color-line); margin: 0.25rem auto 0.75rem; }
.manage-sheet__title { font-weight: 800; margin-bottom: 0.5rem; }
.manage-sheet__nav { display: flex; flex-direction: column; gap: 0.15rem; }
.sheet-item {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--color-ink); text-align: left;
  padding: 0.85rem 0.5rem; border-radius: var(--radius-sm); cursor: pointer;
}
.sheet-item:hover { background: var(--color-bg); }

/* Modal head shared by Share/Appearance/Settings */
.manage-head { margin-bottom: 0.5rem; }
.manage-head__title { font-size: 1.4rem; font-weight: 800; }

/* --- Pending notes inline at top of the owner's wall --- */
.pending-wrap { margin-bottom: 2rem; }
.pending-wrap__label {
  font-weight: 700; color: var(--color-accent-ink);
  margin-bottom: 0.75rem;
}
.note-card--pending {
  border: 1px dashed color-mix(in srgb, var(--color-accent) 55%, var(--color-line));
  background: color-mix(in srgb, var(--color-accent-soft) 30%, var(--color-surface));
  filter: saturate(0.85);
  margin-bottom: 0.9rem;
  transform: none !important;
}
.pending-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Approve: card fades to full color and slides into place. */
.note-card--joining { animation: kw-join 0.4s ease-out; }
@keyframes kw-join {
  from { opacity: 0.3; transform: translateY(-8px) scale(0.98); filter: saturate(0.7); }
  to { opacity: 1; transform: none; filter: none; }
}

/* --- Published card overflow menu (owner only) --- */
.note-card { position: relative; }
.note-menu { position: absolute; top: 0.6rem; right: 0.6rem; }
.note-menu__trigger {
  border: 0; background: none; cursor: pointer; line-height: 1;
  font-size: 1.2rem; color: var(--color-ink-soft);
  padding: 0.1rem 0.4rem; border-radius: 6px; opacity: 0;
  transition: opacity 0.12s ease;
}
.note-card:hover .note-menu__trigger,
.note-menu.is-open .note-menu__trigger { opacity: 1; }
.note-menu__trigger:hover { background: var(--color-bg); }
.note-menu__pop {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 0.3rem;
}
.note-menu.is-open .note-menu__pop { display: block; }

/* --- Hidden notes list (in Settings) --- */
.hidden-list { display: grid; gap: 0.6rem; }
.hidden-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--color-line);
  border-radius: var(--radius-sm); background: var(--color-bg);
}
.hidden-row__text { font-family: var(--font-note); font-size: 1.1rem; line-height: 1.25; grid-column: 1 / -1; }
.hidden-row__who { font-size: 0.85rem; }

/* Confirm dialog stacked over the Settings modal */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(43, 38, 34, 0.4);
  display: grid; place-items: center; padding: 1rem;
}
.confirm-card {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card-lift); padding: 1.5rem; max-width: 26rem;
  max-height: calc(100dvh - 2rem); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================
   Mobile-first cleanup for app pages (phones ≤ 640px)
   ================================================================ */
@media (max-width: 640px) {
  .app-main { padding-block: 1.75rem; }
  .app-main .container { padding-inline: 16px; }

  /* Owner identity block: smaller avatar + tighter spacing */
  .wall-head { gap: 0.85rem; margin-bottom: 1.4rem; }
  .wall-head__avatar {
    width: 4rem; height: 4rem; font-size: 1.2rem;
  }
  .wall-head__meta { font-size: 0.88rem; }
  .wall-context { margin: -0.75rem 0 1.4rem; }

  /* Notes: consistent with landing, tighter grid (single column on phones) */
  .kw-note .note-card__text { font-size: 1.2rem; }
  .notes-grid { column-width: auto; columns: 1; column-gap: 1rem; }
  .notes-grid .note-card { margin-bottom: 1rem; }
  .notes-grid .note-card__head { margin-top: 0.85rem; }

  /* Primary wall CTA spans the width so it's an easy tap target */
  .wall-cta .btn { width: 100%; justify-content: center; }
  .wall-cta { margin-bottom: 1.25rem; }

  /* Modal: use more of the screen, less chrome */
  .modal { padding: 1.35rem 1.2rem; border-radius: 18px; }
  .modal__title { font-size: 1.15rem; margin-bottom: 0.85rem; }
  .textarea { font-size: 1.2rem; min-height: 6rem; }

  /* Locked / private card: tighter, full-width action buttons */
  .wall-locked { padding: 2rem 1.25rem; }
  .wall-locked__actions { flex-direction: column; }
  .wall-locked__actions .btn { width: 100%; justify-content: center; }

  /* Panels + auth cards snug to the edges */
  .panel { padding: 1.25rem 1.15rem; }
  .container--narrow { padding-inline: 16px; }

  /* Bottom sheet items get comfortable 44px+ tap targets */
  .sheet-item { padding: 0.95rem 0.6rem; }

  /* Keep the Manage FAB clear of the bottom toast */
  .manage-fab { bottom: 1.1rem; right: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .note-card--tilt,
  .note-card--tilt:hover { transform: rotate(var(--tilt, 0deg)); transition: none; }
  .notes-grid .note-card { animation: none; }
  .modal-backdrop { animation: none; }
  .toast { transition: none; }
  .note-row--glow { animation: none; }
  .switch, .switch__dot { transition: none; }
  .note-card--joining { animation: none; }
  .manage-sheet { animation: none; }
}
