/* atlas · ink & watercolor theme — overrides layered on top of the app's own CSS */

:root {
  --ink: #26271F; --inkSoft: rgba(38,39,31,.58);
  --teal: #46D6B3; --tealMid: #2BB993; --tealDeep: #0E8F75;
  --paper: #F6EDDB; --paperHi: #FBF5E8;
  --bg: #F6EDDB; --panel: rgba(251,245,232,.97); --panelSolid: #FBF5E8;
  --card: #FBF5E8; --card2: #F1E6CF; --card3: #D8C9AB;
  --text: #26271F; --dim: #57564A; --faint: #8C8572; --line: rgba(38,39,31,.2);
  --shadow: 3px 4px 0 rgba(38,39,31,.09);
  --brand: #0E8F75; --brandHi: #0B7461; --gold: #0E8F75; --goldHi: #0E8F75;
  --accent: #26271F; --accentHi: #000; --accentSoft: rgba(70,214,179,.2); --coral: #26271F;
  --plan: #6B8E9E; --planHi: #557584;
  --serif: "LXGW WenKai","Kaiti SC","STKaiti","KaiTi",serif;
  --hand: "Caveat","LXGW WenKai",cursive;
  --rHand: 16px 22px 14px 20px / 20px 14px 22px 16px;
  --swash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cfilter id='f' x='-5%25' y='-20%25' width='110%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='3' seed='5'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='10'/%3E%3C/filter%3E%3Cg filter='url(%23f)'%3E%3Crect x='7' y='8' width='186' height='44' rx='16' fill='%2346D6B3' fill-opacity='.62'/%3E%3Crect x='7' y='8' width='186' height='44' rx='16' fill='none' stroke='%232BB993' stroke-opacity='.75' stroke-width='3'/%3E%3Cellipse cx='70' cy='30' rx='60' ry='14' fill='%23A9E6D5' fill-opacity='.45'/%3E%3C/g%3E%3C/svg%3E");
  --blot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='f' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.06' numOctaves='3' seed='9'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='14'/%3E%3C/filter%3E%3Cg filter='url(%23f)'%3E%3Ccircle cx='50' cy='50' r='36' fill='%2346D6B3' fill-opacity='.55'/%3E%3Ccircle cx='50' cy='50' r='36' fill='none' stroke='%232BB993' stroke-opacity='.7' stroke-width='3'/%3E%3Ccircle cx='42' cy='44' r='18' fill='%23A9E6D5' fill-opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
}

html.ink body, html.ink button, html.ink input, html.ink textarea, html.ink select {
  font-family: "LXGW WenKai","Kaiti SC","STKaiti","PingFang SC",sans-serif !important;
}
html.ink body { background: var(--paper); color: var(--text); }
html.ink .maplibregl-map { background: var(--paper); font-family: inherit; }

/* paper grain over everything (transparent specks, never catches clicks) */
.ink-paper { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; background-size: 320px 320px; }

/* ink line icons replacing emoji (colour = currentColor) */
.ink-ic { display: inline-block; width: 1.08em; height: 1.08em; vertical-align: -.17em; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; font-style: normal; }

/* hand-lettered title + compass (desktop only) */
.ink-title, .ink-compass { display: none; }
@media (min-width: 900px) {
  body.tourmode .ink-title { display: block; }
  body.tourmode .ink-compass { display: block; }
  .ink-title { position: fixed; left: 104px; top: 14px; z-index: 6; pointer-events: none; color: var(--ink); }
  .ink-title b { display: block; font-family: var(--serif); font-weight: 700; font-size: 25px; letter-spacing: 3px; line-height: 1.15; }
  .ink-title i { display: block; font-family: var(--hand); font-style: normal; font-size: 19px; color: var(--tealDeep); margin-top: 1px; }
  .ink-title i::after { content: ''; display: block; width: 74px; height: 2px; margin-top: 3px; border-radius: 2px;
    background: var(--ink); opacity: .75; transform: rotate(-4deg); transform-origin: left; }
  .ink-compass { position: fixed; right: 26px; top: 18px; width: 74px; height: 74px; z-index: 6;
    pointer-events: none; opacity: .82; transform: rotate(-8deg); }
  .ink-compass svg { width: 100%; height: 100%; }
  html.ink .tourinfo { top: 104px !important; }
  html.ink .tourtl { left: 84px; }
}

