/* ===========================================================================
 * hejpics — design tokens
 * Calm, editorial, accessible by default. WCAG 2.2 AA.
 * ========================================================================= */

:root {
  /* Surface — warm parchment, not flat white */
  --paper: #faf7f2;
  --paper-2: #f3eee6;
  --paper-3: #ebe5da;
  --ink: #1a1814;
  --ink-2: #3d3a33;
  --ink-3: #6b6760;
  --ink-mute: #9a948a;
  --hair: #d7d0c2;
  --hair-2: #c2bbac;

  /* Accent — sage, the color of trusted privacy */
  --sage: #6f8a6a;
  --sage-2: #587256;
  --sage-soft: #e6ede2;
  --sage-tint: #f1f4ed;

  /* Warm coral for destructive / cautions */
  --coral: #b85540;
  --coral-2: #963f2c;
  --coral-soft: #f5e2da;

  /* Amber for warnings (date retained, etc.) */
  --amber: #a3792a;
  --amber-soft: #f5ead0;

  /* Cool ink for neutral info */
  --slate: #4b5a6b;
  --slate-soft: #e3e8ed;

  /* Type */
  --display: "Fraunces", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Geometry */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --r-4: 22px;
  --r-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --shadow-1: 0 1px 2px rgba(26, 24, 20, 0.04), 0 2px 6px rgba(26, 24, 20, 0.06);
  --shadow-2: 0 2px 6px rgba(26, 24, 20, 0.06), 0 12px 28px rgba(26, 24, 20, 0.1);
  --shadow-3: 0 4px 12px rgba(26, 24, 20, 0.08), 0 24px 56px rgba(26, 24, 20, 0.16);

  /* Motion */
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  /* Focus — strong, always visible */
  --focus: #1f3d3a;
  --focus-ring: 3px solid var(--focus);
  --focus-offset: 2px;

  /* Layout */
  --nav-height: 68px;
  --header-height: 64px;
  --content-max: 1180px;
  --content-narrow: 720px;

  --font-size-base: 16px;
}

/* High-contrast mode toggle */
[data-contrast="high"] {
  --paper: #ffffff;
  --paper-2: #f4f1ea;
  --ink: #000000;
  --ink-2: #1a1814;
  --ink-3: #3d3a33;
  --hair: #1a1814;
  --sage: #305c2c;
  --sage-2: #224020;
  --coral: #8b2515;
  --focus: #000000;
}

/* Large text mode */
[data-text-size="large"] {
  --font-size-base: 19px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14130f;
    --paper-2: #1f1d18;
    --paper-3: #2a2722;
    --ink: #f3eee6;
    --ink-2: #d7d0c2;
    --ink-3: #a8a193;
    --ink-mute: #6b6760;
    --hair: #3a362f;
    --hair-2: #4a4538;
    --sage: #9ab095;
    --sage-2: #b8c8b3;
    --sage-soft: #2a352a;
    --sage-tint: #1f2a1f;
    --coral: #e0937e;
    --coral-soft: #3a261c;
    --amber: #d5a85a;
    --amber-soft: #3a2f1a;
    --slate-soft: #2a323a;
    --focus: #f3eee6;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 28px rgba(0, 0, 0, 0.6);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce), (prefers-reduced-motion) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* ===========================================================================
 * Reset & base
 * ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-feature-settings: "ss01", "ss02", "cv11";
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "SOFT" 30;
  color: var(--ink);
}

p { margin: 0; }

/* Strong global focus — never invisible */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--r-2);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); outline: var(--focus-ring); }

/* ===========================================================================
 * App shell
 * ========================================================================= */

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  min-height: 100vh;
}

.main-region {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) calc(var(--nav-height) + var(--space-7));
}
@media (min-width: 800px) {
  .main-region {
    padding: var(--space-6) var(--space-6) var(--space-7);
  }
}

/* ===========================================================================
 * Trust header
 * ========================================================================= */

.trust-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hair);
}

.trust-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
  color: var(--ink);
}
.brand__dot {
  width: 8px; height: 8px;
  background: var(--sage);
  border-radius: 50%;
  display: inline-block;
}

.trust-strip {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 640px) {
  .trust-strip { gap: 6px; }
  .trust-strip .privacy-badge .label { display: none; }
}

/* ===========================================================================
 * Bottom nav (primary navigation, mobile-first; visible on all viewports)
 * ========================================================================= */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 500;
  min-height: 56px;
  border-radius: 4px;
  transition: color var(--dur-1) var(--ease);
}
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="page"] {
  color: var(--sage-2);
}
.nav-item[aria-current="page"] .nav-item__dot {
  background: var(--sage);
}
.nav-item__icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
}
.nav-item__dot {
  width: 4px; height: 4px;
  background: transparent;
  border-radius: 50%;
  margin-top: 1px;
}

