/* 누리소재 그룹웨어 데모 — pine sidebar, cool paper, ochre marks what the AI search found */
:root {
  --pine: #1d3a32;
  --pine-2: #27493f;
  --paper: #eef1f0;
  --surface: #ffffff;
  --ink: #17201d;
  --muted: #5a6762;
  --line: #d4dbd8;
  --teal: #226b59;
  --ochre: #d39b16;
  --ochre-soft: #fbf0d3;
  --red: #b23b2e;
  --radius-s: 4px;
  --radius-m: 8px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ---------------- shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--pine); color: #d9e4e0; padding: 22px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--ochre); color: var(--pine); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-name { font-weight: 700; font-size: 17px; display: flex; flex-direction: column; line-height: 1.2; }
.brand-name small { font-weight: 400; font-size: 12px; color: #a9bdb6; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #d9e4e0; padding: 9px 12px; border-radius: var(--radius-s); display: flex; align-items: center; justify-content: space-between; }
.nav a:hover { background: var(--pine-2); text-decoration: none; }
.nav a.on { background: #f4f7f6; color: var(--pine); font-weight: 700; }
.nav a.dim { color: #9fb3ac; }
.nav em { font-style: normal; font-size: 12px; color: #a9bdb6; }
.nav .new { font-size: 11px; font-weight: 800; background: var(--ochre); color: var(--pine); padding: 1px 6px; border-radius: 3px; }
.side-note { margin-top: auto; font-size: 12px; color: #93a9a1; line-height: 1.5; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 24px; padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gsearch { flex: 1; max-width: 640px; display: flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.gsearch input { flex: 1; border: 0; padding: 9px 12px; font: inherit; min-width: 0; background: #f7f9f8; }
.gsearch input:focus { outline: none; background: #fff; }
.gsearch:focus-within { border-color: var(--teal); }
.gsearch button { border: 0; background: var(--pine); color: #fff; padding: 0 18px; }
.me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.me .dept { color: var(--muted); font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #cfe0da; color: var(--pine); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.mockbar { background: var(--ochre-soft); color: #6b4e05; font-size: 13px; padding: 7px 32px; border-bottom: 1px solid #ecd9a2; }
main { padding: 28px 32px 80px; max-width: 1240px; width: 100%; }

/* ---------------- home */
.hello h1 { font-size: 24px; font-weight: 700; }
.hello p { color: var(--muted); margin: 4px 0 24px; }
.ask { background: var(--pine); color: #fff; border-radius: var(--radius-m); padding: 28px 32px 24px; margin-bottom: 24px; }
.ask h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.ask > p { color: #c3d4ce; margin: 6px 0 18px; max-width: 60ch; }
.askform { display: flex; gap: 10px; align-items: stretch; }
.askform textarea { flex: 1; resize: vertical; border: 0; border-radius: var(--radius-s); padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); min-height: 56px; }
.askform button { border: 0; border-radius: var(--radius-s); background: var(--ochre); color: var(--pine); font-weight: 800; padding: 0 22px; }
.askform button:hover { background: #e4ad25; }
.tries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 13px; align-items: center; }
.tries span { color: #9fb8af; margin-right: 4px; }
.tries a { color: #fff; border: 1px solid #4a6b61; border-radius: 999px; padding: 3px 12px; }
.tries a:hover { background: var(--pine-2); text-decoration: none; }

.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
.panel h2 { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.panel h2 a { font-size: 13px; font-weight: 500; }
.doclist, .plain { list-style: none; margin: 0; padding: 0; }
.doclist li, .plain li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0ef; }
.doclist li:first-child, .plain li:first-child { border-top: 0; }
.doclist a { color: var(--ink); display: flex; flex-direction: column; min-width: 0; }
.doclist a strong { font-weight: 600; }
.doclist a:hover strong { color: var(--teal); }
.doclist a span { font-size: 13px; color: var(--muted); }
.plain li { font-size: 14px; }
time { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------- search */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { background: none; border: 0; padding: 10px 16px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ochre); }
.tabs button span { font-weight: 500; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.searchwrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.filters { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.filters.off { opacity: .4; pointer-events: none; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg label { flex: 1; }
.seg input, .chips input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 6px 0; font-size: 14px; cursor: pointer; }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--pine); color: #fff; }
.seg input:focus-visible + span, .chips input:focus-visible + span { outline: 2px solid var(--ochre); outline-offset: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { display: inline-block; font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.chips input:checked + span { background: #dcebe6; border-color: var(--teal); color: var(--pine); font-weight: 600; }
.years { display: flex; align-items: center; gap: 6px; }
.years input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; }
.fmore { display: none; }
.linkbtn { background: none; border: 0; color: var(--teal); padding: 0; text-align: left; font-size: 13px; }

.qline { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.qline p { margin: 0; color: var(--muted); }
#took { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hits, .rhits, .ihits { list-style: none; padding: 0; margin: 0; }
.hits.busy { opacity: .45; transition: opacity .15s; }

.hit { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.hit:first-child { border-top: 0; }
.match { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 4px; }
.match i { display: block; width: 44px; height: 4px; background: #e2e7e5; border-radius: 2px; position: relative; overflow: hidden; }
.match i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ochre); }
.match span { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.match span::after { content: "%"; font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 1px; }
.results, .hbody { min-width: 0; }
.hbody h3, .snip { overflow-wrap: anywhere; }
.hbody h3 { font-size: 16px; font-weight: 650; }
.hbody h3 a { color: var(--ink); }
.hbody h3 a:hover { color: var(--teal); }
.hmeta { margin: 3px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.badges { display: inline-flex; gap: 4px; }
.badges b { font-weight: 600; font-size: 11px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: #f7f9f8; }
.badges .b-pat { border-color: #e6c7c3; color: var(--red); background: #fbefed; }
.snip { margin: 8px 0 0; font-size: 14px; color: #33403b; max-width: 78ch; }
.where { display: inline-block; margin-right: 8px; font-size: 12px; font-weight: 600; color: #7a5a08; background: var(--ochre-soft); padding: 0 6px; border-radius: 3px; }
.empty, .error, .loading { padding: 28px 0; color: var(--muted); }
.error { color: var(--red); }

.ihits li { padding: 16px 0; border-top: 1px solid var(--line); }
.ihits li:first-child { border-top: 0; }
.ihits a { font-weight: 650; font-size: 16px; }
.ihits p { margin: 4px 0; font-size: 14px; }
.ihits span { font-size: 13px; color: var(--muted); }

/* ---------------- KMS document */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.docwrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 32px 40px; }
.docid { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; max-width: 30ch; }
.docmeta { display: flex; gap: 24px; margin: 14px 0; font-size: 14px; }
.docmeta div { display: flex; gap: 6px; }
.docmeta dt { color: var(--muted); }
.docmeta dd { margin: 0; }
.tags { list-style: none; padding: 0; margin: 0 0 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.tags li { font-size: 12px; background: #e6eeeb; color: var(--pine); padding: 2px 9px; border-radius: 3px; }
.docbody { border-top: 1px solid var(--line); padding-top: 18px; }
.docbody p { font-size: 16px; line-height: 1.85; margin: 0 0 16px; max-width: 70ch; }
.docbody ::selection { background: #f3d888; }
.hint { font-size: 13px; color: #7a5a08; background: var(--ochre-soft); padding: 8px 12px; border-radius: var(--radius-s); display: inline-block; margin: 4px 0 0; }
.otherdocs { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 16px; }
.otherdocs h2 { font-size: 14px; margin-bottom: 6px; }
.otherdocs ul { margin: 0; padding-left: 18px; font-size: 14px; }

.related { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ochre); border-radius: var(--radius-m); padding: 18px 20px; max-height: calc(100vh - 32px); overflow: auto; }
.related h2 { font-size: 16px; font-weight: 700; }
#relbasis { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }
.hit.compact { grid-template-columns: 40px 1fr; gap: 10px; padding: 12px 0; }
.hit.compact .match i { width: 34px; }
.hit.compact h3 { font-size: 14px; }
.hit.compact .snip { font-size: 13px; }
.hit.compact .where { display: none; }
.more { display: block; font-size: 13px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }

.selpop { position: absolute; z-index: 30; }
.selpop button { border: 0; background: var(--pine); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-s); box-shadow: 0 6px 18px rgba(29, 58, 50, .28); }
.selpop button::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ochre); margin-right: 8px; vertical-align: 1px; }

/* ---------------- dev panel */
.devtoggle { position: fixed; right: 20px; bottom: 20px; z-index: 40; border: 1px solid var(--pine); background: var(--surface); color: var(--pine); font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.devtoggle[aria-expanded="true"] { background: var(--pine); color: #fff; }
.devpanel { position: fixed; right: 20px; bottom: 64px; z-index: 40; width: min(520px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: #13241f; color: #d6e3de; border-radius: var(--radius-m); padding: 16px 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); }
.devpanel header { display: flex; justify-content: space-between; align-items: center; }
.devpanel header button { background: none; border: 0; color: #9fb8af; font-size: 13px; }
.devpanel h4 { margin: 14px 0 4px; font-size: 12px; color: #9fb8af; font-weight: 600; }
.devmeta { margin: 6px 0 0; font-size: 13px; color: var(--ochre); font-variant-numeric: tabular-nums; }
.devpanel pre { margin: 0; font: 12px/1.5 "SFMono-Regular", Consolas, "D2Coding", monospace; white-space: pre-wrap; word-break: break-all; background: #0d1a16; padding: 10px 12px; border-radius: var(--radius-s); }

/* ---------------- responsive */
@media (max-width: 1080px) {
  .docwrap { grid-template-columns: 1fr; }
  .related { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .nav a.dim, .side-note { display: none; }
  .top { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .me .dept { display: none; }
  .mockbar { padding: 7px 16px; }
  main { padding: 20px 16px 80px; }
  .ask { padding: 22px 18px; }
  .askform { flex-direction: column; }
  .askform button { padding: 12px; }
  .grid2, .searchwrap { grid-template-columns: 1fr; }
  .filters { position: static; gap: 14px; }
  .filters:not(.open) fieldset:not(:first-of-type), .filters:not(.open) #resetf { display: none; }
  .fmore { display: block; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px; color: var(--teal); font-size: 14px; }
  .searchwrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .doc { padding: 22px 18px; }
  .docmeta { flex-wrap: wrap; gap: 6px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
