@font-face {
  font-family: "Phosphor";
  src: url("/fonts/Phosphor.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

.ph {
  font-family: "Phosphor" !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  letter-spacing: 0;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-variant-ligatures: discretionary-ligatures;
  font-variant-ligatures: discretionary-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  vertical-align: middle;
  font-size: 1.375rem;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: #f6f2ea;
  color: #1d1d1b;

  --color-bg: #f6f2ea;
  --color-surface: #fffdf8;
  --color-border: #d8d1c2;
  --color-border-subtle: #ece4d5;
  --color-text: #1d1d1b;
  --color-text-muted: #746e62;
  --color-text-dim: #9e9588;
  --color-primary: #1d1d1b;
  --color-accent: #1e8a5e;
  --color-success: #3a7d44;
  --color-danger: #c0392b;
  --color-window: #c89a20;
  --color-warm-btn: #f2ede2;
  --color-warm-btn-hover: #ebe2cf;
  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-full: 999px;
  --header-height: 3.25rem;
  --nav-height: 4rem;
  --max-width: 32rem;
}

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

html, body {
  height: 100%;
  margin: 0;
}

#app {
  height: 100%;
}

/* ── App shell ─────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-bg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.app-wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.app-content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Bottom navigation ─────────────────────────────── */

.app-nav {
  display: flex;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  flex-shrink: 0;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: var(--nav-height);
  border: none;
  background: none;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  gap: 0.2rem;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  transition: color 0.1s;
}

.nav-tab.active {
  color: var(--color-text);
  font-weight: 600;
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: var(--color-accent);
}

.nav-tab-icon {
  font-size: 1.375rem;
  line-height: 1;
}

/* ── Landing screen ────────────────────────────────── */

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 3rem 2rem 4rem;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.landing-wordmark {
  margin: 0 0 0.625rem;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-text);
}

.landing-tagline {
  margin: 0 0 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 22rem;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 20rem;
}

.landing-status {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  min-height: 1.5em;
}

.landing-recovery-link {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.landing-recovery-link:hover:not(:disabled) {
  color: var(--color-text);
}

.landing-recovery-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Buttons ───────────────────────────────────────── */

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-bg);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.1s;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--color-warm-btn-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.125rem;
  background: var(--color-warm-btn);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-warm-btn-hover);
}

.btn.active {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.875rem;
}

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

.btn-ghost:hover {
  background: var(--color-border-subtle);
  color: var(--color-text);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary-warm {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-bg);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.1s;
}

.btn-primary-warm:hover {
  opacity: 0.88;
}

.btn-primary-warm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
}

.btn-back:hover {
  color: var(--color-text);
}

/* ── View layout ───────────────────────────────────── */

.view {
  padding-bottom: 1.5rem;
}

.view-with-fab {
  position: relative;
  padding-bottom: 5rem;
}

/* ── Floating action button ────────────────────────── */

.fab {
  position: fixed;
  right: max(1.25rem, calc(50vw - var(--max-width) / 2 + 1.25rem));
  bottom: calc(var(--nav-height) + 1.25rem);
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: opacity 0.1s, transform 0.1s;
  z-index: 10;
}

.fab:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.fab .ph {
  font-size: 1.5rem;
}

.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.view-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.view-section:last-child {
  border-bottom: none;
}

