:root {
  color-scheme: light;
  --accent: #d14a42;
  --accent-border: #e87068;
  --accent-soft: #f5e8e7;
  --accent-subtle: rgb(209 74 66 / 14%);
  --nav-coral: var(--accent);
  --nav-bar-bg: #ffffff;
  --nav-bar-text: #5a5466;
  --nav-bar-divider: rgb(0 0 0 / 9%);
  --nav-bar-shadow: rgb(15 12 24 / 8%);
  --nav-item-hover: rgb(0 0 0 / 5%);
  --fab-shadow: rgb(209 74 66 / 38%);
  --bg: #f3f1f7;
  --card: #ffffff;
  --surface: #faf9fc;
  --text: #17141f;
  --muted: #6b6577;
  --control-bg: #ffffff;
  --control-border: #d8d3e2;
  --surface-border: #e2dde8;
  --status-bg: var(--card);
  --status-border: var(--surface-border);
  --status-error-border: #c44;
  --card-shadow: rgb(24 20 40 / 7%);
  --press-overlay: rgb(0 0 0 / 6%);
}

body[data-appearance="dark"] {
  color-scheme: dark;
  --accent: #e85d52;
  --accent-border: #f08078;
  --accent-soft: #2c2326;
  --accent-subtle: rgb(232 93 82 / 18%);
  --nav-coral: var(--accent);
  --nav-bar-bg: #16131c;
  --nav-bar-text: #b8b0c4;
  --nav-bar-divider: rgb(255 255 255 / 8%);
  --nav-bar-shadow: rgb(0 0 0 / 45%);
  --nav-item-hover: rgb(255 255 255 / 6%);
  --fab-shadow: rgb(232 93 82 / 42%);
  --bg: #0f0d14;
  --card: #1a1722;
  --surface: #14111a;
  --text: #f3f1f7;
  --muted: #9d96ab;
  --control-bg: #1a1722;
  --control-border: #3d3848;
  --surface-border: #2e2938;
  --status-bg: #1a1722;
  --status-border: var(--surface-border);
  --status-error-border: #e07070;
  --card-shadow: rgb(0 0 0 / 45%);
  --press-overlay: rgb(255 255 255 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

/* Settings sheet on phones: hide bottom nav/FAB to prevent overlap clipping */
body.settings-focus {
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

body.settings-focus .bottom-nav {
  display: none;
}

/* Family setup wizard: hide main bottom nav + FAB so forms aren’t covered */
body.family-setup-focus {
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

body.family-setup-focus .bottom-nav {
  display: none;
}

.container {
  width: min(920px, 94vw);
  margin: 0 auto;
}

.header {
  padding: 1.1rem 0 0.6rem;
}

.header-top {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 48px;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: start;
}

.brand {
  display: contents;
}

.brand-logo {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: none;
  background: transparent;
  display: block;
}

.brand-title {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  text-align: center;
  margin: 0;
  line-height: 1;
}

.brand-wordmark {
  display: block;
  width: clamp(218px, 48vw, 322px);
  height: auto;
  max-width: 100%;
}

h2 {
  margin: 0 0 0.75rem;
}

.subtitle {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  text-align: center;
  margin: 0;
  font-size: clamp(0.92rem, 2.15vw, 1rem);
  line-height: 1.22;
  max-width: 23ch;
  letter-spacing: 0.006em;
  color: var(--muted);
  opacity: 0.86;
}

.header-menu-wrap {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  padding-top: 0;
}

.burger-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  padding: 0;
  min-height: unset;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.burger-btn[aria-expanded="true"] {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.burger-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.9;
}

.header-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: min(19rem, 86vw);
  padding: 0.4rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--surface-border);
  box-shadow: 0 12px 28px rgb(0 0 0 / 35%);
  z-index: 50;
  will-change: transform, opacity;
}

.header-menu-dropdown.menu-enter {
  animation: menu-dropdown-in 250ms cubic-bezier(0.2, 0.9, 0.2, 1);
  transform-origin: top right;
}

.header-menu-dropdown.menu-closing {
  animation: menu-dropdown-out 200ms ease forwards;
  transform-origin: top right;
  pointer-events: none;
}

.header-menu-user {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 0.15rem;
}

.header-menu-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.header-menu-user-text {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.header-menu-user-name {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-menu-user-email {
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-menu-section {
  display: grid;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem 0.55rem;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 0.2rem;
}

.header-menu-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.header-menu-family-select {
  width: 100%;
  min-height: 2.35rem;
  border-radius: 10px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  padding: 0.35rem 0.5rem;
}

.header-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  min-height: unset;
  font-weight: 500;
}

.header-menu-item:hover {
  background: var(--surface);
}

.header-menu-item-primary {
  font-weight: 650;
  color: var(--accent);
}

.settings-hub-intro {
  margin: 0 0 0.65rem;
}

.settings-hub-list {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}

.settings-hub-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: unset;
}

.settings-hub-row:last-child {
  border-bottom: 0;
}

.settings-hub-row:hover {
  background: var(--nav-item-hover);
}

.settings-hub-row-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  flex: 1;
  min-width: 0;
}

.settings-hub-row-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}

.settings-hub-row-desc {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.settings-hub-row-chevron {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  opacity: 0.85;
}

.sheet-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.sheet-title {
  margin: 0;
  font-size: 1.15rem;
}

.sheet-done-btn {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 0.35rem 0.5rem;
  min-height: unset;
  font-weight: 600;
}

.sheet-done-btn:hover {
  filter: brightness(1.15);
}

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

.stack {
  display: grid;
  gap: 0.85rem;
  padding-bottom: 1rem;
}

.view {
  margin-top: 0.8rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.view.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 0.9rem;
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 28px var(--card-shadow);
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}

.form-flow {
  display: grid;
  gap: 0.65rem;
}

.family-setup-wizard {
  display: grid;
  gap: 1rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.setup-wizard-header {
  display: grid;
  gap: 0.45rem;
}

.setup-wizard-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.setup-wizard-intro {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.setup-stepper {
  margin: 0;
}

/* Compact horizontal stepper: numbered circles only; full labels live in #setup-wizard-step-meta */
.setup-stepper-track {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
  position: relative;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--card);
}

.setup-stepper-track::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--surface-border);
  z-index: 0;
  pointer-events: none;
}

.setup-stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 25%;
  padding: 0;
  margin: 0;
  border: none;
  position: relative;
  z-index: 1;
  transition: opacity 0.12s ease;
}

