/*
 * DechoNet components — Notion "디자인 시스템 · UX 개선안" page and component
 * mockups (2026-10-07). Loaded after tokens.css. Tests: tests/e2e/ux-mockup.spec.ts.
 * Scale: cards 4px + 8px shadow, inner boxes 3px, body 14–15px, touch 44px.
 */

/* ---------- page frame ---------- */
/* hidden means hidden (a .btn's display:inline-block used to win over the attribute). */
[hidden] { display: none !important; }
/* Korean breaks between words, not inside them ("여|러" split mid-word). */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }
.page-head .filter + * { margin-top: 0; }
.main { padding: 24px; gap: 20px; }
.card { padding: 24px; }
.section-title {
  font-size: 18px; font-weight: 700; margin: 0 0 16px;
  border-bottom: 3px solid var(--line); padding-bottom: 10px;
  text-transform: none;
}
.section-title:has(> .aside) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title .aside { font-size: var(--fs-label); font-weight: 400; color: var(--muted-ink); }
.section-title .aside a { color: var(--fg); }

/* ---------- SideNav ---------- */
.sidebar { background: #fff; }
.brand { padding: 20px; }
.brand-title { font-size: 44px; }
.brand p { font-size: 13px; letter-spacing: 0.08em; margin-top: 8px; }

/* ---------- StatusBadge: symbol + word + color ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 14px; white-space: nowrap; }
.status::before { content: '\25B2'; font-size: 0.8em; }
.status.ok::before { content: '\2713'; font-size: 1em; }
.status.bad::before { content: '\2715'; font-size: 0.9em; }
.status.info::before { content: '\25CF'; font-size: 0.8em; }

/* ---------- Buttons & inputs ---------- */
.btn { min-height: 40px; padding: 8px 16px; font-weight: 700; }
.btn.primary { font-size: 15px; }
mark { background: var(--fg); color: #fff; padding: 0 3px; }

/* ---------- PageHeader + LookupBar ---------- */
.tool-head h1, .page-head h1 { font-family: var(--font-display); font-size: 44px; line-height: 1.05; margin: 4px 0 10px; letter-spacing: 0.01em; }
.tool-head .tool-desc, .page-head .lead { font-size: 15px; line-height: 1.7; margin: 0; color: var(--fg); max-width: 64ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted-ink); }
.crumbs a { color: var(--muted-ink); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs [aria-current] { color: var(--fg); font-weight: 700; }

.lookup { margin-top: 20px; }
.lookup-row { display: flex; gap: 12px; }
.lookup-field { position: relative; flex: 1; min-width: 0; }
.lookup-field input { height: 52px; border-width: 4px; font-size: 16px; padding: 0 16px; text-transform: none; }
.lookup-field input::placeholder { font-size: 15px; }
.lookup-row .btn.primary { min-width: 160px; min-height: 52px; font-size: 16px; padding: 0 24px; white-space: nowrap; }
.lookup-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted-ink); }
.lookup-kind { display: inline-block; border: 3px solid var(--line); color: var(--fg); font-weight: 700; padding: 1px 8px; margin-left: 4px; }
#history-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: #fff;
  border: 3px solid var(--line); border-top: 0; max-height: 220px; overflow-y: auto; box-shadow: 6px 6px 0 var(--line);
}
.tool-head .search-block form { display: flex; gap: 12px; }
.tool-head .search-block input { height: 52px; border-width: 4px; font-size: 16px; text-transform: none; }
.tool-head .search-block .btn.primary { width: auto !important; margin: 0 !important; min-width: 160px; }
.tool-head .search-block .block-title { display: none; }

/* ---------- one result card (CheckCard) ---------- */
.result-card { padding: 0; }
.result-card > #result-summary { padding: 24px; }
.result-card:not(.has-result) > #result-summary { padding: 20px 24px; }
.result-card:not(.has-result) > .result-tabs,
.result-card:not(.has-result) > .result-foot { display: none; }
.result-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: -24px -24px 20px; padding: 16px 24px; border-bottom: 4px solid var(--line);
}
.result-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere; }
.result-tabs { padding: 0 24px 24px; }
.result-more { padding: 0 24px 20px; }
.result-more:empty { display: none; }
.result-card:not(.has-result) > .result-more { display: none; }
.result-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 4px solid var(--line); background: var(--soft); padding: 12px 24px;
}
.result-foot-note { margin: 0; font-size: 13px; color: var(--muted-ink); }
.result-foot .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-foot .actions .btn { min-height: 40px; }
#result-summary > .footer-note:only-child { margin: 0; font-size: 14px; }