.hood-view .view-section {
  border-bottom: none;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.section-label-spaced {
  margin-top: 1.25rem;
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-full);
  background: var(--color-border-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.section-hint {
  margin: -0.25rem 0 0.875rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.empty-hint {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* ── Status bar ────────────────────────────────────── */

.status-bar {
  margin: 0;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
}

/* ── Badge ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.2rem;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: 0.5rem;
  right: calc(50% - 1.5rem);
}

/* ── QR code section ───────────────────────────────── */

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.qr-image {
  display: block;
  width: min(18rem, 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
}

.qr-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

.qr-token {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  text-align: center;
  word-break: break-all;
  max-width: 20rem;
}

.qr-token code {
  font-family: ui-monospace, monospace;
}

/* ── Scan form ─────────────────────────────────────── */

.scan-form {
  display: flex;
  gap: 0.625rem;
}

.scan-form input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.875rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.9375rem;
  min-width: 0;
}

.scan-form input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ── Request cards ─────────────────────────────────── */

.request-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-bottom: 0.625rem;
}

.request-card:last-child {
  margin-bottom: 0;
}

.request-name {
  margin: 0 0 0.625rem;
  font-size: 0.9375rem;
}

.request-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.request-header .request-name {
  margin: 0;
}

.request-meta {
  margin: 0 0 0.625rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ── Contact list ──────────────────────────────────── */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--color-border-subtle);
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.contact-item--selectable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.contact-item--selected {
  position: relative;
}

.contact-item--selected::before {
  content: "";
  position: absolute;
  inset: 0.25rem -0.875rem;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.contact-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.contact-select-indicator {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.contact-select-indicator--checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.contact-select-indicator .ph {
  font-size: 1rem;
}

.contact-item--pending {
  opacity: 0.5;
}

.contact-pending-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-pending-indicator .ph {
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.contact-item:first-child {
  padding-top: 0.875rem;
  border-top: none;
}

.contact-item-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.contact-name-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.contact-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.btn-contact-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.btn-contact-menu:hover,
.btn-contact-menu:focus-visible {
  background: var(--color-border-subtle);
  color: var(--color-text);
  outline: none;
}

.btn-contact-menu .ph {
  font-size: 1.375rem;
}

.contact-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 20;
}

.contact-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--color-text);
  text-align: left;
}

.contact-menu-item:hover,
.contact-menu-item:focus-visible {
  background: var(--color-surface-hover, rgba(0,0,0,0.06));
}

.contact-menu-item--danger {
  color: var(--color-danger);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  opacity: 0.88;
}

.contact-name {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.nickname-nudge {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--color-text-dim);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.nickname-nudge:hover,
.nickname-nudge:focus-visible {
  color: var(--color-accent);
  outline: none;
}

.nickname-edit-row {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  margin-top: 0.125rem;
}

.nickname-edit-row .ph {
  font-size: 1rem;
}

.nickname-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.875rem;
}

.nickname-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.contact-meta {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.contact-hint {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* ── Contact detail view ───────────────────────────── */

.contact-detail-view {
  display: flex;
  flex-direction: column;
}

.contact-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1.25rem 1.5rem;
  position: relative;
}

.contact-detail-hero-nav {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
}

.contact-detail-hero-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
  text-align: center;
  padding: 0 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.contact-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.5rem 0 0;
}

.contact-detail-avatar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.contact-detail-avatar-ring {
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  display: inline-flex;
  line-height: 0;
}

.contact-detail-pending-badge {
  position: absolute;
  bottom: 1.25rem;
  right: calc(50% - 2.5rem);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.contact-detail-section {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.contact-detail-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-detail-input {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: 0.375rem 0;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.contact-detail-input:focus {
  border-bottom-color: var(--color-primary);
}

.contact-detail-hint {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  margin: 0;
}

.contact-detail-meta {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.contact-detail-meta-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.contact-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
}

.contact-detail-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-detail-remove-section {
  padding: 0 1.25rem 2rem;
  display: flex;
  justify-content: center;
}

.contact-detail-remove-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--color-danger);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.contact-detail-remove-btn:active {
  opacity: 0.7;
}

/* ── Interaction detail view ───────────────────────── */

.interaction-detail-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.interaction-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1.25rem 1.5rem;
  gap: 0.5rem;
  position: relative;
  flex-shrink: 0;
}

.interaction-detail-hero--window {
  background-color: color-mix(in srgb, var(--color-window) 18%, var(--color-surface));
  color: var(--color-window);
}

.interaction-detail-hero--event {
  background-color: color-mix(in srgb, var(--color-accent) 15%, var(--color-surface));
  color: var(--color-accent);
}

.interaction-detail-hero-nav {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
}

.interaction-detail-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.interaction-detail-back-btn:hover {
  opacity: 1;
}

.interaction-detail-back-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

.interaction-detail-hero-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-top: 0.25rem;
}

.interaction-detail-hero-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: inherit;
}

.interaction-detail-hero-you {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 0.875rem;
  font-weight: 600;
}

.interaction-detail-hero-meta {
  font-size: 0.875rem;
  opacity: 0.8;
}

.interaction-detail-hero-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, currentColor 12%, transparent);
  opacity: 0.9;
}

