/* ==========================================================================
   1. Foundations and design tokens
   ========================================================================== */

:root {
  color-scheme: light;

  /* Viewport and layout */
  --app-viewport-height: 100vh;
  --portrait-lock-width: 100vw;
  --portrait-lock-height: 100vh;
  --portrait-lock-footer-drop: 0px;

  /* Core palette */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #607080;
  --border: #d8dee6;
  --accent: #166f7a;
  --accent-strong: #0f5962;

  /* Brand/application palette */
  --brand-petrol: #003f46;
  --brand-petrol-dark: #002f39;
  --brand-orange: #f45a36;
  --brand-paper: #fffdf8;

  /* Status palette */
  --status-ok-border: #9bc7aa;
  --status-ok-bg: #f2fbf5;
  --status-warning-border: #d9c287;
  --status-warning-bg: #fff9e8;
  --status-error-border: #d99a9a;
  --status-error-bg: #fff1f1;

  /* Shape, spacing and elevation */
  --radius-sm: 8px;
  --radius-pill: 999px;
  --control-height: 42px;
  --card-gap: 12px;
  --card-padding: 14px;
  --card-radius: 8px;
  --card-border: #ece8df;
  --card-bg: #ffffff;
  --shadow-card: 0 8px 22px rgba(17, 24, 32, 0.06);
  --shadow-shell: 0 18px 60px rgba(0, 20, 28, 0.3);
}

@supports (height: 100dvh) {
  :root {
    --app-viewport-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.intro-open {
  overflow: hidden;
}

body.intro-pending {
  background: #06191d;
}

body.intro-pending .app-shell {
  visibility: hidden;
}

body.intro-pending::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: #06191d;
}

html.portrait-orientation-fallback {
  width: 100%;
  height: 100%;
  overflow: hidden;
  --portrait-lock-footer-drop: max(10px, env(safe-area-inset-bottom));
}

body.force-portrait-orientation {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--portrait-lock-width);
  height: var(--portrait-lock-height);
  max-width: none;
  overflow: hidden;
  background: var(--bg);
  transform-origin: top left;
}

body.force-portrait-orientation.portrait-rotated-clockwise {
  transform: rotate(90deg) translateY(-100%);
}

body.force-portrait-orientation.portrait-rotated-counterclockwise {
  transform: rotate(-90deg) translateX(-100%);
}

body.force-portrait-orientation .mobile-shell {
  width: 100%;
  height: var(--portrait-lock-height);
  min-height: var(--portrait-lock-height);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
}

body.force-portrait-orientation .bottom-nav {
  bottom: calc(-1 * var(--portrait-lock-footer-drop));
  width: var(--portrait-lock-width);
  border-radius: 0;
}

body.force-portrait-orientation .upload-fab {
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom) - var(--portrait-lock-footer-drop));
}

/* ==========================================================================
   2. Intro animation
   ========================================================================== */

.intro-animation {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  overflow: hidden;
  background: #06191d;
  color: #ffffff;
}

.intro-animation.hidden {
  display: none;
}

.intro-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: intro-image 5s ease-out both;
}

.intro-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 25, 29, 0.28), rgba(6, 25, 29, 0.1) 36%, rgba(6, 25, 29, 0.82)),
    linear-gradient(90deg, rgba(6, 25, 29, 0.72), rgba(6, 25, 29, 0.08));
}

.intro-content {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 8px;
  width: min(100% - 36px, 430px);
  margin: 0 auto calc(56px + env(safe-area-inset-bottom));
}

.intro-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.36));
  opacity: 0;
  transform: translateY(14px);
  animation: intro-up 0.7s ease 0.25s both;
}

.intro-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(14px);
  animation: intro-up 0.7s ease 0.45s both;
}

.intro-content h1 {
  margin: 0;
  font-size: clamp(2rem, 11vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(16px);
  animation: intro-up 0.78s ease 0.7s both;
}

.intro-facts {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.intro-facts div {
  display: grid;
  grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  opacity: 0;
  transform: translateY(14px);
  animation: intro-up 0.65s ease both;
}

.intro-facts .intro-fact-delay-0 {
  animation-delay: 1.1s;
}

.intro-facts .intro-fact-delay-1 {
  animation-delay: 1.45s;
}

.intro-facts .intro-fact-delay-2 {
  animation-delay: 1.8s;
}

.intro-facts .intro-fact-delay-3 {
  animation-delay: 2.15s;
}

.intro-facts dt {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-facts dd {
  margin: 0;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 760;
  overflow-wrap: anywhere;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}

.intro-skip {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(6, 25, 29, 0.34);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
  backdrop-filter: blur(14px);
}

.intro-animation.is-leaving {
  animation: intro-fade-out 0.26s ease both;
}

@keyframes intro-image {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1);
  }
}

@keyframes intro-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-fade-out {
  to {
    opacity: 0;
  }
}

/* ==========================================================================
   3. Base layout, panels and utilities
   ========================================================================== */

.app-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  padding: 32px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

.panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hidden {
  display: none;
}

.map-stage.hidden,
.map-bottom-sheet.hidden,
.map-list.hidden,
.global-search-modal.hidden {
  display: none;
}

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   4. Buttons, forms and shared controls
   ========================================================================== */

button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

button:disabled {
  border-color: var(--border);
  background: #edf1f4;
  color: var(--muted);
  cursor: not-allowed;
}

.secondary {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.secondary.danger {
  border-color: rgba(163, 58, 58, 0.28);
  background: #fff4f2;
  color: #a33a3a;
}

.subtle-button {
  min-height: 34px;
  justify-self: start;
  padding: 0 12px;
  border-color: rgba(32, 48, 56, 0.14);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.success {
  color: #247246;
}

.message {
  min-height: 1.4em;
  margin: 18px 0 0;
  color: var(--muted);
}

.field,
.check-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span,
.check-field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.check-field {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.profile-push-control {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.memory-push-option {
  margin: 4px 0 0;
}

.memory-push-frequency {
  margin-bottom: 0;
}

/* ==========================================================================
   5. Admin forms and issue entry
   ========================================================================== */

.admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.issue-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.issue-description {
  grid-column: 1 / -1;
}

/* ==========================================================================
   6. Upload and import status
   ========================================================================== */

.photo-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.upload-dropzone {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.upload-help {
  margin: 0;
  color: #607080;
  font-size: 0.9rem;
  line-height: 1.4;
}

.upload-dropzone.drag-active {
  border-color: var(--accent);
  background: #eef8f7;
}

.upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-location-option {
  margin: 0;
  padding: 10px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffdf8;
}

.selected-files {
  display: grid;
  gap: 8px;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.selected-file span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.selected-file strong,
.selected-file small {
  overflow-wrap: anywhere;
}

.selected-file small {
  color: var(--muted);
}

.compact {
  min-height: 0;
  margin: 0;
}

.upload-progress {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.visit-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.visit-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

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

.visit-details summary::after {
  content: "Aufklappen";
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.visit-details[open] summary::after {
  content: "Zuklappen";
}

.visit-details summary span {
  display: grid;
  gap: 2px;
}

.visit-details summary small {
  color: var(--muted);
}

.place-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.places-map {
  height: 184px;
  margin: 0 -14px 12px;
  overflow: hidden;
  background: #edf1f4;
}

.places-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.places-search-panel.hidden {
  display: none;
}

.places-search-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  background: #ffffff;
  padding: 0 14px;
  color: #17202a;
  font-size: 1rem;
}

.place-card {
  display: grid;
  gap: var(--card-gap);
  padding: var(--card-padding);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
}

.place-card.is-highlight {
  border-color: rgba(217, 111, 50, 0.45);
  background: #fff8f0;
}

.place-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--card-gap);
}

.place-card-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.place-card-badges {
  display: flex;
  align-self: start;
  align-items: center;
  gap: 7px;
}

.place-card-main em {
  min-width: 40px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f5f0e7;
  color: #111820;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.place-highlight-icon,
.place-card-icon-action {
  --round-icon-size: 36px;
  --round-icon-image-size: 19px;
  --round-icon-bg: rgba(255, 253, 248, 0.74);
  --round-icon-border: rgba(16, 36, 43, 0.08);
  --round-icon-active-bg: rgba(244, 90, 54, 0.12);
  cursor: pointer;
}

.place-highlight-icon:disabled,
.place-card-icon-action:disabled {
  cursor: default;
}

.place-highlight-icon img,
.place-card-icon-action img {
  opacity: 0.7;
}

.place-highlight-icon.is-active img {
  opacity: 1;
}

.place-card-icon-action img {
  --round-icon-image-size: 17px;
}

.place-card-body {
  display: grid;
  gap: var(--card-gap);
  min-width: 0;
}

.place-card-body strong,
.place-card-body small {
  overflow-wrap: anywhere;
}

.place-card-body small {
  color: var(--muted);
}

.place-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.place-thumbs button {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #edf1f4;
  cursor: pointer;
}

.place-thumbs img {
  width: 100%;
  aspect-ratio: 1.55;
  display: block;
  object-fit: cover;
  border-radius: 5px;
  background: #edf1f4;
}

.place-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.place-action-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #ff5a2f;
  border-radius: 8px;
  background: #ffffff;
  color: #e84a22;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}


.place-count-marker {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #063f49;
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 6px 16px rgba(0, 38, 47, 0.22);
}

.place-count-marker span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
}

.map-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.map-controls .field {
  margin-bottom: 0;
}

.map-timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.map-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffdf8;
}

.map-timeline-header span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-timeline-header strong,
.map-timeline-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-timeline-header small {
  color: #607080;
}

.map-timeline-header button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.map-timeline-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.map-timeline-days button {
  display: grid;
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 48px;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid #d7e3e2;
  border-radius: 8px;
  background: #ffffff;
  color: #17323a;
  font-size: 0.82rem;
  scroll-snap-align: start;
}

.map-timeline-days button.is-active {
  border-color: #f45a36;
  background: #fff4ef;
  color: #e84a22;
}

.map-timeline-days button small {
  color: #607080;
  font-size: 0.74rem;
}

.map-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  padding: 3px;
  border-radius: 999px;
  background: #ece8df;
}

.map-mode-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #17323a;
}

.map-mode-tabs button.is-active {
  background: #fffdf8;
  color: #f45a36;
  box-shadow: 0 4px 12px rgba(17, 24, 32, 0.08);
}

.map-stage {
  position: relative;
  min-height: 56vh;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf1f4;
}

.travel-map {
  min-height: 56vh;
  height: 56vh;
  margin-top: 0;
  overflow: hidden;
  background: #edf1f4;
}

.map-bottom-sheet {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 500;
  display: grid;
  gap: 10px;
  padding: 8px 10px 10px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 12px 34px rgba(17, 24, 32, 0.22);
  backdrop-filter: blur(14px);
}

.map-sheet-handle {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #aeb8bf;
}

.map-sheet-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: start;
}

.map-sheet-title span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-sheet-title strong,
.map-sheet-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-sheet-title small {
  color: #607080;
}

.map-sheet-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.map-sheet-thumbs img {
  width: 100%;
  aspect-ratio: 1.28;
  border-radius: 6px;
  object-fit: cover;
}

.map-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-sheet-actions .map-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #ff5a2f;
  border-radius: 8px;
  background: #ffffff;
  color: #e84a22;
  font-weight: 800;
  text-decoration: none;
}

.map-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.map-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #ffffff;
  color: #111820;
  text-align: left;
}

.map-list-item > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-list-item strong,
.map-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list-item small {
  color: #607080;
}

.map-list-item > span:last-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #063f49;
  color: #ffffff;
  font-weight: 850;
}

.trip-list {
  display: grid;
  gap: var(--card-gap);
  margin-top: 12px;
}

.trip-card {
  position: relative;
  display: grid;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: var(--card-radius);
  background: #143a3f;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 32, 0.14);
}

.home-trip-card .trip-cover {
  background:
    linear-gradient(135deg, rgba(21, 78, 83, 0.9), rgba(20, 58, 63, 0.76)),
    radial-gradient(circle at 80% 18%, rgba(238, 160, 82, 0.35), transparent 30%);
}

