/* TRACE · Thử lên tường (/wall/). Orange only ever means a route and blue only water (both
   live in the tile images, never in this file). One face, Regular, for all text. Pencil
   appears only as the TRACE accent: the empty-slot outlines. The tiles sit on the bare
   plaster (Nam 30-09: no board behind them), and nothing on the page tells a printed tile
   from one that is not. */

/* the site's tokens, copied from /css/landing.css :root: keep the two in sync (one change
   here: --ink-3 is a shade darker, for AA on the pressed picker rows). The header, the phone
   menu, the language pairs and the page-to-page transition are /css/chrome.css, shared with
   the homepage (loaded first); --head-h, the header's height, comes from there */
:root{
  --paper:#F1EDE3;
  --paper-2:#E9E4D7;
  --paper-3:#DDD6C5;
  --ink:#20241C;
  --ink-2:#4A5043;
  --ink-3:#5D6257;
  --rule:rgba(32,36,28,.13);
  --olive:#46543C;
  --olive-2:#3A4632;
  --olive-3:#56664A;
  --cream:#F3EFE4;
  --graphite:#3E423A;
  --sans:"Avenir Next","Avenir","Nunito Sans","Nunito Sans Fallback",system-ui,-apple-system,"Segoe UI",sans-serif;
  --ease:cubic-bezier(.22,.8,.18,1);
  /* motion tokens (Material 3) */
  --ease-standard:cubic-bezier(.2,0,0,1);
  --ease-enter:cubic-bezier(.05,.7,.1,1);
  --ease-exit:cubic-bezier(.3,0,.8,.15);
  --k:1;
  --gut-l:max(16px,env(safe-area-inset-left));
  --gut-r:max(16px,env(safe-area-inset-right));
  color-scheme:light;
}
@media (max-width:359px){.intro h1{font-size:23px}}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:calc(var(--head-h) + 8px);scroll-padding-bottom:88px}
/* the shared header is fixed (as on the homepage): the page starts under it */
body{margin:0;padding-top:var(--head-h);background:var(--paper);color:var(--ink);font-family:var(--sans);font-weight:400;font-size:16px;line-height:1.5;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;overflow-x:hidden}
img{max-width:100%;display:block}
a{color:inherit}
button,input{font:inherit;color:inherit}
b,strong{font-weight:400}
h1,h2,h3{font-weight:400;margin:0;letter-spacing:-.018em}
p{margin:0}
::selection{background:rgba(70,84,60,.22)}
.skip{position:absolute;left:-9999px;top:8px;z-index:200;background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:999px;text-decoration:none}
.skip:focus{left:12px}
:focus-visible{outline:2px solid var(--olive);outline-offset:3px;border-radius:6px}
.sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.link{background:none;border:0;padding:0;cursor:pointer;color:inherit;text-decoration:underline;text-decoration-color:rgba(32,36,28,.35);text-underline-offset:3px;transition:text-decoration-color .2s}
.link:hover{text-decoration-color:currentColor}
.btn{--bg:var(--olive);--fg:var(--cream);display:inline-flex;align-items:center;justify-content:center;gap:.5em;height:48px;padding:0 22px;
  border-radius:999px;background:var(--bg);color:var(--fg);text-decoration:none;font-size:15.5px;letter-spacing:.01em;
  border:1px solid transparent;cursor:pointer;white-space:nowrap;
  transition:transform .35s var(--ease),background .25s,color .25s,border-color .25s,box-shadow .35s var(--ease)}
.btn:active{transform:scale(.985);transition-duration:.08s}
.btn-sm{height:40px;padding:0 16px;font-size:14px}
.btn-ghost{--bg:transparent;--fg:var(--ink);border-color:rgba(32,36,28,.24)}
@media (hover:hover){
  .btn:hover{transform:translateY(-2px);box-shadow:0 10px 24px -12px rgba(32,36,28,.55);--bg:var(--olive-2)}
  .btn-ghost:hover{--bg:rgba(32,36,28,.04);box-shadow:none;border-color:rgba(32,36,28,.5)}
}
/* small controls keep a 44 px touch target round what they draw */
.hit{position:relative}
.hit::after,.mag::after,.tabs [role="tab"]::after,.tray-list button::after,.sel-acts button::after,.done::after,.toast button::after{content:"";position:absolute;inset:-4px}
.mag,.tabs [role="tab"],.tray-list button,.sel-acts button,.done,.toast button{position:relative}

