:root {
  --ink: #142b28;
  --ink-soft: #4a5d59;
  --paper: #f5f1e8;
  --paper-deep: #e9e2d3;
  --card: #fffdf8;
  --line: #d8d0c0;
  --forest: #174b43;
  --moss: #8da469;
  --coral: #e36f52;
  --sun: #efb24f;
  --white: #fff;
  --shadow: 0 18px 50px rgba(20, 43, 40, .11);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .2; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); z-index: 20; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.02; letter-spacing: -.045em; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.2rem, 8vw, 7.2rem); font-weight: 400; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 400; }
h3 { font-size: 1.25rem; }
.eyebrow { color: var(--coral); font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--ink-soft); }

.site-header { align-items: center; display: flex; justify-content: space-between; min-height: 86px; padding: 0 clamp(20px, 5vw, 72px); position: relative; z-index: 10; }
.brand { align-items: center; display: inline-flex; font-size: 1.05rem; font-weight: 850; gap: 10px; letter-spacing: -.04em; text-decoration: none; }
.brand small { color: var(--ink-soft); font-weight: 500; }
.brand-mark { align-items: center; background: var(--ink); border-radius: 50%; color: var(--paper); display: flex; height: 35px; justify-content: center; transform: rotate(-10deg); width: 35px; }
.site-header nav { align-items: center; display: flex; gap: 22px; }
.site-header nav > a, .text-button { background: none; border: 0; color: var(--ink); cursor: pointer; font-size: .83rem; font-weight: 750; text-decoration: none; }
.inline-form { display: inline; margin: 0; }
.site-footer { border-top: 1px solid var(--line); color: var(--ink-soft); display: flex; font-size: .75rem; justify-content: space-between; margin: 80px clamp(20px, 5vw, 72px) 0; padding: 25px 0 36px; }

.button { align-items: center; background: var(--ink); border: 1px solid var(--ink); border-radius: 999px; color: white; cursor: pointer; display: inline-flex; font-size: .82rem; font-weight: 800; gap: 22px; justify-content: center; min-height: 48px; padding: 0 22px; text-decoration: none; transition: transform .18s ease, background .18s ease; }
.button:hover { background: var(--forest); transform: translateY(-2px); }
.button span { font-size: 1.1rem; }
.button-wide { width: 100%; }
.button-quiet { background: transparent; color: var(--ink); }
.back-link { display: inline-block; font-size: .78rem; font-weight: 750; margin-bottom: 32px; text-decoration: none; }

.flash-stack { left: 50%; max-width: min(90vw, 720px); position: fixed; top: 76px; transform: translateX(-50%); width: 100%; z-index: 50; }
.flash { background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); color: white; margin: 8px; padding: 13px 18px; }
.flash-error { background: #873f32; }
.flash-success { background: var(--forest); }

.home-hero { align-items: center; display: grid; gap: 30px; grid-template-columns: minmax(0, 1fr) minmax(180px, .35fr); min-height: 68vh; padding: 7vh clamp(20px, 8vw, 120px) 12vh; }
.home-hero h1 { margin-bottom: 26px; max-width: 980px; }
.home-hero h1 em { color: var(--coral); font-weight: inherit; }
.lede { color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.35rem); max-width: 580px; }
.hero-compass { align-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; display: flex; justify-content: center; margin-left: auto; max-width: 260px; position: relative; width: 100%; }
.hero-compass::before, .hero-compass::after { background: var(--line); content: ""; position: absolute; }
.hero-compass::before { height: 1px; left: -12%; right: -12%; }
.hero-compass::after { bottom: -12%; top: -12%; width: 1px; }
.hero-compass span { font-size: .65rem; font-weight: 800; position: absolute; top: 10px; }
.hero-compass i { border: 1px dashed var(--moss); border-radius: 50%; inset: 18%; position: absolute; }
.hero-compass b { color: var(--coral); font-size: clamp(3rem, 7vw, 6rem); font-weight: 400; transform: rotate(-4deg); }