.trip-cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 63, 70, 0.92), rgba(0, 35, 42, 0.78)),
    radial-gradient(circle at 82% 18%, rgba(244, 90, 54, 0.35), transparent 28%);
}

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

.trip-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 22, 28, 0.78), rgba(0, 22, 28, 0.22) 52%, rgba(0, 22, 28, 0.5));
}

.trip-card-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 12px;
  min-height: 168px;
  padding: 18px 16px 14px;
}

.trip-card-content span:first-child {
  display: grid;
  gap: 4px;
  max-width: 82%;
}

.trip-card-content strong {
  color: #ffffff;
  font-size: 1.18rem;
  line-height: 1.12;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.32);
}

.trip-card-content small {
  color: rgba(255, 255, 255, 0.88);
  overflow-wrap: anywhere;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.trip-actions button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 253, 248, 0.5);
  color: #17323a;
}

.trip-card-menu {
  position: absolute;
  top: var(--card-gap);
  right: var(--card-gap);
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
}

.trip-card-icon-action,
.trip-card-open-indicator {
  --round-icon-size: 36px;
  --round-icon-image-size: 18px;
  --round-icon-bg: rgba(255, 255, 255, 0.92);
  --round-icon-border: rgba(255, 255, 255, 0.46);
  --round-icon-active-bg: rgba(255, 255, 255, 1);
  color: #17323a;
  font-size: 1.3rem;
  font-weight: 600;
}

.home-trip-badge {
  position: absolute;
  top: var(--card-gap);
  left: var(--card-gap);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #17323a;
  font-size: 0.78rem;
  font-weight: 800;
}