/* ------------------------------------------------------------ intro + stat strip */
.wallcol{min-width:0}
.intro-m{padding:12px var(--gut-r) 0 var(--gut-l)}
.intro h1{font-size:clamp(26px,7.4vw,34px);line-height:1.12}
.intro-sub{margin-top:4px;font-size:clamp(13px,3.4vw,14.5px);line-height:1.4;color:var(--ink-3);text-wrap:balance}
.intro-d{display:none}
.stat{padding:10px var(--gut-r) 12px var(--gut-l)}
.stat-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 8px}
.count{font-size:15.5px;white-space:nowrap;font-variant-numeric:tabular-nums}
/* the four tools are icons only (their name is the aria-label and the tooltip) */
.tools{display:flex;gap:4px;flex:none}
.tool{position:relative;display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:50%;
  border:1px solid var(--rule);background:rgba(241,237,227,.7);cursor:pointer;transition:background var(--d,.1s),color .1s,border-color .1s}
.tool svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tool[aria-pressed="true"]{background:var(--olive);color:var(--cream);border-color:var(--olive)}
.tool:disabled{opacity:.38;cursor:default}
.tool:focus-visible{border-radius:50%}            /* the global focus rule squares corners off: a round button stays round */
@media (hover:hover){.tool:not(:disabled):not([aria-pressed="true"]):hover{background:var(--paper-2);border-color:rgba(32,36,28,.3)}}
.mag-row{display:flex;margin-top:8px}
/* "6 nam châm dưới đế": the one filled control near the wall, so the magnets are hard to miss */
.mag{display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:0 18px 0 13px;border:0;border-radius:999px;
  background:var(--olive);color:var(--cream);font-size:15px;cursor:pointer;transition:background .2s}
.mag:hover{background:var(--olive-2)}
.mag:focus-visible{border-radius:999px}
.mag svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linejoin:round}
.mag svg circle{fill:currentColor;stroke:none}
@media (max-width:399px){.tools{gap:3px}.tool{width:38px;height:38px}.count{font-size:15px}}
@media (max-width:379px){.tool{width:36px;height:36px}.count{font-size:14.5px}}
@media (min-width:600px){.intro-m,.stat{padding-left:24px;padding-right:24px}}