.trip-grid-section, .stages-section, .photos-section { padding: 60px clamp(20px, 8vw, 120px); }
.section-heading { align-items: end; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 28px; padding-bottom: 18px; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0; }
.section-heading > span { color: var(--ink-soft); font-size: .78rem; }
.trip-grid { display: grid; gap: 26px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-card { background: var(--card); border: 1px solid rgba(20,43,40,.1); border-radius: var(--radius); display: grid; grid-template-columns: .9fr 1.1fr; min-height: 340px; overflow: hidden; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.trip-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.trip-card-map { background-color: #cad8c6; background-image: linear-gradient(32deg, transparent 49.5%, rgba(255,255,255,.4) 50%, transparent 50.5%), linear-gradient(-25deg, transparent 49.5%, rgba(20,43,40,.12) 50%, transparent 50.5%); background-size: 70px 70px, 110px 110px; overflow: hidden; position: relative; }
.trip-card-map::after { border: 4px solid var(--coral); border-left-color: transparent; border-radius: 45% 50% 46% 54%; content: ""; inset: 18% 12% 20% 18%; position: absolute; transform: rotate(-17deg); }
.trip-card-map b { color: rgba(20,43,40,.5); font-family: Georgia, serif; font-size: 2rem; left: 16px; position: absolute; top: 10px; }
.trip-card-copy { display: flex; flex-direction: column; padding: 36px; }
.trip-card-copy h3 { font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.trip-card-copy > p:not(.eyebrow) { color: var(--ink-soft); font-size: .9rem; }
.card-link { border-top: 1px solid var(--line); display: flex; font-size: .75rem; font-weight: 800; justify-content: space-between; margin-top: auto; padding-top: 18px; }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius); padding: 70px 20px; text-align: center; }
.empty-icon { color: var(--coral); display: block; font-size: 4rem; }

.unlock-shell { display: grid; grid-template-columns: 1fr 1fr; margin: 6vh auto; max-width: 1080px; min-height: 580px; padding: 0 20px; }
.lock-illustration { align-items: center; background: var(--forest); border-radius: var(--radius) 0 0 var(--radius); color: var(--paper); display: flex; justify-content: center; overflow: hidden; position: relative; }
.lock-illustration::after { border: 1px solid rgba(255,255,255,.22); border-radius: 50%; content: ""; height: 390px; position: absolute; width: 390px; }
.lock-illustration span { font-size: 8rem; z-index: 1; }
.unlock-card { align-items: stretch; background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 7vw, 82px); }
.unlock-card h1, .login-page h1 { font-size: clamp(2.8rem, 5vw, 4.6rem); margin-bottom: 16px; }
.unlock-card > p:not(.eyebrow) { color: var(--ink-soft); }

.trip-hero { padding: 9vh clamp(20px, 8vw, 120px) 7vh; }
.trip-hero-copy { max-width: 900px; }
.trip-hero-copy h1 { margin-bottom: 24px; }
.trip-hero-copy > p:not(.eyebrow) { color: var(--ink-soft); font-family: Georgia, serif; font-size: clamp(1.2rem, 2.3vw, 1.7rem); max-width: 760px; }
.trip-dates { font-size: .8rem; font-weight: 800; letter-spacing: .08em; margin-top: 36px; text-transform: uppercase; }
.trip-dates span { color: var(--coral); margin: 0 10px; }
.stats-ribbon { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 36px; }
.stats-ribbon div { border-right: 1px solid var(--line); padding: 18px 20px; }
.stats-ribbon div:first-child { padding-left: 0; }
.stats-ribbon div:last-child { border: 0; }
.stats-ribbon strong { display: block; font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 400; line-height: 1; }
.stats-ribbon span { color: var(--ink-soft); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }

.map-stage { height: min(75vh, 760px); margin: 0 clamp(20px, 4vw, 64px); overflow: hidden; position: relative; }
#trip-map { height: 100%; width: 100%; }
.trip-route-overlay { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 1; }
#trip-map .maplibregl-marker { z-index: 2; }
.map-message { align-items: center; background: #d9e4dd; color: var(--forest); display: flex; inset: 0; justify-content: center; padding: 30px; position: absolute; text-align: center; z-index: 1; }
.map-message[hidden] { display: none; }
.map-overlay { background: rgba(245,241,232,.94); border: 0; box-shadow: 0 8px 20px rgba(20,43,40,.12); position: absolute; z-index: 2; }
.map-title { display: flex; flex-direction: column; left: 18px; padding: 13px 18px; top: 18px; }
.map-title span { color: var(--coral); font-size: .58rem; font-weight: 850; letter-spacing: .15em; }
.map-title b { font-family: Georgia, serif; font-size: 1.1rem; font-weight: 400; }
.photo-marker { background: var(--card); border: 3px solid var(--card); border-radius: 50%; box-shadow: 0 4px 16px rgba(20,43,40,.25); cursor: pointer; height: 36px; overflow: hidden; width: 36px; }
.photo-marker img { height: 100%; object-fit: cover; width: 100%; }
.replay-sport-marker { height: 42px; position: relative; user-select: none; width: 42px; }
.replay-sport-icon { align-items: center; background: var(--card); border: 3px solid var(--forest); border-radius: 50%; box-shadow: 0 5px 18px rgba(20,43,40,.35); display: flex; font-size: 1.35rem; height: 42px; justify-content: center; line-height: 1; width: 42px; }
.replay-marker-metrics { background: rgba(20,43,40,.94); border-radius: 999px; box-shadow: 0 4px 14px rgba(20,43,40,.24); color: white; font-size: .68rem; font-weight: 750; left: 50px; padding: 7px 10px; position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; }
.replay-marker-metrics[hidden] { display: none; }

.replay-section { background: var(--ink); color: var(--paper); margin-top: 70px; padding: 80px clamp(20px, 8vw, 120px); }
.replay-section .section-heading { border-color: rgba(255,255,255,.2); }
.replay-heading { align-items: center; }
.stage-select { color: rgba(255,255,255,.65); display: flex; flex-direction: column; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }
.stage-select select { background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.4); color: white; min-width: 220px; padding: 8px 0; }
.stage-select option { color: var(--ink); }
.replay-console { padding-top: 14px; }
.replay-time { align-items: end; display: flex; justify-content: space-between; }
.replay-time span { color: rgba(255,255,255,.6); font-size: .75rem; text-transform: uppercase; }
.replay-time strong { color: var(--sun); font-family: Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.7rem); font-weight: 400; }
.live-metrics { border-bottom: 1px solid rgba(255,255,255,.18); border-top: 1px solid rgba(255,255,255,.18); display: grid; grid-template-columns: repeat(6, 1fr); margin: 18px 0; }
.live-metrics div { border-right: 1px solid rgba(255,255,255,.18); padding: 14px 12px; }
.live-metrics div:first-child { padding-left: 0; }
.live-metrics div:last-child { border: 0; }
.live-metrics span { color: rgba(255,255,255,.48); display: block; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.live-metrics strong { font-family: Georgia, serif; font-size: 1.65rem; font-weight: 400; }
.live-metrics small { color: rgba(255,255,255,.55); font-size: .65rem; margin-left: 4px; }
.timeline-controls { margin: 26px 0 12px; }
.timeline-wrap { align-items: center; display: grid; gap: 14px; grid-template-columns: auto 1fr auto; }
.timeline-wrap span { color: rgba(255,255,255,.6); font-size: .7rem; }
input[type="range"] { accent-color: var(--coral); width: 100%; }
.replay-play { background: var(--coral); border: 0; border-radius: 50%; color: white; cursor: pointer; height: 46px; width: 46px; }
.replay-play:disabled { cursor: default; opacity: .35; }
.map-replay-play { bottom: 22px; left: 50%; position: absolute; transform: translateX(-50%); z-index: 3; }
.replay-help { color: rgba(255,255,255,.58); font-size: .75rem; margin: 0 0 34px; }
.chart-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.12); min-height: 230px; padding: 20px; }
.chart-card h3 { color: rgba(255,255,255,.62); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; }
.chart-card canvas { max-height: 180px; }