/* ---------- desktop rail ---------- */
html.ink .rail { background: var(--paperHi); border-right: 1.6px solid var(--ink); box-shadow: 3px 0 0 rgba(38,39,31,.06); }
html.ink .rail .rbrand { background: var(--paperHi); color: var(--ink); border: 1.6px solid var(--ink);
  border-radius: 48% 52% 46% 54% / 52% 46% 54% 48%; box-shadow: 2px 3px 0 rgba(38,39,31,.12); font-size: 25px; }
html.ink .rail .ntab { color: var(--dim); border-radius: 14px; }
html.ink .rail .ntab svg { stroke-width: 1.6; }
html.ink .rail .ntab .rlb { font-weight: 700; font-size: 12px; letter-spacing: 1px; }
html.ink .rail .ntab:hover { background: rgba(70,214,179,.12); color: var(--ink); }
html.ink .rail .ntab.on { color: var(--ink); background: var(--blot) center / 74px 74px no-repeat; box-shadow: none; }
html.ink .rail .ntab.add .ic { background: var(--blot) center / 64px 64px no-repeat; color: var(--ink); box-shadow: none; border: 1.4px solid var(--ink); }
html.ink .rail .rkey { background: var(--paperHi); border: 1.4px solid var(--ink); color: var(--ink);
  border-radius: 52% 48% 54% 46% / 46% 54% 48% 52%; }

/* ---------- mobile tab bar ---------- */
html.ink .tabbar { background: rgba(251,245,232,.97); border-top: 1.6px solid var(--ink); box-shadow: 0 -3px 0 rgba(38,39,31,.05); }
html.ink .tabbar .tab { color: var(--dim); }
html.ink .tabbar .tab.active { color: var(--ink); background: var(--blot) center 4px / 52px 52px no-repeat; }

/* ---------- trip switcher ---------- */
html.ink .tourswitch { background: var(--panel); border: 1.6px solid var(--ink); border-radius: 30px 26px 32px 24px / 26px 32px 24px 30px;
  box-shadow: 3px 4px 0 rgba(38,39,31,.10); }
html.ink .tourswitch .ts { color: var(--dim); font-size: 15px; font-weight: 700; letter-spacing: 1px; }
html.ink .tourswitch .ts.on { color: var(--ink); background: var(--swash) center / 100% 100% no-repeat; }
html.ink .tourswitch .ts.all { color: var(--tealDeep); }
html.ink .tourswitch .ts .tdot { width: 9px; height: 9px; background: transparent !important; border: 1.6px solid var(--ink); }
html.ink .tourswitch .ts.on .tdot { background: var(--ink) !important; }

/* ---------- current-stop card ---------- */
html.ink .tourinfo { background: var(--panelSolid); border: 1.6px solid var(--ink); border-radius: var(--rHand);
  box-shadow: 5px 6px 0 rgba(38,39,31,.12); overflow: visible; }
html.ink .tourinfo::after { content: ''; position: absolute; inset: 5px -5px -5px 5px; border: 1px solid rgba(38,39,31,.35);
  border-radius: 20px 14px 24px 16px / 14px 22px 16px 20px; pointer-events: none; z-index: -1; }
html.ink .tourinfo .ph { margin: 10px 10px 0; height: 168px; border: 1.4px solid var(--ink);
  border-radius: 10px 14px 9px 13px / 13px 9px 14px 10px; filter: saturate(.86) sepia(.1) contrast(1.02); }
html.ink .tourinfo .ph .idx { background: var(--paperHi); color: var(--ink); border: 1.3px solid var(--ink);
  font-family: var(--hand); font-size: 15px; font-weight: 700; letter-spacing: .5px; padding: 1px 10px; }