.trip-route-preview {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  width: 46%;
  max-width: 180px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

.trip-route-preview path {
  fill: none;
  stroke: #f7a83b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.trip-route-preview circle {
  fill: #fffdf8;
  stroke: #f7a83b;
  stroke-width: 1.4;
}

.trip-route-preview circle.is-last {
  fill: #f45a36;
  stroke: #fffdf8;
}

.upload-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.upload-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.upload-result span {
  display: grid;
  gap: 2px;
}

.upload-result-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.upload-result small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.upload-result-stored {
  border-color: #9bc7aa;
  background: #f2fbf5;
}

.upload-result-duplicate {
  border-color: #d9c287;
  background: #fff9e8;
}

.upload-result-error {
  border-color: #d99a9a;
  background: #fff1f1;
}

/* Import diagnostics */

.import-status-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.import-status-summary div {
  padding: 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffdf8;
}

.import-status-summary dd {
  color: #111820;
  font-size: 1.35rem;
  font-weight: 850;
}

.import-status-list {
  display: grid;
  gap: 10px;
}

.import-status-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.import-status-card.ok {
  border-color: #9bc7aa;
}

.import-status-card.warning,
.import-status-card.pending {
  border-color: #d9c287;
}

.import-status-card.error {
  border-color: #d99a9a;
}

.import-status-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.import-status-place {
  color: #17202a;
  font-size: 0.9rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.import-status-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.import-status-page-actions {
  margin-top: 10px;
}

.status-step {
  display: inline-grid;
  gap: 1px;
  min-width: 0;
  flex: 1 1 92px;
  padding: 6px 8px;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  background: #f7f8fa;
}

.status-step em {
  color: #607080;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 750;
}

.status-step strong {
  color: #17202a;
  font-size: 0.76rem;
  line-height: 1.2;
}

.status-step.ok,
.status-pill.ok {
  border-color: #9bc7aa;
  background: #f2fbf5;
}

.status-step.warning,
.status-step.pending,
.status-pill.warning,
.status-pill.pending {
  border-color: #d9c287;
  background: #fff9e8;
}

.status-step.error,
.status-pill.error {
  border-color: #d99a9a;
  background: #fff1f1;
}

.status-step.muted,
.status-pill.muted {
  border-color: #dfe4e8;
  background: #f7f8fa;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #dfe4e8;
  border-radius: 999px;
  color: #17202a;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ==========================================================================
   7. Gallery cards and shared photo rows
   ========================================================================== */

.photo-item {
  display: grid;
  gap: 10px;
}

.gallery-card {
  position: relative;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.gallery-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(244, 93, 49, 0.18);
}

.photo-row {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.visit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.visit-row span {
  display: grid;
  gap: 2px;
}

.visit-row small {
  color: var(--muted);
}

.photo-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #edf1f4;
}

.photo-row span {
  display: grid;
  gap: 2px;
}

.photo-row small {
  color: var(--muted);
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.photo-select-toggle {
  --round-icon-size: 36px;
  --round-icon-image-size: 18px;
  --round-icon-bg: rgba(255, 253, 248, 0.5);
  --round-icon-border: rgba(255, 253, 248, 0.65);
  --round-icon-active-bg: rgba(255, 253, 248, 0.72);
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  box-shadow: 0 4px 12px rgba(17, 24, 32, 0.18);
}

.photo-select-toggle.is-selected {
  --round-icon-bg: rgba(0, 45, 52, 0.5);
  --round-icon-border: rgba(0, 45, 52, 0.5);
  --round-icon-active-bg: rgba(0, 45, 52, 0.62);
  color: #fff;
}

.photo-select-toggle:not(.is-selected) img {
  transform: translateY(2px);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bulk-place-editor {
  margin: 0 0 14px;
}

/* ==========================================================================
   8. Photo metadata, links and shared place editor
   ========================================================================== */

.photo-detail {
  display: grid;
  gap: 4px;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.photo-detail span {
  overflow-wrap: anywhere;
}

.status-ok {
  color: #247246;
}

.status-missing {
  color: #a33a3a;
}

.map-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #dfe4e8;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.map-link:hover {
  text-decoration: underline;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.text-button.danger {
  color: #a33a3a;
}

.place-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f9fb;
}

.place-editor .field {
  margin-bottom: 0;
}

.place-editor small {
  color: #607080;
  font-size: 0.82rem;
  line-height: 1.35;
}

.place-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.admin-users {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-user span {
  display: grid;
  gap: 2px;
}

.admin-user small,
.error {
  color: var(--muted);
}

.diagnostics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.diagnostics-header h3 {
  margin: 0;
}

.diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.diagnostic-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.diagnostic-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.diagnostic-sections {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.diagnostic-list {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.diagnostic-list h5 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.diagnostic-list ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.diagnostic-list li {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   9. Login screen
   ========================================================================== */

.login-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.food-journey-login {
  position: relative;
  align-content: center;
  gap: 26px;
  overflow: hidden;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 91, 46, 0.18), transparent 10rem),
    radial-gradient(circle at 92% 36%, rgba(255, 194, 77, 0.1), transparent 12rem),
    linear-gradient(145deg, #004d55 0%, #003a43 45%, #022932 100%);
}

.food-journey-login::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}

.login-brand,
.food-journey-login .login-panel {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: grid;
  justify-items: center;
  text-align: center;
}

.login-logo {
  width: 118px;
  height: auto;
  margin-bottom: 8px;
}

.login-brand h1 {
  margin: 0;
  color: #ffffff;
  font-size: 1.68rem;
  letter-spacing: 0;
}

.login-brand p {
  margin: 5px 0 0;
  color: #ffb72f;
  font-size: 0.94rem;
  font-weight: 800;
}

.food-journey-login .login-panel {
  width: min(358px, 100%);
  padding: 22px 18px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 24px 70px rgba(0, 14, 20, 0.32);
}

.login-panel h2 {
  margin: 0 0 8px;
  color: #17202a;
  font-size: 1.26rem;
  text-align: center;
}

.login-copy {
  margin: 0 0 18px;
  color: #425263;
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: center;
}

.login-field {
  gap: 7px;
  margin-bottom: 12px;
}

.login-field > span:first-child {
  font-size: 0.78rem;
}

.input-shell {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid #d9dee4;
  border-radius: 8px;
  background: #ffffff;
}

.input-shell img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: saturate(0) brightness(0.58);
}

.input-shell input {
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

.password-toggle {
  min-height: 34px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #607080;
  font-size: 0.74rem;
  font-weight: 800;
}

.login-remember {
  margin: 2px 0 16px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  background: #003f46;
  border-color: #003f46;
}

.error {
  min-height: 1.4em;
  margin: 14px 0 0;
}

/* ==========================================================================
   10. Desktop fallback for narrow screens
   ========================================================================== */

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 920px);
    padding: 28px 0;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .admin-form,
  .issue-form,
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .upload-actions {
    grid-template-columns: 1fr;
  }

  .upload-actions button,
  #upload-submit {
    width: 100%;
  }

  .selected-file {
    align-items: flex-start;
  }

  .photo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .place-list {
    grid-template-columns: 1fr;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }

  .map-controls button {
    width: 100%;
  }

  .travel-map {
    min-height: 56vh;
    height: 56vh;
  }

  .trip-actions {
    justify-content: flex-start;
  }

  .trip-actions button {
    width: auto;
  }
}

/* ==========================================================================
   11. Mobile app shell
   ========================================================================== */

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 91, 46, 0.14), transparent 28rem),
    linear-gradient(135deg, #053f46 0%, #002f39 48%, #01242d 100%);
}

body.modal-open {
  overflow: hidden;
}

.mobile-shell {
  width: min(430px, 100%);
  min-height: var(--app-viewport-height);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
  background: #fffdf8;
  box-shadow: 0 18px 60px rgba(0, 20, 28, 0.3);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  margin: 0 -14px 10px;
  padding: 6px 14px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.app-header-title {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.app-header-title strong {
  overflow: hidden;
  color: #111820;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-title small {
  overflow: hidden;
  color: #607080;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 44px;
}

.mobile-shell:not([data-active-view="gallery"]) .gallery-header-action {
  display: none;
}

.gallery-selection-toggle img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.gallery-selection-toggle {
  --round-icon-image-size: 26px;
}

.gallery-selection-toggle.is-active {
  background: transparent;
}

.gallery-filter-toggle.is-active {
  --round-icon-bg: transparent;
  --round-icon-border: transparent;
}

.pull-refresh-indicator {
  position: sticky;
  top: calc(54px + env(safe-area-inset-top));
  z-index: 29;
  width: fit-content;
  max-width: calc(100% - 48px);
  min-height: 30px;
  margin: -4px auto 8px;
  padding: 7px 13px;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: #607080;
  box-shadow: 0 8px 22px rgba(17, 24, 32, 0.08);
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.pull-refresh-indicator.is-visible {
  opacity: 1;
}

.pull-refresh-indicator.is-ready {
  color: #f45a36;
}

.pull-refresh-indicator.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-right: 7px;
  border: 2px solid #d9e0e4;
  border-top-color: #f45a36;
  border-radius: 999px;
  animation: state-spin 0.9s linear infinite;
  vertical-align: -0.1em;
}

.pull-refresh-indicator.is-error {
  color: #b83f2d;
}

.app-update-banner {
  position: sticky;
  top: calc(58px + env(safe-area-inset-top));
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 10px;
  padding: 8px 10px 8px 13px;
  border: 1px solid rgba(244, 90, 54, 0.26);
  border-radius: 14px;
  background: #fff5ef;
  color: #74321f;
  box-shadow: 0 10px 24px rgba(17, 24, 32, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-update-banner.hidden {
  display: none;
}

.app-update-banner button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.icon-button {
  --round-icon-size: 40px;
  --round-icon-image-size: 20px;
  --round-icon-bg: transparent;
  --round-icon-border: transparent;
  --round-icon-active-bg: #f0f2f4;
  color: #111820;
  font-size: 1.25rem;
}

.round-icon-action,
.icon-button {
  display: inline-grid;
  box-sizing: border-box;
  width: var(--round-icon-size, 40px);
  min-width: var(--round-icon-size, 40px);
  height: var(--round-icon-size, 40px);
  min-height: var(--round-icon-size, 40px);
  place-items: center;
  padding: 0;
  border: 1px solid var(--round-icon-border, transparent);
  border-radius: 999px;
  background: var(--round-icon-bg, transparent);
  line-height: 1;
  touch-action: manipulation;
}

.round-icon-action:active:not(:disabled),
.icon-button:active {
  background: var(--round-icon-active-bg, #f0f2f4);
}

button,
.icon-button,
.photo-thumb,
.place-card,
.trip-card,
.home-card,
.memory-item {
  transition:
    transform 150ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

button:active:not(:disabled),
.photo-thumb:active,
.place-card:active,
.trip-card:active,
.home-card:active,
.memory-item:active {
  transform: scale(0.985);
}

.round-icon-action img,
.icon-button img {
  display: block;
  width: var(--round-icon-image-size, 20px);
  height: var(--round-icon-image-size, 20px);
  max-width: var(--round-icon-image-size, 20px);
  max-height: var(--round-icon-image-size, 20px);
  object-fit: contain;
}

.app-logo-button img {
  max-width: 30px;
  max-height: 30px;
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
}

.app-view.is-active.is-entering {
  animation: view-enter 220ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   12. Mobile gallery and filters
   ========================================================================== */

.filter-strip {
  display: none;
  gap: 7px;
  margin: 0 0 10px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(17, 24, 32, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-width: none;
}

.filter-strip.is-open {
  display: flex;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-strip .field {
  min-width: max-content;
  margin: 0;
}

.filter-strip .field span {
  display: none;
}

.filter-strip input,
.filter-strip select {
  width: auto;
  min-width: 92px;
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(17, 24, 32, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #26323d;
  font-size: 16px;
}

.filter-strip .field:first-child input {
  min-width: min(220px, 68vw);
}

.gallery-chips {
  display: flex;
  gap: 7px;
  margin: 0 -2px 14px;
  overflow-x: auto;
  padding: 1px 2px 7px;
  scrollbar-width: none;
}

.gallery-chips::-webkit-scrollbar {
  display: none;
}

.gallery-chips button {
  min-height: 34px;
  padding: 0 13px;
  border-color: rgba(17, 24, 32, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #34424f;
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.gallery-chips button.is-active {
  border-color: rgba(244, 90, 54, 0.4);
  background: rgba(244, 90, 54, 0.1);
  color: #b74226;
}

.photo-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--card-gap) * 2);
  margin-top: 0;
}

.photo-day-group {
  display: grid;
  gap: var(--card-gap);
}

.photo-day-group h3 {
  margin: 0;
  color: #17202a;
  font-size: 0.9rem;
  font-weight: 850;
}

.photo-day-group p {
  margin: -4px 0 0;
  overflow: hidden;
  color: #607080;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-strip {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  gap: 10px;
  margin: 0;
  overflow-x: auto;
  padding: 0 0 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.photo-strip::-webkit-scrollbar {
  display: none;
}

.photo-page {
  min-width: 0;
  scroll-snap-align: start;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.gallery-card {
  border: 0;
  border-radius: 6px;
  box-shadow: none;
}

.gallery-card .photo-row {
  position: relative;
  padding: 0;
}

.gallery-card .photo-row > span,
.gallery-card .photo-actions,
.gallery-card .photo-detail {
  display: none;
}

.photo-thumb {
  border-radius: 6px;
}

.photo-highlight-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #f45a36;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 20, 28, 0.22);
}

.photo-scroll-hint {
  color: #607080;
  font-size: 0.76rem;
}

.photo-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: grid;
  align-items: end;
  background: rgba(0, 27, 32, 0.55);
}

.photo-detail-modal:not(.hidden) {
  animation: modal-backdrop-enter 180ms ease both;
}

.photo-detail-modal.hidden {
  display: none;
}

.photo-detail-backdrop {
  position: absolute;
  inset: 0;
}

.photo-detail-sheet {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: 94vh;
  margin: 0 auto;
  overflow: auto;
  border-radius: 20px 20px 0 0;
  background: #fffdf8;
  box-shadow: 0 -16px 44px rgba(0, 20, 28, 0.28);
  transition: transform 160ms ease, opacity 160ms ease;
  will-change: transform, opacity;
}

.photo-detail-modal:not(.hidden) .photo-detail-sheet {
  animation: photo-sheet-enter 240ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
}

.photo-detail-sheet.is-dragging {
  animation: none;
  transition: none;
}

@keyframes modal-backdrop-enter {
  from {
    background: rgba(0, 27, 32, 0);
  }

  to {
    background: rgba(0, 27, 32, 0.55);
  }
}

@keyframes photo-sheet-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.photo-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.photo-detail-title-block {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.photo-detail-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.photo-detail-header strong,
.photo-detail-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-detail-header strong {
  color: #111820;
  font-size: 1rem;
}

.photo-detail-header small {
  color: #607080;
  font-size: 0.78rem;
}

.photo-detail-logo-button img {
  max-width: 30px;
  max-height: 30px;
}

.photo-detail-share-button img {
  max-width: 22px;
  max-height: 22px;
}

.photo-detail-favorite-button img {
  max-width: 22px;
  max-height: 22px;
}

.photo-detail-share-button,
.photo-detail-favorite-button {
  --round-icon-image-size: 22px;
}

.photo-detail-content {
  display: grid;
  gap: 16px;
  padding: 0 14px calc(22px + env(safe-area-inset-bottom));
}

.photo-detail-media {
  position: relative;
  display: grid;
  align-items: center;
}

.photo-detail-image {
  width: 100%;
  max-height: 58vh;
  border-radius: 8px;
  object-fit: contain;
  background: #111820;
  cursor: zoom-in;
}

.photo-detail-fullscreen-button {
  --round-icon-size: 40px;
  --round-icon-image-size: 18px;
  --round-icon-bg: rgba(255, 253, 248, 0.8);
  --round-icon-border: rgba(255, 253, 248, 0.58);
  --round-icon-active-bg: rgba(255, 253, 248, 0.94);
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  color: #111820;
  font-size: 1.15rem;
  line-height: 1;
}

.photo-detail-nav {
  --round-icon-size: 40px;
  --round-icon-image-size: 18px;
  --round-icon-bg: rgba(255, 253, 248, 0.8);
  --round-icon-border: rgba(255, 253, 248, 0.58);
  --round-icon-active-bg: rgba(255, 253, 248, 0.94);
  position: absolute;
  top: 50%;
  z-index: 1;
  color: var(--text);
  transform: translateY(-50%);
  box-shadow: 0 10px 24px rgba(0, 20, 28, 0.24);
}

.photo-detail-nav.previous {
  left: 10px;
}

.photo-detail-nav.next {
  right: 10px;
}

.photo-detail-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.photo-detail-meta {
  display: grid;
  gap: 10px;
}

.photo-detail-meta div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ece8df;
}

.photo-detail-meta dt {
  color: #607080;
  font-size: 0.78rem;
}

.photo-detail-meta dd {
  min-width: 0;
  margin: 0;
  color: #17202a;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.photo-detail-meta.compact {
  gap: 8px;
}

.photo-detail-meta.compact div {
  grid-template-columns: 118px minmax(0, 1fr);
  padding-bottom: 8px;
}

.photo-detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.photo-fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 3600;
  background: #020607;
}

.photo-fullscreen-modal.hidden {
  display: none;
}

.photo-fullscreen-viewer {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #020607;
}

.photo-fullscreen-content {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: calc(64px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.photo-fullscreen-image {
  --photo-fullscreen-zoom: 1;
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  object-fit: contain;
  border-radius: 4px;
  transform-origin: center;
}

.photo-fullscreen-image.is-zoomed {
  width: calc(100dvw * var(--photo-fullscreen-zoom));
  max-width: none;
  max-height: none;
}

.photo-fullscreen-close,
.photo-fullscreen-controls {
  position: absolute;
  z-index: 2;
}

.photo-fullscreen-close {
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  color: #111820;
  font-size: 1.35rem;
  line-height: 1;
}

.photo-fullscreen-controls {
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: flex;
  gap: 8px;
}

.photo-fullscreen-close,
.photo-fullscreen-controls .round-icon-action {
  --round-icon-bg: rgba(255, 253, 248, 0.82);
  --round-icon-border: rgba(255, 253, 248, 0.5);
  --round-icon-active-bg: rgba(255, 253, 248, 0.96);
  color: #111820;
  font-size: 1.3rem;
  line-height: 1;
}

.photo-ai-panel,
.photo-ai-result,
.photo-ai-card {
  display: grid;
  gap: 10px;
}

.photo-ai-panel {
  padding: 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffaf1;
}

.photo-ai-panel h3 {
  margin: 0;
  color: #17202a;
  font-size: 1rem;
}

.photo-ai-card {
  padding-top: 10px;
  border-top: 1px solid #ece8df;
}

.photo-ai-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.photo-ai-card dl div {
  display: grid;
  gap: 3px;
}

.photo-ai-card dt {
  color: #607080;
  font-size: 0.78rem;
  font-weight: 800;
}

.photo-ai-card dd {
  margin: 0;
  color: #17202a;
  font-size: 0.9rem;
  line-height: 1.45;
}

.photo-management {
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffaf1;
}

.photo-management summary {
  cursor: pointer;
  padding: 12px;
  color: #17202a;
  font-size: 0.92rem;
  font-weight: 800;
}

.photo-management[open] summary {
  border-bottom: 1px solid #ece8df;
}

.photo-management .photo-detail-meta,
.photo-management-actions {
  padding: 12px;
}

.photo-management-actions {
  display: grid;
  gap: 8px;
}

.photo-management .photo-detail-meta + .photo-management-actions {
  padding-top: 0;
}

.photo-comments {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.photo-comments header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.photo-comments h3 {
  margin: 0;
  color: #111820;
  font-size: 1rem;
}

.photo-comments header small {
  color: #607080;
  font-size: 0.78rem;
}

.photo-comments-list {
  display: grid;
  gap: 10px;
}

.photo-comment {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffaf1;
}

.photo-comment > div {
  display: grid;
  gap: 2px;
}

.photo-comment strong {
  color: #17202a;
  font-size: 0.9rem;
}

.photo-comment small {
  color: #607080;
  font-size: 0.76rem;
}

.photo-comment p {
  margin: 0;
  color: #17202a;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.photo-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-comment-form {
  display: grid;
  gap: 10px;
}

.photo-comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

/* ==========================================================================
   13. Dialogs, trip detail shell and global search
   ========================================================================== */

.app-dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  background: rgba(0, 27, 32, 0.55);
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
}

.app-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(402px, 100%);
  padding: 18px;
  border: 1px solid #ece8df;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 18px 60px rgba(0, 20, 28, 0.28);
}

.app-dialog h2,
.app-dialog p {
  margin: 0;
}

.app-dialog h2 {
  font-size: 1.08rem;
}

.app-dialog p {
  color: #607080;
  line-height: 1.42;
}

.app-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trip-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: grid;
  background: #fffdf8;
}

.trip-detail-modal.hidden {
  display: none;
}

.trip-detail-screen {
  width: min(430px, 100%);
  height: 100vh;
  margin: 0 auto;
  overflow: auto;
  background: #fffdf8;
}

.global-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: grid;
  background: #fffdf8;
}

.global-search-sheet {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(430px, 100%);
  height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(86px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: #fffdf8;
}

.global-search-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.global-search-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #dfe4e8;
  border-radius: 12px;
  background: #ffffff;
  color: #111820;
  font: inherit;
  font-size: 16px;
}

.global-search-chips {
  display: flex;
  gap: 7px;
  margin: 14px -2px 10px;
  overflow-x: auto;
  padding: 1px 2px 7px;
  scrollbar-width: none;
}

.global-search-chips::-webkit-scrollbar {
  display: none;
}

.global-search-chips button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-color: rgba(17, 24, 32, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #34424f;
  font-size: 0.84rem;
  font-weight: 750;
}

.global-search-chips button.is-active {
  border-color: rgba(244, 90, 54, 0.4);
  background: rgba(244, 90, 54, 0.1);
  color: #b74226;
}

.global-search-results {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 18px;
}

/* Search results */

.search-section {
  display: grid;
  gap: 8px;
}

.search-section h3 {
  margin: 0;
  font-size: 0.9rem;
}

.search-result {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 8px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #ffffff;
  color: #111820;
  text-align: left;
}

.search-result img,
.search-result-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f0e7;
}

.search-result-icon {
  display: grid;
  place-items: center;
  color: #063f49;
  font-weight: 850;
}

.search-result span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.search-result strong,
.search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  color: #607080;
  font-weight: 500;
}

.search-result em {
  color: #ff5a2f;
  font-style: normal;
  font-weight: 850;
}

/* ==========================================================================
   14. Trip detail content
   ========================================================================== */

.trip-detail-content {
  display: grid;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0) 0, #fffdf8 260px),
    #fffdf8;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

.trip-detail-hero {
  position: relative;
  min-height: 272px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 63, 70, 0.95), rgba(0, 35, 42, 0.82)),
    radial-gradient(circle at 80% 20%, rgba(244, 90, 54, 0.34), transparent 28%);
  color: #ffffff;
}

.trip-detail-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trip-detail-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 20, 28, 0.18), rgba(0, 20, 28, 0.82)),
    linear-gradient(90deg, rgba(0, 20, 28, 0.55), rgba(0, 20, 28, 0.08) 58%);
}

.trip-detail-topbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
}

.trip-detail-topbar .icon-button {
  --round-icon-image-size: 20px;
  --round-icon-bg: rgba(255, 255, 255, 0.8);
  --round-icon-border: rgba(255, 255, 255, 0.58);
  --round-icon-active-bg: rgba(255, 255, 255, 0.94);
  color: #17323a;
}

.trip-detail-topbar .icon-button img {
  display: block;
}

.trip-detail-topbar .trip-detail-stats-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  overflow: hidden;
}