.interaction-detail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.interaction-detail-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.interaction-detail-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.interaction-detail-details {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.interaction-detail-place {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.interaction-detail-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 0 0 0.25rem;
}

.interaction-detail-section-label--going {
  color: var(--color-success);
}

.interaction-detail-empty-state {
  font-size: 0.875rem;
  color: var(--color-text-dim);
  margin: 0;
}

.interaction-detail-person-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.interaction-detail-person-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.interaction-detail-actions {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

/* ── Feed ──────────────────────────────────────────── */

.feed-compose-row {
  display: flex;
  gap: 0.625rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.compose-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}

.compose-pill:hover {
  background: var(--color-warm-btn-hover);
}

.compose-pill-icon {
  flex-shrink: 0;
  color: var(--color-accent);
}

.feed-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.feed-card:last-child {
  margin-bottom: 0;
}

.feed-card-author {
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 0.25rem;
}

.feed-card-body {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.feed-card-details {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.feed-card-place {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.feed-card-place .ph {
  font-size: 0.9375rem;
}

.feed-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}

.feed-card-responders {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.feed-card-rsvp {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.rsvp-going {
  color: var(--color-success);
}

.rsvp-not-going {
  color: var(--color-text-muted);
}

.rsvp-empty {
  color: var(--color-text-dim);
}

.responded-label {
  font-size: 0.875rem;
  color: var(--color-success);
  display: inline-flex;
  align-items: center;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── Now View (unified stream) ─────────────────────── */

.now-stream {
  padding: 1rem 1.25rem;
}

.feed-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 0 0 0.625rem;
}

.feed-section-divider {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: 1.75rem 0 1.25rem;
}

.now-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(60, 40, 10, 0.07), 0 0 0 1px rgba(60, 40, 10, 0.05);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.now-card:last-child {
  margin-bottom: 0;
}

.now-card--tappable {
  cursor: pointer;
  transition: background 0.1s;
}

.now-card--tappable:hover {
  background: color-mix(in srgb, var(--color-surface) 85%, var(--color-border));
}

.now-card--tappable:active {
  background: color-mix(in srgb, var(--color-surface) 75%, var(--color-border));
}

.now-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.now-card-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  min-width: 0;
}

.now-card-author-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.now-card-you {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.now-card-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.now-card-type-pill--window {
  background: color-mix(in srgb, var(--color-window) 18%, transparent);
  color: var(--color-window);
}

.now-card-type-pill--event {
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  color: var(--color-accent);
}

.now-card-expiry {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  flex-shrink: 0;
}

.now-card-status-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.now-card-body {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.now-card-details {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.now-card-place {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.now-card-place .ph {
  font-size: 0.9375rem;
}


.now-avatar-cluster {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.now-avatar-cluster > * + * {
  margin-left: -6px;
}

.now-avatar-cluster-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  margin-left: -6px;
  border: 2px solid var(--color-surface);
  flex-shrink: 0;
}

/* Avatar cluster wrapper (used in RSVP displays) */
.avatar-cluster {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.avatar-cluster > * + * {
  margin-left: -6px;
}

.avatar-cluster-label {
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* RSVP clusters row */
.now-rsvp-clusters {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.now-rsvp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  flex-wrap: nowrap;
}

.rsvp-going-label {
  color: var(--color-success);
  font-weight: 500;
  flex-shrink: 0;
  min-width: max-content;
}

.rsvp-maybe-label {
  color: var(--color-text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: max-content;
}

.now-respond-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.1s;
}

.now-respond-btn:hover {
  opacity: 0.9;
}

.now-respond-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.now-respond-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.now-responded-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.now-respond-btn--responded {
  font-size: 0.9375rem;
  color: var(--color-success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.now-responded-ok {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-success);
  font-weight: 600;
}

.now-responded-ok svg {
  width: 1rem;
  height: 1rem;
}

.now-undo-btn {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.now-rsvp-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}

.now-rsvp-btns {
  display: flex;
  gap: 0.5rem;
}

.now-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.now-rsvp-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-warm-btn);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.now-rsvp-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.now-rsvp-btn:hover {
  background: var(--color-warm-btn-hover);
}

.now-rsvp-btn--active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.now-rsvp-btn--active:hover {
  opacity: 0.88;
  background: var(--color-accent);
}

.now-rsvp-btn--going {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.now-rsvp-btn--going:hover {
  opacity: 0.9;
  background: var(--color-accent);
}

.now-extend-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}


.now-extend-btn {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-warm-btn);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.now-extend-btn:hover {
  background: var(--color-warm-btn-hover);
  color: var(--color-text);
}

.interaction-detail-actions .now-extend-btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.9375rem;
  flex: 1;
}

.interaction-detail-actions .now-cancel-btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.9375rem;
  width: 100%;
}

.now-actions-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.now-cancel-btn {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.now-cancel-btn:hover {
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 30%, transparent);
}

.now-dismiss-btn {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.now-dismiss-btn:hover {
  background: var(--color-border-subtle);
  color: var(--color-text-muted);
}

.now-card-responders {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.now-card-responder-count,
.now-rsvp-count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.now-card-empty-state {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  margin: 0.5rem 0;
}

/* ── Empty state ───────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.empty-state-body {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 22rem;
}

/* ── Compose view ──────────────────────────────────── */

.compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-bg);
  overflow-y: auto;
}

.compose-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.compose-type-toggle {
  display: flex;
  background: var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  margin: 1rem 1.25rem;
}

.compose-type-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  color: var(--color-text-muted);
}

.compose-type-btn.active {
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(29, 29, 27, 0.1);
  color: var(--color-text);
  font-weight: 600;
}

.compose-form {
  padding: 0 1.25rem 2rem;
  display: grid;
  gap: 0.875rem;
}

.compose-status {
  font-size: 0.875rem;
  color: var(--color-danger);
  margin-top: 0.25rem;
  text-align: center;
}

/* ── Audience hint ─────────────────────────────────── */

.compose-audience-hint {
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
}

.compose-audience-hood-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.compose-audience-targeted {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compose-audience-targeted-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-accent);
  cursor: pointer;
  transition: opacity 0.15s;
}

.compose-audience-targeted-toggle:hover {
  opacity: 0.75;
}

.compose-audience-targeted-toggle .ph {
  font-size: 1rem;
}

.compose-audience-expanded {
  list-style: none;
  padding: 0.625rem 0.75rem;
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.compose-audience-expanded-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

/* ── Form fields ───────────────────────────────────── */

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.start-time-picker {
  display: grid;
  gap: 0.35rem;
}

.start-time-picker label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.start-time-picker select,
.start-time-picker input[type="datetime-local"] {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
}

.start-time-picker select:focus,
.start-time-picker input[type="datetime-local"]:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.checkbox-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
}

/* ── Transparency indicator ────────────────────────── */

.transparency-indicator {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.transparency-indicator .ph {
  font-size: 1rem;
}

.rsvp-going .ph,
.rsvp-not-going .ph {
  font-size: 0.9375rem;
}

/* ── Nickname setup overlay ─────────────────────────── */

.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
}

.overlay-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.overlay-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.overlay-body {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.55;
}

.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.overlay-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.overlay-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.overlay-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.overlay-input:disabled {
  opacity: 0.55;
}

.overlay-error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-danger);
}

.onboarding-field-hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.nickname-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.nickname-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.pin-warning-card {
  text-align: center;
}

.pin-warning-icon {
  font-size: 3rem;
  margin: 0 0 0.75rem 0;
  display: flex;
  justify-content: center;
}

.pin-warning-icon svg {
  width: 3rem;
  height: 3rem;
  color: #ffc107;
}

.pin-warning-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 1rem 0;
}

.pin-warning-body {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.55;
}

.pin-warning-body:last-of-type {
  margin-bottom: 1.5rem;
}

.pin-success-card {
  text-align: center;
}

.pin-success-icon {
  font-size: 3rem;
  margin: 0 0 0.75rem 0;
  display: flex;
  justify-content: center;
}

.pin-success-icon svg {
  width: 3rem;
  height: 3rem;
  color: var(--color-accent);
}

.pin-success-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.75rem 0;
}

.pin-success-body {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.55;
}

/* Vault reset overlay */

.vault-reset-card {
  text-align: center;
}

.vault-reset-icon {
  font-size: 3rem;
  margin: 0 0 0.75rem 0;
  display: flex;
  justify-content: center;
}

.vault-reset-icon svg {
  width: 3rem;
  height: 3rem;
  color: var(--color-danger);
}

.vault-reset-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.75rem 0;
}

.vault-reset-warning {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-danger);
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.vault-reset-type-prompt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 1rem 0 0.5rem 0;
  text-align: left;
}

.vault-reset-done-card {
  text-align: center;
}

.vault-reset-done-icon {
  font-size: 3rem;
  margin: 0 0 0.75rem 0;
  display: flex;
  justify-content: center;
}

.vault-reset-done-icon svg {
  width: 3rem;
  height: 3rem;
  color: var(--color-accent);
}

.vault-reset-done-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.75rem 0;
}

