/* ===========================================================================
   PhotoGalaxy · core component styles
   Loads after theme.css. Every color reference is a CSS variable.
   =========================================================================== */

/* ---------- TOP NAV ---------- */
.top-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 250, 248, 0.85);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  color: var(--text);
}
.brand-mark svg { display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 500; font-size: 18px;
  letter-spacing: -.005em;
  color: var(--text);
}
.nav-links {
  display: flex; align-items: center; gap: 22px;
  font-size: 14px;
}
.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  font: inherit; font-weight: 500; padding: 0;
  transition: color var(--dur-fast) var(--ease);
}
.link-button:hover { color: var(--text); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font: 500 14px/1 var(--font-ui);
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }

/* Default — light fill, soft border */
.btn:not(.btn-primary):not(.btn-ghost) {
  background: var(--surface);
  border-color: var(--line);
}
.btn:not(.btn-primary):not(.btn-ghost):hover {
  background: var(--surface-alt);
  border-color: var(--line-strong);
}

/* Primary / selected — dark grey */
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Ghost — borderless, used for secondary actions */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.btn[disabled], .btn:disabled {
  opacity: .55; cursor: not-allowed;
  background: var(--surface-sunken);
  color: var(--text-muted);
  border-color: var(--line);
}

.linklike {
  background: none; border: none; cursor: pointer;
  color: var(--text);
  font: inherit; padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.linklike:hover { text-decoration-color: var(--accent); }

/* ---------- LANDING ---------- */
.page-main { min-height: calc(100vh - 140px); }

.hero {
  max-width: 1280px; margin: 0 auto;
  padding: 80px 32px 40px;
  display: grid; gap: 48px;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 22px;
  color: var(--text);
}
.hero-title em {
  font-style: italic;
  color: var(--text-secondary);
}
.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 0 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-collage {
  display: grid; gap: 12px;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 50px);
  height: 500px;
}
.tile {
  border-radius: var(--radius);
  background: var(--surface-alt) center/cover no-repeat;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  position: relative;
}
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(56, 55, 58, .04), rgba(56, 55, 58, .12));
}
.t1 { grid-column: 1 / 4; grid-row: 1 / 4; background-image: linear-gradient(135deg, #ddd9d0, #b6b1a6); }
.t2 { grid-column: 4 / 7; grid-row: 1 / 3; background-image: linear-gradient(135deg, #ebe9e3, #9a989d); }
.t3 { grid-column: 4 / 6; grid-row: 3 / 5; background-image: linear-gradient(135deg, #4a4a4d, #6b6a6f); }
.t4 { grid-column: 6 / 7; grid-row: 3 / 6; background-image: linear-gradient(135deg, #fcfbf9, #d6d2c9); }
.t5 { grid-column: 1 / 5; grid-row: 4 / 7; background-image: linear-gradient(135deg, #c9c4b8, #6b6a6f); }

/* ---------- FEATURES ---------- */
.features {
  max-width: 1280px; margin: 0 auto;
  padding: 60px 32px 100px;
}
.features-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--dur-slow) var(--ease),
    box-shadow var(--dur-slow) var(--ease),
    border-color var(--dur) var(--ease);
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.feature-num {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: .12em;
  margin-bottom: 16px;
}
.feature h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: var(--text);
}
.feature p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; gap: 10px;
}
.footer-sep { opacity: .5; }

/* ---------- AUTH ---------- */
.page-auth .page-main {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px;
}
.auth-shell { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-sub {
  color: var(--text-secondary);
  margin: 0 0 28px;
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.auth-switch a {
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
}

/* ---------- FORMS ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: 400 15px var(--font-ui);
  color: var(--text);
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--line-strong); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
.field-inline {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 20px;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text);
}
.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-soft);
}
.alert-info {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--line);
}

/* ---------- AUTH TABS ---------- */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.tab-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font: 500 13px var(--font-ui);
  color: var(--text-secondary);
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.field-help {
  margin: -6px 0 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Subdomain input — text field on the left, fixed suffix label on the right */
.subdomain-input {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.subdomain-input:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
.subdomain-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font: 400 15px var(--font-ui);
  color: var(--text);
  outline: none;
}
.subdomain-suffix {
  display: inline-flex; align-items: center;
  padding: 0 14px;
  background: var(--surface-alt);
  border-left: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

/* Visibility radio group used on the cover editor */
.visibility-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.visibility-option {
  display: block;
  cursor: pointer;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition:
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.visibility-option:hover {
  border-color: var(--line-strong);
}
.visibility-option input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.visibility-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.visibility-option-title {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.visibility-option-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sidebar separator + private-password sub-panel on the cover editor */
.side-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0 18px;
}
.password-panel {
  margin-top: 6px;
  transition:
    opacity var(--dur) var(--ease),
    max-height var(--dur) var(--ease);
}
.password-panel.is-hidden {
  display: none;
}
.clear-pw-btn {
  font-size: 12px;
  margin-top: -8px;
}

/* Visible-on-card "Private" badge for the dashboard gallery list */
.gallery-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
  vertical-align: middle;
}

/* OTP-specific bits */
.otp-target {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.otp-target-label {
  color: var(--text-muted);
}
.otp-target strong {
  color: var(--text);
  font-weight: 500;
}
.otp-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: .5em !important;
  text-align: center;
  font-size: 22px !important;
  font-weight: 500;
  padding: 14px 14px !important;
  /* The letter-spacing makes a trailing gap; pull text left to re-center visually */
  padding-left: 1.3em !important;
}
.otp-secondary {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dot-sep { color: var(--line-strong); }

/* ---------- DASHBOARD APP SHELL ---------- */
/*
  The dashboard uses a different chrome than the public pages:
  a full-height grey sidebar pinned to the left, and a white canvas
  for all page content. The root layout's top nav is hidden via
  ViewData["HideChrome"] = true on the dashboard.
*/
.page-dashboard { background: var(--surface-alt); }
.page-dashboard .page-main { min-height: 100vh; }

.dashboard-main { padding: 0; max-width: none; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.app-side {
  background: var(--surface-sidebar);
  border-right: 1px solid rgba(0, 0, 0, .08);
  padding: 24px 24px 20px;
  display: flex; flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  margin-bottom: 6px;
}
.side-brand:hover { color: var(--text); }
.side-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--text);
  flex-shrink: 0;
}
.side-brand-mark svg { display: block; }
.side-brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -.005em;
  color: var(--text);
}

.side-back {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.side-back:hover { color: var(--text); }

.side-gallery-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--text);
  line-height: 1.2;
  padding-right: 24px;
}
.side-gallery-title--muted {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: .18em;
}

.side-status {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: .04em;
}
.side-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--text-secondary);
  display: inline-block;
}

.side-nav {
  display: flex; flex-direction: column;
  gap: 2px;
  margin-top: 10px;
}
.nav-link {
  display: block;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
  position: relative;
}
.nav-link:hover {
  background: rgba(255, 255, 255, .35);
  color: var(--text);
}
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, .55);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -24px; top: 10px; bottom: 10px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-separator {
  height: 1px;
  background: rgba(0, 0, 0, .12);
  margin: 10px -12px;
}

/* Bottom-anchored footer */
.side-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.side-cta {
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 14px 18px;
}
.side-signout-form { margin: 0; }
.side-signout {
  background: none; border: none;
  color: var(--text-muted);
  font: 500 12px var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 0;
  width: 100%;
  margin-top: 6px;
  transition: color var(--dur-fast) var(--ease);
}
.side-signout:hover { color: var(--text); }

/* ===== Main canvas ===== */
.app-main {
  background: var(--surface);
  padding: 44px 48px 80px;
  min-width: 0;  /* prevents grid overflow */
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -.02em;
  margin: 0 0 4px;
  color: var(--text);
}
.page-sub {
  color: var(--text-secondary);
  margin: 0; font-size: 15px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 16px;
}

.muted { color: var(--text-muted); font-size: 13px; }

/* ---------- GALLERY CARDS (overview) ---------- */
.gallery-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.gallery-cover {
  aspect-ratio: 4/3;
  background: var(--surface-alt) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line-soft);
}
.gallery-cover-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-style: italic;
}
.gallery-meta { padding: 16px 18px; }
.gallery-meta h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 0 0 4px;
  color: var(--text);
}
.gallery-meta span {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 80px 32px;
}
.empty-state.inset { padding: 56px 32px; }
.empty-icon {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text);
}
.empty-state p {
  color: var(--text-secondary);
  margin: 0 auto 20px;
  max-width: 440px;
}

/* ---------- DIALOG ---------- */
.app-dialog {
  border: none; padding: 0; background: transparent;
  max-width: 460px; width: calc(100% - 32px);
  border-radius: var(--radius-lg);
}
.app-dialog::backdrop {
  background: rgba(44, 43, 46, .35);
  backdrop-filter: blur(4px);
}
.app-dialog form {
  background: var(--surface);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.app-dialog h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--text);
}
.dialog-sub {
  color: var(--text-secondary);
  margin: 0 0 20px;
  font-size: 14px;
}
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 8px;
}

