@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #66666b;
  --line: #dfe1e6;
  --blue: #2d49f0;
  --paper: #ffffff;
  --soft: #f5f6fa;
  --surface: #ffffff;
  --surface-hover: #fbfbfd;
  --placeholder: #88888c;
  --count-muted: #9799a0;
  --secondary: #45454a;
  --soft-line: #d6d6d8;
  --subtle-line: #ececf0;
  --code-paper: #f5f6fa;
  --code-ink: #17171b;
  --drop-border: #77777c;
  --drop-muted: #77777c;
  --drag-paper: #f1f3ff;
  --action-ink: #ffffff;
  --font-sans: 'DM Sans', 'Noto Sans KR', Arial, sans-serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef0f4;
  --muted: #a2a6af;
  --line: #383b45;
  --blue: #2d49f0;
  --paper: #17191f;
  --soft: #17191f;
  --surface: #17191f;
  --surface-hover: #1c1e24;
  --placeholder: #9297a1;
  --count-muted: #9297a1;
  --secondary: #c5c8d0;
  --soft-line: #373a44;
  --subtle-line: #2e313a;
  --code-paper: #1b1d23;
  --code-ink: #e3e5eb;
  --drop-border: #747984;
  --drop-muted: #a2a6af;
  --drag-paper: #282e41;
  --action-ink: #ffffff;
}

:root[data-theme="deep-dark"] {
  color-scheme: dark;
  --ink: #f2f3f6;
  --muted: #969ba5;
  --line: #292c34;
  --blue: #2d49f0;
  --paper: #000000;
  --soft: #000000;
  --surface: #000000;
  --surface-hover: #0a0a0c;
  --placeholder: #777d87;
  --count-muted: #7f858f;
  --secondary: #c1c4cd;
  --soft-line: #282b33;
  --subtle-line: #20232a;
  --code-paper: #08090b;
  --code-ink: #e1e4eb;
  --drop-border: #666b76;
  --drop-muted: #969ba5;
  --drag-paper: #1a2032;
  --action-ink: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); font-family: var(--font-sans); line-height: 1.5; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.topbar,
main { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--blue); color: var(--action-ink); font-size: 17px; font-weight: 800; letter-spacing: -.08em; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.theme-control { min-height: 40px; display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.theme-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-control select { max-width: 120px; padding: 6px 0; border: 0; outline: 0; appearance: none; -webkit-appearance: none; background: transparent; color: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.theme-control select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.theme-chevron { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

main { padding-bottom: 54px; }
.hero { display: block; padding: 58px 0 18px; }
.hero-copy { min-width: 0; }
.eyebrow { margin: 0; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; line-height: 1.4; }
.hero-eyebrow { margin-bottom: 18px; }
.hero h1 { margin: 0; font-size: clamp(32px, 4vw, 45px); font-weight: 800; line-height: 1.1; letter-spacing: -.055em; }
.hero h1 span { color: var(--blue); }
.hero-description { max-width: 640px; margin: 23px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.search-area { margin-top: 38px; border: 1px solid var(--line); background: var(--surface); }
.search-form { min-height: 72px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 10px 9px 18px; }
.search-icon { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: square; }
.search-form input { width: 100%; min-width: 0; height: 52px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-form input::placeholder { color: var(--placeholder); }
.search-form:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.search-button { min-width: 112px; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 1px solid var(--line); background: var(--blue); color: var(--action-ink); font-size: 13px; font-weight: 700; }
.search-button:hover { background: var(--ink); color: var(--paper); }
.search-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }


.source-tabs { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.source-tab { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; font-weight: 600; transition: color .12s, border-color .12s; }
.source-tab:hover { color: var(--ink); }
.source-tab.is-active { border-bottom-color: var(--blue); color: var(--blue); }
.source-tab span { color: var(--count-muted); font-size: 10px; font-weight: 600; }
.semantic-status { margin: 10px 0 0 2px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.semantic-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--blue); }
.semantic-status.is-error::before { background: var(--muted); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 38px; margin-top: 22px; }
.results-column { min-width: 0; padding: 26px 26px 34px 0; }
.sidebar { min-width: 0; display: grid; align-content: start; gap: 24px; padding: 26px 0 30px; }
.welcome-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 32px; padding: 20px; border: 0; background: var(--soft); }
.welcome-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--blue); }
.welcome-icon svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.welcome-card .eyebrow { margin-bottom: 7px; }
.welcome-card h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.04em; }
.welcome-card p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.result-group { margin-bottom: 32px; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.group-heading h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.035em; }
.group-count { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.group-count strong { color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.result-list { display: grid; grid-template-columns: 1fr; }
.more-results { min-width: 112px; min-height: 38px; display: block; margin: 14px auto 0; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.more-results:hover { border-color: var(--blue); color: var(--blue); }
.more-results[hidden] { display: none; }
.result-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 17px 0; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); transition: background .14s; }
.result-card:hover { background: var(--surface-hover); }
.result-card h3 { margin: 0 0 8px; color: var(--blue); font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.result-card h3 a { text-decoration: none; }
.result-card h3 a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.result-excerpt { margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.65; }
.code-preview { width: 100%; height: 184px; min-height: 46px; max-height: 70vh; margin: 13px 0 0; padding: 12px; overflow: auto; resize: vertical; border: 1px solid var(--line); background: var(--code-paper); color: var(--code-ink); font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-preview code { font: inherit; }
.result-footer { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.result-footer span { min-width: 0; word-break: keep-all; }
.result-footer a { flex: none; color: var(--blue); font-weight: 700; text-decoration: none; }
.result-footer a:hover { text-decoration: underline; text-underline-offset: 2px; }
.empty-state, .status-message { grid-column: 1 / -1; padding: 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.status-message { background: var(--soft); }

.side-card { min-width: 0; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.side-card-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 0; }
.side-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--soft); color: var(--blue); }
.side-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.side-card-heading h2 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.025em; }
.side-card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.index-stats { display: flex; align-items: baseline; gap: 8px; padding: 17px 0 15px; border-bottom: 1px solid var(--soft-line); }
.index-stats strong { color: var(--ink); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.index-stats span { color: var(--muted); font-size: 10px; }
.outline-button { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; }
.outline-button:hover { background: var(--blue); color: var(--action-ink); }
.outline-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.dropzone { margin-top: 9px; padding: 12px 8px; border: 1px dashed var(--drop-border); color: var(--muted); text-align: center; font-size: 10px; line-height: 1.6; }
.dropzone small { display: block; color: var(--drop-muted); font-size: 10px; }
.dropzone.is-dragging { border-color: var(--blue); background: var(--drag-paper); color: var(--blue); }
.privacy-hint { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.privacy-hint svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: square; stroke-linejoin: miter; }
.drive-source-list { display: flex; flex-direction: column; margin-top: 12px; }
.drive-source-list details { padding: 10px 0; border-bottom: 1px solid var(--soft-line); }
.drive-source-list details:last-child { border-bottom: 0; padding-bottom: 0; }
.drive-source-list summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); cursor: pointer; list-style: none; font-size: 11px; font-weight: 600; }
.drive-source-list summary::-webkit-details-marker { display: none; }
.drive-source-list summary::after { content: '+'; color: var(--blue); font-size: 18px; line-height: 1; }
.drive-source-list details[open] summary::after { content: '−'; }
.drive-source-list ul { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.drive-source-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--subtle-line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.drive-source-list li a { color: var(--blue); font-weight: 700; text-decoration: none; white-space: nowrap; }
.drive-source-list li a:hover { text-decoration: underline; text-underline-offset: 2px; }

.web-search-container { min-height: 30px; }
.web-query-block { margin: 0 0 14px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.web-query-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.web-query-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.web-query-label { flex: none; padding: 3px 6px; border: 1px solid var(--blue); color: var(--blue); font-size: 9px; font-weight: 800; }
.web-query-text { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.web-query-heading > a, .web-fallback-link { color: var(--blue); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.web-query-heading > a:hover, .web-fallback-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.web-fallback-link { display: block; margin: 8px 0 0; padding: 12px; border: 1px solid var(--line); background: var(--surface); white-space: normal; }
.web-placeholder { padding: 15px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.web-placeholder a { color: var(--blue); }
.web-search-container .gsc-control-cse { padding: 0; border: 0; background: transparent !important; color: var(--ink); font-family: var(--font-sans) !important; }
.web-search-container .gsc-control-wrapper-cse, .web-search-container .gsc-results-wrapper-overlay { font-family: var(--font-sans) !important; }
.web-search-container .gsc-result { border: 0 !important; border-bottom: 1px solid var(--soft-line) !important; background: var(--surface) !important; }
.web-search-container .gs-title, .web-search-container .gs-title b { color: var(--blue) !important; font-family: var(--font-sans) !important; }
.web-search-container .gs-snippet, .web-search-container .gsc-url-top, .web-search-container .gs-visibleUrl, .web-search-container .gs-visibleUrl b { color: var(--muted) !important; font-family: var(--font-sans) !important; }
.web-search-container .gsc-result-info { display: none !important; }
.web-search-container .gsc-cursor-page { color: var(--blue) !important; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(420px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid var(--ink); background: var(--blue); color: var(--action-ink); font-size: 12px; box-shadow: 4px 4px 0 var(--ink); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 920px) {
  .topbar, main { width: min(100% - 44px, 760px); }
  .hero { padding-top: 50px; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 250px; }
  .results-column { padding-right: 20px; }
  .sidebar { padding-left: 19px; }
  .result-list { grid-template-columns: 1fr; }
  .result-card { min-height: 0; }
}

@media (max-width: 700px) {
  .topbar, main { width: calc(100% - 36px); }
  .topbar { min-height: 64px; }
  .hero { padding: 42px 0 14px; }
  .hero h1 { font-size: clamp(25px, 5.5vw, 35px); }
  .hero-eyebrow { margin-bottom: 13px; font-size: 9px; }
  .hero-description { margin-top: 15px; font-size: 12px; }
  .search-area { margin-top: 24px; }
  .search-form { min-height: 62px; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 9px; padding: 7px; }
  .search-form input { height: 46px; font-size: 13px; }
  .search-button { min-width: 82px; height: 46px; gap: 6px; padding: 0 10px; font-size: 12px; }
  .source-tabs { gap: 4px 18px; margin-top: 13px; }
  .source-tab { min-height: 42px; padding: 7px 0; font-size: 11px; }
  .content-grid { grid-template-columns: 1fr; margin-top: 25px; }
  .results-column { padding: 20px 0 26px; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .side-card { padding: 0 0 18px; }
  .welcome-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 15px; margin-bottom: 27px; }
  .welcome-icon { width: 44px; height: 44px; }
  .welcome-icon svg { width: 34px; height: 34px; }
  .welcome-card h2 { font-size: 16px; }
  .welcome-card p:last-child { font-size: 11px; }
  .group-heading h2 { font-size: 22px; }
  .result-card { padding: 14px 0; }
  .result-card h3 { font-size: 15px; }
  .result-excerpt { font-size: 11px; }
  .code-preview { height: 171px; font-size: 11px; }
}

@media (max-width: 470px) {
  .topbar, main { width: calc(100% - 28px); }
  .topbar { min-height: 60px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 14px; }
  .brand { min-width: 0; flex: 1; }
  .brand-copy { overflow: hidden; }
  .brand-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .theme-control { min-height: 36px; gap: 5px; padding-inline: 7px; }
  .theme-icon { width: 14px; height: 14px; }
  .theme-control select { max-width: 82px; font-size: 10px; }
  .theme-chevron { width: 10px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(23px, 6.5vw, 29px); }
  .search-form { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px; }
  .search-button { min-width: 70px; }
  .source-tab { font-size: 10px; }
  .result-list { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .web-query-heading { flex-direction: column; }
}