/* PIN entry forgot-PIN link */

.pin-entry-forgot {
  margin-top: 1rem;
  text-align: center;
}

.pin-entry-forgot-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pin-entry-forgot-btn:hover {
  color: var(--color-text);
}

/* ── Scan confirmation sheet ──────────────────────── */

.scan-confirm-sheet {
  margin: 2rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scan-confirm-heading {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.scan-confirm-body {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.scan-confirm-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* ── Camera scanner ───────────────────────────────── */

.camera-scanner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  min-height: 100%;
  background: #000;
  color: #fff;
}

.camera-video-wrap {
  position: relative;
  width: 100%;
  max-width: 22rem;
}

.camera-video {
  width: 100%;
  border-radius: var(--radius-lg);
  background: #000;
  display: block;
}

.camera-canvas {
  display: none;
}

.camera-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(14rem, 70%);
  height: min(14rem, 70%);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.camera-hint {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  text-align: center;
}

.camera-cancel {
  margin-top: 0.25rem;
}

.camera-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  min-height: 100%;
  background: #000;
  padding: 2rem 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
}

.camera-error .ph {
  font-size: 2rem;
  color: var(--color-accent);
}

.camera-error p {
  margin: 0;
  max-width: 22rem;
  line-height: 1.5;
}

/* ── Scan camera button ───────────────────────────── */

.btn-scan-camera {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 500;
}

/* ── Backup Codes Display ─────────────────────────── */

.backup-codes-display {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.backup-codes-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.backup-codes-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.backup-codes-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: #856404;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.backup-codes-warning svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.backup-code-item {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  color: var(--color-text);
  letter-spacing: 0.05em;
}

.backup-codes-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.backup-codes-btn {
  flex: 1;
  min-width: 8rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.backup-codes-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.backup-codes-btn svg {
  width: 1rem;
  height: 1rem;
}

.backup-codes-confirmation {
  margin-bottom: 1.5rem;
}

.backup-codes-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text);
  cursor: pointer;
}