.trip-detail-topbar .trip-detail-stats-button img {
  position: static;
  inset: auto;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.trip-detail-top-actions {
  display: flex;
  gap: 8px;
}

.trip-detail-title {
  position: absolute;
  right: 16px;
  bottom: 24px;
  left: 16px;
  z-index: 1;
  display: grid;
  gap: 6px;
  max-width: 86%;
}

.trip-detail-title h2 {
  margin: 0;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.76rem;
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.34);
}

.trip-detail-title p {
  width: fit-content;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 20, 28, 0.28);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 800;
}

.trip-cover-upload {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 0 14px;
}

.trip-cover-upload small {
  color: #607080;
}

.trip-detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -12px 14px 0;
  padding: 6px;
  border: 1px solid rgba(236, 232, 223, 0.88);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 12px 28px rgba(17, 24, 32, 0.08);
  position: relative;
  z-index: 2;
}

.trip-detail-tabs button {
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17323a;
  font-size: 0.82rem;
  font-weight: 800;
}

.trip-detail-tabs button.is-active {
  background: #fff3e5;
  color: #f45a36;
}

.trip-detail-body {
  display: grid;
  gap: 16px;
  padding: 16px 14px 14px;
}

.trip-detail-body h3 {
  margin: 4px 0 0;
  color: #111820;
  font-size: 1rem;
}

.trip-stat-grid,
.trip-stat-list {
  display: grid;
  gap: 10px;
}

.trip-album-intro,
.trip-album-section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(236, 232, 223, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(17, 24, 32, 0.05);
}

.trip-album-section-header {
  display: grid;
  gap: 2px;
  margin: 0;
}

.trip-album-section-header h3 {
  margin: 0;
}

.trip-album-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  height: 150px;
  overflow: hidden;
}

.trip-album-preview button {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.trip-album-preview button:first-child {
  grid-row: span 2;
}

.trip-album-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

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

.trip-stats-dashboard {
  display: grid;
  gap: 14px;
}

.trip-stats-dashboard .trip-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trip-stat-grid.prominent div {
  border-color: rgba(244, 90, 54, 0.24);
  background: #fff8ef;
}

.trip-stat-grid div,
.trip-stat-list div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(236, 232, 223, 0.86);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.86);
}

.trip-stat-grid dt,
.trip-stat-list dt {
  color: #607080;
  font-size: 0.72rem;
}

.trip-stat-grid dt.is-long-label {
  font-size: 0.68rem;
}

.trip-stat-grid dd,
.trip-stat-list dd {
  margin: 0;
  color: #111820;
  font-size: 0.92rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.trip-stats-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ece8df;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.trip-stats-section h3 {
  margin: 0;
  color: #111820;
  font-size: 0.98rem;
}

.trip-daily-bars {
  display: grid;
  gap: 9px;
}

.trip-daily-bars div {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 34px minmax(90px, 1.4fr);
  align-items: center;
  gap: 8px;
}

.trip-daily-bars span {
  color: #607080;
  font-size: 0.78rem;
}

.trip-daily-bars strong {
  color: #111820;
  font-size: 0.86rem;
  text-align: right;
}

.trip-daily-bars em {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f45a36, #003f46);
}

.trip-daily-bars .bar-10 { width: 10%; }
.trip-daily-bars .bar-20 { width: 20%; }
.trip-daily-bars .bar-30 { width: 30%; }
.trip-daily-bars .bar-40 { width: 40%; }
.trip-daily-bars .bar-50 { width: 50%; }
.trip-daily-bars .bar-60 { width: 60%; }
.trip-daily-bars .bar-70 { width: 70%; }
.trip-daily-bars .bar-80 { width: 80%; }
.trip-daily-bars .bar-90 { width: 90%; }
.trip-daily-bars .bar-100 { width: 100%; }

.trip-top-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trip-top-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ece8df;
}

.trip-top-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.trip-top-list span {
  min-width: 0;
  color: #17202a;
  font-size: 0.88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.trip-top-list strong {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #003f46;
  color: #fffdf8;
  font-size: 0.82rem;
}

.trip-station-list {
  display: grid;
  gap: 10px;
}

.trip-station {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(236, 232, 223, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(17, 24, 32, 0.04);
}

.trip-station-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111820;
  text-align: left;
}

.trip-station-main span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trip-station strong,
.trip-station small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-station small {
  color: #607080;
  font-weight: 500;
}

.trip-station img {
  width: 74px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.trip-station-pin {
  width: 14px;
  height: 14px;
  border: 3px solid #003f46;
  border-radius: 999px;
  background: #f45a36;
}

.trip-station-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 28px;
}

.trip-station-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.trip-highlight-strip,
.trip-hotels,
.trip-story-panel,
.trip-story-read,
.trip-story-editor,
.trip-story-form,
.trip-highlight-gallery,
.trip-highlight-list,
.trip-ai-panel,
.trip-ai-result,
.trip-ai-card,
.trip-day-notes {
  display: grid;
  gap: 12px;
}

.trip-highlight-strip h3,
.trip-hotels h3,
.trip-highlight-gallery h3,
.trip-highlight-list h3,
.trip-story-read h3,
.trip-story-editor h3,
.trip-ai-panel h3,
.trip-day-notes h3 {
  margin: 0;
  color: #111820;
  font-size: 1rem;
}

.trip-highlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trip-highlight-chips span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff3e5;
  color: #9d4517;
  font-size: 0.78rem;
  font-weight: 850;
}

.trip-highlight-list {
  padding: 12px;
  border: 1px solid rgba(236, 232, 223, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(17, 24, 32, 0.04);
}

.trip-highlight-list > div {
  display: grid;
  gap: 8px;
}

.trip-highlight-list article {
  margin: 0;
}

.trip-highlight-list .trip-highlight-item {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0;
  text-align: left;
  color: inherit;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: rgba(248, 245, 238, 0.8);
}

.trip-highlight-list .trip-highlight-item:focus-visible {
  outline: 2px solid #ff6b46;
  outline-offset: 2px;
}

.trip-highlight-list img {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: cover;
}

.trip-highlight-list em {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 7px;
  background: #edf1f4;
}

.trip-highlight-list span {
  display: grid;
  gap: 3px;
}

.trip-highlight-list small {
  color: #607080;
}

.trip-hotel-list {
  display: grid;
  gap: 8px;
}

.trip-hotel-list button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: rgba(248, 245, 238, 0.82);
  color: inherit;
  text-align: left;
}

.trip-hotel-list img {
  width: 50px;
  height: 50px;
  display: block;
  border-radius: 7px;
  object-fit: cover;
}

.trip-hotel-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.trip-hotel-list strong,
.trip-hotel-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-hotel-list small,
.trip-hotel-list em {
  color: #607080;
  font-size: 0.8rem;
}

.trip-hotel-list em {
  font-style: normal;
  font-weight: 800;
}

.trip-story-read {
  padding: 16px;
  border: 1px solid #eadfd0;
  border-radius: 14px;
  background: #fff8ec;
  box-shadow: 0 10px 26px rgba(33, 45, 47, 0.08);
}

.trip-story-read header,
.trip-story-editor header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #607080;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trip-story-edit-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  background: #ffffff;
}

.trip-story-edit-button img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.trip-story-note {
  color: #1b2a30;
  font-size: 0.96rem;
  line-height: 1.55;
}

.trip-story-composed {
  display: grid;
  gap: 12px;
}

.trip-story-title {
  display: block;
  color: #111820;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.22;
}

.trip-story-lead {
  margin: 0;
  color: #1b2a30;
  font-size: 0.98rem;
  line-height: 1.55;
}

.trip-story-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.trip-story-facts div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #eadfd0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.trip-story-facts dt {
  margin-bottom: 3px;
  color: #607080;
  font-size: 0.72rem;
  font-weight: 800;
}

.trip-story-facts dd {
  margin: 0;
  color: #17202a;
  font-size: 0.9rem;
  line-height: 1.35;
}

.trip-story-section {
  display: grid;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px solid #eadfd0;
}

.trip-story-section h4 {
  margin: 0;
  color: #111820;
  font-size: 0.86rem;
}

.trip-story-section p {
  margin: 0;
  color: #1b2a30;
  font-size: 0.93rem;
  line-height: 1.48;
}

.trip-story-days {
  display: grid;
  gap: 0;
  padding-top: 4px;
}

.trip-story-days h4 {
  margin: 2px 0 8px;
  color: #111820;
  font-size: 0.92rem;
}

.trip-story-days article {
  display: grid;
  gap: 4px;
  position: relative;
  padding: 0 0 12px 18px;
  border-top: 0;
}

.trip-story-days article::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 1px;
  width: 8px;
  height: 8px;
  border: 2px solid #f45a36;
  border-radius: 999px;
  background: #fff8ec;
}

.trip-story-days article::after {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: #eadfd0;
}

.trip-story-days article:last-child {
  padding-bottom: 0;
}

.trip-story-days article:last-child::after {
  display: none;
}

.trip-story-days article span {
  color: #607080;
  font-size: 0.78rem;
  font-weight: 800;
}

.trip-story-days article p {
  margin: 0;
  color: #1b2a30;
  font-size: 0.92rem;
  line-height: 1.48;
}

.trip-story-editor {
  padding: 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #ffffff;
}

.trip-ai-panel {
  padding: 10px 12px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffdf8;
}

.trip-ai-card {
  padding-top: 10px;
  border-top: 1px solid #ece8df;
}

.trip-ai-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.trip-ai-card dl div {
  display: grid;
  gap: 3px;
}

.trip-ai-card dt {
  color: #607080;
  font-size: 0.78rem;
  font-weight: 800;
}

.trip-ai-card dd {
  margin: 0;
  color: #111820;
  font-size: 0.92rem;
  line-height: 1.45;
}

.trip-ai-day-notes {
  display: grid;
  gap: 8px;
}

.trip-ai-day-notes strong {
  color: #111820;
  font-size: 0.86rem;
}

.trip-ai-day-notes ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trip-ai-day-notes li {
  display: grid;
  gap: 2px;
  color: #111820;
  font-size: 0.88rem;
  line-height: 1.4;
}

.trip-ai-day-notes li span {
  color: #607080;
  font-size: 0.76rem;
  font-weight: 800;
}

.trip-highlight-strip > div,
.trip-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.trip-highlight-strip > div button,
.trip-highlight-grid button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: transparent;
}

.trip-highlight-strip img,
.trip-highlight-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.trip-highlight-grid .empty-state {
  grid-column: 1 / -1;
}

.trip-story-form textarea {
  resize: vertical;
}

.trip-route-large {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 24%, rgba(244, 90, 54, 0.16), transparent 24%),
    linear-gradient(180deg, #d8eef1, #f4f0e8);
}