html.ink .tourinfo .ph .zoom { background: rgba(251,245,232,.92); color: var(--ink); border: 1.2px solid var(--ink); font-weight: 700; }
html.ink .tourinfo .bd { padding: 12px 18px 16px; }
html.ink .tourinfo .eb { color: var(--tealDeep); font-family: var(--hand); font-size: 18px; font-weight: 700; letter-spacing: .5px; }
html.ink .tourinfo .eb .cd { background: var(--teal) !important; border: 1.4px solid var(--ink); width: 9px; height: 9px; }
html.ink .tourinfo h3 { font-family: var(--serif); font-weight: 700; font-size: 25px; letter-spacing: 2px; color: var(--ink); }
html.ink .tourinfo .loc { color: var(--dim); font-size: 14px; }
html.ink .tourinfo .loc .ink-ic { color: var(--tealDeep); }
html.ink .tourinfo p { color: #4C4A3F; }
html.ink .tourinfo .rd { background: var(--swash) center / 100% 100% no-repeat; color: var(--ink); border: none; box-shadow: none;
  font-size: 17px; font-weight: 700; letter-spacing: 3px; padding: 12px 0; border-radius: 16px; }
html.ink .tourinfo .rd:hover { filter: saturate(1.15); }

/* ---------- step timeline ---------- */
html.ink .tourtl { background: linear-gradient(rgba(246,237,219,0), rgba(246,237,219,.82) 55%); }
html.ink .tourtl .hd { color: var(--ink); text-shadow: none; font-size: 15px; font-weight: 700; letter-spacing: 2px; top: 0; }
html.ink .tourtl .hd .ink-ic { color: var(--tealDeep); }
html.ink .tstep { background: var(--panelSolid); border: 1.4px solid var(--ink); border-radius: 12px 16px 11px 15px / 15px 11px 16px 12px;
  box-shadow: 3px 4px 0 rgba(38,39,31,.12); outline: none; overflow: visible; }
html.ink .tstep .c { margin: 7px 7px 0; height: 80px; border: 1.2px solid var(--ink); border-radius: 8px 11px 7px 10px / 10px 7px 11px 8px;
  filter: saturate(.86) sepia(.1); }
html.ink .tstep.on { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 0 0 4px rgba(70,214,179,.45), 4px 6px 0 rgba(38,39,31,.14); }
html.ink .tstep .c .n { background: var(--paperHi); color: var(--ink); border: 1.3px solid var(--ink); box-shadow: none;
  font-family: var(--hand); font-size: 15px; font-weight: 700; left: 6px; top: 6px; }
html.ink .tstep .m .nm { font-size: 15px; font-weight: 700; color: var(--ink); }
html.ink .tstep .m .dt { font-size: 12.5px; color: var(--faint); }
html.ink .tstep .m .dt .day { color: var(--tealDeep); font-family: var(--hand); font-size: 15px; }
html.ink .tourtl .lk { height: 0; background: none; border-top: 2px dashed var(--ink); opacity: .7; width: 18px; }

/* ---------- map markers ---------- */
html.ink .pin .bubble { border: 3px solid var(--paperHi); box-shadow: 0 0 0 1.7px var(--ink), 3px 4px 0 rgba(38,39,31,.16); }
html.ink .pin .bubble::after { content: ''; position: absolute; inset: -8px; border: 1.1px solid rgba(38,39,31,.5);
  border-radius: 46% 54% 50% 48% / 52% 46% 54% 50%; pointer-events: none; }
html.ink .pin.active .bubble { box-shadow: 0 0 0 2.2px var(--ink), 0 0 0 9px rgba(70,214,179,.42); }
html.ink .pin .glow { background: radial-gradient(circle, rgba(70,214,179,.35), rgba(70,214,179,0) 68%); }
html.ink body.tourmode .pin .tnum, html.ink .pin .tnum { background: var(--paperHi); color: var(--ink); border: 1.3px solid var(--ink);
  box-shadow: none; font-family: var(--hand); font-size: 14px; font-weight: 700; }
html.ink .pin .lab { background: var(--paperHi); color: var(--ink); border: 1.2px solid var(--ink); box-shadow: none; font-size: 13px; }
html.ink .cluster .cbubble { border: 3px solid var(--paperHi); box-shadow: 0 0 0 1.7px var(--ink), 3px 4px 0 rgba(38,39,31,.16);
  background: var(--paperHi); color: var(--ink); }
html.ink .cluster .cbubble.photo { box-shadow: 0 0 0 1.7px var(--ink), 3px 4px 0 rgba(38,39,31,.16) !important; filter: saturate(.86) sepia(.1); }
html.ink .cluster .cbubble::after { content: ''; position: absolute; inset: -8px; border: 1.1px solid rgba(38,39,31,.5); border-radius: 46% 54% 50% 48% / 52% 46% 54% 50%; pointer-events: none; }
html.ink .pin .bubble.photo { filter: saturate(.86) sepia(.1); }
html.ink .cluster .glow { background: radial-gradient(circle, rgba(70,214,179,.4), rgba(70,214,179,0) 66%); }
html.ink .cluster .cn { background: var(--paperHi); color: var(--ink); border: 1.3px solid var(--ink); font-family: var(--hand); font-size: 15px; }
html.ink .cluster .clb { background: var(--paperHi); color: var(--ink); border: 1.2px solid var(--ink); box-shadow: none; font-size: 13px; }
html.ink .storyhalo i { border: 2px solid var(--tealDeep); box-shadow: 0 0 0 9px rgba(70,214,179,.22), 0 0 22px rgba(70,214,179,.5); }

/* ---------- map controls ---------- */
html.ink .maplibregl-ctrl-group { background: var(--paperHi) !important; border: 1.5px solid var(--ink);
  border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px; box-shadow: 3px 4px 0 rgba(38,39,31,.1) !important; overflow: hidden; }
html.ink .maplibregl-ctrl-group button + button { border-top: 1.2px solid rgba(38,39,31,.4) !important; }
html.ink .maplibregl-ctrl-attrib { background: rgba(251,245,232,.7) !important; font-family: inherit; }

/* ---------- side panel & generic buttons ---------- */
html.ink .panel { background: var(--panelSolid); border-left: 1.6px solid var(--ink); box-shadow: -4px 0 0 rgba(38,39,31,.06); }
html.ink .btn.pri { background: var(--swash) center / 100% 100% no-repeat; color: var(--ink); box-shadow: none; font-weight: 700; }

/* keep the hand-lettered title readable over the map */
@media (min-width: 900px) {
  .ink-title { padding: 6px 22px 10px 8px; margin-left: -8px;
    background: radial-gradient(ellipse at 40% 50%, rgba(246,237,219,.96) 45%, rgba(246,237,219,0) 72%); }
  .ink-compass { border-radius: 50%; background: radial-gradient(circle, rgba(246,237,219,.95) 55%, rgba(246,237,219,0) 72%); }
}


/* ---------- overview mode (全部足迹): header, chips, list, entry ---------- */
html.ink .header { background: var(--panelSolid); border: 1.6px solid var(--ink); border-radius: var(--rHand);
  box-shadow: 5px 6px 0 rgba(38,39,31,.12); backdrop-filter: none; }
html.ink .header h1 { font-size: 24px; font-weight: 700; letter-spacing: 3px; }
html.ink .header h1 .a { color: var(--tealDeep); }
html.ink .header .av { background: var(--blot) center / 120% no-repeat, var(--paperHi); border: 1.5px solid var(--ink); box-shadow: none; }
html.ink .sumbtn { background: var(--paperHi); border: 1.4px solid var(--ink); color: var(--ink); border-radius: 12px 15px 11px 14px / 14px 11px 15px 12px; }
html.ink .tallybar { border-top: 1.4px dashed rgba(38,39,31,.45); }
html.ink .tallybar .stp { border-width: 1.8px; opacity: .92; }
html.ink .tallybar .stp.s0 { color: var(--ink); border-color: var(--ink); }
html.ink .tallybar .stp.s1 { color: var(--tealDeep); border-color: var(--tealDeep); }
html.ink .tallybar .stp.s2 { color: #5C6B4C; border-color: #5C6B4C; }
html.ink .tallybar .stp .c { font-size: 13px; font-weight: 700; }
html.ink .tallybar .stp .d { font-family: var(--hand); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
html.ink .tallybar .ttail b { font-family: var(--hand); font-size: 22px; font-weight: 700; color: var(--ink); }
html.ink .ychip, html.ink .tchip { background: var(--paperHi); border: 1.4px solid var(--ink); color: var(--ink); box-shadow: 2px 3px 0 rgba(38,39,31,.1);
  font-size: 13px; border-radius: 18px 14px 17px 15px / 15px 18px 14px 17px; }
html.ink .ychip.active { background: var(--swash) center / 100% 100% no-repeat, var(--paperHi); color: var(--ink); border-color: var(--ink);
  box-shadow: 2px 3px 0 rgba(38,39,31,.1); }
html.ink .tchip .dot, html.ink .nav .grp .gdot { background: var(--paperHi) !important; border: 1.5px solid var(--ink); }
html.ink .nav .list { background: var(--panelSolid); border: 1.6px solid var(--ink); border-radius: var(--rHand);
  box-shadow: 4px 5px 0 rgba(38,39,31,.12); backdrop-filter: none; }
html.ink .nav .grp { color: var(--dim); font-size: 12px; }
html.ink .nav .grp.trip { color: var(--ink); font-size: 14px; letter-spacing: 1px; }
html.ink .nav .grp::after { background: none; border-top: 1.2px dashed rgba(38,39,31,.35); }
html.ink .nav .it .nm { font-size: 15px; }
html.ink .fabhome { background: var(--paperHi); border: 1.5px solid var(--ink); box-shadow: 2px 3px 0 rgba(38,39,31,.1); }
html.ink .heroentry { background: var(--panelSolid); border: 1.6px solid var(--ink); box-shadow: 4px 5px 0 rgba(38,39,31,.12);
  border-radius: 30px 26px 32px 24px / 26px 32px 24px 30px; backdrop-filter: none; }
html.ink .heroentry .ht b { font-size: 16px; letter-spacing: 1px; }
html.ink .heroentry .ha { background: var(--blot) center / 140% no-repeat; color: var(--ink); border: 1.4px solid var(--ink); }
html.ink .cluster .cbubble:not(.photo) { background: var(--blot) center / 130% no-repeat, var(--paperHi) !important; color: var(--ink) !important;
  font-family: var(--hand); font-size: 24px; }

/* ---------- secondary screens: story cover, trips, summary, dialogs (generic ink pass) ---------- */
html.ink :is(.rvcard .gobtn, .rvcard .btns .rb.nx, .rvcard .endbtns .msg, .trreset.clear, .empty .go, .atoast .cta, .tsguide .gnew,
  .chip.active, .chip.year.active, .gdseg .s.on, .navtoggle.on) {
  background: var(--swash) center / 100% 100% no-repeat !important; color: var(--ink) !important; box-shadow: none !important; border-color: transparent !important; }
html.ink :is(.rvcard, .rcard, .trcard, .mecard, .cklcard, .empty .card, .upcard, .logincard, .plusmenu) {
  background: var(--panelSolid) !important; border: 1.5px solid var(--ink) !important; border-radius: var(--rHand) !important;
  box-shadow: 4px 5px 0 rgba(38,39,31,.12) !important; backdrop-filter: none !important; }
html.ink :is(.rvcard, .trcard, .mecard) img, html.ink .trcard .th { filter: saturate(.88) sepia(.08); }
html.ink :is(.chip, .cchip, .rvprog, .tipbar, .maploading, .fab, .fabkey, .navtoggle, .tdmap) {
  background-color: var(--paperHi) !important; border: 1.4px solid var(--ink) !important; color: var(--ink); box-shadow: 2px 3px 0 rgba(38,39,31,.1) !important;
  backdrop-filter: none !important; }
html.ink .rvcard h2, html.ink .rvcard h3, html.ink .trcard b, html.ink .mecard h2 { font-family: var(--serif); letter-spacing: 1.5px; }

/* map data credit (OpenStreetMap / OpenMapTiles / OpenFreeMap) — small, ink on paper, clear of the rail and bottom bars */
.maplibregl-ctrl-bottom-left { margin: 0 0 6px 6px; }
@media (min-width: 721px) { .maplibregl-ctrl-bottom-left { margin-left: 8px; }
  /* trip view: the stop card fills the left column, so the credit moves right, above the timeline and its header */
  body.tourmode .maplibregl-ctrl-bottom-left { left: auto; right: 10px; margin-bottom: calc(194px + var(--safeB, 0px)); } }
@media (max-width: 720px) { .maplibregl-ctrl-bottom-left { margin-bottom: calc(70px + var(--safeB, 0px)); }
  body.tourmode .maplibregl-ctrl-bottom-left { margin-bottom: calc(258px + var(--safeB, 0px)); } }
/* owner view: the ＋添加 / 📥 buttons sit in the bottom-left corner, keep the credit above them */
@media (min-width: 721px) { body.owner:not(.tourmode) .maplibregl-ctrl-bottom-left { margin-bottom: calc(74px + var(--safeB, 0px)); } }
@media (max-width: 720px) { body.owner:not(.tourmode) .maplibregl-ctrl-bottom-left { margin-bottom: calc(144px + var(--safeB, 0px)); } }
.maplibregl-ctrl.maplibregl-ctrl-attrib { background: rgba(251,245,232,.86); border: 1px solid rgba(38,39,31,.22); border-radius: 10px; padding: 1px 8px;
  font: 10.5px/1.6 var(--serif, serif); color: rgba(38,39,31,.72); margin: 0; }
.maplibregl-ctrl.maplibregl-ctrl-attrib a { color: inherit; text-decoration: none; }
.maplibregl-ctrl.maplibregl-ctrl-attrib a:hover { text-decoration: underline; }
.maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 22px; padding: 1px 8px 1px 26px; }
.maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) { padding: 0; width: 24px; }
.maplibregl-ctrl-attrib-button { background-color: transparent !important; width: 22px; height: 22px; top: 1px; }