.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 0; }
.kpi { padding: 10px 12px; }
.kpi h4 { font-size: 13px; font-weight: 400; }
.kpi p { font-size: 18px; margin-top: 6px; overflow-wrap: anywhere; }
.kpi--wide { grid-column: span 2; }
.kpi--full { grid-column: 1 / -1; }
.insight { padding: 18px 16px 14px; margin-top: 20px; }
.insight p { font-size: 15px; }
.insight::before { font-size: 13px; top: -13px; padding: 3px 10px; }
.checklist li { font-size: 14px; padding-left: 32px; }
.bd-more { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted-ink); cursor: pointer; text-align: left; text-decoration: underline; }
.bd-more:hover { color: var(--fg); }
.tabs { gap: 10px; margin-bottom: 16px; }
.tab { min-height: 44px; font-size: 14px; font-weight: 700; }
.panel { padding: 16px; }
.field h5 { font-size: 13px; }
.field p, .field pre { font-size: 14px; padding: 10px 12px; }

/* ---------- Callouts: upsell ---------- */
.upsell-hint { font-size: 14px; padding: 12px 16px; border-width: 3px; }
.upsell-hint .label { font-size: 12px; }
.card:has(> .upsell-hint) { padding: 0; border: 0; box-shadow: none; background: none; }