.backup-codes-checkbox input {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.backup-codes-proceed {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.backup-codes-proceed:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.backup-codes-proceed:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Recovery Flow ────────────────────────────────── */

.recovery-flow-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.recovery-flow-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 28rem;
  width: 90%;
  position: relative;
}

.recovery-flow-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.recovery-flow-close:hover {
  color: var(--color-text);
}

.recovery-flow-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

.recovery-flow-card h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.recovery-flow-description {
  margin: 0 0 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.recovery-flow-form {
  margin-bottom: 1rem;
}

.recovery-flow-input-group {
  margin-bottom: 1.5rem;
}

.recovery-flow-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.recovery-flow-input-group input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius-md);
  font-family: "Courier New", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

.recovery-flow-input-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.recovery-flow-input-group input.error {
  border-color: #dc3545;
}

.recovery-flow-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #dc3545;
}

.recovery-flow-submit {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.recovery-flow-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.recovery-flow-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.recovery-flow-cancel-link {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.recovery-flow-cancel-link:hover {
  color: var(--color-text);
}

/* ── User Menu ────────────────────────────────────── */

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-trigger:hover {
  background: var(--color-border-subtle);
}


.user-nickname-small {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  max-width: 8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 12rem;
  overflow: hidden;
}

.user-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.9375rem;
  color: var(--color-text);
  transition: background 0.2s;
}

.user-menu-item:hover {
  background: var(--color-bg);
}

.user-menu-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.user-menu-logout {
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-danger);
}

