/* ═══════════════════════════════════════════════════════════════════════
   UST21 Design System "Tide" — ds.css  (source: work/ds/ds.src.css → build.py)
   한 가족: 글꼴 하나(Pretendard), 재질 셋(pill · card · bar), 반경 한 줄, 페이지마다 accent 하나.
   켜는 법:  <html data-ds="koos|kop|roms|seaheat|searoute|busantwin|landing">
             <link rel="stylesheet" href="/assets/ds/ds.css">   ← 모든 CSS 맨 뒤
             <script src="/assets/ds/ds.js" defer></script>
   모든 컴포넌트 선택자는 build.py 가 `html[data-ds] body` 를 앞에 붙인다 (skin.css 와 같은 특이도, 뒤에 실려 이긴다).
   명세: notes/DS.md
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 0. 글꼴 (자체 호스팅, 서브셋: KS X 1001 한글 2,350 + 라틴·기호) ───── */
@font-face{
  font-family:"DS Sans"; font-style:normal; font-weight:100 900; font-display:swap;
  src:url("/assets/ds/fonts/pretendard-latin.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+2010-2027,U+2030-203A,U+20A9,U+2103,U+2190-21FF,U+2212;
}
@font-face{
  font-family:"DS Sans"; font-style:normal; font-weight:100 900; font-display:swap;
  src:url("/assets/ds/fonts/pretendard-kr.woff2") format("woff2");
}

/* ── 1. 토큰 ────────────────────────────────────────────────────────── */
html[data-ds]{
  /* 색 — 바탕은 거의 검정에 가까운 남색. 지도가 주인공이라 판은 한 톤만 밝다. */
  --ds-bg:#06080c;
  --ds-surface:rgba(13,16,22,.90);          /* card: 왼쪽 열·범례·판 (흐림 없음 — fps) */
  --ds-surface-2:rgba(18,22,30,.97);        /* popover·메뉴·모달 */
  --ds-pill:rgba(9,11,16,.74);              /* pill: 머리·도구 레일 (작아서 흐림 허용) */
  --ds-bar:rgba(10,13,18,.90);              /* bar: 시간 막대 */
  --ds-ink:#f2f5f9; --ds-ink-2:#aab4c3; --ds-ink-3:#6f7a8a; --ds-ink-4:#3f4855;
  --ds-line:rgba(255,255,255,.08); --ds-line-2:rgba(255,255,255,.14);
  --ds-fill:rgba(255,255,255,.05); --ds-fill-2:rgba(255,255,255,.09); --ds-fill-3:rgba(255,255,255,.14);
  --ds-ok:#3ddc97; --ds-warn:#ffb454; --ds-bad:#ff5c6a; --ds-info:#5baaff;
  /* accent — 페이지마다 하나. data-ds 값으로 정해진다(아래 표). */
  --ds-accent-rgb:91,170,255;
  --ds-accent:rgb(var(--ds-accent-rgb));
  --ds-accent-soft:rgba(var(--ds-accent-rgb),.16);
  --ds-accent-line:rgba(var(--ds-accent-rgb),.5);
  --ds-accent-glow:0 0 0 1px rgba(var(--ds-accent-rgb),.35), 0 0 24px rgba(var(--ds-accent-rgb),.25);
  --ds-on-accent:#06101c;
  /* 그림자·테 */
  --ds-shadow:0 1px 0 rgba(255,255,255,.05) inset, 0 24px 48px -24px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.35);
  --ds-shadow-2:0 1px 0 rgba(255,255,255,.06) inset, 0 32px 64px -24px rgba(0,0,0,.9), 0 4px 12px rgba(0,0,0,.4);
  --ds-edge-line:0 0 0 1px rgba(255,255,255,.06);
  /* 반경 */
  --ds-r-xs:6px; --ds-r-sm:10px; --ds-r-md:14px; --ds-r-lg:18px; --ds-r-pill:999px;
  /* 자리 (넓은 화면) */
  --ds-edge:14px;            /* 화면 가장자리 */
  --ds-gap:8px;              /* 카드 사이 */
  --ds-pad:12px;             /* 카드 안쪽 */
  --ds-pill-h:40px;          /* 머리 알약·도구 단추 높이 */
  --ds-top:64px;             /* 왼쪽 열이 시작하는 y = edge + pill + 10 (랜딩 알약도 같은 자리) */
  --ds-col-w:268px;          /* 왼쪽 열 폭 */
  --ds-rail-w:58px;          /* 오른쪽 도구 레일 폭 (아이콘 + 밑 이름표) */
  --ds-panel-w:300px;        /* 레일 옆에 열리는 판 폭 */
  --ds-bar-h:64px;           /* 시간 막대 높이 */
  --ds-legend-h:64px;        /* 범례 높이 */
  --ds-above-bar:calc(var(--ds-edge) + var(--ds-bar-h) + 10px);   /* 막대 위에 놓이는 것의 bottom */
  --ds-col-bottom:calc(var(--ds-above-bar) + var(--ds-legend-h) + var(--ds-gap));
  --ds-sat:env(safe-area-inset-top,0px); --ds-sab:env(safe-area-inset-bottom,0px);
  --ds-sal:env(safe-area-inset-left,0px); --ds-sar:env(safe-area-inset-right,0px);
  /* 글 */
  --ds-font:"DS Sans","Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --ds-fs-xs:11px; --ds-fs-sm:12px; --ds-fs-md:13px; --ds-fs-lg:15px; --ds-fs-xl:20px; --ds-fs-2xl:28px;
  /* 움직임 */
  --ds-ease:cubic-bezier(.2,.7,.2,1); --ds-dur:160ms; --ds-dur-2:320ms;
  /* z */
  --ds-z-ui:20; --ds-z-rail:25; --ds-z-pop:40; --ds-z-modal:60; --ds-z-load:90; --ds-z-toast:100;
}
/* accent 표 — 여섯 + 첫 화면 */
html[data-ds="koos"]{      --ds-accent-rgb:91,170,255;  }  /* sky    */
html[data-ds="kop"]{       --ds-accent-rgb:56,214,194;  }  /* lagoon */
html[data-ds="roms"]{      --ds-accent-rgb:245,166,92;  }  /* amber  */
html[data-ds="seaheat"]{   --ds-accent-rgb:255,112,94;  }  /* coral  */
html[data-ds="searoute"]{  --ds-accent-rgb:156,160,255; }  /* ice    */
html[data-ds="busantwin"]{ --ds-accent-rgb:232,120,200; }  /* magenta*/
html[data-ds="landing"]{   --ds-accent-rgb:91,170,255;  }

/* 기존 페이지 토큰을 DS 로 끌어온다 — 페이지 CSS 가 var(--accent) 등을 쓰는 자리가 함께 바뀐다 */
html[data-ds]{
  --accent:var(--ds-accent); --acc:var(--ds-accent); --sr-acc:var(--ds-accent);
  --ink:var(--ds-ink); --dim:var(--ds-ink-2); --faint:var(--ds-ink-3);
  --line:var(--ds-line); --line2:var(--ds-line); --line-2:var(--ds-line-2);
  --glass:var(--ds-surface); --glass2:var(--ds-surface-2);
  --shadow:var(--ds-shadow); --r:var(--ds-r-md);
  --u21m-bg:#0d1118; --u21m-accent:var(--ds-accent); --u21m-ink:var(--ds-ink); --u21m-dim:var(--ds-ink-2); --u21m-line:var(--ds-line-2); --u21m-r:18px;
}
html[data-ds] body{
  font-family:var(--ds-font); font-size:var(--ds-fs-md); line-height:1.4; color:var(--ds-ink);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  font-feature-settings:"tnum" 1, "ss05" 1;   /* 숫자는 고정폭, Pretendard ss05 = 단일층 a */
}