.stage-list { border-top: 1px solid var(--line); }
.day-group { border-bottom: 1px solid var(--line); }
.day-heading { align-items: center; background: rgba(217,228,221,.35); display: flex; justify-content: space-between; padding: 20px 18px; }
.day-heading h3 { font-family: Georgia, serif; font-size: 1.65rem; font-weight: 400; margin: 0; }
.day-heading p { color: var(--ink-soft); font-size: .72rem; margin: 4px 0 0; }
.day-heading button { background: transparent; border: 1px solid var(--forest); border-radius: 999px; color: var(--forest); cursor: pointer; padding: 9px 14px; }
.day-group .stage-item { padding-left: 18px; }
.stage-item { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 20px; grid-template-columns: 66px minmax(200px, 2fr) repeat(3, minmax(80px, 1fr)) 48px; padding: 24px 0; }
.stage-item > b { color: var(--coral); font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; }
.stage-item h3 { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 400; margin: 0; }
.stage-item p, .stage-item small { color: var(--ink-soft); margin: 0; }
.stage-item button { background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; height: 44px; width: 44px; }
.photo-grid { columns: 3 280px; column-gap: 16px; }
.photo-tile { background: none; border: 0; break-inside: avoid; cursor: pointer; display: block; margin-bottom: 16px; padding: 0; position: relative; width: 100%; }
.photo-tile img { display: block; width: 100%; }
.photo-tile span { background: var(--card); bottom: 10px; font-size: .62rem; left: 10px; padding: 6px 9px; position: absolute; }
.photo-dialog { background: transparent; border: 0; color: white; height: 100%; max-height: none; max-width: none; padding: 3vh; width: 100%; }
.photo-dialog::backdrop { background: rgba(8,18,16,.94); }
.photo-dialog img { display: block; height: 82vh; margin: 0 auto; object-fit: contain; width: 100%; }
.photo-dialog button { align-items: center; background: rgba(255,255,255,.94); border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; display: flex; justify-content: center; position: absolute; z-index: 2; }
.photo-close { font-size: 1.6rem; height: 42px; right: 22px; top: 18px; width: 42px; }
.photo-nav { font-family: Georgia, serif; font-size: 2.4rem; height: 54px; top: 50%; transform: translateY(-50%); width: 54px; }
.photo-prev { left: 22px; }
.photo-next { right: 22px; }
.photo-nav[hidden] { display: none; }
.photo-dialog > div { bottom: 18px; left: 4vw; position: absolute; }
.photo-dialog #photo-position { color: rgba(255,255,255,.65); display: block; font-size: .68rem; letter-spacing: .12em; margin-bottom: 5px; text-transform: uppercase; }