/* ===========================================================================
 * Buttons
 * ========================================================================= */

.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  --bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--fg);
  border: 1.5px solid var(--bd);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  --bd: var(--hair);
}
.btn--ghost:hover { background: var(--paper-2); }

.btn--sage {
  --bg: var(--sage-2);
  --fg: var(--paper);
  --bd: var(--sage-2);
}

.btn--danger {
  --bg: transparent;
  --fg: var(--coral-2);
  --bd: var(--coral);
}
.btn--danger:hover { background: var(--coral-soft); }

.btn--text {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--sage-2);
  border-radius: 4px;
}
.btn--text:hover { background: var(--sage-tint); }

.btn--block { width: 100%; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 1rem; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }

/* ===========================================================================
 * Badges
 * ========================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--hair);
  line-height: 1.2;
  white-space: nowrap;
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-mute); display: inline-block; flex: 0 0 auto; }

.badge--sage { background: var(--sage-soft); color: var(--sage-2); border-color: color-mix(in srgb, var(--sage) 32%, transparent); }
.badge--sage .badge__dot { background: var(--sage); }

.badge--amber { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 32%, transparent); }
.badge--amber .badge__dot { background: var(--amber); }

.badge--coral { background: var(--coral-soft); color: var(--coral-2); border-color: color-mix(in srgb, var(--coral) 32%, transparent); }
.badge--coral .badge__dot { background: var(--coral); }

.badge--slate { background: var(--slate-soft); color: var(--slate); border-color: color-mix(in srgb, var(--slate) 25%, transparent); }
.badge--slate .badge__dot { background: var(--slate); }

/* Privacy badge in header (compact) */
.privacy-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  background: var(--sage-tint);
  border: 1px solid color-mix(in srgb, var(--sage) 25%, transparent);
  border-radius: var(--r-pill);
  color: var(--sage-2);
  font-size: 0.78rem; font-weight: 500;
}

/* ===========================================================================
 * Cards
 * ========================================================================= */

.card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  padding: var(--space-5);
  box-shadow: var(--shadow-1);
}

.card--quiet {
  background: var(--paper-2);
  border-color: transparent;
  box-shadow: none;
}

.card__title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
  font-variation-settings: "opsz" 24, "SOFT" 30;
}

.card__help {
  color: var(--ink-3);
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
}

/* ===========================================================================
 * Screen headers
 * ========================================================================= */

.screen-head {
  margin-bottom: var(--space-6);
}
.screen-head__eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  margin-bottom: var(--space-2);
}
.screen-head__title {
  font-size: clamp(1.875rem, 2.2vw + 1rem, 2.75rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 64, "SOFT" 30, "WONK" 0;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.screen-head__lead {
  font-size: 1.05rem;
  color: var(--ink-3);
  max-width: 60ch;
}

/* ===========================================================================
 * Album cards & photo grid
 * ========================================================================= */

.album-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.album-card {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--hair-2);
}
.album-card__cover {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--paper-3), var(--paper-2));
  position: relative;
  overflow: hidden;
}
.album-card__cover-grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: var(--paper);
}
.album-card__cover-grid > div {
  background: linear-gradient(135deg, var(--cell-a, #c8c0b2), var(--cell-b, #aea791));
}
.album-card__cover-grid > :first-child { grid-row: 1 / -1; }
.album-card__body {
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: grid;
  gap: 6px;
}
.album-card__title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 24, "SOFT" 30;
}
.album-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px;
}
@media (min-width: 800px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; }
}
.photo-tile {
  aspect-ratio: 1;
  position: relative;
  background: linear-gradient(135deg, var(--cell-a, var(--paper-3)), var(--cell-b, var(--paper-2)));
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: transform var(--dur-1) var(--ease), filter var(--dur-1) var(--ease);
}
.photo-tile:hover { transform: scale(1.01); }
.photo-tile:focus-visible { outline-offset: 3px; }
.photo-tile__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 8px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  color: white;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.photo-tile:hover .photo-tile__meta { opacity: 1; }
.photo-tile__check {
  position: absolute;
  top: 8px; left: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid white;
  background: rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.photo-grid--selectable .photo-tile__check { opacity: 0.85; }
.photo-tile[aria-pressed="true"] .photo-tile__check {
  background: var(--sage-2);
  border-color: var(--paper);
  opacity: 1;
}
.photo-tile[aria-pressed="true"] { filter: brightness(0.85); }

/* ===========================================================================
 * Forms
 * ========================================================================= */

.field {
  display: grid;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.field__label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.field__help {
  font-size: 0.85rem;
  color: var(--ink-3);
}
.field__input, .field__select, .field__textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1.5px solid var(--hair);
  border-radius: var(--r-2);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.field__textarea { min-height: 120px; resize: vertical; }
.field__input:focus, .field__select:focus, .field__textarea:focus {
  border-color: var(--sage-2);
  background: var(--paper);
}

/* Radio-card group */
.radio-cards {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.radio-card {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--hair);
  border-radius: var(--r-3);
  background: var(--paper);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.radio-card:hover { border-color: var(--hair-2); }
.radio-card[aria-checked="true"], .radio-card:has(input:checked) {
  border-color: var(--sage-2);
  background: var(--sage-tint);
}
.radio-card input { appearance: none; margin: 0; }
.radio-card__indicator {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--hair-2);
  display: grid; place-items: center;
  background: var(--paper);
  margin-top: 2px;
}
.radio-card[aria-checked="true"] .radio-card__indicator,
.radio-card:has(input:checked) .radio-card__indicator {
  border-color: var(--sage-2);
}
.radio-card[aria-checked="true"] .radio-card__indicator::after,
.radio-card:has(input:checked) .radio-card__indicator::after {
  content: "";
  width: 10px; height: 10px;
  background: var(--sage-2);
  border-radius: 50%;
}
.radio-card__title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.radio-card__summary {
  font-size: 0.9rem;
  color: var(--ink-3);
}
.radio-card__chips {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle__track {
  width: 44px; height: 26px;
  background: var(--hair);
  border-radius: 999px;
  position: relative;
  transition: background-color var(--dur-2) var(--ease);
}
.toggle__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--paper);
  border-radius: 50%;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease);
}
.toggle input { display: none; }
.toggle[data-on="true"] .toggle__track { background: var(--sage-2); }
.toggle[data-on="true"] .toggle__thumb { transform: translateX(18px); }