/* ── 2. 재질 ─────────────────────────────────────────────────────────── */
html[data-ds] body .ds-pill{
  display:inline-flex; align-items:center; gap:6px; height:var(--ds-pill-h); padding:0 6px;
  background:var(--ds-pill); color:var(--ds-ink); border-radius:var(--ds-r-pill);
  box-shadow:var(--ds-edge-line), var(--ds-shadow);
  -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4);
}
html[data-ds] body .ds-card{
  background:var(--ds-surface); color:var(--ds-ink); border-radius:var(--ds-r-md);
  box-shadow:var(--ds-edge-line), var(--ds-shadow); padding:var(--ds-pad);
}
html[data-ds] body .ds-surface-2{ background:var(--ds-surface-2); box-shadow:var(--ds-edge-line), var(--ds-shadow-2); }
html[data-ds] body .ds-card__t{
  display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  margin:0 0 8px; font-size:var(--ds-fs-xs); font-weight:600; color:var(--ds-ink-3);
  letter-spacing:.02em; text-transform:uppercase;
}
html[data-ds] body .ds-card__t b{ font-weight:600; color:var(--ds-ink-3); }
html[data-ds] body .ds-card__t i{ font-style:normal; font-weight:500; color:var(--ds-ink-4); text-transform:none; letter-spacing:0; }

/* ── 3. 머리 알약 (왼쪽 위) ───────────────────────────────────────────── */
html[data-ds] body .ds-head{
  position:fixed; left:calc(var(--ds-edge) + var(--ds-sal)); top:calc(var(--ds-edge) + var(--ds-sat)); z-index:var(--ds-z-rail);
  padding:0 14px 0 10px; gap:10px; text-decoration:none; cursor:default;
}
html[data-ds] body .ds-head img{ height:16px; width:auto; display:block; opacity:.95; }
html[data-ds] body .ds-head__dot{ width:8px; height:8px; border-radius:50%; background:var(--ds-accent); box-shadow:0 0 10px rgba(var(--ds-accent-rgb),.8); }
html[data-ds] body .ds-head b{ font-weight:600; font-size:var(--ds-fs-md); letter-spacing:-.01em; white-space:nowrap; }
html[data-ds] body .ds-head i{ font-style:normal; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); white-space:nowrap; }
html[data-ds][data-embed] body .ds-head{ display:none; }        /* 첫 화면 안에서는 랜딩 알약이 같은 자리에 있다 */

/* ── 4. 도구 레일 (오른쪽 위, 세로) ───────────────────────────────────── */
html[data-ds] body .ds-rail{
  position:fixed; right:calc(var(--ds-edge) + var(--ds-sar)); top:calc(var(--ds-edge) + var(--ds-sat)); z-index:var(--ds-z-rail);
  display:flex; flex-direction:column; align-items:center; gap:2px; width:var(--ds-rail-w); padding:4px;
  background:var(--ds-pill); border-radius:var(--ds-r-pill);
  box-shadow:var(--ds-edge-line), var(--ds-shadow);
  -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4);
}
html[data-ds] body .ds-rail--bottom{ top:auto; bottom:var(--ds-above-bar); }
html[data-ds] body .ds-rail hr{ width:20px; height:1px; border:0; margin:3px 0; background:var(--ds-line-2); }
html[data-ds] body .ds-tool{
  appearance:none; -webkit-appearance:none; width:36px; height:36px; padding:0; margin:0; border:0; border-radius:50%;
  background:transparent; color:var(--ds-ink-2); cursor:pointer; display:grid; place-items:center;
  transition:background var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease);
  font:inherit; line-height:1; position:relative;
}
html[data-ds] body .ds-tool svg{ width:20px; height:20px; display:block; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
html[data-ds] body .ds-tool:hover{ background:var(--ds-fill-2); color:var(--ds-ink); }
html[data-ds] body .ds-tool:active{ transform:scale(.94); }
html[data-ds] body .ds-tool.is-on, html[data-ds] body .ds-tool[aria-pressed="true"], html[data-ds] body .ds-tool[aria-expanded="true"]{ background:var(--ds-accent-soft); color:var(--ds-accent); }
html[data-ds] body .ds-tool:focus-visible{ outline:0; box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-tool--txt{ width:auto; padding:0 12px; border-radius:var(--ds-r-pill); gap:6px; font-size:var(--ds-fs-sm); font-weight:600; }
html[data-ds] body .ds-tool--txt svg{ width:16px; height:16px; }
/* 이름표 (.ds-tool--l > .ds-tool__l): 아이콘 밑 2~4글자. 처음 온 사람이 설명말 없이 읽는다. ds.js 가 data-l / data-l-en 으로 단다 */
html[data-ds] body .ds-rail:not(.ds-rail--bottom){ border-radius:var(--ds-r-lg); }
html[data-ds] body .ds-rail--bottom{ width:auto; }
html[data-ds] body .ds-rail .ds-tool.ds-tool--l{
  width:100%; height:auto; min-height:48px; padding:7px 0 6px; border-radius:12px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
}
html[data-ds] body .ds-tool__l{
  display:block; max-width:100%; overflow:hidden; white-space:nowrap; pointer-events:none;
  font-size:11px; line-height:13px; font-weight:500; letter-spacing:-.02em; color:inherit; text-transform:none;
}
html[data-ds] body .ds-rail hr{ width:28px; }
/* 설명말: data-tip 속성 → 왼쪽에 뜬다(레일이 오른쪽에 있으니). .ds-tip--below 면 아래 */
html[data-ds] body [data-tip]{ position:relative; }
html[data-ds] body [data-tip]::after{
  content:attr(data-tip); position:absolute; right:calc(100% + 10px); top:50%; transform:translate(4px,-50%);
  background:#0b0e14; color:var(--ds-ink); font-size:var(--ds-fs-sm); font-weight:500; line-height:1; letter-spacing:0;
  padding:7px 9px; border-radius:8px; white-space:nowrap; box-shadow:var(--ds-edge-line), 0 8px 20px rgba(0,0,0,.5);
  opacity:0; pointer-events:none; transition:opacity var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease);
  z-index:5; text-transform:none;
}
html[data-ds] body [data-tip]:hover::after, html[data-ds] body [data-tip]:focus-visible::after{ opacity:1; transform:translate(0,-50%); transition-delay:.25s; }
html[data-ds] body .ds-tip--below[data-tip]::after{ right:auto; top:calc(100% + 8px); left:50%; transform:translate(-50%,-4px); }
html[data-ds] body .ds-tip--below[data-tip]:hover::after{ transform:translate(-50%,0); }
html[data-ds] body .ds-tip--right[data-tip]::after{ right:auto; left:calc(100% + 10px); transform:translate(-4px,-50%); }
html[data-ds] body .ds-tip--right[data-tip]:hover::after{ transform:translate(0,-50%); }
@media (pointer:coarse){ html[data-ds] body [data-tip]::after{ display:none; } }

/* ── 5. 왼쪽 열 (카드 쌓기) ─────────────────────────────────────────── */
html[data-ds] body .ds-col{
  position:fixed; left:calc(var(--ds-edge) + var(--ds-sal)); top:calc(var(--ds-top) + var(--ds-sat)); width:var(--ds-col-w);
  bottom:var(--ds-col-bottom); z-index:var(--ds-z-ui);
  display:flex; flex-direction:column; gap:var(--ds-gap); pointer-events:none;
  overflow:hidden auto; scrollbar-width:none; -ms-overflow-style:none;
}
html[data-ds] body .ds-col::-webkit-scrollbar{ display:none; }
html[data-ds] body .ds-col > *{ pointer-events:auto; flex:0 0 auto; }

/* ── 6. 세그먼트 (모델·모드 탭) ───────────────────────────────────────── */
html[data-ds] body .ds-seg{
  display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:2px; padding:3px;
  background:var(--ds-fill); border-radius:var(--ds-r-sm);
}
html[data-ds] body .ds-seg > button, html[data-ds] body .ds-seg > a{
  appearance:none; -webkit-appearance:none; border:0; margin:0; min-height:34px; padding:5px 8px; border-radius:8px;
  background:transparent; color:var(--ds-ink-2); font:inherit; font-size:var(--ds-fs-sm); font-weight:600; line-height:1.15;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; cursor:pointer; text-decoration:none;
  transition:background var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
  white-space:nowrap;
}
html[data-ds] body .ds-seg > button i, html[data-ds] body .ds-seg > a i{ font-style:normal; font-size:10.5px; font-weight:500; color:var(--ds-ink-3); }
html[data-ds] body .ds-seg > button:hover, html[data-ds] body .ds-seg > a:hover{ color:var(--ds-ink); background:var(--ds-fill); }
html[data-ds] body .ds-seg > .is-on, html[data-ds] body .ds-seg > [aria-selected="true"], html[data-ds] body .ds-seg > [aria-current], html[data-ds] body .ds-seg > [aria-pressed="true"]{
  background:var(--ds-fill-3); color:var(--ds-ink); box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.35);
}
html[data-ds] body .ds-seg > .is-on i, html[data-ds] body .ds-seg > [aria-selected="true"] i{ color:var(--ds-accent); }
html[data-ds] body .ds-seg--row > button, html[data-ds] body .ds-seg--row > a{ flex-direction:row; gap:6px; min-height:30px; }
html[data-ds] body .ds-seg--sm > button, html[data-ds] body .ds-seg--sm > a{ min-height:28px; font-size:var(--ds-fs-xs); padding:3px 8px; }
html[data-ds] body .ds-seg > button:focus-visible{ outline:0; box-shadow:0 0 0 2px var(--ds-accent); }