.user-menu-logout:hover {
  background: rgba(192, 57, 43, 0.06);
}

/* ── Settings View ────────────────────────────────── */

.settings-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--color-surface);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}

.settings-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
}

.settings-back-btn:hover {
  color: var(--color-text);
}

.settings-back-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

.settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  flex: 1;
}

.settings-header-spacer {
  width: 2.5rem; /* balance back button width */
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
}

.settings-item {
  padding: 1rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-item-label {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.settings-item-value {
  font-size: 0.9375rem;
  color: var(--color-text);
  font-weight: 500;
}

.settings-user-id {
  font-family: "Courier New", monospace;
  font-size: 0.8125rem;
  max-width: 15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-action-btn {
  width: 100%;
  padding: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}

.settings-action-btn:hover {
  background: #f8f8f8;
  border-color: #d0d0d0;
}

.settings-action-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.settings-action-danger {
  color: var(--color-danger, #dc3545);
  border-color: rgba(220, 53, 69, 0.3);
}

.settings-action-danger:hover {
  background: rgba(220, 53, 69, 0.05);
  border-color: rgba(220, 53, 69, 0.5);
}

.settings-warning {
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #856404;
  font-size: 0.9375rem;
  line-height: 1.5;
  align-items: flex-start;
}

.settings-warning svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.settings-privacy-text {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-nav-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.875rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-size: 1rem;
  transition: background 0.12s;
}

.settings-nav-row:hover {
  background: var(--color-warm-btn-hover);
}

.settings-nav-row > .ph:first-child {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.settings-nav-label {
  flex: 1;
}

.settings-nav-row > .ph:last-child {
  color: var(--color-text-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

.settings-locale-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.settings-locale-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-size: 1rem;
  transition: background 0.12s;
}

.settings-locale-row:hover {
  background: var(--color-warm-btn-hover);
}

.settings-locale-row--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.settings-locale-label {
  flex: 1;
}

.settings-confirm-card {
  background: #fff8f0;
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.settings-confirm-body {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.settings-confirm-error {
  font-size: 0.875rem;
  color: var(--color-danger, #dc3545);
  margin: 0 0 0.75rem 0;
}

.settings-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-vault-reset-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

/* ── Getting Started checklist ─────────────────────── */

.getting-started {
  padding: 2rem 1.25rem 1rem;
}

.getting-started-title {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.getting-started-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
}

.getting-started-row + .getting-started-row {
  border-top: 1px solid var(--color-border-subtle);
}

.getting-started-check {
  flex-shrink: 0;
  width: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.getting-started-check .ph {
  font-size: 1.25rem;
  color: var(--color-accent);
}

.getting-started-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-border-subtle);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.getting-started-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.getting-started-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.getting-started-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.getting-started-row.done .getting-started-label,
.getting-started-row.done .getting-started-hint {
  color: var(--color-text-dim);
}

.getting-started-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.getting-started-action:hover {
  background: var(--color-warm-btn-hover);
  border-color: var(--color-text-muted);
}

.getting-started-action .ph {
  font-size: 0.875rem;
}


/* ── Hood empty state ──────────────────────────────── */

.hood-empty-state {
  padding: 2rem 0 1rem;
  text-align: center;
}

.hood-empty-heading {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.hood-empty-body {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ── Selection action bar ──────────────────────────── */

.view-with-selection-bar {
  padding-bottom: 5rem;
}

.selection-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height) + 0.75rem);
  width: min(calc(var(--max-width) - 2.5rem), calc(100vw - 2.5rem));
  background: var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: flex;
  align-items: stretch;
}

.selection-bar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: opacity 0.1s;
}

.selection-bar-btn:hover {
  opacity: 0.9;
}

.selection-bar-btn .ph {
  font-size: 1.125rem;
}

/* ── Settings notification toggle ─────────────────── */

.settings-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0.75rem;
  line-height: 1.5;
}

.settings-notif-status {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--color-text-dim);
}

.settings-notif-status--granted {
  background: #4caf50;
}

.settings-notif-status--denied {
  background: var(--color-accent);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--color-border-subtle);
}

.settings-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.settings-toggle-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.settings-toggle-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.settings-toggle {
  flex-shrink: 0;
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-border);
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.settings-toggle::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.settings-toggle--on {
  background: var(--color-primary);
}

.settings-toggle--on::after {
  transform: translateX(1.25rem);
}

/* ── Groups ────────────────────────────────────────── */

.groups-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 5rem;
}

.groups-header {
  padding: 1.25rem 1.25rem 0.75rem;
}

.groups-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

.groups-loading,
.groups-empty {
  padding: 2rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.group-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.group-create-overlay-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.group-create-overlay-title {
  font-size: 1rem;
  font-weight: 600;
}

.group-create-overlay-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.groups-create-form-wrap {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.groups-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.groups-create-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.groups-create-input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 1rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
  box-sizing: border-box;
}

.groups-create-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.groups-create-status {
  font-size: 0.875rem;
  color: var(--color-danger);
  margin: 0;
}

.groups-create-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.groups-list {
  display: flex;
  flex-direction: column;
}

.groups-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  width: 100%;
  transition: background 0.1s;
}

.groups-list-item:hover,
.groups-list-item:active {
  background: var(--color-surface-raised);
}

.groups-list-item-name {
  font-size: 1rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.groups-list-item-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.groups-list-item-chevron {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ── Group detail ──────────────────────────────────── */

.group-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.group-detail-hero {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.group-detail-hero-nav {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
}

.group-detail-hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.group-detail-hero-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 18%, var(--color-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-accent);
}

.group-detail-hero-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  text-align: center;
}

.group-detail-owner-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 15%, var(--color-surface));
  border-radius: var(--radius-full);
  padding: 0.2rem 0.625rem;
}

.group-detail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.group-detail-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.group-detail-section-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 0.375rem;
}

.group-detail-member-count {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0;
}

.group-detail-meta {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
}

.group-detail-vault-hint {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  font-style: italic;
}

.btn-text-danger {
  background: none;
  border: none;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-danger);
  cursor: pointer;
}

