/* SAMI Suite 공개 사이트 — 화면 스타일
   - 색·글꼴·반경은 제품 토큰(kit/sami-tokens.css)을 tokens 층으로 읽는다.
   - 사이트 규칙은 모두 site 층 안에 둔다. 편집기(Embed SDK)는 층에 든 호스트 규칙을 자기 안에서 되돌리므로
     사이트의 button·img·svg 규칙이 편집기 안으로 새지 않는다. (층 밖 전역 규칙을 만들지 말 것)
   - 제품색: Writer --writer · Spread --spread · Present --slides · PDF --pdf */
@import url("../kit/sami-tokens.css") layer(tokens);
@layer tokens, site;

@layer site {
:root { --rail: 76px; --pane: 340px; --ink: #1f2329; --ink-hover: #343a43; --on-ink: #fff; --r-card: 14px; }
:root[data-theme="dark"] { --ink: #eef0f3; --ink-hover: #fff; --on-ink: #15171a; }
[data-app="writer"]  { --app: var(--writer);  --app-strong: var(--writer-strong);  --app-soft: var(--writer-soft); }
[data-app="spread"]  { --app: var(--spread);  --app-strong: var(--spread-strong);  --app-soft: var(--spread-soft); }
[data-app="present"] { --app: var(--slides);  --app-strong: var(--slides-strong);  --app-soft: var(--slides-soft); }
[data-app="pdf"]     { --app: var(--pdf);     --app-strong: var(--pdf-strong);     --app-soft: var(--pdf-soft); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; font: 400 15px/1.6 var(--font-ui); color: var(--text); background: var(--title-bg); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 200; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--on-ink); text-decoration: none; }
.skip:focus { top: 8px; }
.noscript { position: fixed; inset: auto 16px 16px; padding: 14px; border-radius: 12px; background: var(--warn-soft); color: var(--text); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
[data-mark] { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.sami-mark { display: block; }
.coarse-only { display: none; }
@media (pointer: coarse) { .fine-only { display: none; } .coarse-only { display: inline; } }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-size: 14.5px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s; }
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: translateY(1px); }
.btn.app { background: var(--app); color: var(--on-accent); }
.btn.app:hover { background: var(--app-strong); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.quiet { background: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 12px; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.fmt { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--app-soft, var(--surface-3)); color: var(--app, var(--text-2)); font: 700 11px/1 var(--font-mono); letter-spacing: .02em; }
.fmts { display: inline-flex; flex-wrap: wrap; gap: 4px; }
kbd { padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font: 600 12px var(--font-ui); }

/* ---------- 틀: 레일 | 가운데 | 작업 창 ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) 0; height: 100vh; height: 100dvh; transition: grid-template-columns .2s ease; }
.shell.with-pane { grid-template-columns: var(--rail) minmax(0, 1fr) var(--pane); }
.main { position: relative; min-width: 0; min-height: 0; display: grid; }
.view { min-width: 0; min-height: 0; grid-area: 1 / 1; }

/* 레일 */
.rail { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 0; padding: 10px 0 12px; overflow-y: auto; scrollbar-width: none; background: var(--title-bg); }
.logo { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; }
.logo:hover { background: var(--hover); }
.ri { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 6px 0 7px; border: 0; border-radius: 12px; background: none; color: var(--text-3); font-size: 11.5px; font-weight: 600; text-decoration: none; text-align: center; }
.ri .ico { position: relative; display: grid; place-items: center; width: 46px; height: 32px; border-radius: 999px; color: var(--text-2); transition: background .15s; }
.ri:hover { color: var(--text); } .ri:hover .ico { background: var(--hover); }
.ri[aria-current="page"] { color: var(--text); font-weight: 750; }
.ri[aria-current="page"] .ico { background: var(--surface); box-shadow: var(--shadow-1); }
.ri .dot { position: absolute; right: 6px; top: 2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--title-bg); background: var(--text-3); opacity: 0; transform: scale(.5); transition: .2s; }
.ri.is-open .dot { opacity: 1; transform: none; }
.ri.is-dirty .dot { background: var(--warn); }
.rail .sp { flex: 1; min-height: 12px; }

/* ---------- 홈 ---------- */
.view-home { position: relative; z-index: 2; display: grid; grid-template-rows: 56px minmax(0, 1fr) 30px; background: var(--title-bg); }
.titlebar { display: grid; grid-template-columns: 1fr minmax(0, 600px) 1fr; align-items: center; gap: 16px; padding: 0 14px 0 6px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.wordmark b { font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; }
.titlebar .right { justify-self: end; display: flex; gap: 6px; }
.search { position: relative; }
.search .field { position: relative; display: flex; align-items: center; height: 40px; border: 1px solid var(--title-border); border-radius: 12px; background: var(--title-fill); transition: border-color .15s, box-shadow .15s; }
.search .field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.search .field > .ic { position: absolute; left: 12px; color: var(--text-3); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0 44px 0 40px; border: 0; background: transparent; font-size: 15px; outline: none; }
.search input::placeholder { color: var(--text-3); }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.search kbd { position: absolute; right: 10px; color: var(--text-3); font-family: var(--font-mono); font-weight: 500; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-3); }
.results .lbl { padding: 6px 10px 4px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.results [role="option"] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.results [role="option"][aria-selected="true"], .results [role="option"]:hover { background: var(--hover); }
.results b { display: block; font-size: 14px; font-weight: 650; }
.results small { display: block; color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .go { color: var(--text-3); font-size: 12px; }
.results mark { background: color-mix(in srgb, var(--warn) 24%, transparent); color: inherit; border-radius: 3px; }
.results .empty { padding: 14px 10px; color: var(--text-2); font-size: 13.5px; }
.results .hint { display: flex; gap: 14px; margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }

.content { min-width: 0; overflow: auto; margin-right: 14px; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--surface); outline: none; }
.shell.with-pane .content { margin-right: 0; }
.content-inner { max-width: 1080px; margin: 0 auto; padding: 36px 40px 0; container-type: inline-size; }
.hello h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
.hello p { margin: 8px 0 0; color: var(--text-2); font-size: 15.5px; }

/* 끌어 놓기 상자 (누르면 파일 고르기) */
.drop { position: relative; display: grid; justify-items: center; gap: 12px; width: 100%; margin-top: 22px; padding: 28px 24px 22px; border: 1.5px dashed var(--line-strong); border-radius: 18px; background: var(--surface-2); color: var(--text); text-align: center; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--text-3); }
.drop .glyph { position: relative; width: 120px; height: 52px; }
.drop .glyph > span { position: absolute; top: 10px; transition: transform .25s; }
.drop .glyph .a { left: 6px; transform: rotate(-12deg); }
.drop .glyph .b { right: 6px; transform: rotate(12deg); }
.drop .glyph .c { left: 50%; top: 0; transform: translateX(-50%); filter: drop-shadow(0 6px 12px rgba(20, 22, 26, .16)); }
.drop:hover .glyph .a { transform: rotate(-18deg) translate(-6px, 2px); }
.drop:hover .glyph .b { transform: rotate(18deg) translate(6px, 2px); }
.drop-title { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.drop .formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; width: 100%; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.drop .formats > span { display: inline-flex; align-items: center; gap: 7px; }
.assure { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 13.5px; }
.assure li { display: inline-flex; align-items: center; gap: 6px; }
.assure .ic { color: var(--ok); width: 16px; height: 16px; }

.sec { padding-top: 34px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.sec-head p { margin: 0; color: var(--text-3); font-size: 13px; }

.new { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { display: grid; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-align: left; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--app) 50%, var(--line)); }
.tile .thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--app-soft); overflow: hidden; }
.tile .meta { display: flex; align-items: center; gap: 10px; padding: 11px 12px 12px; }
.tile .meta b { display: block; font-size: 14.5px; font-weight: 700; }
.tile .meta small { display: block; color: var(--text-3); font-size: 12px; }
.tile .plus { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--app); color: var(--on-accent); opacity: 0; transform: scale(.8); transition: .15s; }
.tile:hover .plus, .tile:focus-visible .plus { opacity: 1; transform: none; }
.tile .plus .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.pg, .pdfp { position: relative; width: 46%; aspect-ratio: 210 / 297; margin-top: 18%; border-radius: 4px 4px 0 0; background: #fff; box-shadow: 0 8px 24px rgba(20, 22, 26, .1); padding: 12% 11%; display: grid; align-content: start; gap: 7%; }
.pg i, .pdfp i { display: block; height: 5px; border-radius: 3px; background: #e3e5e9; }
.pg i.t { height: 9px; width: 62%; background: var(--writer); opacity: .85; }
.pg i.s { width: 70%; } .pdfp i.s { width: 60%; }
.pdfp svg { position: absolute; left: 20%; top: 50%; width: 64%; color: var(--pdf); }
.sheet { width: 74%; margin-top: 14%; aspect-ratio: 16 / 9; border-radius: 6px 6px 0 0; background: #fff; box-shadow: 0 8px 24px rgba(20, 22, 26, .1); display: grid; grid-template-columns: 12% repeat(4, 1fr); grid-auto-rows: 1fr; overflow: hidden; }
.sheet span { border-right: 1px solid #e6e8eb; border-bottom: 1px solid #e6e8eb; }
.sheet span.h { background: #f1f2f4; }
.sheet span.sel { outline: 2px solid var(--spread); outline-offset: -2px; background: #fff; }
.slide { position: relative; width: 74%; aspect-ratio: 16 / 9; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(20, 22, 26, .1); display: grid; align-content: center; justify-items: center; gap: 8%; overflow: hidden; }
.slide i { display: block; height: 9%; border-radius: 3px; background: #e3e5e9; }
.slide i.t { width: 56%; height: 13%; background: var(--slides); opacity: .85; }
.slide i.s { width: 38%; }
.slide em { position: absolute; right: -6%; bottom: -26%; width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--slides-soft); }
:root[data-theme="dark"] :is(.pg, .sheet, .slide, .pdfp) { box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.app-card { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.app-card:hover { border-color: color-mix(in srgb, var(--app) 40%, var(--line)); background: color-mix(in srgb, var(--app-soft) 25%, var(--surface)); }
.app-card .hd { display: flex; align-items: center; gap: 10px; }
.app-card .hd b { display: block; font-size: 15px; font-weight: 750; }
.app-card .hd small { display: block; color: var(--text-3); font-size: 12px; }
.app-card .p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.app-card .ul { display: grid; gap: 5px; font-size: 13px; color: var(--text-2); }
.app-card .ul span { display: flex; gap: 8px; align-items: baseline; }
.app-card .ul span::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--app); transform: translateY(-2px); }
.app-card .more { display: inline-flex; align-items: center; gap: 4px; color: var(--app); font-weight: 700; font-size: 13.5px; }

.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 14.5px; font-weight: 650; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 9px; height: 9px; flex: none; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq details > div { padding: 0 16px 16px; color: var(--text-2); font-size: 14px; line-height: 1.75; }

@container (max-width: 860px) { .apps, .new { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 560px) { .apps, .faq-wrap { grid-template-columns: minmax(0, 1fr); } }

/* 바닥글 · 제공자 정보 */
.site-foot { margin: 44px 0 0; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-brand .wordmark b { font-size: 16px; }
.foot-brand p { margin: 12px 0 0; max-width: 34ch; line-height: 1.7; }
.foot-col h3 { margin: 0 0 10px; color: var(--text); font-size: 13px; font-weight: 700; }
.foot-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.foot-col a { color: var(--text-2); text-decoration: none; }
.foot-col a:hover { color: var(--text); text-decoration: underline; }
.provider { display: grid; gap: 6px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.7; }
.provider .who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.provider .who b { color: var(--text-2); font-weight: 650; }
.provider .who a { color: inherit; text-decoration: none; }
.provider .who a:hover { color: var(--text); text-decoration: underline; }
.provider .who span + span::before { content: ""; display: inline-block; width: 1px; height: 10px; margin-right: 14px; background: var(--line-strong); vertical-align: -1px; }
.provider .legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.provider .legal-links a { color: var(--text-2); text-decoration: none; }
.provider .legal-links a.strong { color: var(--text); font-weight: 650; }
.ph { font-style: normal; color: var(--text-3); background: repeating-linear-gradient(-45deg, transparent 0 4px, color-mix(in srgb, var(--text-3) 12%, transparent) 4px 5px); border-radius: 3px; padding: 0 3px; }
@container (max-width: 760px) { .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }

.statusbar { display: flex; align-items: center; gap: 16px; padding: 0 16px 0 6px; color: var(--status-text); font-size: 12px; white-space: nowrap; overflow: hidden; }
.statusbar .dot { display: inline-flex; align-items: center; gap: 6px; }
.statusbar .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.statusbar .sp { flex: 1; }
.statusbar a { color: inherit; text-decoration: none; }
.statusbar a:hover { color: var(--text); text-decoration: underline; }
.statusbar .who b { color: var(--text-2); font-weight: 650; }

/* ---------- 편집기 ---------- */
/* 편집기 조상에는 transform · filter · contain:paint 를 주지 않는다(편집기 메뉴·대화상자 위치가 어긋남). */
.view-editors { position: relative; }
.view-editors.is-off { visibility: hidden; pointer-events: none; }
.stage { position: absolute; inset: 0; }
.editor-host { position: absolute; inset: 0; overflow: hidden; background: var(--surface); }
.editor-host:not(.is-active) { visibility: hidden; pointer-events: none; }
/* 런타임이 자리(.sami-embed-host)에 position:relative 를 주므로 크기는 width·height 로 준다 */
.editor-host > .mount { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: var(--title-bg); }
.loader-box { display: grid; justify-items: center; gap: 14px; width: min(360px, 90%); text-align: center; }
.loader-box b { font-size: 17px; font-weight: 750; }
.loader-box small { color: var(--text-3); font-size: 13px; }
.bar { position: relative; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: var(--line); }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 2px; background: var(--app, var(--accent)); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .bar::after { animation: none; width: 100%; opacity: .5; } }
.loader.is-error .bar { display: none; }
.loader .err { color: var(--danger); font-size: 13.5px; }

/* ---------- 작업 창 (할 일 안내) ---------- */
.pane { min-width: 0; overflow: auto; padding: 10px 14px 14px 10px; background: var(--title-bg); }
.shell:not(.with-pane) .pane { visibility: hidden; padding: 0; }
.task-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.pane-head { display: flex; align-items: center; gap: 12px; }
.pane-head h2 { margin: 0; font-size: 16.5px; font-weight: 750; letter-spacing: -.02em; line-height: 1.3; }
.pane-head small { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.pane-head .icon-btn { margin-left: auto; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; line-height: 1.55; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--app-soft); color: var(--app); font-size: 12.5px; font-weight: 800; }
.steps em { font-style: normal; font-weight: 700; }
.tip { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.tip .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); }

/* ---------- 끌어 놓기 덮개 · 알림 · 대화상자 ---------- */
.veil { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--title-bg) 78%, transparent); backdrop-filter: blur(6px); }
.veil::before { content: ""; position: absolute; inset: 12px; border: 2.5px dashed color-mix(in srgb, var(--text) 35%, transparent); border-radius: 22px; pointer-events: none; }
.veil-box { display: grid; justify-items: center; gap: 12px; padding: 36px 48px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-3); text-align: center; pointer-events: none; }
.veil-box .row { display: flex; gap: 10px; }
.veil-box b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.veil-box small { color: var(--text-3); font: 600 12px var(--font-mono); }

.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 1100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 12px; border-radius: 14px; background: var(--chrome); color: var(--chrome-text); box-shadow: var(--shadow-3); font-size: 14px; pointer-events: auto; animation: rise .2s ease; }
.toast small { display: block; color: var(--chrome-text-2); font-size: 12.5px; }
.toast .ic { color: var(--chrome-text-2); }
.toast.is-error .ic { color: #ff9389; }
.toast button { margin-left: 4px; height: 30px; padding: 0 10px; border: 1px solid var(--chrome-border); border-radius: 8px; background: transparent; color: var(--chrome-text); font-size: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); }
.dlg::backdrop { background: var(--scrim); }
.dlg form { display: grid; gap: 10px; padding: 22px 22px 18px; }
.dlg h2 { margin: 0; font-size: 17px; font-weight: 750; }
.dlg p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.dlg-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 좁은 화면: 레일 → 아래 탭 막대 ---------- */
@media (max-width: 860px) {
  .shell, .shell.with-pane { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow: visible; border-top: 1px solid var(--line); background: var(--surface); }
  .rail .logo, .rail .sp, .rail [data-theme-toggle] { display: none; }
  .ri { width: auto; flex: 1; font-size: 11px; }
  .ri .dot { border-color: var(--surface); }
  .main { grid-row: 1; }
  .titlebar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 10px; }
  .titlebar .wordmark { display: none; }
  .titlebar .right .btn span { display: none; }
  .search kbd { display: none; }
  .content { margin: 0; border-left: 0; border-right: 0; border-radius: 14px 14px 0 0; }
  .content-inner { padding: 20px 16px 32px; }
  .drop .glyph { display: none; }
  .hide-sm { display: none; }
  .pane { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 82vh; padding: 0; background: transparent; transform: translateY(110%); transition: transform .25s; }
  .shell.with-pane .pane { transform: none; visibility: visible; }
  .task-card { border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
}