.setup-stepper-item.is-done {
  cursor: pointer;
}

.setup-stepper-item.is-done:hover .setup-stepper-marker {
  filter: brightness(1.06);
}

.setup-stepper-item.is-upcoming {
  opacity: 0.72;
}

.setup-stepper-marker {
  flex-shrink: 0;
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 2px solid var(--surface-border);
  color: var(--muted);
  background: var(--card);
  /* Opaque “halo” masks the track line so it never cuts through the number */
  box-shadow: 0 0 0 5px var(--card);
  position: relative;
  z-index: 1;
}

@media (min-width: 480px) {
  .setup-stepper-marker {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.8rem;
  }
}

.setup-stepper-item.is-current {
  opacity: 1;
}

.setup-stepper-item.is-current .setup-stepper-marker {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 5px var(--card);
  transform: scale(1.08);
}

.setup-stepper-item.is-done .setup-stepper-marker {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 5px var(--card);
}

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

.setup-stepper-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

.setup-stepper-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.setup-wizard-step-meta {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.setup-wizard-panel--card {
  padding: 1rem 1rem 1.05rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--card);
}

.setup-panel-lead {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.setup-panel-footnote {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}

.setup-wizard-actions--split {
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.setup-wizard-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.setup-wizard-actions--stack .setup-wizard-primary,
.setup-wizard-actions--stack .text-btn {
  width: 100%;
  text-align: center;
}

.setup-wizard-complete {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--card);
}

.setup-wizard-complete-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.setup-wizard-complete-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 28rem;
}

.setup-wizard-primary {
  font-weight: 600;
}

.setup-wizard-panel {
  display: grid;
  gap: 0.55rem;
}

.setup-wizard-form.inline-form {
  flex-direction: column;
  align-items: stretch;
}

.setup-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.setup-members-list {
  display: grid;
  gap: 0.4rem;
}

.setup-member-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--card);
  font-size: 0.88rem;
}

.setup-member-row span {
  color: var(--muted);
}

.setup-subheading {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
}

.setup-subheading .text-btn {
  padding: 0;
  margin-left: 0.18rem;
}

#join-family-panel {
  margin-top: 0.25rem;
}

.invite-share-block {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-top: 0.1rem;
}

.invite-url-text {
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.invite-qr-frame {
  width: fit-content;
  max-width: 100%;
  padding: 0.45rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgb(255 127 107 / 20%), rgb(125 92 255 / 16%));
  border: 1px solid rgb(255 127 107 / 35%);
  box-shadow: 0 8px 22px rgb(0 0 0 / 8%);
}

.settings-screen {
  display: grid;
  gap: 0.7rem;
}

.release-notes-list {
  display: grid;
  gap: 0.7rem;
}

.whats-new-version-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgb(255 127 107 / 20%);
  border: 1px solid rgb(255 127 107 / 35%);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.release-note-item {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
}

.release-note-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.release-note-item ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.ui-enter {
  animation: ui-fade-slide-in 280ms cubic-bezier(0.18, 0.84, 0.24, 1);
  will-change: transform, opacity;
}