.btn-text-danger:hover {
  text-decoration: underline;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  opacity: 0.88;
}

.group-delete-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
}

.group-delete-confirm-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-danger);
}

.group-delete-confirm-actions {
  display: flex;
  gap: 0.5rem;
}

.group-member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.group-member-row:last-child {
  border-bottom: none;
}

.group-member-name {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.group-member-owner-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
}

.group-member-crown {
  display: flex;
  align-items: center;
  color: var(--color-accent);
  font-size: 1rem;
}

.group-member-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.group-member-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.group-member-action-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-raised);
}

.group-member-action-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.group-member-action-item {
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.8125rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.group-member-action-item:hover {
  background: var(--color-surface-raised);
}

.group-member-action-item--danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.group-member-action-item--danger:hover {
  background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface));
}

.group-member-action-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.group-member-remove-confirm {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.group-member-remove-confirm-text {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  flex: 1 1 100%;
}

.group-member-action-error {
  font-size: 0.8125rem;
  color: var(--color-danger);
  margin-bottom: 0.5rem;
}

.group-key-rotation-note {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.group-invite-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-surface-raised);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

.group-invite-picker-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.group-invite-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 14rem;
  overflow-y: auto;
}

.group-invite-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9375rem;
  cursor: pointer;
}

.group-invite-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.group-invite-status {
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin: 0;
}

.group-invites-section {
  padding: 0.75rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-invite-card {
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.group-invite-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 500;
}

.group-invite-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.group-invite-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.group-invite-card-from {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.group-invite-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.group-join-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.group-join-qr-image {
  width: min(18rem, 100%);
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
}

.group-join-qr-expires {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.group-detail-nickname-nudge {
  padding: 0.5rem 0;
}

.btn-sm {
  font-size: 0.875rem;
  padding: 0.35rem 0.875rem;
}

/* Group feed items */
.group-feed-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.group-feed-item:last-child {
  border-bottom: none;
}
.group-feed-item-type {
  flex-shrink: 0;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}
.group-feed-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.group-feed-item-title {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-feed-item-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Compose group selector */
.compose-group-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-surface-alt, var(--color-surface));
  border-bottom: 1px solid var(--color-border);
}
.compose-group-selector-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.compose-group-selector-select {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}