/* ===========================================================================
 * Action bar at bottom of forms / flows
 * ========================================================================= */

.action-bar {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hair);
}
.action-bar--start { justify-content: flex-start; }
.action-bar--between { justify-content: space-between; }

@media (max-width: 640px) {
  .action-bar { flex-direction: column-reverse; }
  .action-bar .btn { width: 100%; }
}

/* ===========================================================================
 * Steps / progress
 * ========================================================================= */

.step-list {
  display: grid;
  gap: var(--space-3);
}
.step-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
}
.step-item__dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 2px solid var(--hair-2);
  display: grid; place-items: center;
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 600;
}
.step-item--done .step-item__dot {
  background: var(--sage-2);
  border-color: var(--sage-2);
  color: var(--paper);
}
.step-item--active .step-item__dot {
  background: var(--paper);
  border-color: var(--sage-2);
  color: var(--sage-2);
}
.step-item__label { font-weight: 500; }
.step-item__hint { font-size: 0.85rem; color: var(--ink-3); }

/* Progress bar */
.progress {
  width: 100%;
  height: 6px;
  background: var(--paper-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--sage-2);
  border-radius: inherit;
  transition: width var(--dur-3) var(--ease);
}

/* ===========================================================================
 * Photo viewer
 * ========================================================================= */

.viewer {
  position: fixed;
  inset: 0;
  background: #0d0c0a;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.viewer__top {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #f3eee6;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}
.viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.viewer__photo {
  width: min(92vw, 1400px);
  height: 100%;
  max-height: calc(100vh - 200px);
  background: linear-gradient(135deg, var(--cell-a, #38332a), var(--cell-b, #1f1c17));
  aspect-ratio: 3/2;
  border-radius: 4px;
}
.viewer__nav {
  position: absolute;
  top: 50%;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #f3eee6;
  transform: translateY(-50%);
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background-color var(--dur-1) var(--ease);
}
.viewer__nav:hover { background: rgba(255,255,255,0.18); }
.viewer__nav--prev { left: 16px; }
.viewer__nav--next { right: 16px; }
.viewer__bottom {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #d7d0c2;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  font-size: 0.9rem;
}
.viewer__close {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  color: #f3eee6;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

/* ===========================================================================
 * Modal / dialog
 * ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: var(--space-4);
}
.modal {
  background: var(--paper);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-3);
  max-width: 520px;
  width: 100%;
  padding: var(--space-6);
  border: 1px solid var(--hair);
}
.modal__title {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-3);
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 1;
}
.modal__body {
  color: var(--ink-2);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

/* ===========================================================================
 * Toast
 * ========================================================================= */

.toast-stack {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  animation: toast-in var(--dur-3) var(--ease);
}
.toast--sage { background: var(--sage-2); }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===========================================================================
 * Layout helpers
 * ========================================================================= */

.stack { display: grid; gap: var(--space-3); }
.stack-sm { display: grid; gap: var(--space-2); }
.stack-md { display: grid; gap: var(--space-4); }
.stack-lg { display: grid; gap: var(--space-5); }
.stack-xl { display: grid; gap: var(--space-6); }

.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }

.text-mute { color: var(--ink-3); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.text-mono { font-family: var(--mono); }

.divider { height: 1px; background: var(--hair); border: 0; margin: var(--space-5) 0; }

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

/* Section header with rule */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: var(--space-6) 0 var(--space-4);
  gap: var(--space-4);
}
.section-head__title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 28, "SOFT" 30;
}
.section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--hair);
  margin-bottom: 6px;
}