.settings-screen-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-screen-header h2 {
  margin: 0;
}

.settings-back-btn {
  min-height: 32px;
  min-width: 32px;
  padding: 0.2rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
}

.theme-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.theme-field-label {
  font-size: 0.92rem;
  color: var(--muted);
}

.account-danger-zone {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--surface-border);
  display: grid;
  gap: 0.6rem;
}

.account-danger-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  cursor: pointer;
  list-style: none;
}

.account-danger-summary::-webkit-details-marker {
  display: none;
}

.account-notifications-zone {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--surface-border);
  display: grid;
  gap: 0.55rem;
}

.account-notifications-title {
  margin: 0;
  font-size: 0.96rem;
}

.account-notif-prefs {
  display: grid;
  gap: 0.45rem;
}

.notif-device-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.9rem;
}

.notif-device-toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.notif-device-state {
  min-width: 2.1rem;
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}

.notif-device-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--control-bg);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.notif-device-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}

.notif-device-toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.notif-device-toggle input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

.notif-device-toggle input[type="checkbox"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.account-danger-title {
  margin: 0;
  font-size: 0.96rem;
  color: var(--accent);
}

.account-form-stack.inline-form {
  flex-direction: column;
  align-items: stretch;
}

.account-reset-row {
  display: grid;
  gap: 0.35rem;
}

.account-reset-acks {
  display: grid;
  gap: 0.5rem;
}

.account-reset-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.account-reset-check input {
  margin: 0;
  flex: 0 0 auto;
}

.danger-btn {
  background: #7f1f1f;
  border-color: #7f1f1f;
}

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

.appearance-segmented,
.member-kind-segmented {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  gap: 2px;
}

.appearance-option,
.navstyle-option,
.member-kind-option {
  flex: 1;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.appearance-option:hover,
.navstyle-option:hover,
.member-kind-option:hover {
  filter: none;
  color: var(--text);
  background: var(--nav-item-hover);
}

.appearance-option:focus-visible,
.navstyle-option:focus-visible,
.member-kind-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.appearance-option[aria-pressed="true"],
.navstyle-option[aria-pressed="true"],
.member-kind-option[aria-pressed="true"] {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

body[data-appearance="dark"] .appearance-option[aria-pressed="true"],
body[data-appearance="dark"] .navstyle-option[aria-pressed="true"],
body[data-appearance="dark"] .member-kind-option[aria-pressed="true"] {
  box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
}

.family-invite-actions {
  gap: 0.5rem;
}

input,
select,
button {
  font: inherit;
}

input[type="date"],
input[type="file"],
input[type="text"],
select {
  background: var(--control-bg);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 10px;
  padding: 0.6rem 0.72rem;
  width: 100%;
}

.upload-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.upload-file-label.secondary-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40px;
  padding: 0.6rem 0.72rem;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font: inherit;
  font-weight: 650;
}

.upload-file-label.secondary-outline:active {
  transform: translateY(1px);
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  min-height: 40px;
}

button:hover {
  filter: brightness(1.08);
}

button.secondary-outline {
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

button.secondary-outline:hover {
  filter: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-border);
  outline-offset: 2px;
}

.note {
  color: var(--muted);
  margin: 0;
}

.empty-state-card {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
  margin-top: 0.5rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed var(--surface-border);
}

.empty-state-title {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 650;
}

.loading-stack {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.loading-shimmer {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 18%), rgb(255 255 255 / 4%));
}

body[data-appearance="light"] .loading-shimmer {
  background: linear-gradient(90deg, rgb(0 0 0 / 4%), rgb(0 0 0 / 12%), rgb(0 0 0 / 4%));
}

.loading-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 32%), transparent);
  animation: loading-shimmer 1.2s ease-in-out infinite;
}

body[data-appearance="light"] .loading-shimmer::after {
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent);
}

.loading-shimmer--line {
  height: 0.62rem;
}

.loading-shimmer--line.short {
  width: 68%;
}

.loading-copy {
  font-size: 0.78rem;
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.timeline-header h2 {
  margin: 0;
}

.timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
}

.timeline-child-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: min(220px, 100%);
}

.timeline-child-filter-wrap label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-child-filter-wrap select {
  width: 100%;
}

.timeline {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  align-items: start;
}

.timeline > .empty-state-card {
  grid-column: 1 / -1;
  width: min(100%, 28rem);
  justify-self: start;
}

/* Home timeline: dual/triple columns of stacked tiles (masonry-style packing, no shared row heights) */
.timeline--mosaic {
  display: block;
  grid-template-columns: unset;
  gap: 0;
}