/* ── 7. 목록 (변수 고르기) ───────────────────────────────────────────── */
html[data-ds] body .ds-list{ display:flex; flex-direction:column; gap:1px; }
html[data-ds] body .ds-item{
  appearance:none; -webkit-appearance:none; border:0; margin:0; width:100%; min-height:36px; padding:0 10px 0 12px; border-radius:9px;
  background:transparent; color:var(--ds-ink-2); font:inherit; font-size:var(--ds-fs-md); font-weight:500; text-align:left;
  display:flex; align-items:center; gap:8px; cursor:pointer; position:relative;
  transition:background var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
}
html[data-ds] body .ds-item__l{ flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html[data-ds] body .ds-item__u, html[data-ds] body .ds-item u{ text-decoration:none; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); font-weight:500; flex:none; }
html[data-ds] body .ds-item__v{ font-size:var(--ds-fs-sm); font-weight:600; color:var(--ds-ink); flex:none; }     /* 커서 값 등 */
html[data-ds] body .ds-item:hover{ background:var(--ds-fill); color:var(--ds-ink); }
html[data-ds] body .ds-item.is-on, html[data-ds] body .ds-item[aria-selected="true"], html[data-ds] body .ds-item[aria-pressed="true"]{
  background:var(--ds-accent-soft); color:var(--ds-ink); font-weight:600;
  box-shadow:inset 3px 0 0 var(--ds-accent);
}
html[data-ds] body .ds-item.is-on .ds-item__u, html[data-ds] body .ds-item.is-on u{ color:rgba(var(--ds-accent-rgb),.9); }
html[data-ds] body .ds-item:disabled, html[data-ds] body .ds-item[aria-disabled="true"]{ color:var(--ds-ink-4); cursor:default; }
html[data-ds] body .ds-item:focus-visible{ outline:0; box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-item svg{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; flex:none; }

/* ── 8. 단추·칩 ────────────────────────────────────────────────────────── */
html[data-ds] body .ds-btn{
  appearance:none; -webkit-appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:34px; padding:0 14px; border:0; border-radius:var(--ds-r-sm); margin:0;
  background:var(--ds-fill-2); color:var(--ds-ink); font:inherit; font-size:var(--ds-fs-sm); font-weight:600; line-height:1;
  cursor:pointer; text-decoration:none; white-space:nowrap;
  transition:background var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
html[data-ds] body .ds-btn svg{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
html[data-ds] body .ds-btn:hover{ background:var(--ds-fill-3); }
html[data-ds] body .ds-btn:active{ transform:scale(.97); }
html[data-ds] body .ds-btn:focus-visible{ outline:0; box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-btn--primary{ background:var(--ds-accent); color:var(--ds-on-accent); box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px -6px rgba(var(--ds-accent-rgb),.7); }
html[data-ds] body .ds-btn--primary:hover{ background:rgba(var(--ds-accent-rgb),.9); }
html[data-ds] body .ds-btn--ghost{ background:transparent; color:var(--ds-ink-2); }
html[data-ds] body .ds-btn--ghost:hover{ background:var(--ds-fill); color:var(--ds-ink); }
html[data-ds] body .ds-btn--line{ background:transparent; box-shadow:inset 0 0 0 1px var(--ds-line-2); }
html[data-ds] body .ds-btn--sm{ min-height:28px; padding:0 10px; font-size:var(--ds-fs-xs); border-radius:8px; }
html[data-ds] body .ds-btn--lg{ min-height:44px; padding:0 20px; font-size:var(--ds-fs-md); border-radius:var(--ds-r-md); }
html[data-ds] body .ds-btn--icon{ width:32px; min-height:32px; padding:0; border-radius:50%; background:transparent; color:var(--ds-ink-2); }
html[data-ds] body .ds-btn--icon:hover{ background:var(--ds-fill-2); color:var(--ds-ink); }
html[data-ds] body .ds-btn--block{ width:100%; }
html[data-ds] body .ds-btn:disabled, html[data-ds] body .ds-btn[aria-disabled="true"]{ opacity:.45; cursor:default; transform:none; }
/* 닫기 단추 = .ds-btn.ds-btn--icon 에 #i-close */
html[data-ds] body .ds-chip{
  appearance:none; -webkit-appearance:none; display:inline-flex; align-items:center; gap:5px; height:28px; padding:0 10px; border:0;
  border-radius:var(--ds-r-pill); background:var(--ds-fill); color:var(--ds-ink-2); font:inherit; font-size:var(--ds-fs-xs); font-weight:600;
  cursor:pointer; white-space:nowrap; transition:background var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
  box-shadow:inset 0 0 0 1px var(--ds-line);
}
html[data-ds] body .ds-chip:hover{ background:var(--ds-fill-2); color:var(--ds-ink); }
html[data-ds] body .ds-chip.is-on, html[data-ds] body .ds-chip[aria-pressed="true"], html[data-ds] body .ds-chip[aria-checked="true"]{ background:var(--ds-accent-soft); color:var(--ds-accent); box-shadow:inset 0 0 0 1px var(--ds-accent-line); }
html[data-ds] body .ds-chip svg{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
html[data-ds] body .ds-chips{ display:flex; flex-wrap:wrap; gap:6px; }
html[data-ds] body .ds-badge{ display:inline-flex; align-items:center; height:20px; padding:0 7px; border-radius:6px; font-size:10.5px; font-weight:700; letter-spacing:.02em; background:var(--ds-fill-2); color:var(--ds-ink-2); }
html[data-ds] body .ds-badge--accent{ background:var(--ds-accent-soft); color:var(--ds-accent); }
html[data-ds] body .ds-badge--warn{ background:rgba(255,180,84,.16); color:var(--ds-warn); }
html[data-ds] body .ds-badge--bad{ background:rgba(255,92,106,.16); color:var(--ds-bad); }
html[data-ds] body .ds-badge--ok{ background:rgba(61,220,151,.16); color:var(--ds-ok); }
html[data-ds] body .ds-badge--assume{ background:transparent; color:var(--ds-warn); box-shadow:inset 0 0 0 1px rgba(255,180,84,.6); border-style:dashed; }  /* "가정" */

/* ── 9. 폼: 스위치 · 슬라이더 · 셀렉트 · 입력 ─────────────────────────── */
html[data-ds] body .ds-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:34px; font-size:var(--ds-fs-md); color:var(--ds-ink-2); }
html[data-ds] body .ds-row > span:first-child, html[data-ds] body .ds-row__l{ flex:1 1 auto; min-width:0; }
html[data-ds] body .ds-switch{ display:inline-flex; align-items:center; gap:10px; cursor:pointer; user-select:none; color:var(--ds-ink-2); font-size:var(--ds-fs-md); min-height:34px; }
html[data-ds] body .ds-switch input{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
html[data-ds] body .ds-switch i{
  flex:none; width:34px; height:20px; border-radius:10px; background:var(--ds-fill-3); position:relative; transition:background var(--ds-dur-2) var(--ds-ease);
  box-shadow:inset 0 0 0 1px var(--ds-line);
}
html[data-ds] body .ds-switch i::after{ content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.5); transition:transform var(--ds-dur-2) var(--ds-ease); }
html[data-ds] body .ds-switch input:checked + i{ background:var(--ds-accent); box-shadow:none; }
html[data-ds] body .ds-switch input:checked + i::after{ transform:translateX(14px); }
html[data-ds] body .ds-switch input:focus-visible + i{ box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-switch--end{ justify-content:space-between; width:100%; }
html[data-ds] body .ds-switch--end i{ order:2; }
html[data-ds] body .ds-check{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; color:var(--ds-ink-2); font-size:var(--ds-fs-md); min-height:30px; }
html[data-ds] body .ds-check input{ appearance:none; -webkit-appearance:none; width:16px; height:16px; margin:0; border-radius:5px; background:var(--ds-fill-2); box-shadow:inset 0 0 0 1px var(--ds-line-2); cursor:pointer; display:grid; place-items:center; flex:none; }
html[data-ds] body .ds-check input:checked{ background:var(--ds-accent); box-shadow:none; }
html[data-ds] body .ds-check input:checked::after{ content:""; width:9px; height:5px; border:2px solid var(--ds-on-accent); border-top:0; border-right:0; transform:translateY(-1px) rotate(-45deg); }
html[data-ds] body .ds-check input:focus-visible{ box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-radio{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; color:var(--ds-ink-2); font-size:var(--ds-fs-md); min-height:30px; }
html[data-ds] body .ds-radio input{ appearance:none; -webkit-appearance:none; width:16px; height:16px; margin:0; border-radius:50%; background:var(--ds-fill-2); box-shadow:inset 0 0 0 1px var(--ds-line-2); cursor:pointer; display:grid; place-items:center; flex:none; }
html[data-ds] body .ds-radio input:checked{ box-shadow:inset 0 0 0 5px var(--ds-accent); background:#fff; }
html[data-ds] body .ds-range{ -webkit-appearance:none; appearance:none; width:100%; height:20px; margin:0; background:transparent; cursor:pointer; }
html[data-ds] body .ds-range::-webkit-slider-runnable-track{ height:4px; border-radius:2px; background:linear-gradient(90deg, var(--ds-accent) var(--ds-range-fill,0%), var(--ds-fill-3) var(--ds-range-fill,0%)); }
html[data-ds] body .ds-range::-moz-range-track{ height:4px; border-radius:2px; background:var(--ds-fill-3); }
html[data-ds] body .ds-range::-moz-range-progress{ height:4px; border-radius:2px; background:var(--ds-accent); }
html[data-ds] body .ds-range::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:14px; height:14px; margin-top:-5px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.6); transition:transform var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease); }
html[data-ds] body .ds-range::-moz-range-thumb{ width:14px; height:14px; border:0; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.6); }
html[data-ds] body .ds-range:hover::-webkit-slider-thumb, html[data-ds] body .ds-range:active::-webkit-slider-thumb{ transform:scale(1.2); box-shadow:0 0 0 4px rgba(var(--ds-accent-rgb),.25), 0 1px 3px rgba(0,0,0,.6); }
html[data-ds] body .ds-range:focus-visible{ outline:0; }
html[data-ds] body .ds-range:focus-visible::-webkit-slider-thumb{ box-shadow:0 0 0 3px var(--ds-accent); }
html[data-ds] body .ds-select{
  appearance:none; -webkit-appearance:none; height:32px; padding:0 28px 0 10px; border:0; border-radius:8px;
  background:var(--ds-fill-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23aab4c3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 9px center / 12px 12px;
  color:var(--ds-ink); font:inherit; font-size:var(--ds-fs-sm); font-weight:600; cursor:pointer; max-width:100%;
}
html[data-ds] body .ds-select:hover{ background-color:var(--ds-fill-3); }
html[data-ds] body .ds-select:focus-visible{ outline:0; box-shadow:0 0 0 2px var(--ds-accent); }
html[data-ds] body .ds-select option{ background:#121620; color:var(--ds-ink); }
html[data-ds] body .ds-field{
  appearance:none; -webkit-appearance:none; height:34px; width:100%; padding:0 10px; border:0; border-radius:8px;
  background:var(--ds-fill); color:var(--ds-ink); font:inherit; font-size:var(--ds-fs-md); box-shadow:inset 0 0 0 1px var(--ds-line);
  transition:box-shadow var(--ds-dur) var(--ds-ease), background var(--ds-dur) var(--ds-ease);
}
html[data-ds] body .ds-field::placeholder{ color:var(--ds-ink-3); }
html[data-ds] body .ds-field:hover{ background:var(--ds-fill-2); }
html[data-ds] body .ds-field:focus{ outline:0; box-shadow:inset 0 0 0 1px var(--ds-accent), 0 0 0 3px var(--ds-accent-soft); background:var(--ds-fill-2); }
html[data-ds] body .ds-field--search{ padding-left:30px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7a8a' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:9px center; background-size:16px 16px; }
html[data-ds] body .ds-label{ display:block; font-size:var(--ds-fs-xs); font-weight:600; color:var(--ds-ink-3); margin:0 0 6px; letter-spacing:.02em; }
html[data-ds] body .ds-kbd{ display:inline-block; min-width:20px; padding:2px 6px; border-radius:5px; background:var(--ds-fill-2); box-shadow:inset 0 -1px 0 rgba(0,0,0,.4), inset 0 0 0 1px var(--ds-line); font-size:11px; font-weight:600; color:var(--ds-ink-2); text-align:center; }
html[data-ds] body .ds-hr{ height:1px; border:0; margin:8px 0; background:var(--ds-line); }

/* ── 10. 범례 (왼쪽 아래, 막대 위) ──────────────────────────────────────── */
html[data-ds] body .ds-legend{
  position:fixed; left:calc(var(--ds-edge) + var(--ds-sal)); bottom:var(--ds-above-bar); width:var(--ds-col-w); z-index:var(--ds-z-ui);
  padding:10px 12px 9px;
}
html[data-ds] body .ds-legend__t{ display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin:0 0 7px; font-size:var(--ds-fs-sm); font-weight:600; color:var(--ds-ink); }
html[data-ds] body .ds-legend__t i{ font-style:normal; font-weight:500; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); }
html[data-ds] body .ds-legend__bar{ height:8px; border-radius:4px; background:linear-gradient(90deg,#1b2a5a,#2d7ad6,#4fc3a1,#f1d85e,#f0803c,#c81d4a); box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); position:relative; }
html[data-ds] body .ds-legend__mk{ position:absolute; top:-3px; width:2px; height:14px; margin-left:-1px; background:#fff; border-radius:1px; box-shadow:0 0 4px rgba(0,0,0,.8); }   /* 커서 값 표식 — left:% */
html[data-ds] body .ds-legend__s{ display:flex; justify-content:space-between; margin:5px 0 0; font-size:var(--ds-fs-xs); color:var(--ds-ink-2); font-weight:500; }
html[data-ds] body .ds-legend__s span{ flex:1 1 0; text-align:center; }
html[data-ds] body .ds-legend__s span:first-child{ text-align:left; } html[data-ds] body .ds-legend__s span:last-child{ text-align:right; }
html[data-ds] body .ds-legend__cap{ margin:5px 0 0; font-size:10.5px; color:var(--ds-ink-3); }

/* ── 11. 시간 막대 (아래, 가로 전체) ────────────────────────────────────── */
html[data-ds] body .ds-bar{
  position:fixed; left:calc(var(--ds-edge) + var(--ds-sal)); right:calc(var(--ds-edge) + var(--ds-sar)); bottom:calc(var(--ds-edge) + var(--ds-sab)); height:var(--ds-bar-h);
  z-index:var(--ds-z-ui); display:grid; grid-template-columns:auto auto 1fr auto; align-items:center; gap:14px; padding:0 14px 0 12px;
  background:var(--ds-bar); color:var(--ds-ink); border-radius:var(--ds-r-lg); box-shadow:var(--ds-edge-line), var(--ds-shadow);
}
html[data-ds] body .ds-play{
  appearance:none; -webkit-appearance:none; width:40px; height:40px; border:0; border-radius:50%; margin:0; padding:0; cursor:pointer;
  background:var(--ds-accent); color:var(--ds-on-accent); display:grid; place-items:center;
  box-shadow:0 1px 0 rgba(255,255,255,.3) inset, 0 6px 16px -4px rgba(var(--ds-accent-rgb),.6);
  transition:transform var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
html[data-ds] body .ds-play:hover{ transform:scale(1.05); }
html[data-ds] body .ds-play:active{ transform:scale(.96); }
html[data-ds] body .ds-play:focus-visible{ outline:0; box-shadow:0 0 0 3px rgba(255,255,255,.5); }
html[data-ds] body .ds-play svg{ width:18px; height:18px; fill:currentColor; stroke:none; display:block; }
html[data-ds] body .ds-play .i-pause{ display:none; }
html[data-ds] body .ds-play.is-on .i-play, html[data-ds] body .ds-play[data-playing="1"] .i-play, html[data-ds] body .ds-play[aria-pressed="true"] .i-play{ display:none; }
html[data-ds] body .ds-play.is-on .i-pause, html[data-ds] body .ds-play[data-playing="1"] .i-pause, html[data-ds] body .ds-play[aria-pressed="true"] .i-pause{ display:block; }
html[data-ds] body .ds-clock{ display:flex; flex-direction:column; gap:1px; min-width:124px; white-space:nowrap; }
html[data-ds] body .ds-clock b{ font-size:16px; font-weight:700; letter-spacing:-.01em; line-height:1.1; }
html[data-ds] body .ds-clock b small{ font-size:11px; font-weight:600; color:var(--ds-ink-3); margin-left:5px; }
html[data-ds] body .ds-clock i{ font-style:normal; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); font-weight:500; }
html[data-ds] body .ds-track{ position:relative; height:40px; min-width:0; }
html[data-ds] body .ds-track .ds-range{ position:absolute; left:0; right:0; top:10px; height:20px; }
html[data-ds] body .ds-ticks{ position:absolute; left:0; right:0; top:30px; height:14px; pointer-events:none; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); font-weight:500; }
html[data-ds] body .ds-ticks span, html[data-ds] body .ds-ticks b{ position:absolute; transform:translateX(-50%); white-space:nowrap; font-weight:500; }
html[data-ds] body .ds-ticks i{ position:absolute; top:-10px; width:1px; height:6px; background:var(--ds-line-2); }
html[data-ds] body .ds-ticks .is-major{ color:var(--ds-ink-2); font-weight:600; }
html[data-ds] body .ds-now{ position:absolute; top:6px; width:2px; height:12px; margin-left:-1px; background:var(--ds-ink); border-radius:1px; pointer-events:none; }
html[data-ds] body .ds-now::after{ content:attr(data-l); position:absolute; left:50%; top:-16px; transform:translateX(-50%); font-size:10px; font-weight:700; color:var(--ds-ink); background:var(--ds-bar); padding:1px 5px; border-radius:4px; white-space:nowrap; }
html[data-ds] body .ds-band{ position:absolute; top:18px; height:4px; border-radius:2px; background:var(--ds-fill-2); pointer-events:none; }
html[data-ds] body .ds-bar__r{ display:flex; align-items:center; gap:6px; }
html[data-ds] body .ds-bar .ds-select{ height:30px; }

/* ── 12. 레일 옆 판 (레이어·검증·목록) ───────────────────────────────────── */
html[data-ds] body .ds-panel{
  position:fixed; right:calc(var(--ds-edge) + var(--ds-rail-w) + 8px + var(--ds-sar)); top:calc(var(--ds-edge) + var(--ds-sat)); width:var(--ds-panel-w);
  max-height:calc(100vh - var(--ds-above-bar) - var(--ds-edge)); max-height:calc(100dvh - var(--ds-above-bar) - var(--ds-edge));
  z-index:var(--ds-z-pop); display:flex; flex-direction:column; padding:0; overflow:hidden;
  background:var(--ds-surface-2); border-radius:var(--ds-r-lg); box-shadow:var(--ds-edge-line), var(--ds-shadow-2);
  transform-origin:top right; transition:opacity var(--ds-dur) var(--ds-ease), transform var(--ds-dur-2) var(--ds-ease), visibility 0s;
}
html[data-ds] body .ds-panel.closed, html[data-ds] body .ds-panel[hidden]{ opacity:0; transform:translateX(8px) scale(.98); visibility:hidden; pointer-events:none; transition:opacity var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease), visibility 0s var(--ds-dur); }
html[data-ds] body .ds-panel--wide{ width:380px; }
html[data-ds] body .ds-panel__h{ display:flex; align-items:center; gap:8px; min-height:48px; padding:6px 8px 6px 16px; flex:none; }
html[data-ds] body .ds-panel__h b{ flex:1 1 auto; font-size:var(--ds-fs-lg); font-weight:700; letter-spacing:-.01em; }
html[data-ds] body .ds-panel__h i{ font-style:normal; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); }
html[data-ds] body .ds-panel__b{ flex:1 1 auto; min-height:0; overflow:hidden auto; padding:4px 16px 16px; scrollbar-width:thin; scrollbar-color:var(--ds-fill-3) transparent; }
html[data-ds] body .ds-panel__b::-webkit-scrollbar{ width:8px; } html[data-ds] body .ds-panel__b::-webkit-scrollbar-thumb{ background:var(--ds-fill-3); border-radius:4px; border:2px solid transparent; background-clip:padding-box; }
html[data-ds] body .ds-panel__f{ flex:none; padding:10px 16px 14px; display:flex; gap:8px; box-shadow:0 -1px 0 var(--ds-line); }
html[data-ds] body .ds-group{ padding:10px 0 4px; }
html[data-ds] body .ds-group + .ds-group{ box-shadow:0 -1px 0 var(--ds-line); margin-top:4px; padding-top:12px; }
html[data-ds] body .ds-group__t{ font-size:var(--ds-fs-xs); font-weight:600; color:var(--ds-ink-3); letter-spacing:.02em; margin:0 0 4px; }
/* 왼쪽에 서는 판(열 옆) */
html[data-ds] body .ds-panel--left{ right:auto; left:calc(var(--ds-edge) + var(--ds-col-w) + 8px + var(--ds-sal)); top:calc(var(--ds-top) + var(--ds-sat)); transform-origin:top left; }
html[data-ds] body .ds-panel--left.closed, html[data-ds] body .ds-panel--left[hidden]{ transform:translateX(-8px) scale(.98); }

/* ── 13. 팝오버 · 지점 카드 · 커서 값 ───────────────────────────────────── */
html[data-ds] body .ds-pop{
  position:fixed; z-index:var(--ds-z-pop); min-width:200px; max-width:320px; padding:12px 14px;
  background:var(--ds-surface-2); color:var(--ds-ink); border-radius:var(--ds-r-md); box-shadow:var(--ds-edge-line), var(--ds-shadow-2);
}
html[data-ds] body .ds-pop__h{ display:flex; align-items:flex-start; gap:8px; margin:0 0 8px; }
html[data-ds] body .ds-pop__h b{ flex:1 1 auto; font-size:var(--ds-fs-md); font-weight:700; letter-spacing:-.01em; }
html[data-ds] body .ds-pop__h i{ display:block; font-style:normal; font-size:var(--ds-fs-xs); color:var(--ds-ink-3); font-weight:500; margin-top:1px; }
html[data-ds] body .ds-pop__v{ font-size:var(--ds-fs-2xl); font-weight:700; letter-spacing:-.02em; line-height:1; }
html[data-ds] body .ds-pop__v small{ font-size:var(--ds-fs-sm); font-weight:600; color:var(--ds-ink-3); margin-left:4px; letter-spacing:0; }
html[data-ds] body .ds-pop__rows{ display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:var(--ds-fs-sm); margin:8px 0 0; }
html[data-ds] body .ds-pop__rows dt{ color:var(--ds-ink-3); font-weight:500; } html[data-ds] body .ds-pop__rows dd{ margin:0; color:var(--ds-ink); font-weight:600; text-align:right; }
html[data-ds] body .ds-cursor{   /* 커서 옆 값 칩 — 작고 불투명 */
  position:fixed; z-index:var(--ds-z-pop); pointer-events:none; display:inline-flex; align-items:center; gap:6px; height:26px; padding:0 9px 0 7px;
  background:#0b0e14; color:var(--ds-ink); border-radius:8px; box-shadow:var(--ds-edge-line), 0 6px 16px rgba(0,0,0,.5);
  font-size:var(--ds-fs-sm); font-weight:600; white-space:nowrap; transform:translate(14px,14px);
}
html[data-ds] body .ds-cursor i{ width:8px; height:8px; border-radius:50%; background:var(--ds-accent); flex:none; }
html[data-ds] body .ds-cursor u{ text-decoration:none; color:var(--ds-ink-3); font-weight:500; font-size:var(--ds-fs-xs); }
html[data-ds] body .ds-pin{ width:14px; height:14px; border-radius:50%; background:var(--ds-accent); box-shadow:0 0 0 3px rgba(var(--ds-accent-rgb),.3), 0 0 0 1px #fff inset; }

/* ── 14. 모달 (도움말 등) ──────────────────────────────────────────────── */
html[data-ds] body .ds-scrim{ position:fixed; inset:0; z-index:var(--ds-z-modal); background:rgba(3,5,9,.6); display:grid; place-items:center; padding:24px; }
html[data-ds] body .ds-modal{
  width:min(560px, 100%); max-height:min(80vh, 760px); display:flex; flex-direction:column; overflow:hidden;
  background:var(--ds-surface-2); color:var(--ds-ink); border-radius:var(--ds-r-lg); box-shadow:var(--ds-edge-line), var(--ds-shadow-2);
}
html[data-ds] body .ds-modal__h{ display:flex; align-items:center; gap:8px; padding:14px 12px 10px 20px; flex:none; }
html[data-ds] body .ds-modal__h b{ flex:1 1 auto; font-size:var(--ds-fs-xl); font-weight:700; letter-spacing:-.02em; }
html[data-ds] body .ds-modal__b{ flex:1 1 auto; min-height:0; overflow:auto; padding:0 20px 20px; font-size:var(--ds-fs-md); color:var(--ds-ink-2); line-height:1.55; }
html[data-ds] body .ds-modal__b h3{ font-size:var(--ds-fs-xs); font-weight:600; color:var(--ds-ink-3); letter-spacing:.02em; text-transform:uppercase; margin:16px 0 6px; }
html[data-ds] body .ds-modal__b table{ width:100%; border-collapse:collapse; font-size:var(--ds-fs-sm); }
html[data-ds] body .ds-modal__b td{ padding:6px 0; border-top:1px solid var(--ds-line); vertical-align:top; }
html[data-ds] body .ds-modal__b td:first-child{ width:38%; color:var(--ds-ink); font-weight:600; }

/* ── 15. 로딩 · 토스트 · 출처 ─────────────────────────────────────────── */
html[data-ds] body .ds-loading{
  position:fixed; inset:0; z-index:var(--ds-z-load); background:var(--ds-bg); display:grid; place-items:center; color:var(--ds-ink-2);
  transition:opacity .4s var(--ds-ease), visibility 0s .4s;
}
html[data-ds] body .ds-loading.done, html[data-ds] body .ds-loading.out, html[data-ds] body .ds-loading.gone, html[data-ds] body .ds-loading[hidden]{ opacity:0; visibility:hidden; pointer-events:none; }
html[data-ds] body .ds-loading__in{ display:flex; flex-direction:column; align-items:center; gap:18px; width:220px; }
html[data-ds] body .ds-loading__in img{ height:22px; width:auto; opacity:.9; }
html[data-ds] body .ds-loading__t{ font-size:var(--ds-fs-md); font-weight:600; color:var(--ds-ink); letter-spacing:-.01em; text-align:center; }
html[data-ds] body .ds-loading__s{ font-size:var(--ds-fs-xs); color:var(--ds-ink-3); text-align:center; margin-top:-12px; }
html[data-ds] body .ds-loading__bar{ width:160px; height:2px; border-radius:1px; background:var(--ds-fill-2); overflow:hidden; position:relative; }
html[data-ds] body .ds-loading__bar i{ position:absolute; left:0; top:0; bottom:0; width:var(--p,0%); background:var(--ds-accent); border-radius:1px; transition:width .3s var(--ds-ease); }
html[data-ds] body .ds-loading__bar.is-indet i{ width:40%; animation:ds-indet 1.2s var(--ds-ease) infinite; }
@keyframes ds-indet{ 0%{ transform:translateX(-100%);} 100%{ transform:translateX(250%);} }
html[data-ds] body .ds-toast{
  position:fixed; left:50%; bottom:calc(var(--ds-above-bar) + 8px); transform:translate(-50%, 8px); z-index:var(--ds-z-toast);
  padding:9px 14px; background:#0b0e14; color:var(--ds-ink); font-size:var(--ds-fs-sm); font-weight:600; border-radius:var(--ds-r-sm);
  box-shadow:var(--ds-edge-line), var(--ds-shadow-2); opacity:0; pointer-events:none; transition:opacity var(--ds-dur) var(--ds-ease), transform var(--ds-dur-2) var(--ds-ease);
  white-space:nowrap;
}
html[data-ds] body .ds-toast.is-on, html[data-ds] body .ds-toast.on, html[data-ds] body .ds-toast.show{ opacity:1; transform:translate(-50%,0); }
html[data-ds] body .ds-attrib{
  position:fixed; left:50%; bottom:calc(1px + var(--ds-sab)); transform:translateX(-50%); z-index:var(--ds-z-ui);
  font-size:10.5px; line-height:12px; color:var(--ds-ink-3); white-space:nowrap; pointer-events:auto; text-shadow:0 1px 2px rgba(0,0,0,.8);
}
html[data-ds] body .ds-attrib a{ color:inherit; text-decoration:none; } html[data-ds] body .ds-attrib a:hover{ color:var(--ds-ink-2); }

/* ── 16. MapLibre 컨트롤 → DS ────────────────────────────────────────── */
html[data-ds] body .maplibregl-ctrl-bottom-right{ right:calc(var(--ds-edge) + var(--ds-sar)) !important; bottom:var(--ds-above-bar) !important; z-index:var(--ds-z-ui) !important; }
html[data-ds] body .maplibregl-ctrl-bottom-right .maplibregl-ctrl{ margin:0 !important; }
html[data-ds] body .maplibregl-ctrl-group{
  background:var(--ds-pill) !important; border-radius:var(--ds-r-pill) !important; box-shadow:var(--ds-edge-line), var(--ds-shadow) !important; padding:4px !important;
  -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4);
}
html[data-ds] body .maplibregl-ctrl-group button{ width:36px !important; height:36px !important; border:0 !important; border-radius:50% !important; background-color:transparent !important; transition:background var(--ds-dur) var(--ds-ease); }
html[data-ds] body .maplibregl-ctrl-group button + button{ border-top:0 !important; }
html[data-ds] body .maplibregl-ctrl-group button:hover{ background-color:var(--ds-fill-2) !important; }
html[data-ds] body .maplibregl-ctrl-group button .maplibregl-ctrl-icon{ filter:invert(1) brightness(.85); background-size:18px 18px !important; }
html[data-ds] body .maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon{ filter:invert(1) brightness(1); }
html[data-ds] body .maplibregl-ctrl-attrib{ position:fixed !important; left:50% !important; bottom:calc(1px + var(--ds-sab)) !important; transform:translateX(-50%); margin:0 !important; z-index:var(--ds-z-ui); background:transparent !important; color:var(--ds-ink-3) !important; font:500 10.5px/12px var(--ds-font) !important; padding:0 !important; text-shadow:0 1px 2px rgba(0,0,0,.8); }
html[data-ds] body .maplibregl-ctrl-attrib a{ color:inherit !important; text-decoration:none !important; }
html[data-ds] body .maplibregl-ctrl-attrib-button{ display:none !important; }
html[data-ds] body .maplibregl-ctrl-attrib.maplibregl-compact{ padding:0 !important; min-height:0 !important; }
html[data-ds] body .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{ display:block !important; }
html[data-ds] body .maplibregl-ctrl-bottom-left{ left:50% !important; transform:translateX(-50%); bottom:calc(1px + var(--ds-sab)) !important; z-index:var(--ds-z-ui) !important; }
html[data-ds] body .maplibregl-ctrl-bottom-left .maplibregl-ctrl{ margin:0 !important; }
html[data-ds] body .maplibregl-popup-content{ background:var(--ds-surface-2) !important; color:var(--ds-ink) !important; border-radius:var(--ds-r-md) !important; box-shadow:var(--ds-edge-line), var(--ds-shadow-2) !important; padding:12px 14px !important; font-family:var(--ds-font) !important; }
html[data-ds] body .maplibregl-popup-anchor-bottom .maplibregl-popup-tip{ border-top-color:var(--ds-surface-2) !important; }
html[data-ds] body .maplibregl-popup-anchor-top .maplibregl-popup-tip{ border-bottom-color:var(--ds-surface-2) !important; }
html[data-ds] body .maplibregl-popup-close-button{ color:var(--ds-ink-3) !important; font-size:18px !important; right:6px !important; top:4px !important; }
html[data-ds] body .maplibregl-canvas:focus{ outline:0; }

/* ── 17. 공통 바닥 시트(ust21-sheet) 재질 ────────────────────────────────── */
html[data-ds] body .u21s.u21s-open{ background:#0d1118 !important; color:var(--ds-ink); box-shadow:0 -16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08) !important; }
html[data-ds] body .u21s-head{ display:flex !important; align-items:center; gap:8px; min-height:44px; padding:6px 8px 2px 16px; position:relative; }
html[data-ds] body .u21s-grab{ position:absolute; left:50%; top:6px; width:36px; height:4px; margin-left:-18px; border-radius:2px; background:var(--ds-fill-3); }
html[data-ds] body .u21s-title{ flex:1 1 auto; font-size:var(--ds-fs-lg); font-weight:700; letter-spacing:-.01em; padding-top:8px; }
html[data-ds] body .u21s-x{ appearance:none; width:36px; height:36px; border:0; border-radius:50%; background:var(--ds-fill); color:var(--ds-ink-2); margin-top:6px; display:grid; place-items:center; }
html[data-ds] body .u21s-scrim.is-on{ background:rgba(3,5,9,.5); }

/* ── 18. 유틸 ───────────────────────────────────────────────────────── */
html[data-ds] body .ds-sprite{ position:absolute; width:0; height:0; overflow:hidden; }
html[data-ds] body .ds-sprite__svg{ display:none; }
html[data-ds] body .ds-sr{ position:absolute !important; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
html[data-ds] body .ds-num{ font-variant-numeric:tabular-nums; }
html[data-ds] body .ds-hide{ display:none !important; }
html[data-ds] body .ds-muted{ color:var(--ds-ink-3); }
html[data-ds] body .ds-accent{ color:var(--ds-accent); }
html[data-ds] body .ds-stack{ display:flex; flex-direction:column; gap:var(--ds-gap); }
html[data-ds] body .ds-row-wrap{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
html[data-ds] body .ds-big{ font-size:var(--ds-fs-2xl); font-weight:700; letter-spacing:-.02em; line-height:1; }
html[data-ds] body .ds-big small{ font-size:var(--ds-fs-sm); font-weight:600; color:var(--ds-ink-3); margin-left:4px; letter-spacing:0; }
html[data-ds] body .ds-svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; display:block; }
html[data-ds] ::selection{ background:rgba(var(--ds-accent-rgb),.35); }
html[data-ds] *:focus{ outline-color:var(--ds-accent); }
@media (prefers-reduced-motion:reduce){ html[data-ds] *{ transition-duration:0s !important; animation-duration:0s !important; } }


/* ── 20. 큰 화면 (≥ 2200px): 한 단 키운다 — 2560 에서 268px 열은 작다 ─────────── */
@media (min-width:2200px){
  html[data-ds]{ --ds-edge:18px; --ds-pill-h:44px; --ds-top:72px; --ds-col-w:300px; --ds-rail-w:64px; --ds-panel-w:340px; --ds-bar-h:72px; --ds-legend-h:70px;
    --ds-fs-xs:12px; --ds-fs-sm:13px; --ds-fs-md:14px; --ds-fs-lg:16px; --ds-fs-xl:22px; --ds-fs-2xl:32px; }
  html[data-ds] body .ds-tool{ width:40px; height:40px; } html[data-ds] body .ds-tool svg{ width:22px; height:22px; }
  html[data-ds] body .ds-rail .ds-tool.ds-tool--l{ min-height:54px; gap:5px; } html[data-ds] body .ds-tool__l{ font-size:11.5px; line-height:13px; }
  html[data-ds] body .ds-play{ width:44px; height:44px; }
  html[data-ds] body .ds-clock b{ font-size:18px; }
}

/* ── 19. 폰 (≤ 760px · 가로 폰) ────────────────────────────────────────── */
@media (max-width:760px), (max-height:500px) and (max-width:960px){
  html[data-ds]{
    --ds-edge:10px; --ds-pill-h:36px; --ds-top:54px; --ds-bar-h:56px; --ds-legend-h:30px; --ds-rail-w:48px; --ds-col-w:auto;
    --ds-above-bar:calc(var(--ds-bar-h) + var(--ds-sab) + 8px);
  }
  html[data-ds] body .ds-head{ padding:0 10px 0 8px; gap:7px; }
  html[data-ds] body .ds-head img{ height:13px; } html[data-ds] body .ds-head i{ display:none; }
  html[data-ds] body .ds-rail{ padding:3px; gap:1px; }
  html[data-ds] body .ds-rail--bottom{ display:none; }                      /* 폰에서는 손가락 확대 */
  html[data-ds] body .ds-tool{ width:34px; height:34px; }
  html[data-ds] body .ds-rail .ds-tool.ds-tool--l{ min-height:42px; padding:5px 0 4px; gap:2px; border-radius:10px; }
  html[data-ds] body .ds-rail .ds-tool--l svg{ width:18px; height:18px; }
  html[data-ds] body .ds-tool__l{ font-size:11px; line-height:12px; letter-spacing:-.03em; }
  /* 왼쪽 열 → 위 가로 칩 줄 (세그먼트·목록이 한 줄로 눕는다). 머리 알약 밑, 레일 왼쪽까지 */
  html[data-ds] body .ds-col{
    top:calc(var(--ds-top) + var(--ds-sat)); bottom:auto; right:calc(var(--ds-edge) + var(--ds-rail-w) + 8px + var(--ds-sar)); width:auto;
    flex-direction:column; align-items:stretch; gap:6px; overflow:visible; padding:0; pointer-events:none;
  }
  html[data-ds] body .ds-col > .ds-card{ padding:3px; background:var(--ds-pill); border-radius:var(--ds-r-pill); flex:none; align-self:flex-start; max-width:100%; overflow:auto hidden; scrollbar-width:none; pointer-events:auto; }
  html[data-ds] body .ds-col > .ds-card::-webkit-scrollbar{ display:none; }
  html[data-ds] body .ds-col .ds-seg{ display:flex; width:max-content; }
  html[data-ds] body .ds-col .ds-list{ width:max-content; }
  html[data-ds] body .ds-col .ds-card__t{ display:none; }
  html[data-ds] body .ds-col .ds-seg{ padding:0; background:transparent; gap:2px; }
  html[data-ds] body .ds-col .ds-seg > button, html[data-ds] body .ds-col .ds-seg > a{ min-height:30px; padding:0 10px; border-radius:var(--ds-r-pill); flex-direction:row; gap:5px; }
  html[data-ds] body .ds-col .ds-seg > button i{ font-size:10.5px; }
  html[data-ds] body .ds-col .ds-list{ flex-direction:row; gap:2px; }
  html[data-ds] body .ds-col .ds-item{ width:auto; min-height:30px; padding:0 10px; border-radius:var(--ds-r-pill); font-size:var(--ds-fs-sm); gap:4px; }
  html[data-ds] body .ds-col .ds-item.is-on{ box-shadow:none; }
  html[data-ds] body .ds-col .ds-item__v{ display:none; }
  /* 범례 = 한 줄 칩 (막대 바로 위 왼쪽) */
  html[data-ds] body .ds-legend{ width:auto; max-width:calc(100vw - 2*var(--ds-edge)); padding:4px 10px 4px 8px; display:flex; align-items:center; gap:8px; border-radius:var(--ds-r-pill); }
  html[data-ds] body .ds-legend__t{ margin:0; gap:4px; font-size:var(--ds-fs-xs); }
  html[data-ds] body .ds-legend__bar{ width:90px; height:6px; }
  html[data-ds] body .ds-legend__s{ margin:0; gap:6px; font-size:10.5px; } html[data-ds] body .ds-legend__s span{ text-align:left; flex:none; }
  html[data-ds] body .ds-legend__s span:not(:first-child):not(:last-child){ display:none; }
  html[data-ds] body .ds-legend__cap{ display:none; }
  /* 시간 막대: 화면 아래 붙임 */
  html[data-ds] body .ds-bar{ left:0; right:0; bottom:0; height:calc(var(--ds-bar-h) + var(--ds-sab)); padding:0 12px var(--ds-sab) 10px; border-radius:var(--ds-r-lg) var(--ds-r-lg) 0 0; gap:10px; grid-template-columns:auto auto 1fr auto; }
  html[data-ds] body .ds-play{ width:36px; height:36px; } html[data-ds] body .ds-play svg{ width:16px; height:16px; }
  html[data-ds] body .ds-clock{ min-width:0; } html[data-ds] body .ds-clock b{ font-size:14px; } html[data-ds] body .ds-clock i{ display:none; }
  html[data-ds] body .ds-track{ height:36px; } html[data-ds] body .ds-track .ds-range{ top:8px; } html[data-ds] body .ds-ticks{ top:26px; font-size:10px; }
  html[data-ds] body .ds-ticks b:nth-of-type(even){ display:none; }     /* 날짜 글이 겹친다 — 하나 걸러 */
  html[data-ds] body .ds-bar .ds-select{ height:28px; padding-left:8px; font-size:var(--ds-fs-xs); }
  html[data-ds] body .ds-attrib{ display:none; }
  html[data-ds] body .ds-toast{ bottom:calc(var(--ds-above-bar) + 44px); }
  html[data-ds] body .ds-panel, html[data-ds] body .ds-panel--left{ right:auto; left:auto; width:auto; max-height:none; }   /* 판은 시트가 맡는다(ust21-sheet) */
  html[data-ds] body .ds-scrim{ padding:0; align-items:end; }
  html[data-ds] body .ds-modal{ width:100%; max-height:88dvh; border-radius:var(--ds-r-lg) var(--ds-r-lg) 0 0; }
  html[data-ds] body .maplibregl-ctrl-bottom-right{ display:none !important; }
  html[data-ds] body .maplibregl-ctrl-bottom-left{ display:none !important; }
}