/* ------------------------------------------------------------ the stage */
.stage{position:relative;overflow:hidden;isolation:isolate;height:calc((100vw - 16px) * 1.19313 + 16px);background:#ECE6DA;
  touch-action:pan-y pinch-zoom;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.stage.can-grab{cursor:grab}
.stage.grabbing,.stage.grabbing *{cursor:grabbing}
.wall-bg{position:absolute;inset:0;z-index:0;
  background:radial-gradient(120% 90% at 18% 0%,rgba(255,252,244,.75),rgba(255,252,244,0) 60%),radial-gradient(90% 80% at 100% 100%,rgba(60,50,30,.07),rgba(60,50,30,0) 70%),#ECE6DA}
.wall-bg::after{content:"";position:absolute;inset:0;background:url(/assets/wall/plaster.webp) 0 0/192px 192px;mix-blend-mode:multiply;opacity:.35}
/* nothing that the script sizes shows before it has its size: no layout shift on a first visit */
html.js:not(.placed) :is(.switch,.under,.fine){visibility:hidden}
@media (max-width:1199px){html.js:not(.placed) .panel{visibility:hidden}}
/* desktop: the list waits for its size too (it would move when the rows arrive) */
@media (min-width:1200px){html.js:not(.placed) :is(.tray,.picker){visibility:hidden}}
/* a real 86 mm light switch, the one scale cue from everyday life */
.switch{position:absolute;z-index:0;border-radius:calc(var(--k) * 3px);background:linear-gradient(160deg,#FBF9F4,#ECE8DE);
  box-shadow:inset 0 1px 0 #fff,inset 0 0 0 1px rgba(60,55,40,.06),0 calc(var(--k) * 1px) calc(var(--k) * 2px) rgba(40,36,28,.16),0 calc(var(--k) * 3px) calc(var(--k) * 8px) rgba(40,36,28,.12)}
.switch i{position:absolute;left:50%;top:50%;width:calc(var(--k) * 26px);height:calc(var(--k) * 52px);transform:translate(-50%,-50%);border-radius:calc(var(--k) * 2px);
  background:linear-gradient(180deg,#F8F5EF,#E4DFD4);box-shadow:inset 0 0 0 1px rgba(60,55,40,.1),0 calc(var(--k) * .6px) calc(var(--k) * 1.4px) rgba(40,36,28,.22)}

svg.art{position:absolute;left:0;top:0;z-index:1;overflow:visible;pointer-events:none}
/* an empty slot: a pencil outline and a small "+", quiet on the bare wall (stage.js sets the
   group's opacity: about a quarter next to the cluster, clear while a tile is in the hand) */
.sl{opacity:0;transition:opacity 160ms var(--ease-standard)}
.sl path{fill:none;stroke:rgb(50,60,40);stroke-linecap:round}
.sl .p1{stroke-opacity:.9}
.sl .p2{stroke-opacity:.45}
.sl .plus{opacity:0;transition:opacity 160ms}
.sl.idle .plus{opacity:1}
.art .hi{fill:rgba(70,84,60,.13);stroke:rgba(70,84,60,.95);transform-box:fill-box;transform-origin:center;opacity:0;transition:opacity 120ms var(--ease-standard)}
svg.fx{position:absolute;left:0;top:0;z-index:4;overflow:visible;pointer-events:none}
/* rings round a stand: the keyboard focus and the selected piece, a light halo under an olive line */
.fx .ring{opacity:0}
.fx .ring path{fill:none;stroke-linejoin:round}
.fx .ring .halo{stroke:rgba(255,255,255,.85);stroke-width:6}
.fx .ring .line{stroke:var(--olive);stroke-width:3}
.fx .ring.sel .line{stroke-width:2.5}
.art .ripple{fill:none;stroke:var(--olive);transform-box:fill-box;transform-origin:center}
.shadows,.layer{position:absolute;inset:0;pointer-events:none}
.shadows{z-index:2}
.layer{z-index:3}
.shadow{position:absolute;left:0;top:0;max-width:none;transform-origin:50% 50%;opacity:0}
.piece{position:absolute;left:0;top:0;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.piece img{width:100%;height:100%;max-width:none;-webkit-user-drag:none;pointer-events:none}

.hover-label{position:absolute;left:0;top:0;z-index:5;pointer-events:none;font-size:12px;color:var(--ink);padding:1px 8px;border-radius:999px;white-space:nowrap;
  background:rgba(241,237,227,.92);box-shadow:0 1px 4px rgba(32,36,28,.14);opacity:0;transition:opacity 150ms var(--ease-standard)}
.hover-label.show{opacity:1}
.stage.grabbing .hover-label{opacity:0}
svg.ruler{position:absolute;inset:0;width:100%;height:100%;z-index:6;overflow:visible;pointer-events:none}
.ruler line{stroke:var(--ink);stroke-width:1}
.ruler text{fill:var(--ink);font:12px var(--sans);paint-order:stroke;stroke:rgba(241,237,227,.96);stroke-width:4px;stroke-linejoin:round}
.slots{position:absolute;inset:0;z-index:7;pointer-events:none}
.slot{position:absolute;left:0;top:0;padding:0;border:0;background:none;opacity:0;border-radius:50%}
.slot:focus-visible{outline:none}

/* the first-run hint: one short line at the bottom of the wall, for a few seconds, once */
.hint,.bin{position:absolute;left:50%;bottom:12px;z-index:8;margin:0;display:flex;align-items:center;font-size:13px;border-radius:999px;
  transform:translate(-50%,10px);opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity 180ms var(--ease-standard),transform 220ms var(--ease-enter),background 150ms,color 150ms,visibility 0s 220ms}
.hint{width:max-content;max-width:calc(100% - 24px);padding:7px 16px;line-height:1.35;color:var(--ink);background:rgba(241,237,227,.95);border:1px dashed rgba(50,60,40,.4)}
.hint.show{opacity:1;transform:translate(-50%,0);visibility:visible;transition-delay:0s}
.in-hand .hint{opacity:0;visibility:hidden}
.bin{white-space:nowrap;padding:8px 15px;color:var(--ink-2);background:rgba(241,237,227,.95);border:1px dashed rgba(50,60,40,.45)}
.bin .on{display:none}
.bin.show{opacity:1;transform:translate(-50%,0);visibility:visible;transition-delay:0s}
.bin.hot{background:var(--ink);color:var(--cream);border-color:var(--ink);transform:translate(-50%,0) scale(1.04)}
.bin.hot .on{display:inline}
.bin.hot .off{display:none}
.empty{position:absolute;inset:0;z-index:8;display:grid;place-content:center;justify-items:center;gap:12px;text-align:center;pointer-events:none}
.empty>p:first-child{font-size:15px;color:var(--ink-2);background:rgba(241,237,227,.9);padding:4px 14px;border-radius:999px}
.empty-acts{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;pointer-events:auto}
.empty .btn-ghost{background:rgba(241,237,227,.9)}
.loading{position:absolute;left:50%;top:180px;z-index:9;transform:translateX(-50%);font-size:14px;color:var(--ink-2);transition:opacity 300ms var(--ease-standard);white-space:nowrap}
/* no script: the teaser picture stands in for the wall; controls that need the script go */
html:not(.js) :is(.loading,.switch,.tools,.m-add,.add,.find,.skip,.y-bar){display:none}
.loading.gone{opacity:0;pointer-events:none}
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));z-index:70;display:flex;align-items:center;gap:8px;max-width:calc(100vw - 32px);white-space:nowrap;
  padding:6px 6px 6px 16px;border-radius:999px;background:var(--ink);color:var(--cream);font-size:13.5px;box-shadow:0 10px 24px -10px rgba(0,0,0,.45);
  transform:translate(-50%,16px);opacity:0;pointer-events:none;transition:opacity 150ms var(--ease-exit),transform 150ms var(--ease-exit)}
.toast>span{padding:6px 0;overflow:hidden;text-overflow:ellipsis}
.toast:not(:has(button)){padding-right:16px}
.toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto;transition:opacity 220ms var(--ease-enter),transform 220ms var(--ease-enter)}
.toast button{min-height:36px;padding:0 12px;border:0;border-radius:999px;background:rgba(243,239,228,.14);color:var(--cream);cursor:pointer}
/* a whole sentence (why a GPX could not be read): it wraps inside the toast instead of being cut (app.js adds .long) */
.toast.long{width:max-content;max-width:min(520px,calc(100vw - 32px));white-space:normal;border-radius:18px}
.toast.long>span{line-height:1.4;overflow:visible}
.nojs{position:absolute;inset:0}
.nojs img{width:100%;height:100%;object-fit:cover}          /* the picture is the wall itself: it fills it, no seam */
.nojs-line{position:absolute;left:16px;right:16px;bottom:16px;background:rgba(241,237,227,.94);padding:8px 12px;border-radius:12px;font-size:14px}

/* ------------------------------------------------------------ under the wall: the selected piece */
.selbar{position:relative;display:grid;gap:6px;padding:10px 12px 12px;border-radius:16px;background:var(--paper-2)}
.sel-tx{min-width:0}
.sel-name{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:17px;line-height:1.25}
.sel-meta{font-size:13px;color:var(--ink-2)}
.sel-acts{display:flex;gap:6px}
.sel-acts button{flex:none;min-height:40px;padding:0 12px;border-radius:999px;border:1px solid var(--rule);background:var(--paper);font-size:13.5px;cursor:pointer;white-space:nowrap}
.sel-acts .done{margin-left:auto;background:var(--olive);color:var(--cream);border-color:var(--olive)}
.sel-x{display:none}
/* phones and tablets: the bar docks at the bottom of the screen, in the "+ Thêm mảnh" bar's place */
@media (max-width:1199px){
  .selbar{position:fixed;z-index:55;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));
    background:rgba(233,228,215,.97);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:0 12px 32px -10px rgba(32,36,28,.45),0 0 0 1px var(--rule)}
  .sel-name{font-size:16px}
  .sel-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sel-tx{padding-right:40px}
  .sel-acts{overflow-x:auto;scrollbar-width:none;margin:0 -12px;padding:2px 12px 2px}
  .sel-acts::-webkit-scrollbar{display:none}
  .sel-acts .done{display:none}
  /* "Xong" is the corner x here: the three actions keep one row */
  .sel-x{position:absolute;top:4px;right:4px;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:none;color:var(--ink-2);cursor:pointer}
  .sel-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
}
@media (max-width:389px){.sel-acts{gap:5px}.sel-acts button{padding:0 10px;font-size:13px}}

/* ------------------------------------------------------------ panel */
.panel{padding:18px var(--gut-r) 0 var(--gut-l);min-width:0}
.add{width:100%;min-height:50px;border:1px solid var(--olive);border-radius:14px;background:transparent;color:var(--olive);font-size:16px;cursor:pointer}
.tray{margin-top:18px}
.tray-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px}
.tray-head h2{font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:var(--ink-2)}
.tray-head .link{font-size:13.5px;color:var(--ink-2);min-height:44px;padding:0 4px}
.tray-list{position:relative;list-style:none;margin:8px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.tray-list li{display:inline-flex;align-items:center;min-height:40px;padding-left:13px;border-radius:999px;background:var(--paper-2);font-size:14px}
.tray-list li.gone{position:absolute;pointer-events:none}
.tray-list button{width:40px;height:40px;display:grid;place-items:center;border:0;background:none;border-radius:50%;color:var(--ink-2);cursor:pointer}
.tray-list svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}