.timeline-mosaic-cols {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.timeline-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline--mosaic .photo-card {
  width: 100%;
  border-radius: 11px;
}

.timeline-hero-slot {
  margin: 6px 0;
}

.timeline-hero-slot .photo-card {
  border-radius: 14px;
}

.timeline-hero-slot .photo-card--hero {
  box-shadow: 0 14px 38px var(--card-shadow);
}

@media (min-width: 560px) {
  .timeline {
    grid-template-columns: repeat(3, 1fr);
  }

  .timeline-mosaic-cols {
    gap: 10px;
  }
}

@media (max-width: 380px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline-mosaic-cols {
    gap: 10px;
  }
}

@media (orientation: landscape) and (max-height: 480px) and (min-width: 480px) {
  .timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
}

.view-screen-title {
  margin-bottom: 0.5rem;
}

.view-screen-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.calendar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.calendar-title-row h2 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
}

.cal-nav-btn {
  min-height: unset;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
}

.calendar-cell {
  aspect-ratio: 1;
  max-height: 52px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.2rem;
  gap: 2px;
}

.calendar-cell.is-muted {
  opacity: 0.35;
}

.calendar-cell.is-today {
  border-color: var(--accent);
}

.calendar-cell.is-selected {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

.calendar-cell.has-photos::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nav-coral);
}

.calendar-day-label {
  margin: 0.65rem 0 0.25rem;
}

.calendar-day-photos {
  margin-top: 0.25rem;
}

.albums-block-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.albums-block-hint {
  margin: 0 0 0.65rem;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 520px) {
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.album-card {
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.album-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.album-card-body {
  padding: 0.45rem 0.5rem 0.55rem;
  background: var(--card);
}

.album-card-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.album-card-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.album-detail-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.album-detail-bar h3 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
}

.text-btn {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  min-height: unset;
}

.create-album-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.65rem;
}

.activity-feed {
  display: grid;
  gap: 0.55rem;
}

.activity-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}

.activity-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.activity-detail {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.activity-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr 80px 1fr 1fr;
  align-items: end;
  justify-items: center;
  padding: 0.2rem 0.35rem calc(0.38rem + env(safe-area-inset-bottom));
  background: var(--nav-bar-bg);
  color: var(--nav-bar-text);
  border-top: 0;
  box-shadow: 0 -8px 28px var(--nav-bar-shadow);
  overflow: visible;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -48px;
  transform: translateX(-50%);
  width: 97px;
  height: 48px;
  border-radius: 48px 48px 0 0;
  background: var(--nav-bar-bg);
  border: 1px solid var(--nav-bar-divider);
  border-bottom: 0;
  pointer-events: none;
  z-index: -1;
}

.bottom-nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  width: 100%;
  max-width: 88px;
  padding: 0.26rem 0.15rem 0.24rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 10px;
  min-height: unset;
}

.bottom-nav-item:hover {
  filter: none;
  background: var(--nav-item-hover);
}

.bottom-nav-item.is-active {
  color: var(--nav-coral);
}

.bottom-nav-label {
  line-height: 1;
  letter-spacing: 0.01em;
}

.bottom-nav-icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  background: currentColor;
  opacity: 0.78;
}

.bottom-nav-item[data-nav-tab="home"] {
  grid-column: 1;
}

.bottom-nav-item[data-nav-tab="albums"] {
  grid-column: 2;
}

.bottom-nav-item[data-nav-tab="calendar"] {
  grid-column: 4;
}

.bottom-nav-item[data-nav-tab="activity"] {
  grid-column: 5;
}

.bottom-nav-item.is-active .bottom-nav-icon {
  opacity: 1;
  color: var(--nav-coral);
}