.trip-route-large .trip-route-preview {
  position: static;
  width: 82%;
  max-width: none;
  filter: none;
}

.trip-route-large .trip-route-preview path {
  stroke-width: 3.2;
}

.trip-route-map {
  width: 100%;
  height: 220px;
}

.trip-route-map path {
  fill: none;
  stroke: #f45a36;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.trip-route-map circle {
  fill: #003f46;
  stroke: #fffdf8;
  stroke-width: 3;
}

.trip-route-map circle.is-last {
  fill: #f45a36;
}

.trip-route-map text {
  fill: #17323a;
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.86);
  stroke-width: 4px;
}

.trip-route-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: #17323a;
}

.trip-route-list li small {
  display: block;
  color: #607080;
}

.trip-photo-browser {
  display: grid;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(236, 232, 223, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(17, 24, 32, 0.05);
}

.trip-photo-browser header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trip-photo-browser header > div {
  display: grid;
  gap: 2px;
}

.trip-photo-browser h3 {
  margin: 0;
  color: #111820;
  font-size: 1.08rem;
}

.trip-photo-browser header button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.trip-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 7px;
}

.trip-photo-grid button {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 8px 18px rgba(17, 24, 32, 0.08);
}

.trip-photo-grid:has(button:nth-child(6)) button:nth-child(10n + 1),
.trip-photo-grid:has(button:nth-child(13)) button:nth-child(10n + 8) {
  grid-column: span 2;
  grid-row: span 2;
}

.trip-photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.trip-photo-grid:has(button:nth-child(6)) button:nth-child(10n + 1) img,
.trip-photo-grid:has(button:nth-child(13)) button:nth-child(10n + 8) img {
  height: 100%;
}

.trip-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: calc(54px + env(safe-area-inset-top)) 14px calc(42px + env(safe-area-inset-bottom));
  background: rgba(0, 20, 28, 0.92);
}

.trip-photo-lightbox img {
  display: block;
  width: 100%;
  max-width: 920px;
  max-height: 78vh;
  object-fit: contain;
}

.trip-photo-lightbox-close,
.trip-photo-lightbox-nav {
  --round-icon-size: 42px;
  --round-icon-bg: rgba(0, 27, 32, 0.68);
  --round-icon-border: rgba(255, 255, 255, 0.72);
  --round-icon-active-bg: rgba(0, 27, 32, 0.86);
  position: absolute;
  color: #fffdf8;
  font-size: 1.8rem;
  line-height: 0.8;
}

.trip-photo-lightbox-nav {
  --round-icon-image-size: 19px;
  --round-icon-bg: rgba(255, 253, 248, 0.8);
  --round-icon-border: rgba(255, 253, 248, 0.58);
  --round-icon-active-bg: rgba(255, 253, 248, 0.94);
}

.trip-photo-lightbox-close {
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  padding: 0 0 4px;
}

.trip-photo-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.trip-photo-lightbox-nav.previous {
  left: 14px;
}

.trip-photo-lightbox-nav.next {
  right: 14px;
}

.trip-photo-lightbox-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.trip-photo-lightbox-count {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.14);
  color: #fffdf8;
  font-size: 0.82rem;
  font-weight: 800;
}

.trip-detail-loading,
.trip-detail-error {
  display: grid;
  gap: 12px;
  min-height: 100vh;
  place-content: center;
  padding: 24px;
  color: #17323a;
  text-align: center;
}

.detail-place-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

.detail-place-editor .field span {
  display: block;
}

.detail-place-editor .place-editor-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.button-link {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  text-decoration: none;
}

#gallery-summary:not(.is-visible-filter) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#gallery-summary.is-visible-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 9px 10px;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 18px rgba(17, 24, 32, 0.04);
}

#gallery-summary.is-visible-filter .gallery-summary-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#gallery-summary.is-visible-filter small {
  color: #607080;
  font-size: 0.76rem;
  font-weight: 700;
}

#gallery-summary.is-visible-filter button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 8px;
  font-size: 0.8rem;
  white-space: nowrap;
}

#gallery-summary.is-visible-filter .gallery-filter-pills {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

#gallery-summary.is-visible-filter .gallery-filter-pills span {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(244, 90, 54, 0.2);
  border-radius: 999px;
  background: rgba(244, 90, 54, 0.08);
  color: #8f3a23;
  font-size: 0.78rem;
  font-weight: 800;
}

#gallery-summary.is-context-filter {
  border-color: rgba(0, 67, 81, 0.12);
  background: rgba(255, 253, 248, 0.9);
}

#gallery-summary.is-filter-summary .gallery-summary-main strong {
  color: #2e3b45;
}

#gallery-summary.is-selection-summary {
  border-color: rgba(244, 90, 54, 0.22);
  background: #fff7f1;
}

#gallery-summary.is-selection-summary button {
  flex: 1 1 calc(50% - 8px);
  min-height: 36px;
  padding: 0 12px;
}

#gallery-summary.is-visible-filter .bulk-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#gallery-summary.is-visible-filter .bulk-actions button {
  max-width: 100%;
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  justify-items: start;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(244, 90, 54, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(255, 247, 239, 0.94)),
    #ffffff;
  color: #17202a;
  box-shadow: 0 10px 26px rgba(17, 24, 32, 0.07);
}

.empty-state.compact {
  margin-top: 12px;
  padding: 14px;
}

.empty-state-feature {
  position: relative;
  overflow: hidden;
}

.empty-state span {
  color: #607080;
  line-height: 1.45;
}

.empty-state .empty-state-eyebrow {
  color: #b84a2e;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.empty-state button {
  margin-top: 2px;
}

.view-state.is-loading {
  border-style: dashed;
}

.view-state.is-loading strong::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 8px;
  border: 2px solid #d9e0e4;
  border-top-color: #f45a36;
  border-radius: 999px;
  animation: state-spin 0.9s linear infinite;
  vertical-align: -0.1em;
}

.view-state.is-error {
  border-color: rgba(196, 52, 52, 0.24);
  background: #fff8f6;
}

.view-state.is-error strong {
  color: #b83f2d;
}

@keyframes state-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   15. Shared mobile states and tabs
   ========================================================================== */

.place-list,
.trip-list,
.visit-list {
  margin-top: 12px;
}

.home-dashboard {
  display: grid;
  gap: 14px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #dbe7e4;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f5 100%);
  box-shadow: 0 8px 22px rgba(17, 24, 32, 0.06);
}

.home-hero.has-background {
  min-height: 210px;
  border-color: rgba(255, 253, 248, 0.72);
  background: #10242b;
}

.home-hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-background img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  transform: scale(1.04);
  transition: opacity 1400ms ease;
}

.home-hero-background img.is-active {
  opacity: 1;
}

.home-hero.has-background::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.9) 0%, rgba(255, 253, 248, 0.62) 52%, rgba(255, 253, 248, 0.42) 100%),
    linear-gradient(180deg, rgba(16, 36, 43, 0.08) 0%, rgba(16, 36, 43, 0.22) 100%);
}

.home-hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.home-hero h2 {
  margin: 0;
  color: #10242b;
  font-size: 1.35rem;
  line-height: 1.15;
}

.home-hero p {
  margin: 0;
  color: #52636f;
  line-height: 1.45;
}

.home-hero-actions,
.home-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-metric-grid button,
.home-action-grid button {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  text-align: left;
  box-shadow: 0 8px 22px rgba(17, 24, 32, 0.06);
}

.home-action-grid {
  gap: 10px;
}

.home-action-grid button {
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-color: rgba(16, 36, 43, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96) 0%, rgba(238, 248, 245, 0.98) 100%),
    #ffffff;
  color: #10242b;
  font-weight: 850;
  letter-spacing: 0;
}

.home-action-grid button:active {
  transform: translateY(1px);
}

.home-action-grid .home-action-icon {
  --round-icon-size: 36px;
  --round-icon-image-size: 22px;
  --round-icon-bg: rgba(255, 255, 255, 0.82);
  --round-icon-border: rgba(16, 36, 43, 0.08);
}

.home-action-grid img {
  object-fit: contain;
}

.home-action-grid button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-metric-grid span,
.home-metric-grid small {
  overflow: hidden;
  color: #607080;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-metric-grid strong {
  color: #f45a36;
  font-size: 1.45rem;
  line-height: 1;
}

.home-card {
  display: grid;
  gap: var(--card-gap);
  padding: var(--card-padding);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
}

.home-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--card-gap);
}

.home-card header > button {
  flex: 0 0 auto;
}

.home-card header span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-card header strong,
.home-card header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card header small {
  color: #607080;
  font-size: 0.78rem;
}

.home-personal-card {
  gap: 10px;
  border-color: rgba(15, 89, 98, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98) 0%, rgba(238, 248, 245, 0.92) 100%),
    #ffffff;
}

.home-personal-trip {
  position: relative;
  display: grid;
  min-height: 120px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #0f5962;
  color: #ffffff;
  text-align: left;
}

.home-personal-trip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-personal-trip::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(16, 36, 43, 0.12) 0%, rgba(16, 36, 43, 0.78) 100%);
}

.home-personal-trip span {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 2px;
  padding: 12px;
}

.home-personal-trip em {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.home-personal-trip strong {
  color: #ffffff;
  font-size: 1.04rem;
  line-height: 1.15;
}

.home-trip-cover {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #0f5962;
  color: #ffffff;
  text-align: left;
}

.home-trip-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-trip-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.58));
}

.home-trip-cover span {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 1;
  overflow: hidden;
  font-size: 1.15rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.home-photo-strip button {
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #edf1f4;
}

.home-photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card {
  gap: 10px;
}

.memory-list {
  display: grid;
  gap: 8px;
}

.memory-item {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: #fffaf2;
  color: #17202a;
  text-align: left;
}

.memory-thumb {
  width: 70px;
  height: 62px;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: #edf1f4;
}

.memory-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.memory-copy em {
  color: #f45a36;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-copy strong,
.memory-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-copy small {
  color: #607080;
  font-size: 0.78rem;
}

.place-card,
.trip-card,
.visit-row,
.panel {
  border-color: #ece8df;
  box-shadow: 0 8px 22px rgba(17, 24, 32, 0.06);
}

.app-view.is-entering .home-card,
.app-view.is-entering .trip-card,
.app-view.is-entering .place-card,
.app-view.is-entering .gallery-card,
.app-view.is-entering .memory-item,
.app-view.is-entering .view-state {
  animation: content-rise 260ms cubic-bezier(0.2, 0.72, 0.18, 1) both;
}

.app-view.is-entering .home-card:nth-of-type(2),
.app-view.is-entering .trip-card:nth-of-type(2),
.app-view.is-entering .place-card:nth-of-type(2),
.app-view.is-entering .gallery-card:nth-of-type(2),
.app-view.is-entering .memory-item:nth-of-type(2) {
  animation-delay: 35ms;
}

.app-view.is-entering .home-card:nth-of-type(3),
.app-view.is-entering .trip-card:nth-of-type(3),
.app-view.is-entering .place-card:nth-of-type(3),
.app-view.is-entering .gallery-card:nth-of-type(3),
.app-view.is-entering .memory-item:nth-of-type(3) {
  animation-delay: 70ms;
}

.app-view.is-entering .home-card:nth-of-type(n + 4),
.app-view.is-entering .trip-card:nth-of-type(n + 4),
.app-view.is-entering .place-card:nth-of-type(n + 4),
.app-view.is-entering .gallery-card:nth-of-type(n + 4),
.app-view.is-entering .memory-item:nth-of-type(n + 4) {
  animation-delay: 105ms;
}

@keyframes content-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 12px;
  border-bottom: 1px solid #ece8df;
}

.view-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #111820;
  font-size: 0.9rem;
}

.view-tabs button.is-active {
  border-bottom-color: #f45a36;
  color: #f45a36;
}

.travel-map {
  min-height: 56vh;
  margin-top: 12px;
}

.logout-form {
  margin-top: 14px;
}

.more-upload-panel {
  border-color: rgba(244, 90, 54, 0.18);
  scroll-margin-top: 74px;
}

/* ==========================================================================
   16. Review inbox
   ========================================================================== */

.review-inbox-panel {
  scroll-margin-top: 74px;
}