/* ===========================================================================
 * Trust strip — privacy reassurance panel
 * ========================================================================= */

.trust-panel {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--r-4);
  background:
    radial-gradient(ellipse at top left, var(--sage-tint), transparent 60%),
    var(--paper);
  border: 1px solid var(--hair);
  overflow: hidden;
}
.trust-panel::before {
  content: "";
  position: absolute;
  top: -20px; right: -20px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--sage) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.trust-panel__quote {
  position: relative;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: var(--space-4);
  font-variation-settings: "opsz" 24, "SOFT" 50, "WONK" 1;
}
.trust-panel__quote::before {
  content: "“";
  position: absolute;
  left: -22px; top: -12px;
  font-size: 3rem;
  line-height: 1;
  color: var(--sage);
  opacity: 0.5;
}
.trust-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===========================================================================
 * Empty state
 * ========================================================================= */

.empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  border: 1px dashed var(--hair-2);
  border-radius: var(--r-4);
  background: var(--paper-2);
}
.empty__title {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
  font-variation-settings: "opsz" 24, "SOFT" 30;
}
.empty__body {
  color: var(--ink-3);
  margin-bottom: var(--space-4);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================================================================
 * Access list (Share Center)
 * ========================================================================= */

.access-list {
  display: grid;
  gap: var(--space-2);
}
.access-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
}
.access-row__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper-2);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.access-row__label { font-weight: 500; }
.access-row__hint { font-size: 0.85rem; color: var(--ink-3); }

/* ===========================================================================
 * Storage meter
 * ========================================================================= */

.usage-meter {
  display: grid;
  gap: var(--space-3);
}
.usage-meter__bar {
  height: 10px;
  width: 100%;
  background: var(--paper-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  display: flex;
}
.usage-meter__slice { height: 100%; }
.usage-meter__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.85rem;
  color: var(--ink-3);
}
.usage-meter__legend-dot {
  width: 9px; height: 9px;
  display: inline-block;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===========================================================================
 * Shared album entry — minimal trust-first shell
 * ========================================================================= */

.public-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background:
    radial-gradient(ellipse at top, var(--sage-tint), transparent 60%),
    var(--paper);
}
.public-shell__card {
  max-width: 460px;
  width: 100%;
  padding: var(--space-7);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-2);
}
.public-shell__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 28, "SOFT" 50, "WONK" 1;
  margin-bottom: var(--space-5);
}

/* ===========================================================================
 * Inline metadata diff (Privacy Review)
 * ========================================================================= */

.meta-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
}
@media (max-width: 600px) {
  .meta-diff { grid-template-columns: 1fr; }
}
.meta-diff__col {
  padding: var(--space-3);
  background: var(--paper);
  border-radius: var(--r-2);
  border: 1px solid var(--hair);
}
.meta-diff__head {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: var(--space-3);
}
.meta-diff__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.88rem;
}
.meta-diff__row:last-child { border-bottom: 0; }
.meta-diff__row .strike { color: var(--ink-mute); text-decoration: line-through; }

/* ===========================================================================
 * Language selector
 * ========================================================================= */

.lang-switch {
  display: inline-flex;
  background: var(--paper-2);
  border-radius: var(--r-pill);
  padding: 3px;
  border: 1px solid var(--hair);
  font-size: 0.8rem;
  font-weight: 500;
}
.lang-switch button {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ===========================================================================
 * Offline indicator
 * ========================================================================= */

.offline-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-3);
}
.offline-dot__pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
}
.offline-dot[data-offline="true"] .offline-dot__pip { background: var(--coral); }

/* Animation for page enter — subtle */
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-in { animation: page-in var(--dur-3) var(--ease); }

/* ===========================================================================
 * Additional styles for Share Center, Create Album/Link, Data, Settings, Public
 * ========================================================================= */