/* ---------- COVER EDITOR ---------- */
.cover-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1.1fr 1fr;
}
.cover-drop {
  margin-top: 8px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  aspect-ratio: 3/2;
  background: var(--surface-alt);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.cover-drop:hover,
.cover-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cover-preview {
  width: 100%; height: 100%;
  background: center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.cover-drop-inner { text-align: center; padding: 20px; }
.cover-drop-icon {
  font-size: 26px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.cover-drop-inner p { margin: 4px 0; }

.template-list {
  /* Retained only for backward compat; the Cover editor now uses .template-strip/.template-row */
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- UPLOAD PAGE ---------- */
.section-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--text);
}
.upload-drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  background: var(--surface-alt);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
  margin-bottom: 16px;
}
.upload-drop:hover,
.upload-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-drop-inner {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}
.upload-drop-icon {
  font-size: 22px;
  color: var(--text-secondary);
}
.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.thumb-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line-soft);
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.thumb-del {
  position: absolute; top: 6px; right: 6px;
  background: rgba(44, 43, 46, .75);
  color: var(--text-on-accent);
  border: none; border-radius: 50%;
  width: 24px; height: 24px;
  cursor: pointer;
  font-size: 16px; line-height: 1;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.thumb:hover .thumb-del { opacity: 1; }

/* ---------- SHARE PAGE ---------- */
.share-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.share-form {
  display: flex; gap: 12px; align-items: flex-end;
}
.share-form .field { flex: 1; margin: 0; }
.share-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.share-items { list-style: none; padding: 0; margin: 0; }
.share-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.share-item:last-child { border-bottom: none; }
.share-scope {
  font-weight: 500; font-size: 14px;
  color: var(--text);
}
.share-url {
  color: var(--text-secondary);
  font-size: 13px;
  word-break: break-all;
  border-bottom: 1px dashed var(--line-strong);
}
.share-url:hover { color: var(--accent); }
.share-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: var(--line-strong);
  transition: background var(--dur) var(--ease);
  border-radius: var(--radius-pill);
}
.toggle-slider::before {
  content: ""; position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background-color: var(--surface);
  transition: transform var(--dur) var(--ease);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}
.toggle input:checked + .toggle-slider { background-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: transform var(--dur-slow) var(--ease);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); }

/* ---------- HELPERS ---------- */
.narrow-page {
  max-width: 520px; margin: 80px auto;
  padding: 32px; text-align: center;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 48px 24px; }
  .hero-collage { height: 360px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }

  /* Collapse the app shell into a single column; sidebar becomes a top bar */
  .app-shell { grid-template-columns: 1fr; }
  .app-side {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  .side-brand,
  .side-back,
  .side-gallery-title,
  .side-status { margin: 0; }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    margin-left: auto;
    gap: 4px;
  }
  .nav-link { margin: 0; padding: 8px 12px; white-space: nowrap; }
  .nav-link.active::before { display: none; }
  .nav-separator { display: none; }
  .side-footer {
    flex-direction: row;
    flex-basis: 100%;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }
  .side-cta { flex: 1; }
  .app-main { padding: 24px 20px 80px; }

  .cover-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 14px 18px; }
  .auth-card { padding: 28px 22px; }
  .share-form { flex-direction: column; align-items: stretch; }
  .share-item { flex-direction: column; align-items: flex-start; }
  .app-main { padding: 20px 16px 80px; }
}