.review-inbox {
  display: grid;
  gap: 12px;
}

.review-assistant {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(217, 111, 50, 0.24);
  border-radius: 8px;
  background: #fff8f0;
}

.review-assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-assistant-header span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-assistant-header span > strong {
  color: #17323a;
  font-size: 1.08rem;
  line-height: 1.15;
}

.review-assistant-header em {
  display: inline-grid;
  min-height: 30px;
  padding: 0 10px;
  place-items: center;
  border-radius: 999px;
  background: #d96f32;
  color: #ffffff;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.review-assistant h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.review-assistant p {
  margin: 3px 0 0;
  color: #607080;
  line-height: 1.45;
}

.review-assistant-guidance {
  padding: 10px 12px;
  border: 1px solid rgba(217, 111, 50, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.review-assistant-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #eadfd2;
}

.review-assistant-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #eadfd2;
}

.review-assistant-progress::-webkit-progress-value {
  border-radius: 999px;
  background: #d96f32;
}

.review-assistant-progress::-moz-progress-bar {
  border-radius: 999px;
  background: #d96f32;
}

.review-assistant-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.review-assistant-card img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.review-assistant-step {
  color: #d96f32;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-assistant-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.review-assistant-stats div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.review-assistant-stats dt {
  color: #607080;
  font-size: 0.72rem;
  font-weight: 800;
}

.review-assistant-stats dd {
  margin: 0;
  color: #17323a;
  font-weight: 900;
}

.review-queue {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.review-queue button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(217, 111, 50, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #17323a;
  text-align: left;
}

.review-queue button.is-active {
  border-color: rgba(217, 111, 50, 0.42);
  background: #ffffff;
  box-shadow: inset 3px 0 0 #d96f32;
}

.review-queue span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.review-queue strong,
.review-queue small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-queue strong {
  font-size: 0.8rem;
  line-height: 1.15;
}

.review-queue small {
  color: #607080;
  font-size: 0.72rem;
}

.review-queue em {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(217, 111, 50, 0.12);
  color: #d96f32;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.review-assistant-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.review-assistant-actions button {
  min-height: 40px;
  padding-right: 10px;
  padding-left: 10px;
}

.review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--card-radius);
  background: #f3f0ea;
}

.review-summary span {
  color: #607080;
  font-size: 0.88rem;
  text-align: right;
}

.review-group {
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: #fffdf8;
  box-shadow: var(--shadow-card);
}

.review-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 850;
}

.review-group summary strong {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #003f46;
  color: #ffffff;
  font-size: 0.82rem;
}

.review-list {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.review-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #ece8df;
}

.review-item img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.review-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-item strong,
.review-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-item small {
  color: #607080;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.review-tags em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf4f3;
  color: #003f46;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.review-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.review-actions .review-done-button {
  min-width: 38px;
  font-weight: 900;
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.theme-mode-control,
.start-view-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #ece8df;
  border-radius: 999px;
  background: #f3f0ea;
}

.start-view-control {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.theme-mode-control button,
.start-view-control button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #17323a;
  font-size: 0.88rem;
}

.theme-mode-control button.is-active,
.start-view-control button.is-active {
  background: #ffffff;
  color: #f45a36;
  box-shadow: 0 3px 10px rgba(17, 24, 32, 0.08);
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: #f45a36;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

/* ==========================================================================
   17. Admin center
   ========================================================================== */

.admin-panel {
  border-color: rgba(244, 90, 54, 0.2);
}

.admin-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #ece8df;
}

.admin-section-card {
  padding: var(--card-padding);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: #fffdfa;
}

.admin-primary-section {
  background: #fffaf2;
}

.admin-control-grid,
.admin-task-groups {
  display: grid;
  gap: 12px;
}

.admin-control-grid {
  margin-top: 14px;
}

.admin-control-grid .admin-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.admin-task-group {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 32, 0.08);
}

.admin-task-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-task-group-header {
  display: grid;
  gap: 2px;
}

.admin-task-group-header span {
  color: #111820;
  font-size: 0.94rem;
  font-weight: 850;
}

.admin-task-group-header small {
  color: #6b6f72;
  font-size: 0.8rem;
}

.admin-foldout {
  gap: 0;
}

.admin-foldout[open] {
  gap: 12px;
}

.admin-foldout > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.admin-foldout > summary::-webkit-details-marker,
.admin-task-card > summary::-webkit-details-marker {
  display: none;
}

.admin-foldout > summary::after,
.admin-task-card > summary::after {
  content: "›";
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #f5f0e7;
  color: #17323a;
  font-weight: 900;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.admin-foldout[open] > summary::after,
.admin-task-card[open] > summary::after {
  transform: rotate(-90deg);
}

.admin-foldout summary span {
  display: grid;
  gap: 2px;
}

.admin-foldout summary strong {
  color: #111820;
  font-size: 1rem;
}

.admin-foldout summary small {
  color: #6b6f72;
  font-size: 0.82rem;
}

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

.admin-task-grid {
  display: grid;
  gap: 12px;
}

.admin-task-card {
  display: grid;
  gap: var(--card-gap);
  padding: var(--card-padding);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: #fffaf2;
}

.admin-task-card:not([open]) {
  gap: 0;
}

.admin-task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.admin-task-header h4 {
  margin: 0;
  font-size: 1rem;
}

.admin-task-header p {
  margin: 4px 0 0;
  color: #6b6f72;
  font-size: 0.88rem;
}

.admin-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf8f1;
  color: #1f7a4e;
  font-size: 0.78rem;
  font-weight: 850;
}

.admin-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.admin-status.is-warning {
  background: #fff0e8;
  color: #d44821;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.admin-metric span {
  display: block;
  margin-bottom: 4px;
  color: #6b6f72;
  font-size: 0.74rem;
}

.admin-metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: #111820;
  font-size: 0.95rem;
  line-height: 1.25;
}

.admin-metric.is-ok {
  border-color: rgba(31, 122, 78, 0.16);
  background: #f3fbf6;
}

.admin-metric.is-warning {
  border-color: rgba(244, 90, 54, 0.2);
  background: #fff4ed;
}

.admin-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 8px 0 10px;
}

.admin-card-details {
  display: grid;
  gap: 10px;
}

.admin-card-details details {
  padding-top: 6px;
  border-top: 1px solid rgba(17, 24, 32, 0.08);
}

.admin-card-details summary {
  cursor: pointer;
  color: #111820;
  font-weight: 700;
}

.diagnostics-actions-refresh {
  flex: 0 0 auto;
}

/* ==========================================================================
   18. Floating upload action and bottom navigation
   ========================================================================== */

.upload-fab {
  --round-icon-size: 46px;
  --round-icon-image-size: 30px;
  --round-icon-bg: rgba(255, 253, 248, 0.8);
  --round-icon-border: rgba(255, 253, 248, 0.7);
  --round-icon-active-bg: rgba(255, 253, 248, 0.94);
  position: fixed;
  right: max(18px, calc((100vw - 430px) / 2 + 18px));
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 1200;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(17, 24, 32, 0.18);
  pointer-events: auto;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 1250;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(430px, 100vw);
  min-height: calc(64px + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(17, 24, 32, 0.08);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 -10px 30px rgba(17, 24, 32, 0.08);
  backdrop-filter: blur(18px);
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
}

.bottom-nav button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  justify-items: center;
  padding: 4px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17323a;
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 160ms ease, transform 150ms ease, background-color 160ms ease;
}

.bottom-nav button:active {
  transform: translateY(1px) scale(0.97);
}

.bottom-nav button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: saturate(0) brightness(0.55);
  opacity: 0.95;
  transition: filter 160ms ease, opacity 160ms ease, transform 180ms cubic-bezier(0.2, 0.72, 0.18, 1);
}

.bottom-nav button.is-active {
  color: #f45a36;
}

.bottom-nav button.is-active img {
  filter: none;
  opacity: 1;
  transform: translateY(-1px) scale(1.08);
}

/* ==========================================================================
   19. Theme overrides
   ========================================================================== */

body[data-theme="dark"] {
  color-scheme: dark;
}

body[data-theme="dark"] .mobile-shell {
  background: #10191d;
  color: #f8f2e9;
}

body[data-theme="dark"] .app-header,
body[data-theme="dark"] .bottom-nav {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(16, 25, 29, 0.94);
}

body[data-theme="dark"] .pull-refresh-indicator {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(16, 25, 29, 0.96);
  color: #aeb8bc;
}

body[data-theme="dark"] .app-update-banner {
  border-color: rgba(255, 138, 107, 0.32);
  background: #2b1c17;
  color: #ffd3c4;
}

body[data-theme="dark"] .app-header-title strong,
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .bottom-nav button,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .secondary {
  color: #f8f2e9;
}

body[data-theme="dark"] .place-action-button {
  border-color: #ff8a63;
  background: rgba(248, 242, 233, 0.06);
  color: #ffb28f;
}

body[data-theme="dark"] .subtle-button {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(248, 242, 233, 0.04);
  color: #aeb8bc;
}

body[data-theme="dark"] .admin-foldout > summary::after,
body[data-theme="dark"] .admin-task-card > summary::after {
  background: rgba(248, 242, 233, 0.08);
  color: #f8f2e9;
}

body[data-theme="dark"] .admin-status.is-ok {
  background: rgba(63, 201, 126, 0.14);
  color: #74e6a7;
}

body[data-theme="dark"] .admin-status.is-warning {
  background: rgba(244, 90, 54, 0.18);
  color: #ff9b75;
}

body[data-theme="dark"] .admin-foldout summary strong {
  color: #f8f2e9;
}

