/* ==========================================================================
   Xearch — app dashboard (built on css/tokens.css)
   Quieter than the landing: the whole app is ink. The only colour is the
   ▲ / ▼ arrow glyph (rise red · fall blue, Korean convention). Emphasis comes
   from weight and inversion, never from hue.
   ========================================================================== */
.arw { font-size: .86em; margin-right: 1px; }
.arw.up { color: var(--rise); }
.arw.down { color: var(--fall); }

body.app { font-size: 15px; line-height: 1.5; min-height: 100vh; min-height: 100svh; }
.app h1, .app h2, .app h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--text); color: var(--bg); transition: top 200ms; }
.skip:focus { top: 12px; }

/* ---------- Shell ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: var(--bg);
}
.app-logo { display: block; width: 100px; height: 40px; overflow: hidden; position: relative; margin: 0 6px 14px; flex: none; }
.app-logo img { position: absolute; width: 140px; max-width: none; height: auto; left: -18px; top: -21px; mix-blend-mode: screen; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav button, .side-foot button, .side-foot a {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-size: 14.5px; font-weight: 560; text-align: left;
  transition: color 160ms, background-color 160ms;
}
.side-nav a:hover, .side-nav button:hover, .side-foot button:hover, .side-foot a:hover { color: var(--text); background: rgb(var(--ink) / .05); }
.side-nav [aria-current="page"], .side-foot [aria-current="page"] { color: var(--text); background: rgb(var(--ink) / .08); }
.side-nav svg, .side-foot svg, .tabbar svg, .side-foot a svg { width: 18px; height: 18px; flex: none; }
.side-nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--text); background: rgb(var(--ink) / .1); }
.side-label { font-size: 11px; letter-spacing: .18em; color: var(--dim); margin: 16px 12px 6px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; }

.shell { margin-left: 232px; min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgb(var(--paper) / .72);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.top .app-logo { display: none; margin: 0; }
.search-trigger {
  flex: 1; max-width: 460px; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  border-radius: 999px; color: var(--dim); font-size: 14px; background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 160ms, box-shadow 160ms;
}
.search-trigger:hover { background: rgb(var(--ink) / .08); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger kbd { margin-left: auto; font: 11px var(--mono); padding: 3px 8px; border-radius: 6px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- The store you're looking at (an owner has 1–5) ---------- */
.store-switch { position: relative; min-width: 0; flex: 0 1 auto; }
.store-name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.store-switch > .store-name { display: block; padding: 0 4px; }
.store-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 100%; padding: 0 12px 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 160ms, transform 120ms; }
.store-btn:hover { background: rgb(var(--ink) / .06); }
.store-btn:active { transform: scale(.97); }
.store-btn svg { width: 12px; height: 12px; color: var(--muted); flex: none; transition: transform 220ms var(--ease-out); }
.store-switch.open .store-btn svg { transform: rotate(180deg); }
.store-count { font: 600 11px var(--mono); color: var(--muted); padding: 1px 6px; border-radius: 999px; background: rgb(var(--ink) / .08); flex: none; }
.store-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: min(280px, calc(100vw - 32px));
  list-style: none; margin: 0; padding: 6px; border-radius: 16px;
  /* opaque: a menu over a live graph must stay readable */
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 60px -20px var(--shadow);
  transform-origin: top left; opacity: 0; transform: scale(.96) translateY(-4px); visibility: hidden;
  transition: opacity 160ms, transform 220ms var(--ease-out), visibility 0s linear 220ms;
}
.store-switch.open .store-menu { opacity: 1; transform: none; visibility: visible; transition: opacity 160ms, transform 220ms var(--ease-out), visibility 0s; }
.store-menu [role="option"] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 8px; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; outline: none; }
.store-menu [role="option"]:hover, .store-menu [role="option"]:focus-visible { background: rgb(var(--ink) / .07); }
.store-menu [aria-selected="true"] { background: rgb(var(--ink) / .1); }
.store-menu .grade { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.sm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-rank { font-size: 12.5px; color: var(--muted); }
.sm-add { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.sm-add button { width: 100%; display: flex; justify-content: space-between; padding: 10px; border-radius: 10px; font-size: 13.5px; color: var(--muted); }
.sm-add button:hover { color: var(--text); background: rgb(var(--ink) / .06); }
.sm-add span { font: 12px var(--mono); }
.store-menu [aria-disabled="true"] { color: var(--dim); }
.store-menu [aria-disabled="true"] .sm-ini { opacity: .5; }
.sm-ini { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--muted); background: rgb(var(--ink) / .08); }
.store-sk { display: block; width: 140px; height: 20px; border-radius: 8px; background: rgb(var(--ink) / .08); }
.pl-dot { width: 7px; height: 7px; border-radius: 50%; }
.pl-dot.warn { background: rgb(var(--ink) / .5); }
.pl-dot.crit { background: var(--text); box-shadow: 0 0 0 3px rgb(var(--ink) / .15); }

/* Screens that never scroll as a page (monitoring): the shell is exactly the screen, an inner list scrolls. */
body.app-fixed { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
body.app-fixed .shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body.app-fixed .top { flex: none; }
body.app-fixed .main { flex: 1 1 auto; min-height: 0; }
.collect { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px 0 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
.collect b { color: var(--text); font-weight: 620; }
.collect svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.collect .ring-bg { fill: none; stroke: rgb(var(--ink) / .12); stroke-width: 3; }
.collect .ring-fg { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease-out); }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: color 160ms, background-color 160ms, transform 120ms;
}
.icon-btn:hover { color: var(--text); background: rgb(var(--ink) / .06); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.top .theme-toggle { width: 38px; height: 38px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--bg); background: var(--text); flex: none; }

.main { max-width: 1440px; padding: 28px 28px 96px; margin: 0 auto; }

/* ---------- Headline ---------- */
.hello { margin: 4px 0 24px; }
.eyebrow { font-size: 13px; color: var(--dim); margin: 0 0 8px; }
.hello h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; }
.brief { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.hello-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hello-actions .btn, .app main .d-actions .btn-sm, .state-box .btn-sm { height: 44px; }

/* ---------- Stat strip: four numbers, each a filter ---------- */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px; gap: 4px; margin-bottom: 16px; }
.stat {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; text-align: left;
  transition: background-color 160ms, transform 120ms;
}
.stat:hover, .stat[aria-pressed="true"] { background: rgb(var(--ink) / .07); }
.stat:active { transform: scale(.97); }
.stat[data-filter="all"][aria-pressed="true"]:not(:hover) { background: none; } /* the default state needs no highlight */
.stat-n { font: 650 30px/1.15 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13px; color: var(--muted); }