/* the picker: a nonmodal bottom sheet on phones and tablets, inline in the panel on a desktop */
.picker{position:fixed;z-index:60;left:0;right:0;bottom:0;max-height:72vh;max-height:72svh;display:flex;flex-direction:column;outline:none;
  background:var(--paper);border-radius:20px 20px 0 0;box-shadow:0 -10px 34px rgba(32,36,28,.22);padding-bottom:env(safe-area-inset-bottom);
  transform:translateY(105%);visibility:hidden;transition:transform 240ms var(--ease-exit),visibility 0s 240ms,opacity 200ms}
.picker.aimed{max-height:58vh;max-height:58svh}
.picker.open{transform:none;visibility:visible;transition:transform 320ms var(--ease),visibility 0s,opacity 200ms}
.picker.swiping{transition:none}
.picker>*{flex:none}
.picker>.list{flex:1 1 auto}
/* dragging a row out: the sheet steps down to its header, the whole wall is free to aim at */
.picker.dragging{transform:translateY(calc(100% - 64px));pointer-events:none;transition:transform 280ms var(--ease-standard)}
.picker-head{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px var(--gut-r) 4px var(--gut-l);touch-action:none}
.grip{position:absolute;left:50%;top:6px;width:40px;height:4px;border-radius:2px;background:rgba(32,36,28,.2);transform:translateX(-50%)}
.picker-head h2{font-size:19px}
.done{min-height:40px;padding:0 18px;border-radius:999px;border:1px solid var(--rule);background:var(--paper-2);cursor:pointer;font-size:14.5px}
.tabs{display:flex;gap:4px;padding:6px 12px 6px;overflow-x:auto;scrollbar-width:none}
.tabs [role="tab"]{flex:none;min-height:40px;padding:0 14px;border:0;border-radius:999px;background:none;font-size:11.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-2);cursor:pointer;white-space:nowrap}
.tabs [aria-selected="true"]{background:var(--ink);color:var(--cream)}
.find{position:relative;margin:0 16px 8px}
.find svg{position:absolute;left:12px;top:50%;width:17px;height:17px;transform:translateY(-50%);fill:none;stroke:var(--ink-3);stroke-width:1.7;stroke-linecap:round;pointer-events:none}
.find input{display:block;width:100%;height:42px;padding:0 12px 0 38px;border:1px solid rgba(32,36,28,.2);border-radius:999px;background:#FBF9F4;font-size:16px;
  -webkit-appearance:none;appearance:none;outline:none;transition:border-color .15s}
