html {
  font-size: 16px;
}

:root {
  --app-bg: #11100f;
  --app-surface: #1d1b1a;
  --app-surface-2: #262321;
  --app-surface-3: #302c29;
  --app-section: #211f1d;
  --app-titlebar: #3a3028;
  --app-border: #4a4038;
  --app-border-strong: #d6a35d;
  --app-text: #f4efe8;
  --app-muted: #c9bfb2;
  --app-soft: #cbd5e1;
  --app-accent: #4ade80;
  --app-accent-strong: #22c55e;
  --section-accent: #d6a35d;
  --section-accent-soft: rgba(214, 163, 93, 0.2);
  --section-bg: #211f1d;
  --section-card-bg: #2b2825;
  --section-border: #6b5640;
  --section-card-border: #806649;
  --section-divider: #5f4d38;
  --section-code-border: #d6a35d;
  --section-code-text: #fde9bd;
  --section-title-from: #5f3f1d;
  --section-title-to: #8a5a22;
  --app-danger: #fb7185;
  --app-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  --app-shadow-soft: 0 9px 22px rgba(0, 0, 0, 0.24);
}

body {
  margin: 0;
  color: var(--app-text);
  background: var(--app-bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

.topbar {
  background: #151311;
  border-bottom: 1px solid #4a4038;
  box-shadow: 0 1px 0 rgba(214, 163, 93, 0.12);
}

.nav-shell,
.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-shell {
  justify-content: space-between;
}

.nav-primary {
  min-width: 0;
}

.brand {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  margin-right: 0.5rem;
  text-decoration: none;
}

.nav-actions,
.toolbar-actions,
.action-row,
.copy-row,
.owner-actions,
.member-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-name {
  color: var(--app-muted);
  font-size: 1.08rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.topbar-compact-map .navbar {
  min-height: auto;
}

.topbar-compact-map .nav-shell {
  justify-content: flex-start;
  padding-bottom: 0.45rem;
  padding-top: 0.45rem;
}

.map-greeting {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
}

.btn {
  font-size: 0.9rem;
}

.btn-primary {
  --bs-btn-bg: #db2777;
  --bs-btn-border-color: #f472b6;
  --bs-btn-hover-bg: #be185d;
  --bs-btn-hover-border-color: #f9a8d4;
  --bs-btn-active-bg: #9d174d;
  --bs-btn-active-border-color: #f472b6;
}

.btn-outline-primary {
  --bs-btn-color: #f6d18b;
  --bs-btn-border-color: #d6a35d;
  --bs-btn-hover-bg: #8a5a22;
  --bs-btn-hover-border-color: #fbbf24;
  --bs-btn-hover-color: #fff7ed;
}

.btn-outline-secondary {
  --bs-btn-color: #cbd5e1;
  --bs-btn-border-color: #64748b;
  --bs-btn-hover-bg: #334155;
  --bs-btn-hover-border-color: #94a3b8;
  --bs-btn-hover-color: #ffffff;
}

.btn-outline-danger {
  --bs-btn-color: #fda4af;
  --bs-btn-border-color: #fb7185;
  --bs-btn-hover-bg: #be123c;
  --bs-btn-hover-border-color: #fb7185;
  --bs-btn-hover-color: #ffffff;
}

.btn-danger {
  --bs-btn-bg: #be123c;
  --bs-btn-border-color: #fb7185;
  --bs-btn-hover-bg: #9f1239;
  --bs-btn-hover-border-color: #fecdd3;
}

.form-control,
.form-select,
textarea,
input:not([type="checkbox"]):not([type="radio"]) {
  background-color: #0b1220;
  border-color: #475569;
  color: var(--app-text);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):focus {
  background-color: #0f172a;
  border-color: #d6a35d;
  box-shadow: 0 0 0 0.2rem rgba(214, 163, 93, 0.2);
  color: var(--app-text);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #718096;
}

.alert {
  background: #3b2f12;
  border-color: #a16207;
  color: #fde68a;
}

.browser-notice,
.browser-login-warning {
  background:
    linear-gradient(135deg, #4a1720, #27191c 66%),
    radial-gradient(circle at top right, rgba(251, 113, 133, 0.2), transparent 42%);
  border: 1px solid #fb7185;
  border-left: 4px solid #fb7185;
  border-radius: 8px;
  color: #ffe4e6;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  white-space: pre-line;
}

.browser-notice p {
  color: #fecdd3;
  margin: 0.25rem 0 0;
}

.browser-login-warning p {
  color: #fecdd3;
  margin: 0.35rem 0 0;
}

.browser-login-warning .btn,
.browser-notice .btn {
  margin-top: 0.65rem;
}

.line-browser-help-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 20000;
}

.line-browser-help-modal[hidden] {
  display: none;
}

.line-browser-help-card {
  background: #1f1f22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 1rem;
  width: 100%;
}

.line-browser-help-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.line-browser-help-close {
  background: transparent;
  border: 0;
  color: #f8fafc;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.line-browser-menu-demo {
  background: #2b2b2e;
  border-radius: 12px;
  overflow: hidden;
}

.line-browser-menu-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  font-size: 1.05rem;
  font-weight: 800;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.line-browser-menu-row:last-child {
  border-bottom: 0;
}

.line-browser-menu-row.is-target {
  color: #ffffff;
}

.line-browser-menu-icon {
  color: #d1d5db;
  font-size: 1rem;
  margin-left: 1rem;
}

.line-browser-help-card p {
  color: #e5e7eb;
  margin: 0.75rem 0 0;
}

table {
  color: var(--app-text);
}

thead,
th {
  background: #122038;
  color: #e0f2fe;
}

td,
th {
  border-color: #334155;
}

a {
  color: #f6d18b;
}

a:hover {
  color: #fde9bd;
}

.page-shell {
  padding: 1.5rem 0 3rem;
}

.hero-band,
.auth-intro,
.section-head,
.content-section,
.info-band,
.form-panel,
.auth-panel,
.empty-state {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--app-shadow-soft);
}

.hero-band,
.auth-intro,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
}

.control-section {
  --section-accent: #f9a8d4;
  --section-accent-soft: rgba(244, 114, 182, 0.18);
  background:
    linear-gradient(135deg, rgba(88, 28, 59, 0.86), rgba(37, 24, 34, 0.98) 60%),
    #281722;
  border-color: #f9a8d4;
  border-left: 5px solid var(--section-accent);
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 16px 32px rgba(190, 24, 93, 0.18);
  margin-bottom: 1rem;
}

.section-head:not(.control-section) {
  --section-accent: #f9a8d4;
  --section-accent-soft: rgba(244, 114, 182, 0.18);
  --section-border: #9f5b83;
  background:
    linear-gradient(135deg, #3b1830, #211a2f 62%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 42%);
  border-color: var(--section-border);
  border-left: 4px solid var(--section-accent);
}

.content-section {
  background:
    linear-gradient(135deg, var(--section-bg), rgba(17, 16, 15, 0.82) 72%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 42%);
  border-color: var(--section-border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  margin-top: 1.15rem;
  padding: 0;
  overflow: hidden;
}

.content-section:nth-of-type(2),
.content-section:nth-of-type(3),
.content-section:nth-of-type(4) {
  --section-accent: #c4b5fd;
  --section-accent-soft: rgba(196, 181, 253, 0.18);
  --section-bg: #211a2f;
  --section-card-bg: #2f2741;
  --section-border: #7561a6;
  --section-card-border: #9b87c9;
  --section-divider: #5d4f83;
  --section-code-border: #c4b5fd;
  --section-code-text: #ede9fe;
  --section-title-from: #6d5ba8;
  --section-title-to: #8b73c7;
}

.section-titlebar {
  background: linear-gradient(90deg, var(--section-title-from), var(--section-title-to));
  border-bottom: 1px solid var(--section-accent);
  padding: 0.3rem 0.8rem;
}

.section-titlebar h2 {
  line-height: 1.15;
  margin-bottom: 0;
}

.content-section .trip-grid {
  padding: 1rem;
}

.control-heading h1 {
  margin-bottom: 0;
}

.quick-action-row {
  align-items: center;
  border-top: 1px solid rgba(249, 168, 212, 0.32);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 0.85rem;
}

.quick-action-row strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.quick-action-row p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.invite-form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.invite-form .form-control {
  max-width: 10rem;
  text-transform: uppercase;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
}

h3,
.list-title {
  font-size: 1rem;
  margin: 1.25rem 0 0.75rem;
  font-weight: 700;
}

.list-title {
  align-items: center;
  color: #e2e8f0;
  display: flex;
  gap: 0.5rem;
}

.list-title::before {
  background: linear-gradient(180deg, #f472b6, #fbbf24);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 1.15rem;
  width: 0.32rem;
}

h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.muted,
.trip-card p,
.member-row p,
.hero-band p,
.auth-intro p,
.section-head p,
.empty-state p {
  color: var(--app-muted);
}

.trip-card p,
.member-row p,
.section-head p,
.map-toolbar p {
  margin-bottom: 0;
}

.map-toolbar .map-debug {
  color: #f9a8d4;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.map-status-summary {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.45rem;
}

.map-status-summary p {
  color: #d7c9b8;
  font-size: 0.92rem;
}

.map-status-summary span {
  color: #f6d18b;
  font-weight: 700;
}

.map-status-summary strong {
  color: #ffffff;
  font-weight: 700;
}

.map-location-counters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.85rem;
}

.map-location-counters strong {
  color: #bbf7d0;
}

.map-view-mode-line {
  display: none;
}

.map-share-note {
  background: rgba(120, 53, 15, 0.28);
  border: 1px solid rgba(246, 209, 139, 0.45);
  border-radius: 8px;
  color: #fde68a;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 0.55rem;
  max-width: 52rem;
  padding: 0.55rem 0.7rem;
}

.gps-status-card {
  background:
    linear-gradient(135deg, #211a2f, #282139 64%),
    radial-gradient(circle at top right, rgba(196, 181, 253, 0.18), transparent 44%);
  border: 1px solid #7561a6;
  border-left: 4px solid #c4b5fd;
  border-radius: 8px;
  box-shadow: var(--app-shadow-soft);
  padding: 1rem;
}

.gps-status-head {
  border-bottom: 1px solid rgba(196, 181, 253, 0.26);
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
}

.gps-status-title-row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.gps-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-bottom: 0.65rem;
}

.gps-status-head h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.gps-test-note,
.gps-status-head p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.gps-test-checklist {
  color: #f4efe8;
  display: grid;
  gap: 0.25rem;
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
}

.gps-test-checklist li {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.gps-test-checklist li::before {
  color: #86efac;
  content: "✓";
  font-weight: 900;
}

.gps-result-label {
  color: #f6d18b;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
}

.gps-status-message {
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.85rem;
  padding: 0.75rem;
}

.gps-status-message.is-idle {
  background: rgba(11, 18, 32, 0.5);
  border: 1px solid rgba(196, 181, 253, 0.22);
  color: #f4efe8;
}

.gps-status-message.is-progress {
  background: rgba(120, 53, 15, 0.55);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.gps-status-message.is-success {
  background: rgba(20, 83, 45, 0.55);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}

.gps-status-message.is-error {
  background: rgba(74, 23, 32, 0.72);
  border: 1px solid #fb7185;
  color: #ffe4e6;
}

.gps-status-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
}

.gps-status-grid div {
  background: rgba(11, 18, 32, 0.58);
  border: 1px solid rgba(196, 181, 253, 0.2);
  border-radius: 8px;
  padding: 0.65rem;
}

.gps-status-grid dt {
  color: #d7c9b8;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.gps-status-grid dd {
  color: #f4efe8;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.gps-status-chips {
  grid-template-columns: repeat(auto-fit, minmax(190px, max-content));
}

.gps-status-chips div {
  align-items: center;
  border-radius: 999px;
  display: flex;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.75rem;
}

.gps-status-chips dt {
  margin: 0;
  white-space: nowrap;
}

.gps-error {
  background: #4a1720;
  border: 1px solid #fb7185;
  border-radius: 8px;
  color: #ffe4e6;
  font-weight: 700;
  margin: 0.85rem 0 0;
  padding: 0.75rem;
}

.gps-debug-details {
  background: #0b1220;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #bfdbfe;
  font-size: 0.78rem;
  margin: 0.85rem 0 0;
  overflow-x: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr));
  gap: 0.9rem;
}

.trip-card,
.member-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%),
    var(--section-card-bg);
  border: 1px solid var(--section-card-border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 18px var(--section-accent-soft);
}

.trip-card,
.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.trip-card-media {
  align-items: stretch;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.6rem;
  min-width: 0;
  padding: 0.75rem;
}

.trip-card-cover {
  align-items: center;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(196, 181, 253, 0.24);
  border-radius: 8px;
  display: flex;
  aspect-ratio: 4 / 3;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.trip-card-cover img {
  display: block;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  object-fit: cover;
  width: 100%;
}

.trip-card-cover span {
  color: #f4efe8;
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  text-align: center;
}

.trip-card-body {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  position: relative;
}

.trip-card-description {
  color: #e9d5ff;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.trip-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}

.member-row {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.member-row:hover,
.member-row:focus-visible,
.member-row-selected {
  border-color: #f9a8d4;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(244, 114, 182, 0.28), 0 0 20px rgba(244, 114, 182, 0.22);
  outline: none;
}

.map-info-card,
.member-map-info {
  color: #111827;
  display: grid;
  gap: 0.16rem;
  line-height: 1.28;
  min-width: 9rem;
  padding: 0.1rem 1.45rem 0.1rem 0;
  position: relative;
}

.map-info-card strong,
.member-map-info strong {
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.2;
  margin: 0;
}

.map-info-card span,
.member-map-info span {
  color: #4b5563;
  font-size: 0.85rem;
  line-height: 1.25;
  margin: 0;
}

.map-canvas .gm-style .gm-style-iw-c {
  padding: 0.42rem 0.58rem !important;
}

.map-canvas .gm-style .gm-style-iw-ch,
.map-canvas .gm-style .gm-style-iw-chr {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.map-canvas .gm-style .gm-style-iw-d {
  overflow: auto !important;
}

.map-canvas .gm-style .gm-ui-hover-effect {
  display: none !important;
}

.map-info-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 800;
  height: 1.25rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 0;
  top: -0.02rem;
  width: 1.25rem;
}

.map-info-close:hover,
.map-info-close:focus-visible {
  color: #111827;
  outline: none;
}

.trip-card {
  align-items: stretch;
  flex-direction: column;
  min-height: 10rem;
  border-top: 3px solid var(--section-accent);
}

.trip-card-body {
  display: grid;
  gap: 0.75rem;
}

.trip-card h4 {
  margin-bottom: 0;
}

.trip-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.trip-meta div {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.trip-meta dt {
  color: #d7c9b8;
  font-size: 0.82rem;
  line-height: 1.45;
}

.trip-meta dd {
  color: var(--app-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.trip-meta code {
  background: #0b1220;
  border: 1px solid var(--section-code-border);
  border-radius: 6px;
  color: var(--section-code-text);
  display: inline-block;
  font-size: 0.86rem;
  letter-spacing: 0;
  padding: 0.1rem 0.35rem;
}

.trip-card-actions {
  align-items: center;
  border-top: 1px solid var(--section-divider);
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 0.75rem;
}

.trip-card-actions .btn {
  white-space: nowrap;
}

.trip-header-actions {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trip-header-actions form {
  margin: 0;
}

.trip-header-actions .btn {
  white-space: nowrap;
}

.trip-copy-actions {
  border-top: 1px solid rgba(249, 168, 212, 0.24);
  display: flex;
  flex-basis: 100%;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
}

.copy-toast {
  background: #042f2e;
  border: 1px solid #2dd4bf;
  border-radius: 6px;
  color: #99f6e4;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
}

.photo-upload-panel {
  --section-accent: #f9a8d4;
  --section-accent-soft: rgba(244, 114, 182, 0.18);
  align-items: center;
  background:
    linear-gradient(135deg, #3b1830, #241a2b 66%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 44%);
  border: 1px solid #9f5b83;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 1rem;
  box-shadow: var(--app-shadow-soft);
}

.photo-upload-panel h2 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.photo-upload-panel p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.photo-upload-panel form,
.member-photo-form,
.inline-upload-form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.photo-upload-panel .form-control,
.member-photo-form .form-control,
.inline-upload-form .form-control {
  max-width: 18rem;
}

.photo-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.photo-thumb-button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  padding: 0;
}

.photo-thumb {
  aspect-ratio: 1;
  border: 1px solid #9b87c9;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  height: 4.5rem;
  object-fit: cover;
  width: 4.5rem;
}

.photo-thumb-cover {
  aspect-ratio: 4 / 3;
  height: 7rem;
  width: 9.5rem;
}

.member-photo-form {
  margin-top: 0.75rem;
}

.member-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.member-photo-form .btn {
  white-space: nowrap;
}

.photo-lightbox {
  align-items: center;
  background: rgba(0, 0, 0, 0.82);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 2rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1050;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox img {
  max-height: 88vh;
  max-width: 92vw;
  object-fit: contain;
}

.photo-lightbox-close {
  background: #db2777;
  border: 1px solid #f9a8d4;
  border-radius: 6px;
  color: #fff;
  padding: 0.45rem 0.85rem;
  position: fixed;
  right: 1rem;
  top: 1rem;
}

.invite-panel {
  --section-accent: #f472b6;
  --section-accent-soft: rgba(244, 114, 182, 0.22);
  background:
    linear-gradient(135deg, #431629, #261b23 66%),
    radial-gradient(circle at top left, var(--section-accent-soft), transparent 44%);
  border: 1px solid #ad4c78;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: var(--app-shadow-soft);
}

.invite-panel h2 {
  font-size: 1rem;
  margin-bottom: 0;
}

.info-band {
  --section-accent: #c4b5fd;
  --section-accent-soft: rgba(196, 181, 253, 0.18);
  background:
    linear-gradient(135deg, #211a2f, #282139 64%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 44%);
  border-color: #7561a6;
  border-left: 4px solid var(--section-accent);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.info-band span {
  display: block;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.copy-row {
  margin-bottom: 1rem;
}

.copy-row input {
  min-width: 240px;
  flex: 1;
}

.trip-detail-overview {
  --section-accent: #f9a8d4;
  --section-accent-soft: rgba(244, 114, 182, 0.18);
  background:
    linear-gradient(135deg, rgba(88, 28, 59, 0.82), rgba(37, 24, 34, 0.98) 60%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 44%);
  border: 1px solid #f9a8d4;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  box-shadow: var(--app-shadow-soft);
  display: grid;
  grid-template-columns: minmax(260px, 38%) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.15rem;
}

.trip-detail-overview-compact {
  align-items: start;
  gap: 0.9rem;
  grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
  padding: 0.9rem;
}

.trip-detail-overview-compact .trip-cover-large {
  aspect-ratio: 16 / 10;
}

.trip-detail-overview-compact .trip-detail-main {
  gap: 0.7rem;
}

.trip-detail-hero-photo {
  min-width: 0;
}

.trip-cover-large-button,
.trip-cover-large {
  width: 100%;
}

.trip-cover-large-button {
  background: transparent;
  border: 0;
  display: block;
  padding: 0;
}

.trip-cover-large {
  aspect-ratio: 4 / 3;
  background: rgba(11, 18, 32, 0.52);
  border: 1px solid rgba(249, 168, 212, 0.34);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  display: block;
  object-fit: cover;
}

.trip-cover-large-empty {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  justify-content: center;
  min-height: 15rem;
  text-align: center;
}

.trip-detail-main {
  display: grid;
  gap: 1rem;
}

.trip-detail-title {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.trip-detail-title h1 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.trip-detail-title p,
.trip-detail-description p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.trip-detail-invite {
  background: rgba(11, 18, 32, 0.35);
  border: 1px solid rgba(249, 168, 212, 0.2);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
}

.trip-detail-copy-line {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
}

.trip-detail-copy-line span,
.trip-detail-grid span,
.trip-detail-description span {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.trip-detail-copy-line strong {
  color: #ffffff;
  overflow-wrap: anywhere;
}

.trip-detail-grid {
  border-top: 1px solid rgba(249, 168, 212, 0.24);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-top: 0.85rem;
}

.trip-detail-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trip-detail-grid > div {
  background: rgba(11, 18, 32, 0.48);
  border: 1px solid rgba(196, 181, 253, 0.22);
  border-radius: 8px;
  min-height: 4.15rem;
  padding: 0.65rem 0.75rem;
}

.trip-detail-grid strong {
  color: #ffffff;
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.trip-detail-description {
  background: rgba(11, 18, 32, 0.35);
  border: 1px solid rgba(249, 168, 212, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
}

.auth-login-form {
  margin: 0.85rem 0 0;
}

.dev-login-link {
  color: var(--app-muted);
  display: inline-block;
  font-size: 0.86rem;
  margin-top: 0.65rem;
}

.gps-accepted-hint {
  color: var(--app-muted);
  font-size: 0.86rem;
  margin: 0.85rem 0 0;
}

.gps-recent-list {
  border-top: 1px solid rgba(196, 181, 253, 0.24);
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.gps-recent-list h3 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.gps-recent-table {
  display: grid;
  gap: 0.18rem;
}

.gps-recent-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  gap: 0.75rem;
  padding: 0.1rem 0;
}

.gps-recent-row span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.gps-recent-row span:first-child {
  color: #f6d18b;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-width: 12.5rem;
  text-align: right;
  white-space: nowrap;
}

.gps-recent-row span:last-child {
  color: rgba(255, 255, 255, 0.92);
  font-family: Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.gps-recent-row-head {
  background: transparent;
  border-color: rgba(246, 209, 139, 0.35);
  color: #f6d18b;
  font-size: 0.82rem;
  font-weight: 800;
}

.trip-detail-actions {
  align-items: center;
  border-top: 1px solid rgba(249, 168, 212, 0.24);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.85rem;
}

.trip-detail-actions form {
  margin: 0;
}

.trip-detail-actions-top {
  border-top: 0;
  padding-top: 0;
}

.trip-detail-member-list {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.trip-detail-member-row {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.75rem;
}

.trip-detail-member-main {
  min-width: 0;
}

@media (max-width: 1100px) {
  .trip-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .trip-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.owner-actions {
  --section-accent: #fb7185;
  --section-accent-soft: rgba(251, 113, 133, 0.22);
  background:
    linear-gradient(135deg, #4a1720, #27191c 66%),
    radial-gradient(circle at top left, var(--section-accent-soft), transparent 44%);
  border: 1px solid #a94a5c;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: 1rem;
  box-shadow: var(--app-shadow-soft);
}

.section-head.manage-overview {
  align-items: stretch;
  display: block;
  gap: 0.85rem;
  margin-bottom: 1rem;
  width: 100%;
}

.manage-overview-title {
  align-items: flex-start;
  border-bottom: 1px solid rgba(244, 114, 182, 0.18);
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 0.85rem;
}

.manage-page-title {
  font-size: clamp(1.85rem, 4.4vw, 3rem);
  line-height: 1.15;
  margin: 0;
  overflow-wrap: normal;
  white-space: nowrap;
}

.manage-flash-message {
  margin: 0.85rem 0 0;
}

.manage-overview-identity {
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.manage-overview-identity strong {
  color: #ffffff;
}

.manage-overview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  padding-top: 0.85rem;
  width: 100%;
}

.manage-overview-stats > div {
  align-items: baseline;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(196, 181, 253, 0.14);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.45rem;
  min-height: 0;
  padding: 0.42rem 0.7rem;
}

.manage-overview-stats span {
  color: var(--app-muted);
  display: inline;
  font-size: 0.78rem;
  margin-bottom: 0;
}

.manage-overview-stats strong {
  color: #ffffff;
  display: inline;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.manage-settings-panel {
  --section-accent: #c4b5fd;
  --section-accent-soft: rgba(196, 181, 253, 0.18);
  background:
    linear-gradient(135deg, #211a2f, #282139 64%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 44%);
  border: 1px solid #7561a6;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  box-shadow: var(--app-shadow-soft);
  margin-bottom: 1rem;
  padding: 1rem;
}

.manage-toggle-row {
  margin-top: 1rem;
}

.manage-settings-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.manage-top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.manage-top-actions .btn {
  white-space: nowrap;
}

.field-help {
  color: var(--app-muted);
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.manage-subsection {
  align-items: center;
  border-top: 1px solid rgba(196, 181, 253, 0.28);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
}

.manage-subsection h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.manage-subsection p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.manage-danger-subsection {
  align-items: flex-start;
  background: rgba(127, 29, 29, 0.12);
  border-color: rgba(251, 113, 133, 0.42);
  border-left: 4px solid #fb7185;
}

.trip-cover-subsection {
  align-items: stretch;
  display: grid;
  grid-template-columns: 1fr;
}

.trip-cover-control {
  align-items: stretch;
  display: grid;
  gap: 1rem;
  grid-column: 1 / -1;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
}

.trip-cover-copy {
  min-width: 0;
}

.trip-cover-preview {
  align-items: center;
  background: rgba(11, 18, 32, 0.38);
  border: 1px dashed rgba(196, 181, 253, 0.36);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 11rem;
  min-width: 0;
  padding: 0.45rem;
}

.trip-cover-preview .photo-thumb-button,
.trip-cover-preview .photo-thumb-cover {
  height: auto;
  width: 100%;
}

.trip-cover-preview .photo-thumb-cover {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.trip-cover-upload {
  align-content: center;
  display: grid;
  gap: 0.65rem;
}

.trip-cover-upload p {
  color: var(--app-muted);
  margin: 0;
}

.trip-cover-empty {
  color: var(--app-muted);
  display: inline-block;
  font-size: 0.9rem;
  padding: 0 0.75rem;
}

.inline-upload-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.manage-toggle-row .form-check-input {
  background-color: #0b1220;
  border-color: #9b87c9;
}

.manage-toggle-row .form-check-input:checked {
  background-color: #db2777;
  border-color: #f9a8d4;
}

.danger-panel {
  --section-accent: #fb7185;
  --section-accent-soft: rgba(251, 113, 133, 0.2);
  align-items: flex-start;
  background:
    linear-gradient(135deg, #4a1720, #24191d 66%),
    radial-gradient(circle at top right, var(--section-accent-soft), transparent 44%);
  border: 1px solid #a94a5c;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: var(--app-shadow-soft);
}

.danger-panel h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.danger-panel p,
.delete-trip-form label {
  color: var(--app-muted);
  margin-bottom: 0;
}

.danger-actions {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.danger-actions form {
  margin: 0;
}

.delete-trip-form {
  display: grid;
  gap: 0.35rem;
}

.delete-trip-form > div {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.delete-trip-form .form-control {
  max-width: 11rem;
  text-transform: uppercase;
}

.manage-member-list {
  display: grid;
  gap: 0.75rem;
}

.manage-member-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%),
    #2f2741;
  border: 1px solid #9b87c9;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 18px rgba(196, 181, 253, 0.16);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(12rem, 1.1fr) minmax(24rem, 3fr) auto;
  padding: 1rem;
}

.manage-member-main strong {
  display: block;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.manage-member-main p {
  color: var(--app-muted);
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.manage-member-meta {
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  margin: 0;
}

.manage-member-meta div {
  display: grid;
  gap: 0.2rem;
}

.manage-member-meta dt {
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.manage-member-meta dd {
  color: var(--app-text);
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0;
}

.manage-member-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.manage-member-actions form {
  margin: 0;
}

.manage-member-actions .btn,
.manage-member-actions .form-select {
  align-items: center;
  display: inline-flex;
  min-height: 2.15rem;
}

.manage-member-actions .btn {
  justify-content: center;
}

.platform-head {
  margin-bottom: 1rem;
}

.platform-section .platform-trip-list {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.platform-settings-form {
  padding: 0 1rem 1rem;
}

.setting-block {
  border-bottom: 1px solid #334155;
  display: grid;
  gap: 0.45rem;
  padding: 1rem 0;
}

.setting-block label {
  font-weight: 700;
}

.setting-block p {
  color: var(--app-muted);
  font-size: 0.86rem;
  margin: 0;
}

.platform-admin-note {
  border-bottom: 1px solid rgba(196, 181, 253, 0.25);
  display: grid;
  gap: 0.35rem;
  margin: 0 1rem;
  padding: 1rem 0;
}

.platform-admin-note p {
  color: var(--app-muted);
  margin: 0;
}

.admin-email-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-email-tags span {
  background: #0b1220;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  color: #fde68a;
  font-size: 0.82rem;
  padding: 0.2rem 0.45rem;
}

.platform-admin-form {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 0.8fr) auto;
  padding: 1rem;
}

.platform-admin-form label {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.platform-admin-list {
  display: grid;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.platform-admin-row {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%),
    #2f2741;
  border: 1px solid #9b87c9;
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(16rem, 1fr) auto auto;
  padding: 0.85rem;
}

.platform-admin-row p {
  color: var(--app-muted);
  margin: 0.1rem 0 0;
}

.platform-admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.platform-trip-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%),
    #2f2741;
  border: 1px solid #9b87c9;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 18px rgba(196, 181, 253, 0.16);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(14rem, 1.2fr) minmax(28rem, 3fr) auto;
  padding: 1rem;
}

.platform-trip-main strong {
  display: block;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.platform-trip-main p {
  color: var(--app-muted);
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}

.platform-trip-main code {
  background: #0b1220;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  color: #ede9fe;
  padding: 0.08rem 0.35rem;
}

.platform-trip-meta {
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  margin: 0;
}

.platform-trip-meta div {
  display: grid;
  gap: 0.2rem;
}

.platform-trip-meta dt {
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.platform-trip-meta dd {
  color: var(--app-text);
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0;
}

.platform-trip-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.member-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 15rem;
}

.member-actions form {
  margin: 0;
  order: 1;
}

.member-actions .status-badge {
  margin-left: 0.35rem;
  order: 3;
}

.status-badge {
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge-approved {
  background: #14532d;
  color: #bbf7d0;
}

.status-badge-manual {
  background: #581c87;
  color: #f3e8ff;
}

.status-badge-pending {
  background: #4a3412;
  color: #fde68a;
}

.status-badge-exited {
  background: #293241;
  color: #cbd5e1;
}

.status-badge-neutral {
  background: #1f2937;
  color: #cbd5e1;
}

.form-panel,
.auth-panel {
  max-width: 760px;
  margin: 0 auto;
}

.form-panel {
  --section-accent: #fbbf24;
  background:
    linear-gradient(135deg, #3a2a12, #1d1b1a 66%),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.2), transparent 42%);
  border-color: #9a7422;
  border-left: 4px solid var(--section-accent);
}

.auth-panel {
  --section-accent: #34d399;
  background:
    linear-gradient(135deg, #123629, #1d1b1a 66%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.18), transparent 42%);
  border-color: #2f8064;
  max-width: 420px;
}

.panel-head {
  border-bottom: 1px solid #334155;
  margin-bottom: 0.25rem;
  padding-bottom: 1rem;
}

.panel-head h1 {
  margin-bottom: 0.35rem;
}

.panel-head p {
  color: var(--app-muted);
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.action-row {
  margin-top: 1.25rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #334155;
  padding: 1rem 0;
}

.setting-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.setting-copy strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.setting-copy span {
  color: var(--app-muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}

.setting-row p {
  color: var(--app-muted);
  font-size: 0.86rem;
  margin-bottom: 0;
}

.setting-row .form-check {
  margin-bottom: 0;
}

.dev-login {
  border-top: 1px solid #334155;
  margin-top: 1rem;
  padding-top: 1rem;
}

.map-layout {
  display: grid;
  gap: 0.7rem;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #272320;
  border: 1px solid #685540;
  border-radius: 8px;
  padding: 1rem;
}

.map-toolbar-compact {
  align-items: stretch;
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
}

.map-toolbar-compact .toolbar-actions {
  gap: 0.45rem;
}

.map-toolbar-compact .toolbar-actions .btn {
  padding: 0.45rem 0.7rem;
}

.map-trip-title {
  color: #ffffff;
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.map-toolbar-compact .map-share-note {
  margin: 0;
  max-width: none;
  padding: 0.45rem 0.65rem;
}

.map-status-summary-compact {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.95rem;
  margin-top: 0;
}

.map-canvas-wrap {
  position: relative;
}

.map-fullscreen-status {
  display: none;
}

.map-floating-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  pointer-events: none;
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 2;
}

.map-floating-actions .btn {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.map-show-all-button,
.map-layer-button {
  background: rgba(11, 18, 32, 0.9);
  border-color: #f59e0b;
  color: #fde68a;
  font-weight: 800;
}

.map-show-all-button:hover,
.map-show-all-button:focus,
.map-layer-button:hover,
.map-layer-button:focus {
  background: #1f2937;
  border-color: #fff7cc;
  color: #fff7cc;
}

.map-recenter-button {
  background: #f59e0b;
  border-color: #fde68a;
  border-width: 2px;
  color: #1f1300;
  font-weight: 800;
}

.map-recenter-button:hover,
.map-recenter-button:focus {
  background: #fbbf24;
  border-color: #fff7cc;
  color: #1f1300;
}

.map-fullscreen-button {
  background: rgba(11, 18, 32, 0.9);
  border-color: #fde68a;
  color: #fde68a;
  font-weight: 800;
}

.map-fullscreen-button:hover,
.map-fullscreen-button:focus {
  background: #1f2937;
  border-color: #fff7cc;
  color: #fff7cc;
}

.map-layer-control {
  pointer-events: auto;
  position: relative;
}

.map-layer-menu {
  background: rgba(11, 18, 32, 0.96);
  border: 1px solid rgba(253, 230, 138, 0.55);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.44);
  display: grid;
  gap: 0.25rem;
  min-width: 7rem;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 10003;
}

.map-layer-menu[hidden] {
  display: none;
}

.map-layer-menu button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #f8fafc;
  font-weight: 800;
  padding: 0.45rem 0.65rem;
  text-align: left;
}

.map-layer-menu button:hover,
.map-layer-menu button:focus,
.map-layer-menu button.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(253, 230, 138, 0.65);
  color: #fde68a;
}

.map-canvas {
  width: 100%;
  min-height: 62vh;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #685540;
  background: #22201e;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.map-canvas img,
.map-canvas .gm-style {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.replay-layout {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem auto 1.5rem;
  max-width: 92rem;
  padding: 0 1rem;
}

.replay-head {
  align-items: center;
  background: #221f1b;
  border: 1px solid #8a6f3d;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
}

.replay-head-compact {
  justify-content: flex-start;
}

.replay-head-compact strong {
  font-size: 1.05rem;
}

.replay-head-compact span {
  color: var(--app-muted);
  font-weight: 700;
}

.replay-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.replay-filter-row {
  align-items: end;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: minmax(13rem, 18rem) minmax(10rem, 14rem) minmax(7rem, 9rem) minmax(0, 1fr);
}

.replay-filter-row label {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  min-width: 0;
}

.replay-filter-row label span {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.replay-filter-row .form-control,
.replay-filter-row .form-select {
  min-height: 2.35rem;
}

.replay-filter-hint {
  align-self: center;
  color: #fde68a;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.replay-reset-button {
  font-weight: 800;
  white-space: nowrap;
}

.replay-time-chip {
  align-items: center;
  background: rgba(11, 18, 32, 0.5);
  border: 1px solid rgba(196, 181, 253, 0.18);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.45rem;
  margin-left: auto;
  min-width: 0;
  padding: 0.45rem 0.75rem;
}

.replay-time-chip span {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.replay-time-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-set-start-button {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
  width: auto;
}

.replay-set-start-short {
  display: none;
}

.replay-progress-row {
  display: block;
}

.replay-progress {
  accent-color: #db2777;
  width: 100%;
}

.replay-map-wrap {
  border: 1px solid #8a6f3d;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.replay-map-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  padding: 0.45rem;
  pointer-events: none;
  position: absolute;
  right: 0.3rem;
  top: 0.3rem;
  z-index: 20;
}

.replay-map-actions .btn {
  background: rgba(11, 18, 32, 0.9);
  border-color: #fde68a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  color: #fde68a;
  font-weight: 800;
  min-height: 2.25rem;
  pointer-events: auto;
}

.replay-map-actions .btn:hover,
.replay-map-actions .btn:focus {
  background: #1f2937;
  border-color: #fff7cc;
  color: #fff7cc;
}

#replayMyPositionButton {
  background: #f59e0b;
  border-color: #fde68a;
  border-width: 2px;
  color: #1f1300;
}

#replayMyPositionButton:hover,
#replayMyPositionButton:focus,
#replayMyPositionButton.active {
  background: #fbbf24;
  border-color: #fff7cc;
  color: #1f1300;
}

.replay-layer-control {
  pointer-events: auto;
  position: relative;
}

.replay-layer-menu {
  background: rgba(11, 18, 32, 0.96);
  border: 1px solid rgba(253, 230, 138, 0.55);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.44);
  display: grid;
  gap: 0.25rem;
  min-width: 7rem;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 10003;
}

.replay-layer-menu[hidden] {
  display: none;
}

.replay-layer-menu button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #f8fafc;
  font-weight: 800;
  padding: 0.45rem 0.65rem;
  text-align: left;
}

.replay-layer-menu button:hover,
.replay-layer-menu button:focus,
.replay-layer-menu button.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(253, 230, 138, 0.65);
  color: #fde68a;
}

.replay-map {
  background: #22201e;
  height: min(72vh, 44rem);
  min-height: 34rem;
  width: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.replay-map img,
.replay-map .gm-style {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.replay-map-wrap:fullscreen {
  background: #0b0b0b;
  height: 100vh;
  width: 100vw;
}

.replay-map-wrap:fullscreen .replay-map {
  height: 100vh;
  min-height: 100vh;
}

.map-canvas-wrap:fullscreen {
  background: #0b0b0b;
  display: flex;
  height: 100vh;
  width: 100vw;
}

.map-canvas-wrap:fullscreen .map-canvas,
.map-canvas-wrap.map-fallback-fullscreen .map-canvas {
  border: 0;
  border-radius: 0;
  flex: 1;
  min-height: 100vh;
}

.map-canvas-wrap:fullscreen .map-floating-actions,
.map-canvas-wrap.map-fallback-fullscreen .map-floating-actions {
  right: max(0.75rem, env(safe-area-inset-right));
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 10002;
}

.map-canvas-wrap:fullscreen .map-fullscreen-status,
.map-canvas-wrap.map-fallback-fullscreen .map-fullscreen-status {
  background: rgba(11, 18, 32, 0.86);
  border: 1px solid rgba(253, 230, 138, 0.38);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 0.12rem;
  left: max(0.75rem, env(safe-area-inset-left));
  max-width: min(28rem, calc(100vw - 12rem));
  padding: 0.52rem 0.7rem;
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 10001;
}

.map-fullscreen-status p {
  align-items: center;
  color: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.12rem 0.5rem;
  line-height: 1.3;
  margin: 0;
}

.map-fullscreen-status span {
  color: #fde68a;
  font-weight: 800;
}

.map-fullscreen-status strong {
  color: #ffffff;
  font-weight: 800;
}

.map-canvas-wrap.map-fallback-fullscreen {
  background: #0b0b0b;
  bottom: 0;
  display: flex;
  height: 100dvh;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  width: 100vw;
  z-index: 10000;
}

body.map-fullscreen-active {
  overflow: hidden;
}

.map-placeholder {
  min-height: 58vh;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  text-align: center;
  color: var(--app-soft);
  font-size: 0.9rem;
  padding: 1rem;
}

.landmark-panel {
  --section-accent: #f59e0b;
  --section-accent-soft: rgba(245, 158, 11, 0.18);
  --section-card-bg: #231f1c;
  --section-card-border: #8a6d3d;
  background: var(--section-card-bg);
  border: 1px solid var(--section-card-border);
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 18px var(--section-accent-soft);
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
}

.landmark-panel-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.landmark-panel h2 {
  font-size: 1rem;
  margin: 0;
}

.landmark-panel p {
  color: var(--app-muted);
  margin: 0;
}

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

.landmark-row {
  align-items: center;
  background: rgba(11, 18, 32, 0.58);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(8rem, 1fr) minmax(9rem, auto) max-content;
  padding: 0.5rem 0.65rem;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.landmark-row:hover,
.landmark-row:focus-visible {
  background: rgba(30, 41, 59, 0.76);
  border-color: rgba(245, 158, 11, 0.58);
  outline: none;
}

.landmark-row-main,
.landmark-row-time {
  min-width: 0;
}

.landmark-row-main strong,
.landmark-row-time span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landmark-row-time {
  color: var(--app-muted);
  font-size: 0.85rem;
}

.landmark-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.member-status-message {
  color: #fde68a;
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 0.15rem;
  white-space: normal;
}

.member-photo-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.member-photo-manager-list {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  margin-bottom: 0.85rem;
}

.member-photo-manager-item {
  align-items: stretch;
  background: rgba(11, 18, 32, 0.5);
  border: 1px solid rgba(196, 181, 253, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
}

.member-photo-manager-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.member-photo-manager-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-status-edit {
  display: grid;
  gap: 0.4rem;
  grid-column: 1 / -1;
}

.member-status-edit[hidden] {
  display: none;
}

.member-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.app-modal[hidden] {
  display: none;
}

.app-modal {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 1rem;
  position: fixed;
  z-index: 1000;
}

.app-modal-backdrop {
  background: rgba(0, 0, 0, 0.68);
  inset: 0;
  position: absolute;
}

.app-modal-panel {
  background: #241c31;
  border: 1px solid #c084fc;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  max-height: min(88vh, 48rem);
  max-width: 42rem;
  overflow: auto;
  padding: 1rem;
  position: relative;
  width: min(100%, 42rem);
  z-index: 1;
}

.app-modal-panel.is-draggable {
  cursor: default;
}

.app-modal-head,
.app-modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
}

.app-modal-head {
  border-bottom: 1px solid rgba(196, 181, 253, 0.22);
  cursor: move;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  user-select: none;
}

.app-modal-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.app-modal-message {
  background: rgba(11, 18, 32, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 6px;
  color: #fde68a;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
  padding: 0.65rem 0.75rem;
  white-space: pre-wrap;
}

.app-modal-message.is-error {
  border-color: rgba(248, 113, 113, 0.68);
  color: #fecaca;
}

.app-modal-message.is-success {
  border-color: rgba(52, 211, 153, 0.68);
  color: #bbf7d0;
}

.app-modal-actions {
  border-top: 1px solid rgba(196, 181, 253, 0.22);
  justify-content: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
}

.form-grid-tight {
  margin-top: 0.6rem;
}

.landmark-delete-list {
  display: grid;
  gap: 0.45rem;
}

.landmark-delete-item,
.landmark-delete-all {
  align-items: center;
  background: rgba(11, 18, 32, 0.52);
  border: 1px solid rgba(196, 181, 253, 0.18);
  border-radius: 8px;
  display: flex;
  gap: 0.55rem;
  padding: 0.55rem;
}

.landmark-manage-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.landmark-delete-check {
  align-items: center;
  display: inline-flex;
  margin: 0;
}

.landmark-manage-main {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.landmark-manage-main span {
  color: var(--app-muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

.landmark-manage-item .btn {
  white-space: nowrap;
}

.member-list {
  --section-accent: #c4b5fd;
  --section-accent-soft: rgba(196, 181, 253, 0.16);
  --section-card-bg: #2f2741;
  --section-card-border: #9b87c9;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.member-list .member-row {
  align-items: start;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  justify-content: initial;
  min-height: 4rem;
  padding: 0.55rem;
}

.member-photo-stack {
  align-content: start;
  display: grid;
  gap: 0.25rem;
  grid-template-columns: 1fr;
  width: 4.5rem;
}

.member-photo-stack-single,
.member-photo-stack-empty {
  grid-template-columns: 1fr;
}

.member-photo-square {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(11, 18, 32, 0.68);
  border: 1px solid rgba(196, 181, 253, 0.34);
  border-radius: 8px;
  display: flex;
  height: 4.5rem;
  justify-content: center;
  overflow: hidden;
  width: 4.5rem;
}

.member-photo-stack-single .member-photo-square,
.member-photo-stack-empty .member-photo-square {
  height: 4.5rem;
  width: 4.5rem;
}

.member-photo-square img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-avatar-empty span {
  color: #f4efe8;
  font-weight: 900;
}

.member-avatar {
  align-items: center;
  background: rgba(11, 18, 32, 0.68);
  border: 1px solid rgba(196, 181, 253, 0.28);
  border-radius: 999px;
  display: flex;
  height: 3rem;
  justify-content: center;
  overflow: hidden;
  width: 3rem;
}

.member-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-avatar span {
  color: #f4efe8;
  font-weight: 900;
}

.member-row-main {
  min-width: 0;
}

.member-name-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-map-color-dot {
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(11, 18, 32, 0.56);
  flex: 0 0 auto;
  height: 0.8rem;
  width: 0.8rem;
}

.member-color-preview {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  display: inline-block;
  height: 0.85rem;
  margin-right: 0.35rem;
  vertical-align: -0.08rem;
  width: 0.85rem;
}

.member-color-form {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.member-color-form .form-select {
  min-width: 5.5rem;
  width: auto;
}

.member-name-line .btn {
  flex: 0 0 auto;
}

.member-name-edit {
  display: grid;
  gap: 0.45rem;
  margin: 0.35rem 0;
}

.member-name-edit[hidden] {
  display: none;
}

.member-row-main strong,
.member-row-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-detail-member-list {
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
}

.member-list .trip-detail-member-row {
  align-items: start;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 10rem minmax(0, 1fr) max-content;
  justify-content: stretch;
  min-height: 0;
  padding: 1rem;
}

.trip-detail-member-photo {
  align-items: flex-start;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.trip-detail-member-avatar {
  height: 9rem;
  width: 9rem;
}

.trip-detail-member-avatar-empty {
  align-items: center;
  background: rgba(11, 18, 32, 0.68);
  border: 1px solid rgba(196, 181, 253, 0.28);
  border-radius: 8px;
  color: #f4efe8;
  display: flex;
  font-size: 1.5rem;
  font-weight: 900;
  justify-content: center;
}

.trip-detail-member-main {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.trip-detail-member-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trip-detail-member-main strong {
  color: #ffffff;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.trip-detail-member-main p {
  color: var(--app-muted);
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.trip-detail-member-meta {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));
  margin: 0;
}

.trip-detail-member-meta div {
  background: rgba(11, 18, 32, 0.38);
  border: 1px solid rgba(196, 181, 253, 0.16);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.trip-detail-member-meta dt {
  color: var(--app-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.trip-detail-member-meta dd {
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.15rem 0 0;
}

.trip-detail-member-main .photo-strip {
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.trip-detail-member-main .photo-strip .photo-thumb {
  height: 3.4rem;
  width: 3.4rem;
}

.trip-detail-member-main .member-inline-actions,
.trip-detail-member-main .member-photo-form {
  margin-top: 0.25rem;
}

.trip-detail-member-main .member-inline-actions .btn,
.trip-detail-member-main .member-photo-form .btn,
.trip-detail-member-row .member-actions .btn {
  white-space: nowrap;
}

.trip-detail-member-row .member-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  justify-content: flex-start;
  min-width: 0;
}

.trip-detail-member-row .member-actions form {
  margin: 0;
}

.trip-detail-member-row .member-actions .status-badge {
  margin-left: 0;
  order: initial;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: #064e3b;
  color: #a7f3d0;
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-pill.offline {
  background: #7f1d1d;
  color: #fecaca;
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .map-layout,
  .map-toolbar-compact,
  .map-canvas-wrap,
  .map-canvas,
  .landmark-panel,
  .member-list,
  .gps-status-card,
  .gps-recent-list {
    max-width: 100%;
    min-width: 0;
  }

  .nav-shell,
  .nav-primary {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .nav-shell {
    gap: 0.65rem;
  }

  .nav-actions {
    display: flex;
    gap: 0.5rem;
    width: auto;
  }

  .nav-actions .btn {
    min-height: 2.35rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    white-space: nowrap;
  }

  .hero-band,
  .auth-intro,
  .section-head,
  .trip-detail-overview,
  .trip-detail-title,
  .trip-detail-actions,
  .photo-upload-panel,
  .photo-upload-panel form,
  .inline-upload-form,
  .member-photo-form,
  .manage-subsection,
  .map-toolbar,
  .trip-card,
  .member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    font-size: 1.25rem;
  }

  .user-name {
    font-size: 1.22rem;
    line-height: 1.4;
  }

  .toolbar-actions,
  .toolbar-actions .btn,
  .action-row .btn,
  .trip-detail-actions .btn,
  .trip-detail-actions form,
  .trip-header-actions,
  .trip-header-actions .btn,
  .trip-header-actions form,
  .trip-copy-actions,
  .trip-copy-actions .btn,
  .invite-form,
  .invite-form .form-control,
  .photo-upload-panel .form-control,
  .photo-upload-panel .btn,
  .inline-upload-form,
  .inline-upload-form .form-control,
  .inline-upload-form .btn,
  .member-photo-form .form-control,
  .member-photo-form .btn,
  .owner-actions .btn,
  .owner-actions form {
    width: 100%;
  }

  .map-toolbar-compact .toolbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .map-toolbar-compact .toolbar-actions .btn {
    flex: 1 1 auto;
    font-size: 0.86rem;
    min-height: 2.35rem;
    min-width: 0;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    white-space: normal;
    width: auto;
  }

  .map-toolbar-compact .toolbar-actions .map-action-half {
    flex-basis: calc(50% - 0.4rem);
  }

  .replay-layout {
    padding: 0 0.75rem;
  }

  .replay-head {
    align-items: flex-start;
    gap: 0.25rem;
  }

  .replay-toolbar {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .replay-filter-row {
    gap: 0.4rem;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .replay-filter-row label span {
    font-size: 0.78rem;
  }

  .replay-filter-row .form-control,
  .replay-filter-row .form-select {
    font-size: 0.84rem;
    min-height: 2.25rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .replay-filter-hint {
    font-size: 0.8rem;
    grid-column: 1 / -1;
  }

  .replay-reset-button {
    font-size: 0.86rem;
  }

  .replay-toolbar .btn {
    min-width: 0;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    width: 100%;
  }

  .replay-time-chip {
    display: grid;
    gap: 0.35rem;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-content: stretch;
    margin-left: 0;
    width: 100%;
  }

  .replay-set-start-button {
    font-size: 0.78rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    width: auto;
  }

  .replay-set-start-full {
    display: none;
  }

  .replay-set-start-short {
    display: inline;
  }

  .replay-progress-row {
    gap: 0.35rem;
    grid-template-columns: 1fr;
  }

  .replay-map {
    height: 68vh;
    min-height: 26rem;
  }

  .replay-map-actions {
    gap: 0.35rem;
    justify-content: flex-end;
    padding: 0.35rem;
  }

  .replay-map-actions .btn {
    font-size: 0.82rem;
    min-height: 2.1rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .map-toolbar-compact .toolbar-actions .map-action-wide {
    flex-basis: 100%;
  }

  .map-status-summary-compact {
    align-items: stretch;
    display: grid;
    gap: 0.16rem;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .map-location-counters {
    align-items: flex-start;
    display: grid;
    gap: 0.08rem 0.4rem;
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .map-location-counters span,
  .map-location-counters strong {
    min-width: 0;
  }

  .gps-status-title-row,
  .manage-settings-head,
  .manage-overview-title,
  .manage-top-actions,
  .trip-copy-actions,
  .trip-detail-actions {
    align-items: stretch;
  }

  .manage-overview-title {
    grid-template-columns: 1fr;
  }

  .manage-page-title {
    font-size: clamp(1.55rem, 7vw, 2.15rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gps-status-title-row,
  .manage-settings-head,
  .manage-top-actions,
  .trip-copy-actions,
  .trip-detail-actions {
    flex-direction: column;
  }

  .manage-top-actions,
  .manage-top-actions .btn {
    width: 100%;
  }

  .trip-detail-copy-line,
  .trip-detail-overview,
  .trip-detail-grid,
  .trip-card-media,
  .trip-cover-control {
    grid-template-columns: 1fr;
  }

  .trip-card-media {
    gap: 0.9rem;
  }

  .landmark-row {
    align-items: center;
    gap: 0.35rem;
    grid-template-columns: minmax(4.25rem, 1fr) max-content max-content;
    padding: 0.42rem 0.5rem;
  }

  .gps-recent-row {
    gap: 0.6rem;
    min-width: 0;
  }

  .gps-recent-row span:first-child {
    flex: 0 1 9rem;
    min-width: 0;
    text-align: right;
  }

  .gps-recent-row span:last-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .landmark-row-actions,
  .app-modal-actions,
  .app-modal-actions .btn {
    width: 100%;
  }

  .landmark-row-actions,
  .app-modal-actions {
    justify-content: stretch;
  }

  .landmark-row-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
  }

  .landmark-row-actions .btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    white-space: nowrap;
  }

  .landmark-manage-item {
    align-items: stretch;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .landmark-manage-item .btn {
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
  }

  .landmark-row-time {
    font-size: 0.78rem;
  }

  .trip-card-cover {
    min-height: 9.5rem;
  }

  .member-list .trip-detail-member-row {
    gap: 0.8rem;
    grid-template-columns: 6.25rem minmax(0, 1fr);
    padding: 0.85rem;
  }

  .member-list .member-row {
    align-items: start;
    display: grid;
    grid-template-columns: 1fr;
  }

  .member-list .trip-detail-member-row {
    grid-template-columns: 6.25rem minmax(0, 1fr);
  }

  .member-photo-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .member-photo-square {
    height: auto;
    min-height: 4.75rem;
    width: 100%;
  }

  .member-photo-stack-single .member-photo-square,
  .member-photo-stack-empty .member-photo-square {
    height: 5rem;
    width: 5rem;
  }

  .trip-detail-member-avatar {
    height: 5.75rem;
    width: 5.75rem;
  }

  .trip-detail-member-main .photo-strip {
    gap: 0.35rem;
  }

  .trip-detail-member-main .photo-strip .photo-thumb {
    height: 2.65rem;
    width: 2.65rem;
  }

  .trip-detail-member-row .member-actions {
    grid-column: 1 / -1;
    align-items: flex-start;
    border-top: 1px solid rgba(196, 181, 253, 0.22);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 0.75rem;
  }

  .trip-detail-member-row .member-actions .btn {
    width: auto;
  }

  .trip-detail-overview {
    display: grid;
  }

  .trip-detail-hero-photo {
    order: 1;
  }

  .trip-detail-main {
    order: 2;
    min-width: 0;
  }

  .trip-detail-main,
  .trip-detail-copy-line,
  .trip-detail-copy-line input {
    width: 100%;
  }

  .trip-cover-large-empty {
    min-height: 11rem;
  }

  .map-status-summary p {
    font-size: 0.86rem;
  }

  .map-canvas-wrap:fullscreen .map-fullscreen-status,
  .map-canvas-wrap.map-fallback-fullscreen .map-fullscreen-status {
    border-radius: 0 0 8px 8px;
    left: 0;
    max-width: none;
    padding: calc(0.45rem + env(safe-area-inset-top)) 0.65rem 0.48rem;
    right: 0;
    top: 0;
    width: 100%;
  }

  .map-canvas-wrap:fullscreen .map-floating-actions,
  .map-canvas-wrap.map-fallback-fullscreen .map-floating-actions {
    top: calc(4.9rem + env(safe-area-inset-top));
  }

  .map-fullscreen-status p {
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .gps-test-actions,
  .gps-test-actions .btn {
    width: 100%;
  }

  .gps-test-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-thumb-cover {
    height: auto;
    max-width: 100%;
    width: 12rem;
  }

  .photo-lightbox {
    padding: 1rem;
  }

  .invite-form .btn {
    flex: 0 0 7.5rem;
    width: 7.5rem;
    min-width: 7.5rem;
  }

  .invite-form .form-control {
    flex: 1 1 0;
    min-width: 0;
  }

  .control-section .quick-action-row {
    align-items: flex-end;
    flex-direction: column;
  }

  .control-section .quick-action-row > div:first-child {
    width: 100%;
  }

  .control-section .quick-action-row > .btn-primary {
    align-self: flex-end;
    width: 7.5rem;
  }

  .setting-row {
    align-items: flex-start;
  }

  .danger-actions,
  .danger-actions form,
  .delete-trip-form,
  .delete-trip-form > div,
  .delete-trip-form .form-control,
  .danger-actions .btn,
  .manage-bottom-actions,
  .manage-bottom-actions .btn,
  .manage-inline-message,
  .member-inline-actions,
  .member-inline-actions .btn,
  .manage-member-actions,
  .manage-member-actions form,
  .manage-member-actions .btn,
  .platform-admin-form,
  .platform-admin-form .btn,
  .platform-admin-row form,
  .platform-admin-row .btn {
    width: 100%;
  }

  .delete-trip-form > div {
    align-items: stretch;
    flex-direction: column;
  }

  .manage-member-row {
    grid-template-columns: 1fr;
  }

  .platform-trip-row {
    grid-template-columns: 1fr;
  }

  .platform-admin-form,
  .platform-admin-row {
    grid-template-columns: 1fr;
  }

  .platform-admin-status {
    justify-content: flex-start;
  }

  .platform-trip-actions,
  .platform-trip-actions .btn {
    width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .map-canvas-wrap:fullscreen .map-fullscreen-status,
  .map-canvas-wrap.map-fallback-fullscreen .map-fullscreen-status {
    border-radius: 8px;
    left: max(0.65rem, env(safe-area-inset-left));
    max-width: min(24rem, calc(100vw - 11rem));
    padding: 0.42rem 0.6rem;
    right: auto;
    top: max(0.65rem, env(safe-area-inset-top));
    width: auto;
  }

  .map-canvas-wrap:fullscreen .map-floating-actions,
  .map-canvas-wrap.map-fallback-fullscreen .map-floating-actions {
    top: max(0.65rem, env(safe-area-inset-top));
  }

  .map-fullscreen-status p {
    font-size: 0.72rem;
  }
}

.gps-edit-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.gps-edit-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 1rem;
}

.gps-edit-warning {
  background: rgba(220, 38, 38, 0.16);
  border-left: 4px solid #fb7185;
  color: #ffe4e6;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
}

.gps-edit-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.gps-edit-select-all {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  margin: 0;
}

.gps-edit-table-wrap {
  overflow-x: auto;
}

.gps-edit-table {
  border-collapse: separate;
  border-spacing: 0 0.45rem;
  min-width: 980px;
  width: 100%;
}

.gps-edit-table th {
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.55rem;
}

.gps-edit-table td {
  background: rgba(15, 23, 42, 0.64);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  padding: 0.5rem 0.55rem;
  vertical-align: middle;
}

.gps-edit-table td:first-child {
  border-left: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px 0 0 8px;
  text-align: center;
}

.gps-edit-table td:last-child {
  border-radius: 0 8px 8px 0;
  border-right: 1px solid rgba(148, 163, 184, 0.24);
}

.gps-edit-table .form-control {
  min-width: 8.5rem;
}

.gps-edit-time {
  min-width: 12rem;
}

.gps-edit-empty {
  color: var(--muted-text);
  text-align: center;
}

@media (max-width: 720px) {
  .gps-edit-head {
    align-items: stretch;
    flex-direction: column;
  }

  .gps-edit-head .btn {
    width: 100%;
  }
}