/* ---------- Switch ---------- */
.sw { width: 40px; height: 24px; border-radius: 12px; background: rgb(var(--ink) / .16); position: relative; transition: background-color 200ms; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform 260ms var(--ease-ios); }
.sw[aria-checked="true"] { background: var(--text); }
.sw[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- Settings rows ---------- */
.prefs { display: grid; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.pref:first-child { border-top: 0; }

/* ---------- Grid & panels ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; }
.panel-head .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.count-pill { font: 600 13px var(--mono); color: var(--muted); padding: 2px 8px; border-radius: 999px; background: rgb(var(--ink) / .08); }
.count-pill:empty { display: none; }
.meta-dim { font-size: 13px; color: var(--dim); }
.link-btn { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color 140ms; }
.link-btn:hover { color: var(--text); }
.link-btn.end { margin-left: auto; }
.text-btn { min-height: 44px; font-size: 13px; color: var(--muted); padding: 4px 12px; border-radius: 8px; transition: color 160ms, background-color 160ms; }
.text-btn:hover { color: var(--text); background: rgb(var(--ink) / .06); }
.more { display: flex; justify-content: center; padding-top: 8px; }
.more [hidden] { display: none; }
.panel.flash { animation: panelFlash 1200ms var(--ease-out); }
@keyframes panelFlash { 0% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 4px rgb(var(--ink) / .18); } 100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 rgb(var(--ink) / 0); } }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 14px; list-style: none; }
.empty b { color: var(--text); font-weight: 600; }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-weight: 650; white-space: nowrap; color: var(--muted); background: rgb(var(--ink) / .07); flex: none; }
.tag.strong { color: var(--bg); background: var(--text); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgb(var(--ink) / .06); }
.seg button { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: color 160ms, background-color 160ms; }
.seg button[aria-selected="true"] { color: var(--text); background: rgb(var(--ink) / .12); }

/* ---------- To-do ---------- */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; border-top: 1px solid var(--line); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.todo li:first-child { border-top: 0; }
.todo li.leaving { opacity: 0; transform: translateX(12px); }
.check {
  position: relative; width: 44px; height: 44px; margin: 0 -11px; border-radius: 50%; display: grid; place-items: center; color: transparent;
  transition: color 160ms, transform 120ms;
}
/* a 22px ring inside a 44px target */
.check::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow 160ms; }
.check:hover { color: var(--muted); }
.check:hover::before { box-shadow: inset 0 0 0 1.5px var(--text); }
.check:active { transform: scale(.88); }
.check svg { position: relative; width: 12px; height: 12px; }
.todo-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 13px 4px; text-align: left; border-radius: 10px; transition: background-color 140ms; }
.todo-row:hover { background: rgb(var(--ink) / .04); }
.todo-title { font-size: 14.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { margin-left: auto; color: var(--dim); font-size: 18px; line-height: 1; }

/* ---------- Keyword ranks (dashboard) ---------- */
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.filters button { height: 44px; padding: 0 13px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: color 140ms, background-color 140ms; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { color: var(--bg); background: var(--text); }
.grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font: 700 13px var(--mono); }
.grade.g-S { color: var(--bg); background: var(--text); }
.grade.g-A { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.grade.g-B { color: var(--text); background: rgb(var(--ink) / .12); }
.grade.g-C { color: var(--muted); background: rgb(var(--ink) / .07); }
.grade.g-D { color: var(--dim); box-shadow: inset 0 0 0 1px var(--line-2); }

.kgroup { margin: 14px 0 4px; font-size: 13px; font-weight: 650; color: var(--muted); }
.kgroup:first-child { margin-top: 2px; }
.kgrid { list-style: none; margin: 0; padding: 0; }
.krow {
  width: calc(100% + 16px); margin: 0 -8px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(52px, auto) 44px; gap: 12px; align-items: center; min-height: 48px;
  padding: 11px 8px; border-radius: 10px; text-align: left; border-top: 1px solid var(--line); transition: background-color 120ms;
}
.kgrid li:first-child .krow { border-top-color: transparent; }
.krow:hover { background: rgb(var(--ink) / .045); }
.kr-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kr-rank { font-size: 14px; font-weight: 600; text-align: right; }
.kr-d { font-size: 13px; font-weight: 600; text-align: right; color: var(--muted); }
.krow .spark { width: 72px; height: 22px; display: block; }
.spark path { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .sp-dot { fill: var(--text); }
.spark .sp-fl { fill: none; stroke: var(--dim); stroke-width: 1; }
.spark .sp-base { stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
.kr-at { font-size: 13px; font-weight: 450; color: var(--dim); }
.krow.locked { color: var(--dim); grid-template-columns: minmax(0, 1fr) minmax(52px, auto) 44px; }
.krow.locked .kr-rank { font-size: 13px; font-weight: 600; color: var(--dim); }
.kgroup span { font-weight: 450; color: var(--dim); margin-left: 6px; }
.rv-nums.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.chk { display: grid; gap: 8px; }
.chk-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.chk-head b { font-size: 16px; color: var(--text); }
.chk .fine { margin: 0; font-size: 13px; }
div.stat[aria-disabled="true"] .stat-n { color: var(--dim); }
.empty .muted { margin: 6px 0 14px; }
.d-empty { display: grid; gap: 6px; padding: 28px 18px; border-radius: 14px; text-align: center; background: rgb(var(--ink) / .04); }
.d-empty b { font-size: 16px; }
.d-empty span { font-size: 14px; color: var(--muted); }
.dchart .fl { fill: var(--bg); stroke: var(--muted); stroke-width: 1.5; }
.dchart .pre { fill: rgb(var(--ink) / .035); }
.stat-n small { font-size: max(13px, .55em); color: var(--muted); margin-left: 2px; }
div.stat { cursor: default; }
div.stat:hover { background: none; }

/* ---------- Small add button (competitors, google) ---------- */
.add-btn { font-size: 12.5px; font-weight: 650; padding: 5px 12px; border-radius: 999px; color: var(--bg); background: var(--text); transition: transform 120ms; white-space: nowrap; }
.add-btn:active { transform: scale(.94); }
.add-btn[aria-pressed="true"] { color: var(--muted); background: rgb(var(--ink) / .1); }

/* plan usage lives quietly in the sidebar */
.plan-mini { display: grid !important; gap: 8px; height: auto !important; padding: 12px !important; margin-bottom: 6px; border-radius: 12px !important; box-shadow: inset 0 0 0 1px var(--line); }
.plan-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.plan-top b { font-size: 12.5px; color: var(--text); }
.use-track { display: block; height: 4px; border-radius: 4px; background: rgb(var(--ink) / .1); overflow: hidden; }
.use-track i { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width 900ms var(--ease-out); }

/* ---------- Drawer (keyword detail) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease-out); }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(560px, 100vw);
  display: flex; flex-direction: column; background: var(--bg); box-shadow: -1px 0 0 var(--line), -30px 0 80px -30px var(--shadow);
  transform: translateX(104%); visibility: hidden;
  transition: transform 460ms var(--ease-ios), visibility 0s linear 460ms;
}
.drawer.on { transform: none; visibility: visible; transition: transform 460ms var(--ease-ios), visibility 0s; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.drawer-head .icon-btn { margin-left: auto; flex: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; display: grid; gap: 18px; align-content: start; overscroll-behavior: contain; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.stats div { background: var(--bg); padding: 12px 14px; display: grid; gap: 4px; }
.stats span { font-size: 11.5px; color: var(--dim); }
.stats b { font: 650 20px var(--mono); letter-spacing: -0.02em; }
.dchart { width: 100%; height: auto; display: block; overflow: visible; }
.dchart .gl { stroke: rgb(var(--ink) / .07); }
.dchart .lb { fill: var(--dim); font: 13px var(--mono); }
.dchart .ln { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.dchart .ar { fill: rgb(var(--ink) / .06); }
.dchart .pt { fill: var(--text); }
.dchart .hv { stroke: rgb(var(--ink) / .25); stroke-dasharray: 3 3; }
.dchart .tip rect { fill: var(--text); }
.dchart .tip text { fill: var(--bg); font: 600 11px var(--mono); }
.sub-h { font-size: 13.5px; font-weight: 650; margin: 0 0 10px; display: flex; justify-content: space-between; gap: 8px; }
.sub-h span { font-weight: 500; color: var(--dim); font-size: 12px; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 14px; font-size: 14px;
  color: var(--bg); background: var(--text); box-shadow: 0 20px 50px -16px var(--shadow);
  animation: toastIn 320ms var(--ease-out);
}
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 200ms, transform 200ms; }
.toast button { font-weight: 700; padding: 6px 10px; border-radius: 8px; color: var(--bg); background: rgb(var(--paper) / .14); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- "전체" menu sheet (phones) ---------- */
.menu-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 75;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
  background: var(--bg); box-shadow: 0 -1px 0 var(--line), 0 -30px 80px -30px var(--shadow);
  transform: translateY(104%); visibility: hidden;
  transition: transform 420ms var(--ease-ios), visibility 0s linear 420ms;
}
.menu-sheet.on { transform: none; visibility: visible; transition: transform 420ms var(--ease-ios), visibility 0s; }
.grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgb(var(--ink) / .2); margin: 0 auto 14px; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.menu-grid a, .menu-grid button {
  position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 2px; border-radius: 16px;
  font-size: 12.5px; color: var(--text); text-align: center; transition: background-color 140ms;
}
.menu-grid a:active, .menu-grid button:active { background: rgb(var(--ink) / .08); }
.menu-grid [aria-current="page"] { background: rgb(var(--ink) / .08); }
.menu-grid svg { width: 24px; height: 24px; }
.menu-grid .count { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font: 600 10.5px var(--mono); color: var(--bg); background: var(--text); }
.menu-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-foot button, .menu-foot a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; font-size: 13.5px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.menu-foot svg { width: 18px; height: 18px; }
@media (min-width: 961px) { .menu-sheet, #menuScrim { display: none; } }

/* ---------- Tab bar (phones) ---------- */
.tabbar { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .col-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .side { display: none; }
  .shell { margin-left: 0; }
  .top { padding: 0 16px; }
  /* img 100px wide (1536→100): ink x 240–1274 fills the 68px box; the box is centred on the wordmark's
     visual centre (source y≈549 — "earch", not the X's raised stroke), so it lines up with the store name */
  .top .app-logo { display: block; width: 68px; height: 42px; }
  .top .app-logo img { width: 100px; left: -15.6px; top: -14.7px; }
  .search-trigger { max-width: none; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgb(var(--paper) / .8); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--dim); position: relative; }
  .tabbar [aria-current="page"] { color: var(--text); }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; font: 600 10px/16px var(--mono); color: var(--bg); background: var(--text); }
}
@media (max-width: 720px) {
  .top { gap: 8px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; }
  .collect { padding: 0; width: 38px; justify-content: center; }
  .collect > span { display: none; }
  .store-count { display: none; }
  .store-switch { flex: 1 1 auto; }
  /* a title with a chevron, not a pill: the store name gets the room */
  .store-btn { gap: 4px; padding: 0 4px; box-shadow: none; }
  .store-btn .store-name { font-size: 14px; }
  .top-right { gap: 6px; }
  /* full-width under the top bar so it never spills past the screen edge */
  .store-menu { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; transform-origin: top center; }
  .avatar { display: none; }
  .hello { margin-bottom: 18px; }
  .strip { padding: 4px; gap: 2px; }
  .stat { padding: 12px 10px; }
  .stat-n { font-size: 22px; }
  .stat-l { font-size: 13px; }
  .col-side { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .panel-head .end.filters { margin-left: 0; width: 100%; }
  .krow { grid-template-columns: minmax(0, 1fr) minmax(52px, auto) 44px; }
  .krow .spark { display: none; }
  .drawer { top: auto; left: 0; width: 100%; height: min(88svh, 760px); border-radius: 22px 22px 0 0; transform: translateY(104%); box-shadow: 0 -1px 0 var(--line), 0 -30px 80px -30px var(--shadow); }
  .drawer.on { transform: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); }
}

/* ---------- Light theme logo (the wordmark ships white-on-black) ---------- */
:root[data-theme="light"] .app-logo img { filter: invert(1) contrast(1.25); mix-blend-mode: multiply; }
/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .tabbar, .palette { background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* an alert count with nothing to count is not a badge */
/* premium ribbon: blue, cut by the item's top-right corner */
.has-prem { position: relative; overflow: hidden; }
.prem {
  position: absolute; top: 9px; right: -27px; width: 92px; padding: 2px 0; text-align: center; pointer-events: none;
  font: 800 9px/1.3 var(--font); letter-spacing: .04em; color: #fff; background: rgb(var(--accent-rgb));
  transform: rotate(45deg); box-shadow: 0 2px 8px -2px rgb(var(--accent-rgb) / .6);
}
.menu-grid .prem { top: 12px; right: -24px; width: 88px; }
.prem-tag { display: inline-block; margin-left: 8px; padding: 4px 9px; border-radius: 7px; vertical-align: 6px; font: 800 11.5px/1.2 var(--font); color: #fff; background: rgb(var(--accent-rgb)); transform: rotate(-8deg); }
.side-nav .count:empty, .menu-grid .count:empty, .tabbar .count:empty { display: none; }

/* ---------- Account shortcuts ---------- */
a.avatar { transition: transform 120ms, box-shadow 160ms; }
a.avatar:hover { box-shadow: 0 0 0 3px rgb(var(--ink) / .18); }
a.avatar:active { transform: scale(.94); }
.icon-btn .badge[hidden] { display: none; }
.menu-me { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line); }
.menu-me .avatar { display: grid; width: 38px; height: 38px; font-size: 15px; }
.menu-me > span:nth-child(2) { display: grid; gap: 1px; flex: 1; min-width: 0; }
.menu-me b { font-size: 15px; }
.menu-me small { font-size: 12px; color: var(--dim); }
.menu-me svg { width: 14px; height: 14px; color: var(--dim); }
.menu-foot { flex-wrap: wrap; }
.menu-foot a, .menu-foot button { flex: 1 1 calc(50% - 4px); }

/* ---------- Notifications: bell popover + the shared row ---------- */
.npop {
  position: fixed; z-index: 65; width: min(400px, calc(100vw - 32px)); max-height: min(560px, calc(100svh - 96px));
  display: flex; flex-direction: column; border-radius: 18px; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px -24px var(--shadow);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; visibility: hidden; pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s linear 260ms;
}
.npop.on { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 180ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s; }
.np-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.np-head > b { font-size: 16px; }
.np-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--bg); background: var(--text); }
.np-head .link-btn { margin-left: auto; }
.np-head .link-btn:disabled { opacity: .35; pointer-events: none; }
.np-set { width: 34px; height: 34px; }
.np-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.np-empty { padding: 36px 12px; text-align: center; font-size: 13.5px; color: var(--dim); }
.np-all { display: block; padding: 13px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); }
.np-all:hover { color: var(--text); }
.nt { position: relative; list-style: none; }
.nt-link { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 11px 26px 11px 10px; border-radius: 12px; transition: background-color 140ms; }
.nt-link:hover { background: rgb(var(--ink) / .05); }
.nt-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--muted); background: rgb(var(--ink) / .07); }
.nt-ic svg { width: 18px; height: 18px; }
.nt-txt { display: grid; gap: 2px; min-width: 0; }
.nt-txt b { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.nt-txt span { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.nt-txt small { margin-top: 2px; font-size: 11.5px; color: var(--dim); }
.nt.unread .nt-txt b { color: var(--text); }
.nt.unread .nt-ic { color: var(--text); background: rgb(var(--ink) / .12); }
.nt.unread::after { content: ""; position: absolute; top: 18px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--accent-rgb)); }
@media (max-width: 720px) {
  .npop { left: 16px; right: 16px !important; width: auto; transform-origin: top center; }
}

