/* STYLE-LIBRARY:BEGIN — tools/pick-style.js 가 쓴 블록. 손으로 고치지 말고 다시 실행 */
:root{--bg:#d9e6f8;--paper:#ffffff;--ink:#1f1d33;--muted:#5a5872;--accent:#6d28d9;--accent-ink:#ffffff;--line:#d3dff0;--font-display:"Sora", Pretendard, "Noto Sans KR", sans-serif;--font-body:Pretendard, "Noto Sans KR", system-ui, sans-serif;--radius:20px;--shadow:0 10px 30px rgba(109, 40, 217, .10);--border:1px solid rgba(255, 255, 255, .75);--card-pad:16px;--dur:360ms;--ease:cubic-bezier(0.4, 0, 0.2, 1);--enter:rise-blur;--stagger:70ms;--layout:chat-flow;--x-glow:radial-gradient(circle at 50% 30%, #f1e4ff 0%, transparent 60%);--x-cloud:#f7d9ea}
/* STYLE-LIBRARY:END */
/* 엑셀 수식 → 구글 시트 함수 호환 검사(#2788).
 * 색·글꼴·모서리·움직임은 위 STYLE-LIBRARY 블록(스타일 창고 ai-cloud, tools/pick-style.js 가 씀)의 토큰을 바탕으로 한다.
 * 짜임(참고 화면 ai-assistant-project-revive, design-dna 측정색 #f8eef8·#dfe2f2·#9367d8): 하늘·분홍 구름 바탕 + 흰 반투명 판,
 *   ① 대화 첫 화면 = 수식 입력창(아래 보라 단추) + 추천 질문 알약 3개 = 예시 수식, ② 상태 탭(분류·개수) = 분류별 거르기,
 *   ③ 할 일 카드(색 면 + 우선순위 배지) = 함수 결과 카드. 1280px 부터 입력 판이 왼쪽에 붙고 결과가 오른쪽.
 * 상태는 표가 아니라 선·색·배경: 카드 왼쪽 막대 색 + 옅은 같은 색 면 + 배지 글자(색만으로 구분하지 않음).
 *   바깥 글꼴은 불러오지 않는다(meta CSP font-src self) — 토큰 글꼴 목록의 시스템 폴백("Noto Sans KR" 포함)으로 보인다. */
:root {
  --font: var(--font-body);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans KR", monospace;
  --panel: rgba(255, 255, 255, .86);
  --line-strong: #7a7896;      /* 입력칸·체크 테두리: 흰 바탕 4.2:1, 판 위 3:1 이상 */
  --focus: #4c1d95;
  --s-same: #1d7f54;   --s-same-bg: #e3f4eb;   --s-same-ink: #12583a;
  --s-diff: #b85f00;   --s-diff-bg: #fdeedb;   --s-diff-ink: #7f4100;
  --s-miss: #c0284f;   --s-miss-bg: #fbe4ea;   --s-miss-ink: #941b3b;
  --s-sheet: #2d68cf;  --s-sheet-bg: #e3ecfb;  --s-sheet-ink: #1b4a9c;
  --s-unk: #6c6985;    --s-unk-bg: #eeedf4;    --s-unk-ink: #46435c;
  --s-list: #0e7c86;   --s-list-bg: #e1f3f4;   --s-list-ink: #0a5960;   /* 양쪽 공식 목록에 있음(이름만, 대조 전) */
  --s-xl: #a1368f;     --s-xl-bg: #f7e5f3;     --s-xl-ink: #76236a;     /* 엑셀 목록에만 있음 */
  --pill-line: #8a6fd1;   /* 예시 알약 테두리: 판 3.87:1 · 알약 바탕 3.57:1 (r2, 전 #cdbff0 = 1.65) */
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
  background: radial-gradient(ellipse 60% 40% at 88% 0%, var(--x-cloud) 0%, transparent 70%),
              radial-gradient(ellipse 50% 35% at 6% 18%, #f1e4ff 0%, transparent 70%),
              linear-gradient(180deg, var(--bg) 0%, #eef0fb 55%, #f6eef8 100%);
  background-color: var(--bg); min-height: 100vh; caret-color: var(--accent);
}
::selection { background: #e4d6fb; color: var(--ink); }
h1, h2, h3 { --font: var(--font-display); font-family: var(--font); line-height: 1.3; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1.125rem; font-weight: 800; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .92em; background: rgba(109, 40, 217, .07); border-radius: 6px; padding: 0 .3em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; background: var(--paper); color: var(--ink); }
.skip:focus { left: 8px; top: 8px; z-index: 9; }
.app, .foot { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 머리: 참고 화면의 인사 문구 자리(왼쪽 위, 큰 두 줄) */
.bar { padding: 22px 0 18px; }
.bar h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem); font-weight: 800; letter-spacing: -0.02em; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 1rem; max-width: 60ch; }

.layout { display: grid; gap: 18px; padding-bottom: 28px; }
.ask, .out, .feat, .ref, .faq, .about, .also {
  background: var(--panel); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
@supports (backdrop-filter: blur(1px)) { .ask, .out, .feat { backdrop-filter: blur(14px) saturate(140%); } }

/* ① 입력: 대화 첫 화면의 입력창 */
.ask h2 { margin-bottom: 10px; }
.field-label { display: block; font-weight: 700; font-size: .9375rem; margin-bottom: 8px; }
.composer { background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 18px; padding: 10px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(109, 40, 217, .14); outline: 3px solid var(--focus); outline-offset: 2px; }
textarea { display: block; width: 100%; min-height: 150px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 .9375rem/1.6 var(--mono); padding: 4px 6px; word-break: break-all; }
textarea::placeholder { color: var(--muted); opacity: 1; }
textarea::-webkit-scrollbar { width: 10px; }
textarea::-webkit-scrollbar-thumb { background: #cfc7e6; border-radius: 10px; border: 3px solid var(--paper); }
.composer-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
button { font: inherit; cursor: pointer; }
.btn-main { min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: 0 8px 18px rgba(109, 40, 217, .28); transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.btn-main:hover { box-shadow: 0 10px 24px rgba(109, 40, 217, .36); }
.btn-main:active, .btn-ghost:active, .pill:active, .btn-copy:active, .tab:active { transform: scale(.97); }
.btn-ghost { min-height: 46px; padding: 0 18px; border-radius: 999px; background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); font-weight: 700; }
.btn-ghost:hover { background: rgba(109, 40, 217, .06); }
.help { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--pill-line); background: #f6f0ff; color: #4c1d95; font-weight: 700; font-size: .9375rem; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.pill:hover { background: #ece2ff; border-color: var(--accent); }
.privacy { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(217, 230, 248, .6); color: var(--muted); font-size: .8125rem; }
.note-js { padding: 10px 12px; border-radius: 12px; background: var(--s-diff-bg); color: var(--s-diff-ink); }

/* ② 결과 머리 + 상태 탭 */
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#h-out { scroll-margin-top: 12px; }
#h-out:focus { outline: none; }   /* 「검사하기」 뒤 옮겨 온 초점 자리(누르는 곳 아님). 키보드 초점 표시는 :focus-visible 이 그대로 그림 */
#h-out:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.btn-copy { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--paper); color: #4c1d95; font-weight: 800; }
.btn-copy:hover { background: #f6f0ff; }
.summary { margin: 12px 0 0; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.summary.is-warn { color: var(--s-miss-ink); }
.summary.is-ok { color: var(--s-same-ink); }
.copy-msg { margin: 4px 0 0; min-height: 1.4em; font-size: .875rem; color: var(--s-same-ink); font-weight: 700; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font-weight: 700; font-size: .875rem; box-shadow: 0 2px 8px rgba(31, 29, 51, .06); }
.tab::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tab-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.tab[aria-pressed="true"] { border-color: var(--c); background: var(--cb); }
.tab:disabled { opacity: .55; cursor: default; box-shadow: none; }
.t-same, .c-same { --c: var(--s-same); --cb: var(--s-same-bg); --ci: var(--s-same-ink); }
.t-diff, .c-diff, .c-part { --c: var(--s-diff); --cb: var(--s-diff-bg); --ci: var(--s-diff-ink); }
.t-missing, .c-missing, .c-no { --c: var(--s-miss); --cb: var(--s-miss-bg); --ci: var(--s-miss-ink); }
.t-sheets, .c-sheets { --c: var(--s-sheet); --cb: var(--s-sheet-bg); --ci: var(--s-sheet-ink); }
.t-unknown, .c-unknown { --c: var(--s-unk); --cb: var(--s-unk-bg); --ci: var(--s-unk-ink); }
.t-listed, .c-listed { --c: var(--s-list); --cb: var(--s-list-bg); --ci: var(--s-list-ink); }
.t-xlonly, .c-xlonly { --c: var(--s-xl); --cb: var(--s-xl-bg); --ci: var(--s-xl-ink); }
.t-gsonly, .c-gsonly { --c: var(--s-sheet); --cb: var(--s-sheet-bg); --ci: var(--s-sheet-ink); }
.c-ok { --c: var(--s-same); --cb: var(--s-same-bg); --ci: var(--s-same-ink); }

/* ③ 결과 카드: 참고 화면의 색 면 할 일 카드. 상태 = 왼쪽 막대 색(오너 지시 「선·색으로 읽음」) + 옅은 면 + 배지 */
.results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.card { position: relative; background: var(--cb); border-left: 5px solid var(--c); border-radius: 16px; padding: 14px 16px 12px 16px; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), filter var(--dur) var(--ease); transition-delay: calc(var(--i, 0) * 40ms); }
/* 점선 막대 = 사실표 대조 전(공식 목록 이름만 맞댐), 실선 = 사실표 판정 */
.card.c-unknown, .card.c-listed, .card.c-xlonly, .card.c-gsonly { border-left-style: dashed; }
.card.enter { opacity: 0; transform: translateY(10px); filter: blur(4px); transition: none; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fn { font-family: var(--mono); font-weight: 800; font-size: 1.0625rem; background: none; padding: 0; color: var(--ink); }
.fn-g { font-weight: 800; font-size: 1rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--paper); color: var(--ci); font-size: .8125rem; font-weight: 800; border: 1px solid var(--c); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.times { font-size: .8125rem; color: var(--muted); }
.rid { margin-left: auto; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.desc { margin: 8px 0 0; font-size: .9375rem; }
.note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .72); }
.note p { margin: 2px 0 0; font-size: .9375rem; }
.note-label { font-size: .75rem; font-weight: 800; color: var(--ci); }
.noalt { color: var(--muted); }
.alt-link { display: inline-flex; align-items: center; min-height: 44px; color: #4c1d95; font-weight: 700; }
.basis { margin: 8px 0 0; font-size: .8125rem; color: var(--muted); }
.src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 10px 0 0; font-size: .8125rem; }
.src-label { color: var(--muted); font-weight: 700; }
.src a { color: #4c1d95; display: inline-flex; align-items: center; min-height: 44px; }
.legend { margin-top: 16px; }
.legend-title { margin: 0 0 8px; font-weight: 800; font-size: .9375rem; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lg { background: var(--cb); border-left: 5px solid var(--c); border-radius: 12px; padding: 8px 12px; font-size: .875rem; }
.lg.c-unknown, .lg.c-listed, .lg.c-xlonly, .lg.c-gsonly { border-left-style: dashed; }
.lg b { color: var(--ci); margin-right: 6px; }

/* 기능 점검 */
.feat { display: grid; gap: 16px; }
.groups { display: grid; gap: 12px; margin-top: 14px; }
.group { border: 0; margin: 0; padding: 0; min-width: 0; }
.group legend { font-weight: 800; font-size: .875rem; color: var(--muted); padding: 0; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line-strong); font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check:has(input:checked) { background: #efe6ff; border-color: var(--accent); color: #3b1678; }
.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.feat-out .summary { margin-top: 0; }

/* 표 전체(JS 없이도 보임) */
.ref h2 { margin-bottom: 4px; }
.ref-h2 { margin-top: 22px !important; }
.ref-group { margin-top: 10px; border-radius: 14px; background: var(--paper); border-left: 5px solid var(--c, var(--accent)); }
.ref-group.c-feat { --c: var(--accent); }
.ref-group summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; font-weight: 800; list-style: none; }
.ref-group summary::-webkit-details-marker { display: none; }
.ref-group summary::after { content: "+"; margin-left: auto; font-size: 1.25rem; color: var(--muted); }
.ref-group[open] summary::after { content: "−"; }
.ref-n { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ref-list { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 0; }
.ref-list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.ref-list .fn { font-size: .9375rem; }
.ref-d { color: var(--ink); }
.ref-note { color: var(--muted); }
.ref-badge { justify-self: start; font-size: .75rem; font-weight: 800; padding: 0 8px; border-radius: 999px; }
.f-ok { color: var(--s-same-ink); background: var(--s-same-bg); }
.f-part { color: var(--s-diff-ink); background: var(--s-diff-bg); }
.f-no { color: var(--s-miss-ink); background: var(--s-miss-bg); }

.faq details { border-top: 1px solid var(--line); }
.faq details:first-of-type { margin-top: 8px; border-top: 0; }
.faq summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; padding: 8px 0; }
.faq p { margin: 0 0 12px; color: var(--muted); font-size: .9375rem; }
.about p { margin: 8px 0 0; font-size: .9375rem; color: var(--muted); }
.about .asof { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: #efe6ff; color: #4c1d95; font-weight: 800; font-size: .875rem; }
.src-main { margin: 10px 0 0; padding-left: 18px; font-size: .875rem; }
.src-main li { padding: 0; }
.src-main a { display: inline-flex; align-items: center; min-height: 44px; }
.also ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.also a { display: grid; gap: 2px; padding: 12px 14px; min-height: 56px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.also a:hover { border-color: var(--accent); transform: translateY(-1px); }
.also a span { color: var(--muted); font-size: .875rem; }
.foot { padding: 8px 16px 32px; color: var(--muted); font-size: .8125rem; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
.clip { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* 넓은 화면(1280px~): 입력 판 왼쪽 고정, 결과 오른쪽. 그보다 좁으면 한 줄(오너 폰 펼침 ≈1100px 포함) */
@media (min-width: 1280px) {
  .layout { grid-template-columns: 420px minmax(0, 1fr); align-items: start; }
  .ask { position: sticky; top: 16px; }
  .feat, .ref, .faq, .about, .also { grid-column: 1 / -1; }
  .feat { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .also ul { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1279px) {
  .also ul { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .app { padding: 0 12px; }
  .ask, .out, .feat, .ref, .faq, .about, .also { padding: 14px; border-radius: 18px; }
  .composer-actions { justify-content: stretch; }
  .composer-actions button { flex: 1; }
  .rid { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; transition-delay: 0ms !important; animation: none !important; }
}
@media print {
  body { background: #fff; }
  .examples, .composer-actions, .btn-copy, .tally, .foot-links { display: none; }
}