.admin-body { background: #ece8df; }
.admin-shell { margin: 50px auto; max-width: 1240px; padding: 0 24px; }
.narrow-shell { max-width: 820px; }
.admin-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 42px; }
.admin-heading h1 { font-size: clamp(3.2rem, 7vw, 6rem); margin: 0; }
.admin-heading p { color: var(--ink-soft); margin-bottom: 0; }
.admin-card { background: var(--card); border: 1px solid rgba(20,43,40,.09); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(28px, 5vw, 56px); }
.compact-card { max-width: 520px; width: 100%; }
.centered-page { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 66vh; padding: 30px 20px; text-align: center; }
.login-page { text-align: left; }
.login-page .compact-card > p { color: var(--ink-soft); }
.stack-form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.roomy-form { gap: 26px; }
label, fieldset legend { color: var(--ink-soft); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
label small { font-weight: 500; letter-spacing: 0; text-transform: none; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: block; margin-top: 7px; min-height: 46px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); outline: 3px solid rgba(23,75,67,.12); }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
fieldset { border: 0; margin: 0; padding: 0; }
fieldset legend { margin-bottom: 10px; }
.radio-card { align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 12px; margin: 8px 0; padding: 14px; text-transform: none; }
.radio-card b, .radio-card small { display: block; }
.radio-card b { color: var(--ink); font-size: .9rem; }
.radio-card input { accent-color: var(--coral); }
.form-error { color: #9b3e2d; font-size: .78rem; font-weight: 700; }
.admin-trip-list { border-top: 1px solid var(--line); }
.admin-trip-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 24px; grid-template-columns: 60px minmax(250px, 2fr) 100px 100px 52px; padding: 25px 0; }
.admin-trip-index { color: var(--coral); font-family: Georgia, serif; font-size: 1.6rem; }
.admin-trip-row h2 { font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; margin: 5px 0 0; }
.admin-trip-row p { color: var(--ink-soft); font-size: .75rem; margin: 0; }
.status-pill, .placement-badge, .batch-status { border-radius: 999px; display: inline-block; font-size: .58rem; font-weight: 850; letter-spacing: .09em; padding: 4px 9px; text-transform: uppercase; }
.status-pill.public { background: #dce8cf; color: #3d5b24; }
.status-pill.password { background: #f2dac7; color: #7c452a; }
.admin-row-stat strong, .admin-row-stat span { display: block; }
.admin-row-stat strong { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.admin-row-stat span { color: var(--ink-soft); font-size: .62rem; text-transform: uppercase; }
.circle-link { align-items: center; border: 1px solid var(--line); border-radius: 50%; display: flex; height: 48px; justify-content: center; text-decoration: none; width: 48px; }
.admin-empty { background: rgba(255,255,255,.35); }
.admin-empty .button { margin-top: 16px; }

.trip-manage-heading { align-items: center; }
.trip-manage-heading h1 { font-size: clamp(3rem, 7vw, 5.8rem); }
.button-row { display: flex; gap: 9px; }
.admin-metrics { background: var(--ink); color: white; display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 70px; }
.admin-metrics div { border-right: 1px solid rgba(255,255,255,.17); padding: 25px; }
.admin-metrics div:last-child { border: 0; }
.admin-metrics strong, .admin-metrics span { display: block; }
.admin-metrics strong { font-family: Georgia, serif; font-size: 2.7rem; font-weight: 400; }
.admin-metrics span { color: rgba(255,255,255,.6); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
.admin-metrics .attention strong { color: var(--sun); }
.admin-section { margin: 70px 0; }
.admin-section .section-heading h2 { font-size: 2.6rem; }
.upload-panel { align-items: center; background: var(--card); border: 1px dashed #b8ae9b; display: grid; gap: 30px; grid-template-columns: 1fr 1.2fr; padding: 28px; }
.upload-panel h3 { margin-bottom: 8px; }
.upload-panel p { color: var(--ink-soft); font-size: .83rem; margin: 0; }
.upload-form { align-items: center; display: flex; gap: 10px; justify-content: end; }
.file-picker { flex: 1; }
.file-picker input { height: 1px; opacity: 0; overflow: hidden; position: absolute; width: 1px; }
.file-picker span { background: white; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; display: block; min-height: 48px; overflow: hidden; padding: 13px 18px; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.batch-list { margin-top: 12px; }
.batch-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 1fr auto; }
.batch-list a { align-items: center; display: grid; gap: 12px; grid-template-columns: 1fr auto 110px; padding: 12px 0; text-decoration: none; }
.batch-list small { color: var(--ink-soft); text-align: right; }
.batch-status.ready { background: #dce8cf; }
.batch-status.error { background: #efd0ca; }
.batch-status.processing { background: #eee0bd; }
.batch-status.imported { background: #d8e3e1; }
.manual-stage-panel { background: var(--card); border: 1px dashed #b8ae9b; margin-bottom: 22px; }
.manual-stage-panel summary { color: var(--forest); cursor: pointer; font-size: .8rem; font-weight: 800; list-style: none; padding: 18px 22px; }
.manual-stage-panel summary::-webkit-details-marker { display: none; }
.manual-stage-form { border-top: 1px solid var(--line); padding: 22px; }
.activity-admin-list { border-top: 1px solid var(--line); }
.activity-admin-row { border-bottom: 1px solid var(--line); }
.activity-admin-row summary { align-items: center; cursor: pointer; display: grid; gap: 18px; grid-template-columns: 50px minmax(200px, 2fr) repeat(3, 1fr) 25px; list-style: none; padding: 18px 0; }
.activity-admin-row summary::-webkit-details-marker { display: none; }
.activity-admin-row summary small { color: var(--ink-soft); display: block; }
.stage-number { color: var(--coral); font-family: Georgia, serif; font-size: 1.4rem; }
.activity-edit-panel { background: rgba(255,255,255,.45); padding: 22px; }
.activity-edit { padding: 0; }
.activity-delete-form { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; text-align: right; }
.mini-empty { border: 1px dashed var(--line); color: var(--ink-soft); padding: 28px; text-align: center; }
.admin-photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(5, 1fr); margin-top: 22px; }
.admin-photo-item { min-width: 0; position: relative; }
.admin-photo-card { background: white; display: block; min-width: 0; padding-bottom: 10px; position: relative; text-decoration: none; }
.admin-photo-card img { aspect-ratio: 1; display: block; object-fit: cover; width: 100%; }
.admin-photo-card small { color: var(--ink-soft); display: block; overflow: hidden; padding: 8px 8px 0; text-overflow: ellipsis; white-space: nowrap; }
.placement-badge { background: white; left: 7px; position: absolute; top: 7px; }
.placement-badge.unplaced { background: var(--sun); }
.photo-delete-form { position: absolute; right: 7px; top: 7px; z-index: 2; }
.photo-delete-button { align-items: center; background: #fff; border: 1px solid #d4aaa1; border-radius: 50%; color: #8c3e31; cursor: pointer; display: flex; font-size: 1.25rem; height: 30px; justify-content: center; line-height: 1; padding: 0 0 2px; width: 30px; }
.danger-zone { align-items: center; border: 1px solid #d4aaa1; color: #74372e; display: flex; justify-content: space-between; margin-top: 90px; padding: 24px; }
.danger-zone h2 { font-family: inherit; font-size: 1.1rem; font-weight: 800; letter-spacing: 0; margin-bottom: 5px; }
.danger-zone p { font-size: .78rem; margin: 0; }
.danger-button { background: transparent; border: 1px solid #a95142; border-radius: 999px; color: #8c3e31; cursor: pointer; padding: 11px 18px; }
.small-danger-button { background: transparent; border: 1px solid #c17d70; border-radius: 999px; color: #8c3e31; cursor: pointer; padding: 7px 12px; white-space: nowrap; }

.filter-bar { align-items: end; background: var(--card); display: grid; gap: 14px; grid-template-columns: 160px 160px 180px 1fr; margin-bottom: 18px; padding: 18px; }
.filter-bar > span { color: var(--ink-soft); font-size: .72rem; padding-bottom: 12px; text-align: right; }
.candidate-list { border-top: 1px solid var(--line); }
.candidate-row { align-items: center; border-bottom: 1px solid var(--line); color: var(--ink); display: grid; gap: 14px; grid-template-columns: 30px 120px minmax(200px,2fr) 1fr 100px 100px; padding: 15px 8px; text-transform: none; }
.candidate-row:hover { background: rgba(255,255,255,.45); }
.candidate-row[hidden] { display: none; }
.candidate-row input { accent-color: var(--coral); height: 18px; width: 18px; }
.candidate-row span { color: var(--ink-soft); font-weight: 500; letter-spacing: 0; }
.sticky-action { align-items: center; background: var(--ink); bottom: 18px; box-shadow: var(--shadow); color: white; display: flex; justify-content: space-between; margin: 28px auto; max-width: 680px; padding: 12px 14px 12px 22px; position: sticky; z-index: 3; }
.placement-layout { display: grid; gap: 30px; grid-template-columns: .7fr 1.3fr; }
.placement-layout h1 { font-size: clamp(3rem, 6vw, 5rem); }
.placement-photo { box-shadow: var(--shadow); display: block; max-height: 520px; object-fit: contain; width: 100%; }
#placement-map { height: 480px; margin-bottom: 22px; }
.map-help { color: var(--ink-soft); font-size: .75rem; }

@media (max-width: 1000px) {
  .trip-grid { grid-template-columns: 1fr; }
  .live-metrics { grid-template-columns: repeat(3, 1fr); }
  .live-metrics div:nth-child(3) { border-right: 0; }
  .live-metrics div:nth-child(-n+3) { border-bottom: 1px solid rgba(255,255,255,.18); }
  .stage-item { grid-template-columns: 50px minmax(180px, 2fr) repeat(2, 1fr) 44px; }
  .stage-item > span:nth-of-type(3) { display: none; }
  .admin-photo-grid { grid-template-columns: repeat(4, 1fr); }
  .upload-panel { grid-template-columns: 1fr; }
  .upload-form { justify-content: start; }
}

@media (max-width: 720px) {
  .site-header { min-height: 70px; }
  .site-footer { margin-top: 45px; }
  .home-hero { grid-template-columns: 1fr; padding-top: 8vh; }
  .hero-compass { display: none; }
  .trip-grid-section, .stages-section, .photos-section { padding-left: 20px; padding-right: 20px; }
  .trip-card { grid-template-columns: 1fr; }
  .trip-card-map { min-height: 220px; }
  .unlock-shell { grid-template-columns: 1fr; }
  .lock-illustration { border-radius: var(--radius) var(--radius) 0 0; min-height: 220px; }
  .lock-illustration span { font-size: 5rem; }
  .unlock-card { border-radius: 0 0 var(--radius) var(--radius); }
  .trip-hero { padding-top: 6vh; }
  .stats-ribbon { grid-template-columns: repeat(2, 1fr); }
  .stats-ribbon div:first-child { padding-left: 18px; }
  .stats-ribbon div:nth-child(2) { border-right: 0; }
  .stats-ribbon div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .map-stage { height: 56vh; margin: 0; }
  .replay-section { padding: 55px 20px; }
  .replay-heading { align-items: start; flex-direction: column; gap: 20px; }
  .stage-select, .stage-select select { width: 100%; }
  .live-metrics { grid-template-columns: repeat(2, 1fr); }
  .live-metrics div:nth-child(3) { border-right: 1px solid rgba(255,255,255,.18); }
  .live-metrics div:nth-child(even) { border-right: 0; }
  .live-metrics div:nth-child(-n+4) { border-bottom: 1px solid rgba(255,255,255,.18); }
  .replay-help { margin-left: 0; }
  .day-heading { align-items: start; flex-direction: column; gap: 14px; }
  .chart-grid { grid-template-columns: 1fr; }
  .stage-item { grid-template-columns: 38px minmax(150px, 1fr) 44px; }
  .stage-item > span { display: none; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .admin-heading, .trip-manage-heading { align-items: start; flex-direction: column; gap: 20px; }
  .button-row { flex-wrap: wrap; }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-trip-row { grid-template-columns: 42px minmax(0,1fr) 48px; }
  .admin-row-stat { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .activity-admin-row summary { grid-template-columns: 42px 1fr 25px; }
  .activity-admin-row summary > span:not(.stage-number) { display: none; }
  .admin-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-form { align-items: stretch; flex-direction: column; }
  .danger-zone { align-items: start; flex-direction: column; gap: 18px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar > span { display: none; }
  .candidate-row { grid-template-columns: 25px 100px 1fr; }
  .candidate-row > span:not(.candidate-date) { display: none; }
  .placement-layout { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