body[data-theme="dark"] .app-header-title small,
body[data-theme="dark"] dt,
body[data-theme="dark"] .field span,
body[data-theme="dark"] .check-field span,
body[data-theme="dark"] .message,
body[data-theme="dark"] .admin-foldout summary small,
body[data-theme="dark"] .admin-user small,
body[data-theme="dark"] .error {
  color: #aeb8bc;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .home-card,
body[data-theme="dark"] .home-personal-card,
body[data-theme="dark"] .place-card,
body[data-theme="dark"] .trip-card,
body[data-theme="dark"] .visit-row,
body[data-theme="dark"] .diagnostic-item,
body[data-theme="dark"] .admin-section-card,
body[data-theme="dark"] .admin-task-card,
body[data-theme="dark"] .trip-album-intro,
body[data-theme="dark"] .trip-album-section,
body[data-theme="dark"] .trip-photo-browser,
body[data-theme="dark"] .trip-station,
body[data-theme="dark"] .trip-story-read,
body[data-theme="dark"] .trip-story-editor,
body[data-theme="dark"] .trip-hotels,
body[data-theme="dark"] .trip-highlight-list,
body[data-theme="dark"] .photo-ai-panel,
body[data-theme="dark"] .trip-ai-panel,
body[data-theme="dark"] .admin-user,
body[data-theme="dark"] .empty-state {
  border-color: rgba(248, 242, 233, 0.12);
  background: #172328;
  color: #f8f2e9;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .empty-state-eyebrow {
  color: #ff9b75;
}

body[data-theme="dark"] .upload-dropzone,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .secondary,
body[data-theme="dark"] .theme-mode-control {
  border-color: rgba(248, 242, 233, 0.12);
  background: #0f171b;
}

body[data-theme="dark"] .secondary.danger {
  border-color: rgba(255, 107, 70, 0.32);
  background: #241817;
  color: #ff8a6b;
}

body[data-theme="dark"] .theme-mode-control button {
  color: #f8f2e9;
}

body[data-theme="dark"] .theme-mode-control button.is-active {
  background: #243238;
  color: #ff6b46;
}

body[data-theme="dark"] .admin-section {
  border-color: rgba(248, 242, 233, 0.12);
}

body[data-theme="dark"] .admin-metric,
body[data-theme="dark"] .photo-ai-card,
body[data-theme="dark"] .trip-ai-card,
body[data-theme="dark"] .diagnostic-list {
  border-color: rgba(248, 242, 233, 0.12);
  background: #0f171b;
}

body[data-theme="dark"] .admin-metric.is-ok {
  border-color: rgba(66, 168, 112, 0.24);
  background: #10251b;
}

body[data-theme="dark"] .admin-metric.is-warning {
  border-color: rgba(255, 107, 70, 0.28);
  background: #241817;
}

body[data-theme="dark"] .review-assistant,
body[data-theme="dark"] .review-assistant-guidance,
body[data-theme="dark"] .review-summary,
body[data-theme="dark"] .review-group,
body[data-theme="dark"] .review-queue button,
body[data-theme="dark"] .memory-item,
body[data-theme="dark"] .trip-hotel-list button {
  border-color: rgba(248, 242, 233, 0.12);
  background: #172328;
}

body[data-theme="dark"] .review-assistant-progress,
body[data-theme="dark"] .review-assistant-progress::-webkit-progress-bar {
  background: rgba(248, 242, 233, 0.12);
}

body[data-theme="dark"] .review-assistant-stats div {
  background: rgba(248, 242, 233, 0.06);
}

body[data-theme="dark"] .trip-story-days article {
  border-top-color: rgba(248, 242, 233, 0.12);
}

body[data-theme="dark"] .admin-task-header p,
body[data-theme="dark"] .review-assistant p,
body[data-theme="dark"] .review-summary span,
body[data-theme="dark"] .review-item small,
body[data-theme="dark"] .review-assistant-stats dt,
body[data-theme="dark"] .review-queue small,
body[data-theme="dark"] .section-eyebrow,
body[data-theme="dark"] .trip-story-days article span,
body[data-theme="dark"] .trip-highlight-list small,
body[data-theme="dark"] .trip-hotel-list small,
body[data-theme="dark"] .trip-hotel-list em,
body[data-theme="dark"] .trip-story-facts dt,
body[data-theme="dark"] .photo-ai-card dt,
body[data-theme="dark"] .trip-ai-card dt,
body[data-theme="dark"] .trip-ai-day-notes li span,
body[data-theme="dark"] .admin-metric span,
body[data-theme="dark"] .memory-copy small {
  color: #aeb8bc;
}

body[data-theme="dark"] .admin-metric strong,
body[data-theme="dark"] .review-assistant h3,
body[data-theme="dark"] .review-assistant-header span > strong,
body[data-theme="dark"] .review-item strong,
body[data-theme="dark"] .review-assistant-stats dd,
body[data-theme="dark"] .photo-ai-card dd,
body[data-theme="dark"] .photo-ai-panel h3,
body[data-theme="dark"] .trip-ai-card dd,
body[data-theme="dark"] .trip-story-note,
body[data-theme="dark"] .trip-story-days h4,
body[data-theme="dark"] .trip-story-days article p,
body[data-theme="dark"] .trip-story-read h3,
body[data-theme="dark"] .trip-story-editor h3,
body[data-theme="dark"] .trip-album-section-header h3,
body[data-theme="dark"] .trip-photo-browser h3,
body[data-theme="dark"] .trip-stat-grid dd,
body[data-theme="dark"] .trip-stat-list dd,
body[data-theme="dark"] .trip-highlight-gallery h3,
body[data-theme="dark"] .trip-hotels h3,
body[data-theme="dark"] .trip-highlight-list h3,
body[data-theme="dark"] .trip-highlight-list strong,
body[data-theme="dark"] .trip-hotel-list strong,
body[data-theme="dark"] .trip-story-title,
body[data-theme="dark"] .trip-story-lead,
body[data-theme="dark"] .trip-story-facts dd,
body[data-theme="dark"] .trip-story-section h4,
body[data-theme="dark"] .memory-copy strong,
body[data-theme="dark"] .trip-story-section p,
body[data-theme="dark"] .trip-ai-day-notes strong,
body[data-theme="dark"] .trip-ai-day-notes li,
body[data-theme="dark"] .trip-ai-panel h3,
body[data-theme="dark"] .admin-card-details summary {
  color: #f8f2e9;
}

body[data-theme="dark"] .view-state.is-error {
  border-color: rgba(255, 107, 70, 0.28);
  background: #241817;
}

body[data-theme="dark"] .trip-story-facts div {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(248, 242, 233, 0.04);
}

body[data-theme="dark"] .trip-story-section {
  border-top-color: rgba(248, 242, 233, 0.12);
}

body[data-theme="dark"] .trip-story-days article::before {
  background: #172328;
}

body[data-theme="dark"] .trip-story-days article::after {
  background: rgba(248, 242, 233, 0.12);
}

body[data-theme="dark"] .view-state.is-error strong {
  color: #ff8a6b;
}

body[data-theme="dark"] .pull-refresh-indicator.is-ready {
  color: #ff8a6b;
}

body[data-theme="dark"] .trip-detail-content {
  background: #10191d;
}

body[data-theme="dark"] .trip-detail-tabs {
  border-color: rgba(248, 242, 233, 0.1);
  background: rgba(16, 25, 29, 0.94);
}

body[data-theme="dark"] .trip-detail-tabs button.is-active {
  background: rgba(255, 138, 107, 0.12);
  color: #ff8a6b;
}

body[data-theme="dark"] .filter-strip,
body[data-theme="dark"] #gallery-summary.is-visible-filter {
  border-color: rgba(248, 242, 233, 0.1);
  background: rgba(248, 242, 233, 0.04);
}

body[data-theme="dark"] .gallery-chips button,
body[data-theme="dark"] .global-search-chips button,
body[data-theme="dark"] .global-search-field input,
body[data-theme="dark"] .filter-strip input,
body[data-theme="dark"] .filter-strip select {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(248, 242, 233, 0.05);
  color: #f8f2e9;
}

body[data-theme="dark"] .gallery-chips button.is-active,
body[data-theme="dark"] .global-search-chips button.is-active,
body[data-theme="dark"] #gallery-summary.is-visible-filter .gallery-filter-pills span {
  border-color: rgba(255, 138, 107, 0.35);
  background: rgba(255, 138, 107, 0.12);
  color: #ffd3c4;
}

body[data-theme="dark"] .bottom-nav button img {
  filter: saturate(0) brightness(1.75);
  opacity: 0.82;
}

body[data-theme="dark"] .bottom-nav button.is-active img {
  filter: none;
  opacity: 1;
}

body[data-theme="dark"] .home-metric-grid button,
body[data-theme="dark"] .home-action-grid button,
body[data-theme="dark"] .app-dialog,
body[data-theme="dark"] .photo-detail-sheet,
body[data-theme="dark"] .photo-detail-header,
body[data-theme="dark"] .global-search-modal,
body[data-theme="dark"] .global-search-sheet,
body[data-theme="dark"] .trip-detail-modal,
body[data-theme="dark"] .trip-detail-screen,
body[data-theme="dark"] .map-bottom-sheet,
body[data-theme="dark"] .map-list-item,
body[data-theme="dark"] .map-timeline-days button {
  border-color: rgba(248, 242, 233, 0.12);
  background: #172328;
  color: #f8f2e9;
}

body[data-theme="dark"] .photo-detail-header {
  background: rgba(23, 35, 40, 0.94);
}

body[data-theme="dark"] .global-search-modal,
body[data-theme="dark"] .global-search-sheet,
body[data-theme="dark"] .trip-detail-modal,
body[data-theme="dark"] .trip-detail-screen {
  background: #10191d;
}

body[data-theme="dark"] .home-hero.has-background::after {
  background:
    linear-gradient(135deg, rgba(16, 25, 29, 0.9) 0%, rgba(16, 25, 29, 0.68) 52%, rgba(16, 25, 29, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 20, 28, 0.1) 0%, rgba(0, 20, 28, 0.3) 100%);
}

body[data-theme="dark"] .home-hero h2,
body[data-theme="dark"] .photo-detail-header strong,
body[data-theme="dark"] .map-list-item strong,
body[data-theme="dark"] .map-sheet-title strong,
body[data-theme="dark"] .app-dialog h2 {
  color: #f8f2e9;
}

body[data-theme="dark"] .home-hero p,
body[data-theme="dark"] .home-metric-grid span,
body[data-theme="dark"] .home-metric-grid small,
body[data-theme="dark"] .home-card header small,
body[data-theme="dark"] .photo-detail-header small,
body[data-theme="dark"] .app-dialog p,
body[data-theme="dark"] .map-sheet-title small,
body[data-theme="dark"] .map-timeline-days button small {
  color: #aeb8bc;
}

body[data-theme="dark"] .place-card-main em,
body[data-theme="dark"] .home-action-grid .home-action-icon,
body[data-theme="dark"] .map-mode-tabs,
body[data-theme="dark"] .map-mode-tabs button.is-active,
body[data-theme="dark"] .home-photo-strip button,
body[data-theme="dark"] .memory-thumb {
  border-color: rgba(248, 242, 233, 0.12);
  background: rgba(248, 242, 233, 0.08);
  color: #f8f2e9;
}

body[data-theme="dark"] .map-mode-tabs button,
body[data-theme="dark"] .trip-actions button {
  color: #f8f2e9;
}

body[data-theme="dark"] .trip-actions button,
body[data-theme="dark"] .place-highlight-icon,
body[data-theme="dark"] .place-card-icon-action {
  --round-icon-bg: rgba(248, 242, 233, 0.1);
  --round-icon-border: rgba(248, 242, 233, 0.14);
  --round-icon-active-bg: rgba(255, 138, 107, 0.16);
  border-color: rgba(248, 242, 233, 0.14);
  background: rgba(248, 242, 233, 0.08);
}

body[data-theme="dark"] .map-stage,
body[data-theme="dark"] .travel-map {
  background: #0f171b;
}