/* --- Form blocks -------------------------------------------------------- */
.form-block {
  margin-bottom: var(--space-5);
}
.form-block__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 0.4rem;
}
.form-block__hint {
  color: var(--ink-3);
  font-size: 0.92rem;
  margin: 0 0 0.6rem 0;
  max-width: 56ch;
}
.form-block__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--hair-strong, var(--hair));
  border-radius: var(--r-2);
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.form-block__input:focus-visible {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-tint);
}
textarea.form-block__input { min-height: 96px; resize: vertical; }

/* --- Access list (Share Center) — extension --------------------------- */
.access-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  list-style: none;
}
.access-item + .access-item { margin-top: var(--space-2); }
.access-item__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--paper-2);
  border-radius: 50%;
  color: var(--ink-2);
}
.access-item__main { min-width: 0; }
.access-item__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.access-item__label { font-weight: 500; }
.access-item__detail { color: var(--ink-2); font-size: 0.94rem; margin-bottom: 2px; }
.access-item__meta { color: var(--ink-3); font-size: 0.82rem; font-family: var(--mono); }

/* --- Toggle (checkbox-as-switch) -------------------------------------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  cursor: pointer;
}
.toggle-row__main { flex: 1; min-width: 0; }
.toggle-row__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  margin-bottom: 2px;
}
.toggle-row__desc { color: var(--ink-3); font-size: 0.92rem; max-width: 56ch; }

input[type="checkbox"].toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 46px;
  height: 26px;
  background: var(--paper-3);
  border: 1px solid var(--hair-strong, var(--hair));
  border-radius: var(--r-pill);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--dur-1) var(--ease);
  margin: 0;
}
input[type="checkbox"].toggle::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--paper);
  top: 2px; left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform var(--dur-2) var(--ease);
}
input[type="checkbox"].toggle:checked {
  background: var(--sage);
  border-color: var(--sage);
}
input[type="checkbox"].toggle:checked::after { transform: translateX(20px); }
input[type="checkbox"].toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--sage-tint);
}

/* --- Card variants ----------------------------------------------------- */
.card__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--paper-2);
  border-radius: 50%;
  color: var(--ink-2);
  flex-shrink: 0;
}
.card__title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem 0;
}
.card__body {
  color: var(--ink-2);
  margin: 0 0 1rem 0;
  max-width: 60ch;
}
.card--warn {
  border-color: color-mix(in srgb, var(--coral) 25%, var(--hair));
  background: color-mix(in srgb, var(--coral) 3%, var(--paper));
}

/* --- Usage rows (Data Ownership) -------------------------------------- */
.usage-row { display: grid; gap: 6px; }
.usage-row + .usage-row { margin-top: 12px; }
.usage-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}
.usage-row__label { font-weight: 500; }
.usage-row__size { color: var(--ink-3); font-family: var(--mono); font-size: 0.88rem; }
.usage-row__bar {
  height: 8px;
  background: var(--paper-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.usage-row__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--sage-2, var(--sage)));
  transition: width var(--dur-3) var(--ease);
}

/* --- meta-diff head colour variants ------------------------------------ */
.meta-diff__head--keep { color: var(--sage); }
.meta-diff__head--cut { color: var(--coral); }
.meta-diff__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.meta-diff__list li {
  font-size: 0.92rem;
  color: var(--ink-2);
  padding-left: 14px;
  position: relative;
}
.meta-diff__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
}

/* --- Link display chip ------------------------------------------------- */
.link-display {
  display: inline-flex;
  align-items: center;
  flex: 1;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-2);
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink);
  user-select: all;
  word-break: break-all;
}

/* --- Public shell (shared-by-link pages) ------------------------------- */
.trust-header--public {
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.public-main {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}
.public-main--viewer { max-width: 980px; }

.public-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-4);
  padding: var(--space-7);
  box-shadow: var(--shadow-2, 0 6px 30px rgba(26, 24, 20, 0.08));
  margin-bottom: var(--space-5);
}
.public-card__eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.public-card__owner {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}
.public-card__lead {
  color: var(--ink-2);
  font-size: 1.02rem;
  max-width: 50ch;
  margin: 0 0 var(--space-4) 0;
}

.public-banner {
  border-radius: var(--r-4);
  padding: var(--space-7) var(--space-6);
  color: #fffaf2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
  margin-bottom: var(--space-5);
  min-height: 200px;
  display: grid;
  align-items: end;
}
.public-banner__owner {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-bottom: 6px;
}
.public-banner__title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem 0;
  line-height: 1.1;
}
.public-banner__meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  opacity: 0.88;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.public-trust-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.photo-grid--public {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  margin-bottom: var(--space-6);
}

.public-foot-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.public-foot-card__title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
}
.public-foot-card__body {
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}

.public-trust {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
}
.public-trust__title {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.public-trust__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.public-trust__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  color: var(--ink-2);
}
.public-foot {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.88rem;
  margin-top: var(--space-5);
}