.ic-home {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ic-albums {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h4l2-2h4l2 2h4v12H4V6zm2 2v8h12V8H6zm2 2h8v2H8v-2zm0 3h5v2H8v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h4l2-2h4l2 2h4v12H4V6zm2 2v8h12V8H6zm2 2h8v2H8v-2zm0 3h5v2H8v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ic-calendar {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM5 8V6h14v2H5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM5 8V6h14v2H5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ic-bell {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.bottom-nav-fab {
  position: absolute;
  left: 50%;
  top: -30px;
  transform: translateX(-50%);
  z-index: 2;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  margin-bottom: 0;
  background: var(--nav-coral);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--fab-shadow);
  padding: 0;
  min-height: unset;
  --fab-plus-size: 22px;
  --fab-plus-thickness: 2.6px;
}

.bottom-nav-fab:hover {
  filter: brightness(1.06);
}

.bottom-nav-fab-plus {
  position: relative;
  width: var(--fab-plus-size);
  height: var(--fab-plus-size);
  display: inline-block;
  font-size: 0;
  line-height: 0;
}

.bottom-nav-fab-plus::before,
.bottom-nav-fab-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--fab-plus-size);
  height: var(--fab-plus-thickness);
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.bottom-nav-fab-plus::after {
  width: calc(var(--fab-plus-thickness) + 0.2px);
  height: var(--fab-plus-size);
  transform: translate(-50%, -50%);
}

.navstyle-segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* A: refined notch + medium FAB */
body[data-navstyle="a"] .bottom-nav::before {
  top: -40px;
  width: 88px;
  height: 40px;
}

body[data-navstyle="a"] .bottom-nav-fab {
  top: -24px;
  width: 54px;
  height: 54px;
}

/* B: floating dock with smaller overlap FAB */
body[data-navstyle="b"] .bottom-nav {
  left: 10px;
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  border-radius: 22px;
  border: 1px solid var(--nav-bar-divider);
  align-items: center;
  /* Equal fifths so the center action is truly centered (avoids 80px track vs 44px FAB imbalance). */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 10px 26px var(--nav-bar-shadow);
}

body[data-navstyle="b"] .bottom-nav::before {
  display: none;
}

body[data-navstyle="b"] .bottom-nav-fab {
  position: static;
  transform: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  box-shadow: none;
  justify-self: center;
  align-self: center;
}

body[data-navstyle="b"] .bottom-nav-fab-plus {
  --fab-plus-size: 17px;
  --fab-plus-thickness: 2.3px;
}

/* C: integrated center action (no floating FAB/notch) */
body[data-navstyle="c"] .bottom-nav {
  align-items: center;
  padding: 0.25rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
}

body[data-navstyle="c"] .bottom-nav::before {
  display: none;
}

body[data-navstyle="c"] .bottom-nav-fab {
  position: static;
  transform: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  box-shadow: none;
}

body[data-navstyle="c"] .bottom-nav-fab-plus {
  font-size: 1.65rem;
  font-weight: 500;
}

/* D: premium glass bar + balanced hierarchy */
body[data-navstyle="d"] .bottom-nav {
  border-top: 1px solid var(--nav-bar-divider);
  backdrop-filter: saturate(1.3) blur(9px);
  -webkit-backdrop-filter: saturate(1.3) blur(9px);
  background: var(--nav-bar-bg);
  padding: 0.28rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom));
}

body[data-navstyle="d"] .bottom-nav::before {
  top: -36px;
  width: 82px;
  height: 36px;
  border-color: var(--nav-bar-divider);
  background: var(--nav-bar-bg);
}

body[data-navstyle="d"] .bottom-nav-item {
  gap: 0.08rem;
  padding: 0.23rem 0.15rem 0.2rem;
}

body[data-navstyle="d"] .bottom-nav-fab {
  top: -22px;
  width: 52px;
  height: 52px;
  border: 1px solid rgb(255 255 255 / 45%);
  box-shadow: 0 8px 20px var(--fab-shadow);
}

body[data-navstyle="d"] .bottom-nav-item.is-active .bottom-nav-label {
  position: relative;
}

body[data-navstyle="d"] .bottom-nav-item.is-active .bottom-nav-label::after {
  content: "";
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  margin: 3px auto 0;
  background: var(--nav-coral);
}

.photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.photo-card[data-orientation="portrait"] .photo-card-media {
  aspect-ratio: 3 / 4;
}

.photo-card[data-orientation="landscape"] .photo-card-media {
  aspect-ratio: 4 / 3;
}

.photo-card:not([data-orientation]) .photo-card-media {
  aspect-ratio: 1;
}

.photo-card-media {
  position: relative;
  background: rgb(0 0 0 / 18%);
}

.photo-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

button.photo-card-media {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.photo-card-social-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  pointer-events: none;
  background: linear-gradient(to top, rgb(0 0 0 / 58%) 0%, rgb(0 0 0 / 30%) 45%, transparent 100%);
}

.photo-card-like-btn,
.photo-card-comments-btn {
  pointer-events: auto;
  appearance: none;
  border: 0;
  min-height: unset;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.52rem;
  background: rgb(255 255 255 / 14%);
  color: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgb(0 0 0 / 32%);
  transition: transform 150ms ease, background-color 150ms ease;
}

.photo-card-like-btn:hover,
.photo-card-comments-btn:hover {
  background: rgb(255 255 255 / 24%);
}

.photo-card-like-btn.is-liked .photo-card-like-icon {
  color: var(--accent);
}

.photo-card-like-btn.is-popping {
  animation: card-heart-pop 240ms ease-out;
}

.photo-card-like-icon {
  font-size: 0.98rem;
  line-height: 1;
  color: #fff;
}

.photo-card-like-count,
.photo-card-comments-count {
  min-width: 0.7rem;
}