/* System theme mirrors the dark palette when the OS prefers dark mode. */

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    color-scheme: dark;
  }

  body[data-theme="system"] .mobile-shell {
    background: #10191d;
    color: #f8f2e9;
  }

  body[data-theme="system"] .app-header,
  body[data-theme="system"] .bottom-nav {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(16, 25, 29, 0.94);
  }

  body[data-theme="system"] .pull-refresh-indicator {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(16, 25, 29, 0.96);
    color: #aeb8bc;
  }

  body[data-theme="system"] .app-update-banner {
    border-color: rgba(255, 138, 107, 0.32);
    background: #2b1c17;
    color: #ffd3c4;
  }

  body[data-theme="system"] .app-header-title strong,
  body[data-theme="system"] .icon-button,
  body[data-theme="system"] .bottom-nav button,
  body[data-theme="system"] .field input,
  body[data-theme="system"] .field select,
  body[data-theme="system"] .field textarea,
  body[data-theme="system"] .secondary {
    color: #f8f2e9;
  }

  body[data-theme="system"] .place-action-button {
    border-color: #ff8a63;
    background: rgba(248, 242, 233, 0.06);
    color: #ffb28f;
  }

  body[data-theme="system"] .subtle-button {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(248, 242, 233, 0.04);
    color: #aeb8bc;
  }

  body[data-theme="system"] .admin-foldout > summary::after,
  body[data-theme="system"] .admin-task-card > summary::after {
    background: rgba(248, 242, 233, 0.08);
    color: #f8f2e9;
  }

  body[data-theme="system"] .admin-status.is-ok {
    background: rgba(63, 201, 126, 0.14);
    color: #74e6a7;
  }

  body[data-theme="system"] .admin-status.is-warning {
    background: rgba(244, 90, 54, 0.18);
    color: #ff9b75;
  }

  body[data-theme="system"] .admin-foldout summary strong {
    color: #f8f2e9;
  }

  body[data-theme="system"] .app-header-title small,
  body[data-theme="system"] dt,
  body[data-theme="system"] .field span,
  body[data-theme="system"] .check-field span,
  body[data-theme="system"] .message,
  body[data-theme="system"] .admin-foldout summary small,
  body[data-theme="system"] .admin-user small,
  body[data-theme="system"] .error {
    color: #aeb8bc;
  }

  body[data-theme="system"] .panel,
  body[data-theme="system"] .home-card,
  body[data-theme="system"] .home-personal-card,
  body[data-theme="system"] .place-card,
  body[data-theme="system"] .trip-card,
  body[data-theme="system"] .visit-row,
  body[data-theme="system"] .diagnostic-item,
  body[data-theme="system"] .admin-section-card,
  body[data-theme="system"] .admin-task-card,
  body[data-theme="system"] .trip-album-intro,
  body[data-theme="system"] .trip-album-section,
  body[data-theme="system"] .trip-photo-browser,
  body[data-theme="system"] .trip-station,
  body[data-theme="system"] .review-assistant,
  body[data-theme="system"] .review-assistant-guidance,
  body[data-theme="system"] .review-summary,
  body[data-theme="system"] .review-group,
  body[data-theme="system"] .review-queue button,
  body[data-theme="system"] .memory-item,
  body[data-theme="system"] .trip-hotel-list button,
  body[data-theme="system"] .trip-story-read,
  body[data-theme="system"] .trip-story-editor,
  body[data-theme="system"] .trip-hotels,
  body[data-theme="system"] .trip-highlight-list,
  body[data-theme="system"] .photo-ai-panel,
  body[data-theme="system"] .trip-ai-panel,
  body[data-theme="system"] .admin-user,
  body[data-theme="system"] .empty-state {
    border-color: rgba(248, 242, 233, 0.12);
    background: #172328;
    color: #f8f2e9;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  }

  body[data-theme="system"] .empty-state-eyebrow {
    color: #ff9b75;
  }

  body[data-theme="system"] .upload-dropzone,
  body[data-theme="system"] .field input,
  body[data-theme="system"] .field select,
  body[data-theme="system"] .field textarea,
  body[data-theme="system"] .secondary,
  body[data-theme="system"] .theme-mode-control {
    border-color: rgba(248, 242, 233, 0.12);
    background: #0f171b;
  }

  body[data-theme="system"] .secondary.danger {
    border-color: rgba(255, 107, 70, 0.32);
    background: #241817;
    color: #ff8a6b;
  }

  body[data-theme="system"] .theme-mode-control button {
    color: #f8f2e9;
  }

  body[data-theme="system"] .theme-mode-control button.is-active {
    background: #243238;
    color: #ff6b46;
  }

  body[data-theme="system"] .admin-section {
    border-color: rgba(248, 242, 233, 0.12);
  }

  body[data-theme="system"] .admin-metric,
  body[data-theme="system"] .photo-ai-card,
  body[data-theme="system"] .trip-ai-card,
  body[data-theme="system"] .diagnostic-list {
    border-color: rgba(248, 242, 233, 0.12);
    background: #0f171b;
  }

  body[data-theme="system"] .admin-metric.is-ok {
    border-color: rgba(66, 168, 112, 0.24);
    background: #10251b;
  }

  body[data-theme="system"] .admin-metric.is-warning {
    border-color: rgba(255, 107, 70, 0.28);
    background: #241817;
  }

  body[data-theme="system"] .review-assistant-progress,
  body[data-theme="system"] .review-assistant-progress::-webkit-progress-bar {
    background: rgba(248, 242, 233, 0.12);
  }

  body[data-theme="system"] .review-assistant-stats div {
    background: rgba(248, 242, 233, 0.06);
  }

  body[data-theme="system"] .trip-story-days article {
    border-top-color: rgba(248, 242, 233, 0.12);
  }

  body[data-theme="system"] .admin-task-header p,
  body[data-theme="system"] .review-assistant p,
  body[data-theme="system"] .review-summary span,
  body[data-theme="system"] .review-item small,
  body[data-theme="system"] .review-assistant-stats dt,
  body[data-theme="system"] .review-queue small,
  body[data-theme="system"] .section-eyebrow,
  body[data-theme="system"] .trip-story-days article span,
  body[data-theme="system"] .trip-highlight-list small,
  body[data-theme="system"] .trip-hotel-list small,
  body[data-theme="system"] .trip-hotel-list em,
  body[data-theme="system"] .trip-story-facts dt,
  body[data-theme="system"] .photo-ai-card dt,
  body[data-theme="system"] .trip-ai-card dt,
  body[data-theme="system"] .trip-ai-day-notes li span,
  body[data-theme="system"] .admin-metric span,
  body[data-theme="system"] .memory-copy small {
    color: #aeb8bc;
  }

  body[data-theme="system"] .admin-metric strong,
  body[data-theme="system"] .review-assistant h3,
  body[data-theme="system"] .review-assistant-header span > strong,
  body[data-theme="system"] .review-item strong,
  body[data-theme="system"] .review-assistant-stats dd,
  body[data-theme="system"] .photo-ai-card dd,
  body[data-theme="system"] .photo-ai-panel h3,
  body[data-theme="system"] .trip-ai-card dd,
  body[data-theme="system"] .trip-story-note,
  body[data-theme="system"] .trip-story-days h4,
  body[data-theme="system"] .trip-story-days article p,
  body[data-theme="system"] .trip-story-read h3,
  body[data-theme="system"] .trip-story-editor h3,
  body[data-theme="system"] .trip-album-section-header h3,
  body[data-theme="system"] .trip-photo-browser h3,
  body[data-theme="system"] .trip-stat-grid dd,
  body[data-theme="system"] .trip-stat-list dd,
  body[data-theme="system"] .trip-highlight-gallery h3,
  body[data-theme="system"] .trip-hotels h3,
  body[data-theme="system"] .trip-highlight-list h3,
  body[data-theme="system"] .trip-highlight-list strong,
  body[data-theme="system"] .trip-hotel-list strong,
  body[data-theme="system"] .trip-story-title,
  body[data-theme="system"] .trip-story-lead,
  body[data-theme="system"] .trip-story-facts dd,
  body[data-theme="system"] .trip-story-section h4,
  body[data-theme="system"] .memory-copy strong,
  body[data-theme="system"] .trip-story-section p,
  body[data-theme="system"] .trip-ai-day-notes strong,
  body[data-theme="system"] .trip-ai-day-notes li,
  body[data-theme="system"] .trip-ai-panel h3,
  body[data-theme="system"] .admin-card-details summary {
    color: #f8f2e9;
  }

  body[data-theme="system"] .view-state.is-error {
    border-color: rgba(255, 107, 70, 0.28);
    background: #241817;
  }

  body[data-theme="system"] .trip-story-facts div {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(248, 242, 233, 0.04);
  }

  body[data-theme="system"] .trip-story-section {
    border-top-color: rgba(248, 242, 233, 0.12);
  }

  body[data-theme="system"] .trip-story-days article::before {
    background: #172328;
  }

  body[data-theme="system"] .trip-story-days article::after {
    background: rgba(248, 242, 233, 0.12);
  }

  body[data-theme="system"] .view-state.is-error strong {
    color: #ff8a6b;
  }

  body[data-theme="system"] .pull-refresh-indicator.is-ready {
    color: #ff8a6b;
  }

  body[data-theme="system"] .trip-detail-content {
    background: #10191d;
  }

  body[data-theme="system"] .trip-detail-tabs {
    border-color: rgba(248, 242, 233, 0.1);
    background: rgba(16, 25, 29, 0.94);
  }

  body[data-theme="system"] .trip-detail-tabs button.is-active {
    background: rgba(255, 138, 107, 0.12);
    color: #ff8a6b;
  }

  body[data-theme="system"] .filter-strip,
  body[data-theme="system"] #gallery-summary.is-visible-filter {
    border-color: rgba(248, 242, 233, 0.1);
    background: rgba(248, 242, 233, 0.04);
  }

  body[data-theme="system"] .gallery-chips button,
  body[data-theme="system"] .global-search-chips button,
  body[data-theme="system"] .global-search-field input,
  body[data-theme="system"] .filter-strip input,
  body[data-theme="system"] .filter-strip select {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(248, 242, 233, 0.05);
    color: #f8f2e9;
  }

  body[data-theme="system"] .gallery-chips button.is-active,
  body[data-theme="system"] .global-search-chips button.is-active,
  body[data-theme="system"] #gallery-summary.is-visible-filter .gallery-filter-pills span {
    border-color: rgba(255, 138, 107, 0.35);
    background: rgba(255, 138, 107, 0.12);
    color: #ffd3c4;
  }

  body[data-theme="system"] .bottom-nav button img {
    filter: saturate(0) brightness(1.75);
    opacity: 0.82;
  }

  body[data-theme="system"] .bottom-nav button.is-active img {
    filter: none;
    opacity: 1;
  }

  body[data-theme="system"] .home-metric-grid button,
  body[data-theme="system"] .home-action-grid button,
  body[data-theme="system"] .app-dialog,
  body[data-theme="system"] .photo-detail-sheet,
  body[data-theme="system"] .photo-detail-header,
  body[data-theme="system"] .global-search-modal,
  body[data-theme="system"] .global-search-sheet,
  body[data-theme="system"] .trip-detail-modal,
  body[data-theme="system"] .trip-detail-screen,
  body[data-theme="system"] .map-bottom-sheet,
  body[data-theme="system"] .map-list-item,
  body[data-theme="system"] .map-timeline-days button {
    border-color: rgba(248, 242, 233, 0.12);
    background: #172328;
    color: #f8f2e9;
  }

  body[data-theme="system"] .photo-detail-header {
    background: rgba(23, 35, 40, 0.94);
  }

  body[data-theme="system"] .global-search-modal,
  body[data-theme="system"] .global-search-sheet,
  body[data-theme="system"] .trip-detail-modal,
  body[data-theme="system"] .trip-detail-screen {
    background: #10191d;
  }

  body[data-theme="system"] .home-hero.has-background::after {
    background:
      linear-gradient(135deg, rgba(16, 25, 29, 0.9) 0%, rgba(16, 25, 29, 0.68) 52%, rgba(16, 25, 29, 0.5) 100%),
      linear-gradient(180deg, rgba(0, 20, 28, 0.1) 0%, rgba(0, 20, 28, 0.3) 100%);
  }

  body[data-theme="system"] .home-hero h2,
  body[data-theme="system"] .photo-detail-header strong,
  body[data-theme="system"] .map-list-item strong,
  body[data-theme="system"] .map-sheet-title strong,
  body[data-theme="system"] .app-dialog h2 {
    color: #f8f2e9;
  }

  body[data-theme="system"] .home-hero p,
  body[data-theme="system"] .home-metric-grid span,
  body[data-theme="system"] .home-metric-grid small,
  body[data-theme="system"] .home-card header small,
  body[data-theme="system"] .photo-detail-header small,
  body[data-theme="system"] .app-dialog p,
  body[data-theme="system"] .map-sheet-title small,
  body[data-theme="system"] .map-timeline-days button small {
    color: #aeb8bc;
  }

  body[data-theme="system"] .place-card-main em,
  body[data-theme="system"] .home-action-grid .home-action-icon,
  body[data-theme="system"] .map-mode-tabs,
  body[data-theme="system"] .map-mode-tabs button.is-active,
  body[data-theme="system"] .home-photo-strip button,
  body[data-theme="system"] .memory-thumb {
    border-color: rgba(248, 242, 233, 0.12);
    background: rgba(248, 242, 233, 0.08);
    color: #f8f2e9;
  }

  body[data-theme="system"] .map-mode-tabs button,
  body[data-theme="system"] .trip-actions button {
    color: #f8f2e9;
  }

  body[data-theme="system"] .trip-actions button,
  body[data-theme="system"] .place-highlight-icon,
  body[data-theme="system"] .place-card-icon-action {
    --round-icon-bg: rgba(248, 242, 233, 0.1);
    --round-icon-border: rgba(248, 242, 233, 0.14);
    --round-icon-active-bg: rgba(255, 138, 107, 0.16);
    border-color: rgba(248, 242, 233, 0.14);
    background: rgba(248, 242, 233, 0.08);
  }

  body[data-theme="system"] .map-stage,
  body[data-theme="system"] .travel-map {
    background: #0f171b;
  }
}

/* ==========================================================================
   20. Wider viewport refinements
   ========================================================================== */

@media (min-width: 760px) {
  .mobile-shell {
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: 28px;
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 28px 28px;
  }

  .upload-fab {
    bottom: 102px;
  }

  .import-status-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-task-card:last-child {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   21. Mobile keyboard and compact corrections
   ========================================================================== */

@media (max-width: 720px) {
  .mobile-shell {
    width: 100%;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom));
  }

  .app-header {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .panel {
    padding: 16px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