/* btn--text fallback */
.btn--text {
  background: transparent;
  border: 0;
  color: var(--sage);
  cursor: pointer;
  font-weight: 500;
  padding: 4px 0;
  text-decoration: none;
}
.btn--text:hover { text-decoration: underline; }

/* Disabled buttons */
.btn[disabled], .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================================================================
 * RFC 004 — UI/UX v2 additions
 * ========================================================================= */

/* --- FAB nav item --------------------------------------------------------- */
.nav-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  top: -10px;            /* lifts the button above the nav bar */
}
.nav-fab__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sage) 40%, transparent);
  transition: transform var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.nav-fab:hover .nav-fab__icon,
.nav-fab:focus-visible .nav-fab__icon {
  transform: scale(1.06);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--sage) 50%, transparent);
}
.nav-fab:focus-visible .nav-fab__icon { outline: 3px solid var(--sage); outline-offset: 3px; }

/* Nav item label shared by regular items */
.nav-item__label { font-size: 0.72rem; }

/* --- Activity strip (Library) -------------------------------------------- */
.activity-strip {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  margin-bottom: var(--space-5);
}
.activity-strip__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.activity-strip__title {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.activity-item__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}
.activity-item__album { font-weight: 500; color: var(--ink); }
.activity-item__age { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); white-space: nowrap; }

/* --- Album card v2 -------------------------------------------------------- */
.album-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.album-card { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-3); overflow: hidden; transition: box-shadow var(--dur-1) var(--ease); }
.album-card:hover { box-shadow: 0 4px 20px rgba(26,24,20,0.1); }
.album-card__link { display: block; text-decoration: none; color: inherit; }
.album-card__cover { height: 140px; position: relative; overflow: hidden; }
.album-card__badge { position: absolute; bottom: 8px; left: 8px; }
.album-card__body { padding: var(--space-3) var(--space-4); }
.album-card__title { font-weight: 500; font-size: 1rem; margin-bottom: 4px; }
.album-card__meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.82rem; font-family: var(--mono); }
.album-card__sep { color: var(--hair-strong, var(--hair)); }
.album-card__vis-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hair); }
.album-card__vis-action { font-size: 0.82rem; color: var(--sage); display: inline-flex; align-items: center; gap: 3px; }

/* --- Inbox list (Shared) -------------------------------------------------- */
.inbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.inbox-row { border-radius: var(--r-2); overflow: hidden; }
.inbox-row--unread { background: color-mix(in srgb, var(--sage) 4%, var(--paper)); }
.inbox-row__link { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); text-decoration: none; color: inherit; border: 1px solid var(--hair); border-radius: var(--r-2); transition: background var(--dur-1) var(--ease); }
.inbox-row__link:hover { background: var(--paper-2); }
.inbox-row__thumb { width: 64px; height: 64px; border-radius: var(--r-2); overflow: hidden; position: relative; }
.inbox-row__new-dot {
  position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 2px var(--paper);
}
.inbox-row__content { min-width: 0; }
.inbox-row__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row__meta { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 0.85rem; margin-top: 3px; }
.inbox-row__sender { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.inbox-row__sep { color: var(--hair-strong, var(--hair)); }
.inbox-row__new-count { color: var(--sage); font-weight: 600; }
.inbox-row__expiry { font-size: 0.78rem; font-family: var(--mono); color: var(--amber); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.inbox-row__time { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); white-space: nowrap; }

/* --- Filter chips --------------------------------------------------------- */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.chip--active { background: var(--sage); border-color: var(--sage); color: #fff; }
.chip__badge {
  min-width: 18px; height: 18px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.35);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}

/* --- Share groups (Sharing page) ----------------------------------------- */
.share-group { margin-bottom: var(--space-6); }
.share-group__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
}
.share-row--inactive { opacity: 0.65; }
.share-row__label { font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.share-row__scope { color: var(--ink-3); font-size: 0.85rem; font-family: var(--mono); margin-top: 3px; }
.share-row__albums { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.share-row__album-chip { padding: 2px 8px; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--hair); font-size: 0.8rem; color: var(--ink-2); }
.share-row__right { text-align: right; display: grid; gap: 8px; }
.share-row__status { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); }