.photo-card-comments-icon {
  display: inline-block;
  width: 0.86rem;
  height: 0.86rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@keyframes card-heart-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.status {
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: calc(5.75rem + env(safe-area-inset-bottom));
  background: var(--status-bg);
  border: 1px solid var(--status-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  z-index: 40;
  color: var(--text);
  box-shadow: 0 8px 28px var(--nav-bar-shadow);
}

.status.status--error {
  border-color: var(--status-error-border);
}

.hidden {
  display: none;
}

@keyframes menu-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-dropdown-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

@keyframes ui-fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loading-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-menu-dropdown.menu-enter,
  .header-menu-dropdown.menu-closing,
  .ui-enter {
    animation: none !important;
  }

  .loading-shimmer::after {
    animation: none !important;
  }
}

.children-screen-lead {
  margin: 0 0 0.5rem;
}

.children-list {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
}

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

.member-card-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.member-card-main {
  min-width: 0;
}

.member-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.member-card-meta {
  margin: 0.2rem 0 0;
}

.member-card-edit-btn {
  flex-shrink: 0;
}

.member-card-editor {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--surface-border);
}

.member-editor-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.member-editor-field:last-of-type {
  margin-bottom: 0.5rem;
}

.member-editor-field .theme-field-label {
  margin: 0;
}

.member-card-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.add-member-panel {
  margin-top: 0.75rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 12px;
  border: 1px dashed var(--surface-border);
  background: var(--surface);
}

.add-member-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 650;
}

.add-member-form {
  gap: 1.1rem;
}

.add-member-form.inline-form {
  flex-direction: column;
  align-items: stretch;
}

.add-member-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.add-member-field .theme-field-label {
  margin: 0;
}

.add-member-field .member-kind-segmented {
  margin-top: 0.1rem;
}

.add-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
}

.member-add-cta {
  width: 100%;
  margin-top: 0.75rem;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  box-shadow: none;
  font-weight: 650;
}

.member-add-cta:hover {
  filter: brightness(1.04);
}

.member-add-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.invite-qr {
  display: block;
  margin: 0;
  width: 190px;
  max-width: 100%;
  border-radius: 10px;
  background: #fff;
  padding: 0.42rem;
}

@media (min-width: 760px) {
  body {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .container {
    width: min(920px, 92vw);
  }

  .header {
    padding: 1.5rem 0 0.5rem;
  }

  .stack {
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .inline-form {
    flex-direction: row;
    align-items: center;
  }

  .account-form-stack.inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .setup-wizard-form.inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .add-member-form.inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .add-member-form input[type="text"],
  .add-member-form input[type="date"] {
    width: 100%;
  }

  input[type="date"],
  input[type="file"],
  input[type="text"],
  select {
    width: auto;
    padding: 0.45rem 0.62rem;
  }

  button {
    padding: 0.52rem 0.78rem;
  }

  .timeline-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .timeline-toolbar {
    justify-content: flex-end;
    align-items: center;
  }

  .timeline-child-filter-wrap {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: auto;
  }

  .timeline-child-filter-wrap label {
    margin: 0;
    white-space: nowrap;
  }

  .timeline-child-filter-wrap select {
    width: min(240px, 28vw);
  }

  .status {
    left: auto;
    right: 1rem;
    bottom: 1rem;
  }

}

/* Full-screen photo viewer */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  background: #0a090d;
  color: #f3f1f7;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.photo-viewer.hidden {
  display: none;
}

.photo-viewer-chrome {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.5rem;
  min-height: 2.75rem;
}

.photo-viewer-back,
.photo-viewer-menu-btn {
  appearance: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer-back:hover,
.photo-viewer-menu-btn:hover {
  background: rgb(255 255 255 / 16%);
}

.photo-viewer-age {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  color: rgb(255 255 255 / 92%);
  padding: 0 0.25rem;
}

.photo-viewer-menu-btn {
  justify-self: end;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.photo-viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  padding: 0 6px;
}

.photo-viewer-img {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  -webkit-user-drag: none;
}

.photo-viewer-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgb(0 0 0 / 72%), rgb(0 0 0 / 28%) 60%, transparent);
}

.pv-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.55rem;
  border: none;
  border-radius: 12px;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.pv-action:hover {
  background: rgb(255 255 255 / 18%);
}

.pv-like {
  flex: 0 0 auto;
}

.pv-like .pv-like-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: rgb(255 255 255 / 95%);
}

.pv-like.is-liked .pv-like-icon {
  color: var(--accent);
}

.pv-like-count {
  font-size: 0.85rem;
  font-weight: 650;
  min-width: 0.5rem;
}

.pv-comment-btn {
  flex: 1;
  max-width: 8rem;
  margin: 0 auto;
}

.pv-comment-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  opacity: 0.95;
  flex-shrink: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.pv-comment-count {
  font-size: 0.85rem;
}