/* ---------- Shared form + sheet primitives (forms, upgrade prompt, 매장 추가) ---------- */
.fine { margin: 10px 2px 16px; font-size: 12.5px; line-height: 1.6; color: var(--dim); }
.fine a, .muted a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.muted { color: var(--muted); font-size: 13.5px; margin: 0; }
.btn-danger { color: #fff; background: #d93a3a; }
.btn-danger:hover { background: #c42f2f; }
.btn:disabled { opacity: .4; pointer-events: none; }
/* forms */
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.stack .field { margin-bottom: 0; }
.f-l { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 600; }
.f-l small { font-size: 12px; font-weight: 450; color: var(--dim); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inp, .sel { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; font: inherit; font-size: 15px; color: var(--text); background: rgb(var(--ink) / .05); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 140ms; }
.sel { width: auto; min-height: 38px; padding: 7px 34px 7px 12px; font-size: 13.5px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field .sel { width: 100%; min-height: 46px; font-size: 15px; }
.inp:focus, .sel:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--text); }
textarea.inp { resize: vertical; line-height: 1.55; }
.inp::placeholder { color: var(--dim); }
.inline { display: flex; gap: 8px; }
.inline .btn { flex: none; height: 46px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: color 140ms, background-color 140ms; }
.chip input:checked + span { color: var(--bg); background: var(--text); box-shadow: none; font-weight: 650; }
.chip input:focus-visible + span, .radio input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.files:empty { display: none; }
.file { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 9px; font-size: 12.5px; background: rgb(var(--ink) / .07); max-width: 220px; }
.file button { width: 24px; height: 24px; border-radius: 6px; color: var(--muted); }
.file-btn { position: relative; justify-self: start; display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--text); }
.f-err { margin: 0; min-height: 1px; font-size: 13px; color: #e5534b; }
.f-err:empty { display: none; }
.f-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.inq-form .f-err { margin: 12px 0 0; }

.ok-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.ok-list li { position: relative; padding-left: 20px; }
.ok-list li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 5px; border-left: 1.7px solid var(--text); border-bottom: 1.7px solid var(--text); transform: rotate(-45deg); }
/* 이전 플랫폼 매장 잇기 (js/plrank.js): onboarding and the sheet */
.plr { display: grid; gap: 16px; }
.plr-sum { margin: 0; display: grid; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.plr-sum div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.plr-sum div:first-child { border-top: 0; }
.plr-sum dt { flex: none; color: var(--dim); }
.plr-sum dd { margin: 0; min-width: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.plr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plr-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); }
label.plr-item { cursor: pointer; }
.plr-item input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--text); }
.plr-item input:disabled + span { opacity: .45; }
.plr-item span { display: grid; gap: 2px; min-width: 0; }
.plr-item b { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.plr-item small, .plr-more { font-size: 13px; color: var(--dim); }
.plr-more { padding: 0 14px; }
#onbForm .plr .d-actions .btn { flex: 1 1 0; }
.ups { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ups > i { font-style: normal; color: var(--dim); }
.ups-col { display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line); }
.ups-col.on { background: rgb(var(--ink) / .1); box-shadow: inset 0 0 0 1.5px var(--text); }
.ups-col span { font-size: 13px; color: var(--dim); }
.ups-col b { font-size: 17px; }
.ups-price { margin: 0; font-size: 14px; color: var(--muted); }
.ups-price s, .price s { color: var(--dim); margin-right: 4px; }
.ups-price b { font-size: 22px; color: var(--text); letter-spacing: -0.02em; }
.how-to { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.found { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px var(--line-2); }
.found > div { display: grid; gap: 2px; }
.found b { font-size: 16px; }
.found small { font-size: 12.5px; color: var(--dim); }
.sm-av { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; font-weight: 800; color: var(--bg); background: var(--text); }

/* ---------- System banners ---------- */
/* 구독 없음 화면(app-core renderGate): 추적 화면 대신 이 카드만 보인다 */
body[data-gated] .main > :not(.sub-gate) { display: none !important; }
.sub-gate { max-width: 640px; margin: 8px auto 0; padding: 32px 28px 24px; display: grid; gap: 14px; }
.sub-gate h1 { margin: 0; font-size: clamp(22px, 3.2vw, 28px); line-height: 1.2; letter-spacing: -0.02em; }
.sub-gate .eyebrow { margin: 0; }
.gate-lead { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.gate-plans { display: grid; gap: 8px; margin-top: 6px; }
.gate-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name price go" "lim price go"; align-items: center; column-gap: 12px; row-gap: 2px; min-height: 64px; padding: 14px 16px; border-radius: 16px; color: var(--text); text-decoration: none; background: rgb(var(--ink) / .04); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 140ms, transform 100ms ease-out; }
.gate-plan:hover { background: rgb(var(--ink) / .08); }
.gate-plan:active { transform: scale(.99); }
.gate-plan.on { background: rgb(var(--ink) / .09); box-shadow: inset 0 0 0 1.5px var(--text); }
.gp-name { grid-area: name; display: flex; align-items: baseline; gap: 8px; }
.gp-name b { font-size: 17px; }
.gp-name small { font-size: 12px; color: var(--muted); }
.gp-lim { grid-area: lim; font-size: 12.5px; color: var(--muted); }
.gp-price { grid-area: price; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.gp-price b { font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.gp-price s { color: var(--dim); margin-right: 4px; }
.gp-go { grid-area: go; font-size: 22px; color: var(--dim); }
.sub-gate .fine { margin: 0; }
.sub-gate .fine a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) {
  .sub-gate { padding: 24px 18px 20px; }
  .gate-plan { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name go" "lim go" "price go"; }
  .gp-price { text-align: left; margin-top: 4px; }
}
.sys-banners { display: grid; gap: 8px; margin-bottom: 18px; }
.sys-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 16px; border-radius: 14px; font-size: 13.5px; color: var(--muted); background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line-2); }
.sys-banner > span:first-child { flex: 1 1 240px; }
.sys-banner b { color: var(--text); }
.sys-banner .btn-sm { height: 44px; }
.drawer .fine { font-size: 13px; }
.sys-banner.strong { color: var(--text); background: rgb(var(--ink) / .1); box-shadow: inset 0 0 0 1.5px var(--text); font-weight: 600; }
.sb-act { display: flex; align-items: center; gap: 6px; }
.sb-act .icon-btn { width: 44px; height: 44px; box-shadow: none; }

/* ---------- Loading skeleton / error ---------- */
main.is-loading > :not(.state-box):not(.sys-banners), main.is-error > :not(.state-box):not(.sys-banners) { display: none !important; }
.state-box { display: grid; gap: 14px; }
.sk, .skt { border-radius: 14px; background: linear-gradient(90deg, rgb(var(--ink) / .06) 0%, rgb(var(--ink) / .12) 50%, rgb(var(--ink) / .06) 100%) 0 0 / 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
/* a screen's own markup with grey data spots (Xearch.skeleton): its cards lay out exactly where the loaded ones will */
.sk-page, .state-box:has(> .sk-page) { display: contents; }
/* a real control or chip greyed out in place: same box, no text or ring */
.skb { color: transparent !important; box-shadow: none !important; border-color: transparent !important; background: linear-gradient(90deg, rgb(var(--ink) / .06) 0%, rgb(var(--ink) / .12) 50%, rgb(var(--ink) / .06) 100%) 0 0 / 200% 100% !important; animation: sk 1.4s linear infinite; }
.skb * { visibility: hidden; }
/* one line of the surrounding text: the bar plus its margins is exactly 1lh, inline or as a flex/grid item */
.skt { display: inline-block; flex: none; width: var(--w, 6em); max-width: 100%; height: .72em; margin-block: calc((1lh - .72em) / 2); vertical-align: top; border-radius: .3em; }
@media (prefers-reduced-motion: reduce) { .sk, .skt, .skb { animation: none; } }
.sk-title { width: 180px; height: 34px; }
.sk-line { width: min(420px, 80%); height: 16px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sk-card { height: 96px; }
.sk-chart { height: 260px; }
.err-card { display: grid; gap: 8px; justify-items: start; max-width: 520px; padding: 28px; }
.err-card b { font-size: 18px; }
.err-card span { font-size: 14px; color: var(--muted); }
.err-card small { font-size: 12px; color: var(--dim); }
@media (max-width: 720px) { .ups { grid-template-columns: 1fr; } .ups > i { justify-self: center; transform: rotate(90deg); } .sk-row { grid-template-columns: 1fr 1fr; } }
.field[hidden], .inline[hidden] { display: none; }

/* ---------- 매장 찾기 (js/place-search.js) ---------- */
.ps { position: relative; }
.ps-ic { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--dim); pointer-events: none; }
.ps-ic svg { width: 18px; height: 18px; display: block; }
.ps-in { min-height: 52px; padding-left: 44px; padding-right: 44px; font-size: 16px; }
.ps-in::-webkit-search-cancel-button { display: none; }
.ps-clear { position: absolute; right: 8px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; font-size: 18px; color: var(--muted); }
.ps-clear:hover { background: rgb(var(--ink) / .08); }
.ps-clear[hidden], .ps-pop[hidden] { display: none; }
.ps-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: min(420px, 56svh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 16px; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -20px var(--shadow); }
.ps-ac { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ps-ac::-webkit-scrollbar { display: none; }
.ps-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--muted); background: rgb(var(--ink) / .06); }
.ps-chip::before { content: ""; width: 12px; height: 12px; background: currentColor; opacity: .6; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3Cpath d='m16 16 4 4' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3Cpath d='m16 16 4 4' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ps-chip:hover { color: var(--text); background: rgb(var(--ink) / .1); }
.ps-opt { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; }
.ps-opt.on, .ps-opt:hover { background: rgb(var(--ink) / .07); }
.ps-pin { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-weight: 800; color: var(--muted); background: rgb(var(--ink) / .08); }
.ps-opt.on .ps-pin { color: var(--bg); background: var(--text); }
.ps-t { display: grid; gap: 2px; min-width: 0; }
.ps-t b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-t small { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-r { font-size: 12px; color: var(--dim); white-space: nowrap; }
.ps mark, .ps-chip mark { background: none; color: var(--text); font-weight: 800; }
.ps-empty { margin: 0; padding: 22px 12px; text-align: center; font-size: 14px; color: var(--muted); }
.ps-empty small { color: var(--dim); }
.ps-hint { margin: 8px 2px 0; min-height: 18px; font-size: 12.5px; color: var(--dim); }
.ps-hint.err { color: #e5534b; }
.how { font-size: 13px; color: var(--muted); }
.how summary { cursor: pointer; padding: 6px 2px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how .how-to { margin-top: 6px; }
@media (max-width: 480px) { .ps-r { display: none; } .ps-opt { grid-template-columns: 34px minmax(0, 1fr); } .ps-pin { width: 34px; height: 34px; } }
/* store photos: the first letter sits underneath until the photo loads */
.ps-pin, .sm-av { position: relative; overflow: hidden; }
.ps-pin img, .sm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 240ms var(--ease-out); }
.ps-pin img.on, .sm-av img.on { opacity: 1; }
.ps-more { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 2px; padding: 8px; font-size: 12px; color: var(--dim); }
.ps-deep { width: 100%; min-height: 44px; border-radius: 12px; font-size: 13px; color: var(--muted); }
.ps-deep:hover { color: var(--text); background: rgb(var(--ink) / .07); }
.ps-more i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgb(var(--ink) / .15); border-top-color: var(--muted); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 대표 키워드 change ---------- */
.rc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rc-row { min-height: 52px; padding: 6px 12px; border-radius: 12px; background: rgb(var(--ink) / .04); }
.rc-row span { display: grid; gap: 1px; }
.rc-row b { font-size: 15px; color: var(--text); }
.rc-row small { font-size: 13px; color: var(--dim); }
.rc-count { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 이미지 카드 ---------- */
.share-img { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 18px; box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -24px var(--shadow); }

/* ---------- 둘러보기 가이드 ---------- */
.tour { position: fixed; inset: 0; z-index: 95; }
.tour-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgb(0 0 0 / .66), 0 0 0 2px var(--text); pointer-events: none; will-change: left, top, width, height; }
.tour-card { position: fixed; display: grid; gap: 6px; width: min(340px, calc(100vw - 32px)); padding: 18px; border-radius: 18px; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px -20px var(--shadow); }
.tour-n { font-size: 12px; color: var(--dim); }
.tour-card b { font-size: 17px; letter-spacing: -0.02em; }
.tour-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.tour-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-act > span { display: flex; gap: 6px; }

.pr-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--ink) / .08), rgb(var(--ink) / .35)); }
.pr-bar i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--bg-2); }

/* ---------- Dashboard: 리뷰 ---------- */
.rv-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.rv-nums div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: rgb(var(--ink) / .05); }
.rv-nums b { font-size: 22px; letter-spacing: -0.02em; }
.rv-nums span { font-size: 13px; color: var(--dim); }