/* --- Me page -------------------------------------------------------------- */
.me-section { margin-bottom: var(--space-7); }
.me-section__body { display: grid; gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: var(--r-3); overflow: hidden; }
.me-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  background: var(--paper);
}
.me-row--action { grid-template-columns: 1fr; justify-items: start; }
.me-row__label { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.me-row__value { color: var(--ink-2); font-size: 0.95rem; grid-column: span 1; }
.me-row__hint { color: var(--ink-3); font-size: 0.88rem; margin-top: 2px; max-width: 52ch; }
.me-row__main { display: grid; gap: 3px; }
.me-storage { padding: var(--space-4); background: var(--paper); display: grid; gap: 8px; }
.me-storage__label { font-weight: 500; font-size: 0.9rem; color: var(--ink-2); }
.me-storage__bar { height: 8px; background: var(--paper-3); border-radius: var(--r-pill); overflow: hidden; }
.me-storage__fill { height: 100%; background: var(--sage); }
.me-storage__text { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); }

/* --- About hejpics list (inside Me) -------------------------------------- */
.about-list { display: grid; gap: 1px; background: var(--hair); }
.about-item { display: grid; grid-template-columns: 36px 1fr; gap: var(--space-3); padding: var(--space-4); background: var(--paper); }
.about-item__icon { display: grid; place-items: center; color: var(--sage); padding-top: 2px; }
.about-item__title { font-weight: 500; margin-bottom: 4px; }
.about-item__body { color: var(--ink-2); font-size: 0.92rem; max-width: 60ch; }

/* --- Badge xs variant ---------------------------------------------------- */
.badge--xs { padding: 2px 7px; font-size: 0.72rem; }

/* --- Quick-add panel (upload_start.rs) ------------------------------------ */
.quick-add-panel {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-3);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  display: grid;
  gap: var(--space-3);
}
.quick-add-panel__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.quick-add-panel__row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}
.quick-add-panel__setting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quick-add-panel__change { color: var(--ink-3); font-size: 0.88rem; }
.quick-add-panel__hint { color: var(--ink-3); font-size: 0.88rem; margin: 0; max-width: 56ch; }

/* --- Prose list (photo viewer info drawer) --------------------------------- */
.prose-list { display: grid; gap: 12px; }
.prose-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.prose-item__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  margin-top: 0.55em;
  flex-shrink: 0;
}

/* --- Shared inbox nudge (Library) ----------------------------------------- */
.shared-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-3) var(--space-5);
  background: color-mix(in srgb, var(--sage) 8%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--sage) 25%, var(--hair));
  border-radius: var(--r-2);
  color: var(--sage);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
  transition: background var(--dur-1) var(--ease);
}
.shared-nudge:hover { background: color-mix(in srgb, var(--sage) 13%, var(--paper)); }
.shared-nudge__count {
  min-width: 22px; height: 22px;
  border-radius: var(--r-pill);
  background: var(--sage);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
}

/* --- Album viewer banner (received albums) --------------------------------- */
.album-viewer-banner {
  border-radius: var(--r-3);
  margin-bottom: var(--space-5);
  min-height: 160px;
  display: grid;
  align-items: end;
  color: #fffaf2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.22);
  overflow: hidden;
}
.album-viewer-banner__inner { padding: var(--space-5) var(--space-5) var(--space-4); }
.album-viewer-banner__from {
  font-family: var(--mono);
  font-size: 0.8rem;
  opacity: 0.88;
  margin-bottom: 6px;
}
.album-viewer-banner__title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.album-viewer-banner__count {
  font-family: var(--mono);
  font-size: 0.82rem;
  opacity: 0.85;
}

/* ==========================================================================
 * RFC 006 — progressive disclosure patterns
 * ========================================================================== */

/* --- Library header ------------------------------------------------------- */
.lib-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.lib-header__nudge {
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--sage);
  text-decoration: none;
  opacity: 0.75;
}
.lib-header__nudge:hover { opacity: 1; }

