/* Explo signed-in map: only what this page adds to the map maker's stylesheet (/map/map.css, linked first: card, brush, stage, stats,
   zoom, search, buttons). If a selector from map.css is renamed there, check this page.
   Same rules as the rest of the site: cream page, navy ink, Satoshi 400/500 only, flat solid fills, no pure white or black. */
:root { --warn: #f0a77f; --warn-ink: #8a3a16; }

/* ---- header: signed out shows the map maker and the app, signed in shows who you are ---- */
.nav-out, .nav-in { display: flex; align-items: center; gap: 22px; }
.nav-in { gap: 14px; }
.me { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--muted); }
.nav-out a:not(.btn) { color: var(--fg); text-decoration: none; font-size: 17px; }
.nav-out a:not(.btn):hover { text-decoration: underline; text-underline-offset: 6px; }

/* ---- the card: three modes (load, out, in) share one map ---- */
.card[data-mode="load"] { grid-template-columns: minmax(0, 1fr); }
.stage.locked #map { cursor: default; }
.stage.locked #map path, .stage.locked #map .hit { pointer-events: none; }
/* Territories are tappable here (the app lets you mark them), a shade darker than countries until you do. */
#map path.t { pointer-events: auto; }
.stage.locked #map path.t { pointer-events: none; }
@media (hover: hover) {
  #map path.t:hover { fill: #1e3855; }
  .stage[data-brush="1"] #map path.t:hover { fill: #7b8a96; }
  .stage[data-brush="2"] #map path.t:hover { fill: #1b6ba8; }
  .stage[data-brush="0"] #map path.t:hover { fill: #14283f; }
}

/* ---- signed out: the sign-in panel sits where the tools sit when signed in ---- */
.gate { padding: 20px; border-radius: 16px; background: var(--night-2); align-self: start; }
.gate h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.15; letter-spacing: -0.01em; color: var(--cream); }
.gate p { margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: var(--cream-dim); }
.gate .fine-print { font-size: 14px; line-height: 1.5; }
.gate .fine-print:last-child { margin-bottom: 0; }
.gate a { color: var(--cream); text-underline-offset: 3px; }
.gate a:hover { color: var(--lime); }
.gate a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.gate-btns { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 16px; }
.card .gate-btns .btn { flex: none; width: 100%; }
.gate-btns #in-apple { background: var(--cream); color: var(--night); }
.gate-btns #in-apple:hover { background: #e8e8dc; }
.card .gate-btns .btn[disabled] { background: var(--cream-wash); color: rgba(216, 216, 203, 0.5); }
.gate #gate-err { padding: 10px 14px; border-radius: 12px; background: rgba(240, 167, 127, 0.14); color: var(--warn); }

/* ---- signed in: saving status, small facts under the numbers ---- */
.extra { margin: 12px 0 0; font-size: 14px; line-height: 1.4; color: var(--cream-dim); }
.sync { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 6px; font-size: 14px; color: var(--cream-dim); }
.sync .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cream-dim); }
.sync[data-phase="saved"] .dot { background: var(--lime); }
.sync[data-phase="saving"] .dot, .sync[data-phase="loading"] .dot { animation: pulse 1s ease-in-out infinite alternate; }
.sync[data-phase="error"] .dot { background: var(--warn); }
.sync[data-phase="error"] .sync-text { color: var(--warn); }
.sync-text { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.sync .linkbtn { flex: none; padding: 8px 4px; }
.sync #retry { color: var(--cream); }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

@media (min-width: 960px) {
  .card {
    grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
    grid-template-areas: "notice notice" "stage search" "stage brush" "stage stats" "stage sync" "stage actions" "stage .";
  }
  .sync { grid-area: sync; }
  .card[data-mode="out"] { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "notice notice" "stage gate"; }
  .card[data-mode="load"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "notice" "stage"; }
  .gate { grid-area: gate; }
}

/* ---- below the card: your places, regions, trips, account ---- */
.below { padding-bottom: 8px; }
.sec { margin: 52px 0 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 16px; }
.sec h2 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.sec-sub { margin: -6px 0 18px; max-width: 640px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.filter input { width: 280px; max-width: 100%; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(2, 13, 27, 0.28); background: transparent; color: var(--fg); font-size: 16px; }
.filter input::placeholder { color: var(--muted); }
.filter input:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
@media (min-width: 760px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; } }
.col h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.col h3 span { color: var(--fg); }
.col .sw.a { box-shadow: inset 0 0 0 1.5px rgba(2, 13, 27, 0.4); }
.plist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plist li { display: inline-flex; align-items: stretch; max-width: 100%; border-radius: 999px; background: var(--soft); }
.plist li:hover { background: rgba(2, 13, 27, 0.1); }
.plist .nm { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 0 6px 0 14px; border: 0; border-radius: 999px 0 0 999px; background: none; color: var(--fg); font: 400 15px/1.2 var(--font); text-align: left; cursor: pointer; }
.plist .nm .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .rm { flex: none; display: grid; place-items: center; width: 38px; padding: 0; border: 0; border-radius: 0 999px 999px 0; background: none; color: var(--muted); cursor: pointer; }
.plist .rm:hover { color: var(--fg); }
.plist .x { width: 14px; height: 14px; }
.plist .tg { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(2, 13, 27, 0.07); font-size: 12px; line-height: 1.4; color: var(--muted); }
.plist li.none { padding: 8px 2px; background: none; color: var(--muted); font-size: 15px; }
.plist li.none:hover { background: none; }
.foot-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rcard { padding: 18px 20px; border-radius: 20px; background: var(--soft); }
.rcard h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.rcard .rn { margin: 4px 0 12px; font-size: 15px; color: var(--muted); }
.rbar { height: 6px; border-radius: 999px; background: rgba(2, 13, 27, 0.12); overflow: hidden; }
.rbar i { display: block; height: 100%; border-radius: 999px; background: var(--night); }
.rcard details { margin: 12px 0 0; padding: 0; border: 0; }
.rcard details:last-of-type { border: 0; }
.rcard summary { font-size: 15px; font-weight: 400; color: var(--muted); }
.rcard details p { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg); }

.tgroup { margin: 22px 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tgroup:first-child { margin-top: 0; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.trip { padding: 18px 20px; border-radius: 20px; background: var(--night); color: var(--cream); min-width: 0; }
.trip.past { background: var(--soft); color: var(--fg); }
.t-top { display: flex; align-items: center; gap: 10px; }
.t-emoji { font-size: 24px; line-height: 1; }
.t-top h4 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; }
.when { flex: none; padding: 3px 11px; border-radius: 999px; background: var(--cream-wash); font-size: 13px; line-height: 1.4; color: var(--cream); }
.when.now { background: var(--lime); color: var(--night); }
.t-meta { margin: 8px 0 0; font-size: 15px; color: var(--cream-dim); }
.trip.past .t-meta, .trip.past .t-note { color: var(--muted); }
.t-where { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.t-note { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--cream-dim); white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

.acct p { max-width: 640px; margin: 0 0 12px; color: var(--muted); }
.acct b { color: var(--fg); overflow-wrap: anywhere; }
.acct .btn { margin-top: 6px; }

@media (max-width: 699px) {
  .me { display: none; }
  .gate { padding: 18px; }
  .sec { margin-top: 40px; }
  .sec h2 { font-size: 24px; }
  .filter { flex: 1 1 100%; }
  .filter input { width: 100%; }
  .tgrid, .rgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sync .dot { animation: none !important; }
}