.find input::placeholder{color:var(--ink-3)}
.find input:focus-visible{border-color:var(--olive);box-shadow:0 0 0 2px rgba(70,84,60,.2)}
.list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 8px 6px}
.list .sub{font-size:11px;letter-spacing:.2em;text-transform:uppercase;color:var(--ink-3);padding:10px 8px 4px}
.list .cap{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);padding:6px 8px 4px;font-variant-numeric:tabular-nums}
.list ul{list-style:none;margin:0;padding:0}
.row{width:100%;display:grid;grid-template-columns:44px minmax(0,1fr) 24px;gap:10px;align-items:center;text-align:left;min-height:56px;padding:4px 8px;
  border:0;border-radius:14px;background:none;cursor:pointer;touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;transition:background .15s}
.row[aria-pressed="true"]{background:var(--paper-2)}
.row .th{width:44px;height:44px;object-fit:contain;pointer-events:none}
.row .tx{min-width:0}
.row .nm{display:block;font-size:15px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .mt{display:block;font-size:12.5px;line-height:1.35;color:var(--ink-2);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ck{width:24px;height:24px;display:grid;place-items:center;border-radius:50%;border:1.5px solid rgba(32,36,28,.22);transition:background .15s,border-color .15s}
.ck svg{width:15px;height:15px;fill:none;stroke:transparent;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.row[aria-pressed="true"] .ck{background:var(--olive);border-color:var(--olive)}
.row[aria-pressed="true"] .ck svg{stroke:var(--cream)}
@media (hover:hover){.row:hover{background:rgba(32,36,28,.04)}.row[aria-pressed="true"]:hover{background:var(--paper-3)}}
.list-empty{padding:14px 8px 4px;font-size:14px;color:var(--ink-2)}
.list-foot{padding:10px 8px 12px;font-size:13px;color:var(--ink-2)}
.list-foot b{color:var(--ink)}
/* ------------------------------------------------------------ the visitor's own routes (js/yours-ui.js) */
/* the slim row above the list: what the list is, and the way to add your own */
.y-bar{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:0 8px;margin:0 16px 4px;min-height:40px;font-size:13.5px;color:var(--ink-3)}
.y-note{margin:0}
.y-dot{font-style:normal;opacity:.55}
.y-add{position:relative;display:inline-flex;align-items:center;gap:5px;min-height:36px;padding:0 14px 0 11px;border:1px solid var(--olive);border-radius:999px;background:transparent;
  color:var(--olive);font-size:13.5px;cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}
.y-add::after{content:"";position:absolute;inset:-4px}
@media (hover:hover){.y-add:hover{background:var(--olive);color:var(--cream)}}
/* the privacy line: beside the button while it is pointed at or focused, nowhere else */
.y-priv{position:absolute;left:0;top:100%;z-index:3;margin-top:1px;padding:4px 12px;border-radius:999px;background:var(--ink);color:var(--cream);font-size:12.5px;line-height:1.35;white-space:nowrap;
  opacity:0;transform:translateY(-3px);pointer-events:none;transition:opacity .15s,transform .15s}
.y-add:is(:hover,:focus-visible)~.y-priv{opacity:1;transform:none}
.picker[data-view="yours"] :is(.y-note,.y-dot){display:none}
/* the "Của bạn" tab: a row and its delete button */
.y-li{display:grid;grid-template-columns:minmax(0,1fr) 40px;align-items:center}
.y-rm{position:relative;width:40px;height:40px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:none;color:var(--ink-3);cursor:pointer}
.y-rm::after{content:"";position:absolute;inset:-2px}
.y-rm svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media (hover:hover){.y-rm:hover{background:rgba(32,36,28,.06);color:var(--ink)}}
/* a .gpx dragged over the wall: a dashed frame, one line, the free slots lit (stage.extHover) */
.y-drop{position:absolute;left:50%;top:14px;z-index:9;margin:0;padding:7px 18px;border-radius:999px;background:var(--ink);color:var(--cream);font-size:14px;white-space:nowrap;
  transform:translate(-50%,-6px);opacity:0;pointer-events:none;transition:opacity .15s,transform .18s var(--ease-enter)}
.stage.y-over .y-drop{opacity:1;transform:translate(-50%,0)}
.stage.y-over::after{content:"";position:absolute;inset:8px;z-index:8;border:2px dashed var(--olive);border-radius:14px;pointer-events:none}
/* the selection bar of a tile of the visitor's own: its name is a field, and one line says what the tile is */
.sel-input{flex:1 1 150px;min-width:0;max-width:300px;height:36px;padding:0 13px;border:1px solid rgba(32,36,28,.28);border-radius:999px;background:#FBF9F4;color:var(--ink);
  font-size:16px;line-height:1.2;outline:none;transition:border-color .15s}
.sel-input:focus-visible{border-color:var(--olive);box-shadow:0 0 0 2px rgba(70,84,60,.2)}
.sel-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 10px;min-width:0}
.sel-line .sel-meta{flex:none}
.sel-note{flex:1 1 auto;min-width:0;font-size:12.5px;line-height:1.35;color:var(--ink-2)}
/* a toast never covers the selection bar: it stands just above it (--sel-h is the bar's height, app.js) */
body.has-sel .toast{bottom:calc(var(--sel-h,0px) + 22px + env(safe-area-inset-bottom))}
.y-cap{margin-top:10px;font-size:14px;color:var(--ink-2)}

.ghost{position:fixed;left:0;top:0;z-index:80;width:76px;height:76px;pointer-events:none;will-change:transform}
.ghost img{width:100%;height:100%;transform-origin:50% 57%;transition:transform 160ms var(--ease-standard);filter:drop-shadow(0 10px 12px rgba(32,36,28,.3))}

/* the one fine-print line, last on the page: data credits, then two plain sentences */
.fine{margin:0;padding:20px var(--gut-r) calc(100px + env(safe-area-inset-bottom)) var(--gut-l);font-size:12px;line-height:1.5;color:var(--ink-3)}
.fine a{text-decoration:underline;text-decoration-color:rgba(32,36,28,.3);text-underline-offset:2px}
.fine a:hover{text-decoration-color:currentColor}
@media (min-width:600px){.fine{padding-left:24px;padding-right:24px;max-width:720px}}

/* phones and tablets: "+ Thêm mảnh" stays at hand at the bottom, and steps aside while you arrange */
.mbar{position:fixed;z-index:50;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px var(--gut-r) calc(8px + env(safe-area-inset-bottom)) var(--gut-l);background:rgba(241,237,227,.94);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  box-shadow:0 -1px 0 var(--rule);transition:transform 180ms var(--ease-standard)}
/* one button now (the DM button is the header's, Nam 30-09): "+ Thêm mảnh", the whole width, drawn like the panel's
   "+ Thêm cung đường" (an olive outline): lighter than a filled bar, so the header's DM button stands out */
.mbar .btn{height:48px;padding:0 20px}
.mbar .m-add{flex:1 1 auto;font-size:16px;--bg:var(--paper);--fg:var(--olive);border-color:var(--olive)}
@media (hover:hover){.mbar .m-add:hover{--bg:var(--paper-2);box-shadow:none}}
body.dragging .mbar,body.has-sel .mbar,body.moving .mbar,body.sheet-open .mbar{transform:translateY(110%)}

/* ------------------------------------------------------------ dialogs */
.dlg{border:0;padding:0;margin:auto;background:transparent;color:var(--ink);max-width:100vw;max-height:100vh;max-height:100svh;overflow:visible}
.dlg::backdrop{background:rgba(32,36,28,.46);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.dlg-in{position:relative;width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:calc(100svh - 32px);overflow:auto;overscroll-behavior:contain;
  padding:26px 24px 22px;border-radius:22px;background:var(--paper);box-shadow:0 40px 80px -30px rgba(0,0,0,.5)}
.dlg h2{font-size:24px;line-height:1.2;padding-right:40px}
.dlg-lede{margin-top:8px;font-size:14.5px;color:var(--ink-2)}
/* 16 px: iOS zooms the page into any field set smaller */
.dlg textarea{display:block;width:100%;max-height:46vh;max-height:46svh;margin-top:14px;padding:10px 12px;border:1px solid rgba(32,36,28,.28);border-radius:12px;background:#FBF9F4;color:var(--ink);
  font:16px/1.45 var(--sans);resize:none}
.dlg-acts{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
/* phones: "Sao chép & mở Instagram" first, both buttons full width when they wrap */
#dm:not(.pc) .dlg-acts .btn{flex:1 1 220px}
#dm:not(.pc) [data-dm-go]{order:-1}
.dlg-more{margin-top:10px;font-size:14px}
.dlg-more .link{min-height:40px;color:var(--ink-2)}
.dlg-status{min-height:1.5em;margin-top:8px;font-size:13.5px;color:var(--ink-2)}
.dlg-cap{margin-top:10px;font-size:14px;color:var(--ink-2)}
.pc-note,.pc-only{display:none}
.dlg.pc .pc-note{display:block;margin-top:12px;font-size:14px;color:var(--ink-2)}
.dlg.pc .pc-only{display:block}
.x{position:absolute;top:10px;right:10px;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;border:1px solid var(--rule);background:rgba(241,237,227,.92);cursor:pointer}
.x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
.photos{display:grid;gap:8px;margin-top:14px}
.photos img{width:100%;height:auto;border-radius:14px;background:var(--paper-2)}
.photos img.near{background:#ECE6DA;max-height:62vh;max-height:62svh;object-fit:contain}
.busy{margin-top:18px;font-size:14px;color:var(--ink-2)}
.share-img{width:100%;height:auto;max-height:58vh;max-height:58svh;object-fit:contain;margin-top:14px;border-radius:10px}
@media (max-width:700px){
  .dlg{margin:auto 0 0;width:100%}
  .dlg-in{width:100%;max-height:92vh;max-height:92svh;border-radius:20px 20px 0 0;padding:22px 18px calc(18px + env(safe-area-inset-bottom))}
  .dlg h2{font-size:21px}
}
@media (prefers-reduced-motion:no-preference){
  .dlg[open] .dlg-in{animation:dlg-in .3s var(--ease) both}
  .dlg[open]::backdrop{animation:fade-in .24s ease both}
}
@media (max-width:700px) and (prefers-reduced-motion:no-preference){.dlg[open] .dlg-in{animation-name:sheet-up}}
@keyframes dlg-in{from{opacity:0;transform:scale(.985)}to{opacity:1;transform:none}}
@keyframes sheet-up{from{opacity:.5;transform:translateY(38%)}to{opacity:1;transform:none}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}

/* short phones (iPhone SE class): less above the wall */
@media (max-width:599px) and (max-height:700px){
  .intro-m{padding-top:8px}
  .intro h1{font-size:min(26px,7.2vw)}
  .stat{padding-top:6px;padding-bottom:8px}
  .mag-row{margin-top:4px}
}
/* the smallest phones (320 x 568): the wall first; the line under the title goes (the tabs
   and the DM message say the same) */
@media (max-width:599px) and (max-height:600px){.intro-m .intro-sub{display:none}}

/* ------------------------------------------------------------ landscape phones: the wall first */
@media (max-height:500px) and (orientation:landscape) and (max-width:1199px){
  .intro-m{display:none}
  .stat{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding-top:6px;padding-bottom:6px}
  .stat-row,.mag-row{display:contents}
  .count{order:1}
  .mag{order:2;min-height:36px}
  .tools{order:3;margin-left:auto}
  /* the picker: this screen has room for the wall or the list, not both. The sheet takes the
     height under the header (app.js: it does not give way to the aimed slot), with less
     chrome above the list, so 3 rows or more show */
  .picker,.picker.aimed{max-height:calc(100vh - var(--head-h,56px) - 8px);max-height:calc(100svh - var(--head-h,56px) - 8px)}
  .picker-head{padding-top:8px;padding-bottom:0}
  .picker-head .done{min-height:36px}
  .tabs{padding-top:2px;padding-bottom:2px}
  .tabs [role="tab"]{min-height:36px}
  .find{margin-bottom:6px}
  .find input{height:36px}
  .row{min-height:52px}
  .list .sub{padding-top:6px}
}

/* ------------------------------------------------------------ wider screens */
@media (min-width:600px){
  .stage{margin:0 24px;border-radius:18px;height:auto;aspect-ratio:639.5/537.3}
  .panel{padding:22px 24px 0;max-width:720px}
}
/* the desktop: the wall on the left, the panel sticky on the right, its list the one scroller */
@media (min-width:1200px){
  html{scroll-padding-bottom:0}            /* no sticky bar at the bottom here */
  .wall-main{display:grid;grid-template-columns:minmax(0,1fr) 400px;grid-template-rows:auto 1fr auto;gap:0 32px;max-width:1680px;margin:0 auto;padding:0 24px 24px}
  .wallcol{grid-column:1;grid-row:1}
  .intro-m{display:none}
  .intro-d{display:block}
  .intro-d h1{font-size:34px}
  .intro-d .intro-sub{margin-top:6px;font-size:14.5px}
  /* one line: count · magnet chip ...... tools (wraps on a narrow window) */
  .stat{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:14px 0 12px}
  .stat-row,.mag-row{display:contents}
  .count{order:1;font-size:17px}
  .mag{order:2}
  .tools{order:3;margin-left:auto}
  .stage{margin:0;border-radius:18px;aspect-ratio:1.5}
  /* room for the one-line selection bar, so selecting never scrolls the wall */
  .under{padding:12px 0 0;min-height:66px}
  .selbar{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 16px;padding:8px 8px 8px 16px}
  .sel-name{font-size:16px}
  .sel-meta{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sel-note{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sel-input{height:32px}
  body.has-sel .toast{bottom:calc(var(--sel-h,0px) + 44px)}
  .panel{grid-column:2;grid-row:1 / span 2;position:sticky;top:calc(var(--head-h) + 16px);align-self:start;margin-top:16px;
    display:flex;flex-direction:column;max-height:calc(100vh - var(--head-h) - 40px - var(--fine-h,32px));max-height:calc(100svh - var(--head-h) - 40px - var(--fine-h,32px));overflow:hidden auto;overscroll-behavior:contain;
    padding:4px 6px 0 2px;scrollbar-width:thin}
  .panel>*{flex:none}
  .intro-d{order:1}
  .add{display:none}
  /* the wall itself shows every piece; "Bỏ hết" is the trash tool above it */
  .tray{display:none}
  .picker{order:2;position:static;flex:1 1 auto;min-height:170px;transform:none;visibility:visible;max-height:none;margin-top:14px;border-radius:0;background:none;box-shadow:none;padding:0;transition:none}
  .picker-head{padding:0 0 2px;touch-action:auto}
  .picker-head .grip,.picker-head .done{display:none}
  .picker.dragging{transform:none;opacity:.6}
  .picker-head h2{font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:var(--ink-2)}
  .picker-head{display:none}
  .tabs{padding:0 0 6px;margin-left:-4px}
  .find{margin:0 0 8px}
  .y-bar{margin:0 0 4px}
  .list{min-height:0;overflow-y:auto;padding:0;margin:0 -8px;scrollbar-width:thin}
  .list-foot{padding:10px 8px 6px}
  /* the fine print runs under the wall AND the panel, the last line of the page */
  .fine{grid-column:1 / -1;grid-row:3;max-width:none;padding:14px 0 0}
  /* a short laptop: the list keeps its room */
  @media (max-height:820px){
    .intro-d h1{font-size:28px}
    .intro-d .intro-sub{margin-top:4px;font-size:14px}
  }
  .mbar{display:none}
  .toast{bottom:28px;left:calc(50% - 216px)}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:1ms !important;animation-duration:1ms !important;scroll-behavior:auto !important}
}
.qa *,.qa *::before,.qa *::after{transition:none !important}