/* ---------- GuideLink ---------- */
.related { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-link { font-size: 14px; padding: 12px 16px; min-height: 48px; border-width: 3px; }
.guide-section-title { font-size: 14px; margin-bottom: 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- FAQ ---------- */
.seo-content > p { font-size: 15px; line-height: 1.7; margin: 0 0 16px; }
.seo-content > h4 { font-size: 15px; margin: 20px 0 10px; }
details.faq { border: 3px solid var(--line); background: #fff; margin-top: 10px; }
details.faq > summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 48px; padding: 8px 16px; font-size: 15px; font-weight: 700;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: '+'; font-size: 18px; flex-shrink: 0; }
details.faq[open] > summary { background: var(--soft); border-bottom: 3px solid var(--line); }
details.faq[open] > summary::after { content: '\2212'; }
details.faq > p { margin: 0; padding: 14px 16px; font-size: 15px; line-height: 1.7; }

/* ---------- ToolCard ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
a.tool-card {
  position: relative; display: flex; flex-direction: column; min-height: 132px; padding: 16px 40px 16px 16px;
  border: 4px solid var(--line); background: var(--soft); color: var(--fg); text-decoration: none;
}
a.tool-card h3 { font-size: 16px; margin: 0 0 8px; }
a.tool-card p { font-size: 14px; line-height: 1.5; margin: 0; white-space: normal; overflow: visible; text-overflow: clip; }
a.tool-card::after { content: '\2192'; position: absolute; top: 14px; right: 14px; font-size: 18px; font-weight: 700; }
a.tool-card:hover, a.tool-card:focus-visible { background: var(--fg); color: #fff; }
a.tool-card.featured { grid-column: span 2; background: var(--fg); color: #fff; }
a.tool-card.featured:hover, a.tool-card.featured:focus-visible { background: var(--accent-ink); }
.tool-tag {
  align-self: flex-start; margin-top: auto; font-size: 13px; font-weight: 700; padding: 2px 8px;
  border: 3px solid var(--accent-ink); color: var(--accent-ink); background: #fff;
}
a.tool-card.featured .tool-tag { border-color: #fff; color: var(--fg); }
.group-title { font-size: 14px; color: var(--muted-ink); margin: 20px 0 10px; font-weight: 400; }
.group-title b { color: var(--fg); }

/* ---------- SiteFooter ---------- */
.site-footer { border-top: 4px solid var(--line); padding: 32px 36px 20px; font-size: 15px; text-transform: none; letter-spacing: 0; font-family: var(--font-mono); background: #fff; }
.site-footer .footer-inner { display: block; max-width: none; }
.foot-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.foot-logo { font-family: var(--font-display); font-size: 40px; line-height: 1; margin: 0 0 12px; }
.foot-brand p:not(.foot-logo) { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted-ink); }
.foot-col h2 { font-size: 15px; margin: 4px 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-col a { text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 3px solid var(--line); font-size: 13px; color: var(--muted-ink); }
.foot-bottom a { text-decoration: none; color: inherit; }
.foot-bottom a:hover { color: var(--fg); text-decoration: underline; }
.footer-copy { opacity: 1; }
.tour-replay-wrap:has(> [hidden]) { display: none; }
.tour-replay { text-decoration: none; }

/* ---------- PageHeader (content pages) ---------- */
:root { --font-read: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
.page-head .eyebrow { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.page-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 13px; color: var(--muted-ink); }
.tag { display: inline-block; border: 3px solid var(--line); padding: 1px 8px; font-size: 13px; font-weight: 700; color: var(--fg); text-decoration: none; background: #fff; }
a.tag:hover { background: var(--fg); color: #fff; }
.tag--guide { border-color: var(--guide); color: var(--guide); background: var(--guide-bg); }
.tag--accent { border-color: var(--accent-ink); color: var(--accent-ink); }

/* ---------- Article: body + 240px TOC ---------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: start; }
.article-main { min-width: 0; }
.article-toc { position: sticky; top: 16px; border: 4px solid var(--line); padding: 14px 16px; font-size: 14px; }
.article-toc h2 { font-size: 14px; margin: 0 0 10px; }
.article-toc ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; line-height: 1.5; }
.article-toc a { color: var(--fg); text-decoration: none; }
.article-toc a:hover { text-decoration: underline; }
.tldr { border: 4px solid var(--line); background: var(--soft); padding: 14px 18px; margin-bottom: 24px; }
.tldr h2 { font-size: 14px; margin: 0 0 6px; }
.tldr p { margin: 0; font-size: 15px; line-height: 1.8; }

.article-body { text-transform: none; overflow-wrap: break-word; }
.article-body--mono { font-family: var(--font-mono); font-size: 14px; line-height: 26px; }
.article-body--read { font-family: var(--font-read); font-size: 16px; line-height: 28px; max-width: 70ch; }
.article-body--read p, .article-body--read li { font-family: var(--font-read); }
.article-body h2 { font-family: var(--font-mono); font-size: 20px; line-height: 1.4; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 3px solid var(--line); scroll-margin-top: 16px; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { font-family: var(--font-mono); font-size: 16px; margin: 24px 0 10px; }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 1.4em; }
.article-body li { margin-bottom: 6px; }
.article-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent-ink); }
.article-body code { font-family: var(--font-mono); font-size: 0.9em; background: var(--soft); border: 2px solid var(--line); padding: 0 4px; }
.article-body pre { background: var(--fg); color: #e8e8e8; border: 3px solid var(--line); padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.article-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.article-body blockquote { margin: 0 0 16px; padding: 12px 16px; border-left: 6px solid var(--fg); background: var(--soft); }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; border: 3px solid var(--line); display: block; overflow-x: auto; }
.article-body th { background: var(--fg); color: #fff; text-align: left; padding: 8px 12px; font-family: var(--font-mono); font-size: 13px; }
.article-body td { padding: 8px 12px; border-bottom: 2px solid var(--line); vertical-align: top; }
.article-body hr { border: 0; border-top: 3px solid var(--line); margin: 24px 0; }
.article-body img { max-width: 100%; border: 3px solid var(--line); }
.article-body .contains-task-list { list-style: none; padding: 0; }
.article-body .task-list-item { position: relative; padding-left: 28px; cursor: pointer; }
.article-body .task-list-item input[type="checkbox"] { display: none; }
.article-body .task-list-item::before { content: '[ ]'; position: absolute; left: 0; font-weight: 700; font-family: var(--font-mono); }
.article-body .task-list-item.checked::before { content: '[X]'; color: var(--ok-ink); }

/* Tool CTA inside the article */
.cta-tool { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; border: 4px solid var(--line); box-shadow: 8px 8px 0 var(--line); background: #fff; padding: 18px 20px; margin: 28px 8px 32px 0; font-family: var(--font-mono); }
.cta-tool .cta-copy { flex: 1 1 260px; min-width: 0; }
.cta-tool .guide-section-title { color: var(--fg); font-size: 16px; text-transform: none; margin: 0 0 6px; }
.cta-tool .cta-hint { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted-ink); }
.cta-tool form { display: flex; gap: 10px; flex: 1 1 100%; flex-wrap: wrap; }
.cta-tool form input { flex: 1 1 220px; min-width: 0; height: 48px; border-width: 3px; text-transform: none; font-size: 15px; }
.cta-tool .btn.primary { min-height: 48px; padding: 0 24px; font-size: 15px; }
.cta-tool [data-inline-result] { flex: 1 1 100%; }

/* Share line (joined group) */
.share-line { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-size: 14px; color: var(--muted-ink); }
.share-group { display: inline-flex; flex-wrap: wrap; border: 3px solid var(--line); }
.share-group .btn { border: 0; border-left: 3px solid var(--line); min-height: 40px; text-transform: none; display: inline-flex; align-items: center; }
.share-group .btn:first-child { border-left: 0; }

/* Next post */
.post-next { display: block; border: 4px solid var(--line); padding: 16px 18px; text-decoration: none; color: var(--fg); }
.post-next:hover { background: var(--soft); }
.post-next-meta { display: block; font-size: 13px; color: var(--muted-ink); margin-bottom: 6px; }
.post-next-meta .tag { font-size: 12px; padding: 0 6px; }
.post-next strong { display: block; font-size: 18px; margin-bottom: 6px; }
.post-next-desc { font-size: 14px; color: var(--muted-ink); }

@media (max-width: 960px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .article-toc { position: static; order: -1; }
}

/* ---------- Search box + results, tag rows, PostList, pager ---------- */
.filter { display: flex; align-items: center; gap: 10px; margin-top: 20px; border: 4px solid var(--line); padding: 0 14px; background: #fff; }
.filter span { font-size: 20px; }
.filter input { border: 0; height: 48px; padding: 0; font-size: 15px; text-transform: none; }
.filter input:focus { background: #fff; }
.filter input::placeholder { font-size: 15px; }
.filter:focus-within { border-color: var(--accent); }
.search-results { border: 4px solid var(--line); border-top: 0; max-height: 360px; overflow-y: auto; background: #fff; }
.search-results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--fg); border-top: 2px solid var(--soft); }
.search-results a:first-child { border-top: 0; }
.search-results a:hover, .search-results a:focus-visible { background: var(--soft); }
.search-results strong { display: block; font-size: 15px; }
.search-results span { display: block; font-size: 13px; color: var(--muted-ink); margin-top: 2px; }
.search-empty { margin: 0; padding: 12px 14px; font-size: 14px; color: var(--muted-ink); }
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-row .tag { font-size: 14px; padding: 4px 10px; }
.post-rows { display: grid; gap: 12px; }
.post-row, article.post-card { display: block; border: 4px solid var(--line); padding: 16px 18px; text-decoration: none; color: var(--fg); background: #fff; box-shadow: none; }
a.post-row:hover { background: var(--soft); }
.post-row strong, article.post-card h2 { display: block; font-size: 18px; margin: 8px 0 6px; line-height: 1.4; }
.post-row .post-desc, article.post-card .post-desc { display: block; font-size: 14px; color: var(--muted-ink); line-height: 1.6; margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-ink); }
.post-meta .tag { font-size: 12px; padding: 0 6px; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 3px solid var(--line); background: #fff; color: var(--fg); text-decoration: none; font-weight: 700; }
.pager [aria-current="page"] { background: var(--fg); color: #fff; }
.pager .gap { border: 0; background: none; }
.pager a:hover { background: var(--soft); }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  /* MobileHeader (mockup): one 56px bar — brand and the menu button; language and links in the sheet. */
  .brand { padding: 8px 16px; }
  .brand-title { font-size: 34px; line-height: 1; }
  .brand p { display: none; }
  .sidebar:not(.open) .brand .lang-select { display: none; }
  .sidebar.open .brand .lang-select { display: inline-block; }
  .hamburger { width: 44px; height: 44px; border: 3px solid #fff; padding: 0; font-size: 20px; display: grid !important; place-items: center; }
  /* Closed menu: nothing under the bar (borders and shadows of the collapsed blocks left a gap). */
  .sidebar:not(.open) > *:not(.brand) { display: none; }
  .sidebar.open > .tool-nav-forge { padding: 12px 14px 0; }
  .sidebar.open > .pro-banner { margin: 12px 14px 16px; padding: 16px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-top { grid-template-columns: 1fr 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .main { padding: 12px; gap: 16px; }
  .chip, .btn { min-height: 40px; }
  .card { padding: 16px; }
  .result-head { margin: -16px -16px 16px; padding: 12px 16px; }
  .result-card > #result-summary { padding: 16px; }
  .result-tabs { padding: 0 16px 16px; }
  .result-more { padding: 0 16px 16px; }
  .result-foot { padding: 12px 16px; }
  .tool-head h1, .page-head h1 { font-size: 36px; }
  .lookup-row, .tool-head .search-block form { flex-direction: column; }
  .lookup-row .btn.primary { width: 100%; }
  .tool-grid, .guide-grid, .related { grid-template-columns: minmax(0, 1fr); }
  a.tool-card.featured { grid-column: auto; }
  a.tool-card { min-height: 0; }
  .foot-top { grid-template-columns: 1fr; }
  .site-footer { padding: 24px 16px 16px; }
}

/* Result bottom bar on phones (mockup): share and check again, after a result. */
.m-bottombar { display: none; }
@media (max-width: 680px) {
  .m-bottombar:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 4px solid var(--line); }
  .m-bottombar .btn { min-height: 48px; border-width: 3px; font-size: 15px; }
  body:has(.m-bottombar:not([hidden])) .site-footer { padding-bottom: 88px; }
}