.pv-download {
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 500;
}

.pv-scrim {
  position: absolute;
  inset: 0;
  z-index: 3010;
  background: rgb(0 0 0 / 45%);
}

.pv-scrim.hidden {
  display: none;
}

.pv-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3020;
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--text);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgb(0 0 0 / 35%);
  padding-bottom: env(safe-area-inset-bottom);
}

.pv-sheet.hidden {
  display: none;
}

.pv-sheet-handle {
  width: 2.25rem;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-border);
  margin: 0.5rem auto 0.25rem;
}

.pv-sheet-title {
  margin: 0.35rem 1rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.pv-comment-sheet .pv-sheet-title {
  text-align: center;
}

.pv-comments-thread {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pv-comment-item {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--surface-border);
}

.pv-comment-item:last-child {
  border-bottom: none;
}

.pv-comment-body {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pv-comment-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.pv-comment-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem 1rem;
  border-top: 1px solid var(--surface-border);
  background: var(--surface);
}

.pv-comment-form input[type="text"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
}

.pv-comment-form button {
  flex-shrink: 0;
}

.pv-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 1rem 0.25rem;
}

.pv-info-body {
  overflow-y: auto;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pv-info-row {
  display: grid;
  gap: 0.25rem;
}

.pv-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pv-info-value {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pv-tags-edit-card {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  display: grid;
  gap: 0.55rem;
}

.pv-tags-edit-head {
  display: grid;
  gap: 0.15rem;
}

.pv-tags-checkboxes {
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.15rem;
}

.pv-tag-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.35rem 0.25rem;
  border-radius: 10px;
}

.pv-tag-option input {
  margin-top: 0.2rem;
}

.pv-tag-option span {
  font-size: 0.92rem;
  line-height: 1.25;
}

.pv-tags-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

#pv-info-title-edit-wrap:not(.hidden) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#pv-info-title-edit-wrap input[type="text"] {
  flex: 1;
  min-width: 140px;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
}

.pv-likers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pv-likers-list li {
  font-size: 0.88rem;
}

.pv-likers-empty {
  color: var(--muted);
  font-style: italic;
}

.pv-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pv-info-actions button {
  flex: 1;
  min-width: 120px;
}

.pv-info-actions .secondary-outline {
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

#pv-album-select {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  background: rgb(0 0 0 / 45%);
  backdrop-filter: blur(4px);
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  position: relative;
  width: min(22rem, 100%);
  margin-top: 10vh;
  padding: 1.25rem 1.35rem 1.5rem;
}

.auth-close-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  min-height: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.auth-close-btn:hover {
  background: var(--nav-item-hover);
  color: var(--text);
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.auth-lead {
  margin-top: 0;
}

.auth-form {
  margin-top: 0.75rem;
}

.auth-forgot-toggle {
  align-self: flex-start;
  margin-top: 0.1rem;
}

.auth-reset-panel {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--surface-border);
}

.auth-reset-debug-token {
  display: block;
  overflow-wrap: anywhere;
  margin: 0.25rem 0 0.6rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: 0.78rem;
}