/* --- Album tile (RFC 006: cover fills tile, foot = title + dot only) ------ */
.album-grid { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:var(--space-3); }
.album-tile { border-radius:var(--r-3); overflow:hidden; }
.album-tile__link { display:block; text-decoration:none; color:inherit; }
.album-tile__cover { aspect-ratio:4/3; width:100%; }
.album-tile__foot { display:flex; align-items:center; justify-content:space-between; padding:var(--space-2) var(--space-3); background:var(--paper); }
.album-tile__title { font-size:0.95rem; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Visibility dot — 8×8 px, colour only, no text */
.album-tile__dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.dot--private { background: var(--ink-mute); opacity:0.35; }
.dot--sage    { background: var(--sage); }
.dot--amber   { background: var(--amber); }
.dot--coral   { background: var(--coral); }

/* --- Inbox row (RFC 006: thumb + title + sender only) --------------------- */
.inbox-list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.inbox-row { border-radius:var(--r-2); }
.inbox-row--unread { background:color-mix(in srgb, var(--sage) 4%, var(--paper)); }
.inbox-row__link { display:grid; grid-template-columns:52px 1fr; gap:var(--space-3); align-items:center; padding:var(--space-3) var(--space-4); text-decoration:none; color:inherit; border:1px solid var(--hair); border-radius:var(--r-2); }
.inbox-row__thumb { width:52px; height:52px; border-radius:var(--r-2); position:relative; }
.inbox-row__dot { position:absolute; top:4px; right:4px; width:8px; height:8px; border-radius:50%; background:var(--sage); box-shadow:0 0 0 2px var(--paper); }
.inbox-row__text { min-width:0; }
.inbox-row__title { font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inbox-row__sender { font-size:0.85rem; color:var(--ink-3); margin-top:2px; }

/* --- Share group (RFC 006: collapsed by default) -------------------------- */
.share-group { margin-bottom:var(--space-3); border:1px solid var(--hair); border-radius:var(--r-3); overflow:hidden; }
.share-group__toggle { width:100%; display:flex; align-items:center; gap:var(--space-3); padding:var(--space-4) var(--space-5); background:var(--paper); border:none; cursor:pointer; text-align:left; font-size:1rem; }
.share-group__toggle:hover { background:var(--paper-2); }
.share-group__name { font-weight:500; flex:1; }
.share-group__badge { min-width:22px; height:22px; border-radius:var(--r-pill); background:var(--paper-3); color:var(--ink-2); font-size:0.78rem; font-weight:600; display:grid; place-items:center; padding:0 6px; }
.share-group__arrow { color:var(--ink-mute); font-size:0.85rem; }
.share-group__list { list-style:none; margin:0; padding:0; border-top:1px solid var(--hair); }
.share-row { display:grid; grid-template-columns:1fr auto auto; gap:var(--space-3); align-items:center; padding:var(--space-3) var(--space-5); border-bottom:1px solid var(--hair); }
.share-row:last-child { border-bottom:none; }
.share-row__label { font-size:0.95rem; }
.share-row__status { font-size:0.82rem; font-family:var(--mono); color:var(--ink-3); }
.share-group__footer { padding:var(--space-3) var(--space-5); border-top:1px solid var(--hair); background:var(--paper-2); }
.btn--danger-text { background:none; border:none; cursor:pointer; color:var(--coral); font-size:0.88rem; padding:0; }
.btn--danger-text:hover { text-decoration:underline; }

/* --- Settings list (RFC 006: Me page accordion) --------------------------- */
.settings-list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.settings-section { border:1px solid var(--hair); border-radius:var(--r-3); overflow:hidden; }
.settings-section__header { width:100%; display:flex; align-items:center; padding:var(--space-4) var(--space-5); background:var(--paper); border:none; cursor:pointer; text-align:left; gap:var(--space-3); }
.settings-section__header:hover { background:var(--paper-2); }
.settings-section__text { flex:1; display:grid; gap:2px; }
.settings-section__title { font-weight:500; font-size:1rem; }
.settings-section__hint { font-size:0.82rem; color:var(--ink-3); }
.settings-section__arrow { color:var(--ink-mute); font-size:0.85rem; flex-shrink:0; }
.settings-section__body { border-top:1px solid var(--hair); }
.settings-rows { display:grid; gap:1px; background:var(--hair); }
.settings-row { display:grid; grid-template-columns:1fr auto; gap:var(--space-3); align-items:center; padding:var(--space-4) var(--space-5); background:var(--paper); }
.settings-row--action { grid-template-columns:1fr; justify-items:start; }
.settings-row__label { font-weight:500; }
.settings-row__value { color:var(--ink-2); font-size:0.92rem; }
.settings-row__hint  { color:var(--ink-3); font-size:0.85rem; margin-top:2px; }
.about-list { display:grid; gap:var(--space-3); padding:var(--space-5); background:var(--paper); }
.about-item { font-size:0.95rem; color:var(--ink-2); line-height:1.5; margin:0; }

/* --- Overflow menu (album detail ···) ------------------------------------- */
.overflow-menu { position:relative; }
.overflow-menu summary { list-style:none; }
.overflow-menu summary::-webkit-details-marker { display:none; }
.overflow-menu__panel { position:absolute; right:0; top:calc(100% + 4px); min-width:180px; background:var(--paper); border:1px solid var(--hair); border-radius:var(--r-3); box-shadow:0 4px 16px rgba(26,24,20,0.12); z-index:100; display:grid; gap:1px; }
.overflow-menu__item { display:flex; align-items:center; gap:8px; padding:var(--space-3) var(--space-4); font-size:0.92rem; color:var(--ink-2); text-decoration:none; cursor:pointer; }
.overflow-menu__item:hover { background:var(--paper-2); }
.overflow-menu__select { background:transparent; border:none; font-size:0.92rem; color:var(--ink-2); cursor:pointer; outline:none; }