.auth-subheading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.auth-divider {
  text-align: center;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-divider span {
  padding: 0 0.5rem;
}

.auth-switch-row {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.auth-social-btns {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-social-link {
  display: block;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-social-link--google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.auth-google-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
}

.auth-google-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-social-link:hover {
  background: var(--nav-item-hover);
}

.auth-social-link.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

.auth-social-link.is-disabled:hover {
  background: var(--surface);
}

.header-menu-signout {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.invite-role-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.invite-role-field select {
  width: 100%;
  min-height: 2.35rem;
  font: inherit;
}

.family-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.family-member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

.family-member-name {
  margin: 0;
  font-weight: 600;
}

.family-member-meta {
  margin: 0.15rem 0 0;
}

.family-member-role-select {
  min-width: 7.5rem;
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.admin-section-title {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.admin-section-title:first-of-type {
  margin-top: 0;
}

.admin-block-collapse {
  margin-top: 0.65rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.admin-block-collapse:first-of-type {
  margin-top: 0.35rem;
}

.admin-block-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--text);
  background: rgb(0 0 0 / 4%);
  border-bottom: 1px solid var(--surface-border);
  user-select: none;
}

/* Keep section title + count readable: label left, count + caret right */
.admin-block-summary .admin-block-summary-meta {
  margin-left: auto;
  margin-right: 0.35rem;
}

body[data-appearance="dark"] .admin-block-summary {
  background: rgb(255 255 255 / 4%);
}

.admin-block-summary::-webkit-details-marker {
  display: none;
}

.admin-block-summary::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.admin-block-collapse[open] .admin-block-summary::after {
  content: "▴";
}

.admin-block-summary-label {
  min-width: 0;
}

.admin-block-summary-meta {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-block-body {
  padding: 0.5rem 0.55rem 0.6rem;
}

.admin-filter-field {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 0.45rem;
}

.admin-filter-field input {
  width: 100%;
}

.admin-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.admin-user-row {
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--card);
  padding: 0;
  overflow: hidden;
}

/* Dense row: text column + compact action (no full-width button). */
.admin-row-top--dense {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.45rem;
  row-gap: 0;
  padding: 0.28rem 0.4rem;
  min-width: 0;
}

.admin-dense-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}

.admin-dense-email {
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-top--dense .admin-row-actions {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  width: auto;
  margin-top: 0.06rem;
}

.admin-item-details {
  width: 100%;
  min-width: 0;
}

.admin-item-summary {
  list-style: none;
  cursor: pointer;
  min-width: 0;
}

.admin-item-summary::-webkit-details-marker {
  display: none;
}

.admin-compact-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  min-width: 0;
}

.admin-row-title--inline {
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.2;
}

.admin-compact-sub {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.admin-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.06rem 0.28rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.admin-badge--muted {
  background: rgb(128 128 128 / 15%);
  color: var(--muted);
  border-color: var(--surface-border);
}

.admin-item-extra {
  margin: 0.22rem 0 0;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  background: rgb(0 0 0 / 5%);
  border: 1px solid var(--surface-border);
}

body[data-appearance="dark"] .admin-item-extra {
  background: rgb(255 255 255 / 4%);
}

.admin-item-extra-line {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-item-extra-line + .admin-item-extra-line {
  margin-top: 0.25rem;
}

.admin-mono {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.admin-family-code-inline {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.admin-btn-compact {
  flex-shrink: 0;
  padding: 0.22rem 0.42rem !important;
  min-height: 30px !important;
  font-size: 0.76rem !important;
  border-radius: 8px !important;
}

.admin-row-info {
  min-width: 0;
  flex: 1;
}

.admin-row-title {
  margin: 0;
  font-weight: 700;
}

.admin-row-meta {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  line-height: 1.3;
  word-break: break-word;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: flex-start;
}

.admin-row-actions button,
.admin-row-actions select {
  min-height: 30px;
}

.admin-family-row {
  margin: 0;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--card);
  padding: 0;
  overflow: hidden;
}

.admin-detail {
  margin-top: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--surface);
}

.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-detail-title {
  margin: 0;
  font-size: 1rem;
}

.admin-detail-subtitle {
  margin: 0.25rem 0 0.55rem;
  word-break: break-word;
}

.admin-action-group {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--surface-border);
}

.admin-action-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-family-detail-meta {
  margin: 0 0 0.7rem;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

@media (max-width: 620px) {
  .admin-inline-form {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .container {
    width: calc(100vw - 0.8rem);
  }

  .header {
    padding-top: 0.8rem;
  }

  .card {
    padding: 0.75rem;
  }

  .admin-row-meta {
    font-size: 0.8rem;
  }

  .admin-compact-sub {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .admin-dense-email {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

.welcome-card h2 {
  margin-bottom: 0.35rem;
}

.welcome-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.65rem;
}

.welcome-auth-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.welcome-preview {
  position: relative;
  margin-top: 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.welcome-preview-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.75rem;
  max-height: 24rem;
  overflow: hidden;
}

.welcome-preview-card {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--card);
}

.welcome-preview-media {
  aspect-ratio: 1;
}

.welcome-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.welcome-preview-meta {
  padding: 0.5rem 0.65rem 0.35rem;
}

.welcome-preview-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.welcome-preview-age {
  margin: 0.16rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.welcome-preview-social-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  padding: 0.4rem 0.5rem 0.5rem;
}

.welcome-preview-card .photo-card-like-btn,
.welcome-preview-card .photo-card-comments-btn {
  pointer-events: none;
  cursor: default;
  background: var(--control-bg);
  color: var(--muted);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.welcome-preview-card .photo-card-like-btn.is-liked .photo-card-like-icon {
  color: var(--accent);
}

.welcome-preview-card .photo-card-comments-icon {
  color: currentColor;
}

.welcome-preview-fade {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 6.5rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0%), var(--surface) 78%);
}

.welcome-next-actions {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.welcome-block {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--surface);
}

.welcome-block h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.welcome-guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0.6rem;
}

.welcome-guide-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--control-bg);
}

.welcome-guide-pill.is-active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--surface);
}

.welcome-guide-panel {
  display: grid;
  gap: 0.45rem;
}

.welcome-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.welcome-guide-code {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.welcome-requests {
  display: grid;
  gap: 0.35rem;
}

.welcome-request-item {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
}

.auth-social-hint {
  margin-top: 0.75rem;
}

.join-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
