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

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* ── Variables ───────────────────────────────────── */
:root {
  --brand:       #0d9488;
  --brand-dark:  #0f766e;
  --brand-light: #f0fdfa;

  --dark:   #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;

  --ink:   #0f172a;
  --body:  #475569;
  --muted: #94a3b8;

  --bg:        #f8fafc;
  --surface:   #ffffff;
  --surface-2: #f1f5f9;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;

  --tool-color:       var(--brand);
  --tool-color-light: var(--brand-light);

  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08), 0 24px 56px rgba(0,0,0,.06);

  --radius:    14px;
  --radius-sm: 9px;
  --max-w:     1160px;

  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* Per-tool accent colours */
body[data-tool="text"]       { --tool-color: #4f46e5; --tool-color-light: #eef2ff; }
body[data-tool="pdf"]        { --tool-color: #e11d48; --tool-color-light: #fff1f2; }
body[data-tool="image"]      { --tool-color: #7c3aed; --tool-color-light: #f5f3ff; }
body[data-tool="calculator"] { --tool-color: #0284c7; --tool-color-light: #f0f9ff; }
body[data-tool="qr"]         { --tool-color: #059669; --tool-color-light: #ecfdf5; }
body[data-tool="csv"]        { --tool-color: #d97706; --tool-color-light: #fffbeb; }

html { scroll-behavior: smooth; }
body { min-width: 320px; background: var(--bg); color: var(--ink); }
a    { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, canvas { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 8px; transition: top 200ms;
}
.skip-link:focus { top: 12px; }

.container {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
}

/* ── Header ──────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,23,42,.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.header-inner {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.logo {
  display: flex; align-items: center; gap: 9px;
  color: #fff; font-size: 15px; font-weight: 800; flex-shrink: 0;
}

.logo-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand); display: grid; place-items: center;
  font-size: 10px; font-weight: 900; color: #fff; letter-spacing: .05em;
}

.site-nav {
  display: flex; align-items: center; gap: 6px;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  display: flex; align-items: center; height: 32px; padding: 0 11px;
  border-radius: 7px; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.5); white-space: nowrap;
  transition: all 150ms;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.site-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; height: 44px; padding: 0 22px; border-radius: 100px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 150ms ease; white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }

.btn-primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
}
.btn-primary:hover {
  background: var(--brand-dark); border-color: var(--brand-dark);
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(13,148,136,.4);
}

.btn-white {
  background: transparent; color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.2);
}
.btn-white:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.4); color: #fff;
}

.btn-default {
  background: var(--surface); color: var(--ink);
  border-color: var(--border-2); box-shadow: var(--shadow);
}
.btn-default:hover { border-color: var(--tool-color); color: var(--tool-color); }

.btn-ghost {
  background: transparent; color: var(--body); border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }

.btn-tool {
  background: var(--tool-color); color: #fff; border-color: var(--tool-color);
}
.btn-tool:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; border-radius: 100px; }

/* ── Form inputs ─────────────────────────────────── */
input:not([type="range"]):not([type="color"]):not([type="file"]),
select,
textarea {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); padding: 0 12px; height: 42px; outline: none;
  font-size: 14px; transition: border-color 150ms, box-shadow 150ms;
}
textarea {
  height: auto; min-height: 100px;
  padding: 12px; resize: vertical; line-height: 1.65;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--tool-color);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
input[type="color"]  { height: 42px; padding: 3px 4px; }
input[type="range"]  { width: 100%; accent-color: var(--tool-color); padding: 0; }
input[type="file"]   { width: 100%; font-size: 13px; color: var(--muted); padding: 0; border: none; height: auto; }
label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
hr { border: 0; height: 1px; background: var(--border); margin: 24px 0; }

/* ── Homepage Hero ───────────────────────────────── */
.hero {
  background: var(--dark);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero::after {
  content: '';
  position: absolute;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13,148,136,.14) 0%, transparent 70%);
  top: -220px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
  padding: 104px 0 96px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  text-align: center;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 100px;
  padding: 5px 16px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.5); letter-spacing: .04em;
}
.hero-pill strong { color: var(--brand); font-weight: 700; }
.hero-inner h1 {
  font-size: clamp(38px, 6.5vw, 66px);
  font-weight: 900; line-height: 1.06; letter-spacing: -.03em;
  color: #fff; max-width: 840px;
}
.hero-inner h1 em { font-style: normal; color: var(--brand); }
.hero-inner > p {
  font-size: 17px; color: rgba(255,255,255,.5);
  max-width: 480px; line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 4px;
}

/* ── Tools grid section ──────────────────────────── */
.tools-section { background: var(--surface); padding: 80px 0; }

.section-label {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 8px;
}
.section-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800; letter-spacing: -.02em; color: var(--ink);
}
.section-desc {
  margin-top: 8px; font-size: 15px; color: var(--muted); line-height: 1.7;
}
.section-header { margin-bottom: 36px; }

.tools-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

.tool-entry {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  transition: all 200ms ease;
}
.tool-entry:hover {
  border-color: var(--tc, var(--brand));
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
}
.tool-entry-top {
  height: 76px; display: flex; align-items: center; padding: 0 24px;
  background: var(--tc-bg, var(--brand-light));
}
.tool-entry-top svg {
  width: 30px; height: 30px;
  color: var(--tc, var(--brand)); stroke-width: 1.75;
}
.tool-entry-body { padding: 20px 24px; flex: 1; }
.tool-entry-body h3 {
  font-size: 15px; font-weight: 800;
  letter-spacing: -.01em; color: var(--ink); margin-bottom: 6px;
}
.tool-entry-body p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.tool-entry-foot {
  padding: 13px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--tc, var(--brand));
}
.tool-entry-foot svg { width: 14px; height: 14px; transition: transform 150ms; }
.tool-entry:hover .tool-entry-foot svg { transform: translateX(4px); }

/* Tool card colours */
.tc-text  { --tc: #4f46e5; --tc-bg: #eef2ff; }
.tc-pdf   { --tc: #e11d48; --tc-bg: #fff1f2; }
.tc-img   { --tc: #7c3aed; --tc-bg: #f5f3ff; }
.tc-calc  { --tc: #0284c7; --tc-bg: #f0f9ff; }
.tc-qr    { --tc: #059669; --tc-bg: #ecfdf5; }
.tc-csv   { --tc: #d97706; --tc-bg: #fffbeb; }

/* ── Features band ───────────────────────────────── */
.features-band {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); padding: 56px 0;
}
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.feature-item {
  background: var(--surface); padding: 32px 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand-light); display: grid; place-items: center;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--brand); stroke-width: 2; }
.feature-item h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.feature-item p  { font-size: 14px; color: var(--body); line-height: 1.65; }

/* ── Quick counter section ───────────────────────── */
.quick-section { background: var(--surface); padding: 72px 0; }

.quick-card {
  max-width: 680px; margin-inline: auto;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; background: var(--surface);
}
.quick-head {
  padding: 24px 28px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.quick-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.quick-head p  { font-size: 14px; color: var(--muted); }

#home-text {
  display: block; width: 100%;
  border: 0; border-top: 1.5px solid var(--border); border-radius: 0;
  padding: 20px 28px; min-height: 156px; resize: none;
  font-size: 15px; line-height: 1.65;
}
#home-text:focus { outline: none; box-shadow: none; border-color: var(--brand); }

#home-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1.5px solid var(--border);
}
#home-stats div {
  padding: 16px 20px; text-align: center;
  border-right: 1px solid var(--border);
}
#home-stats div:last-child { border-right: 0; }
#home-stats span {
  display: block; font-size: 22px; font-weight: 900;
  letter-spacing: -.025em; color: var(--ink);
}
#home-stats small {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px;
}

/* ── Ad slot ─────────────────────────────────────── */
.ad-band { background: var(--surface-2); padding: 12px 0; }
.ad-band:not(:has(ins)) { display: none; }
.ad-slot { width: 100%; overflow: hidden; }

/* ── Tool page hero ──────────────────────────────── */
.tool-hero {
  background: var(--dark);
  position: relative; overflow: hidden; padding: 48px 0 44px;
}
.tool-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg,
    rgba(var(--tc-rgb, 13 148 136) / .22) 0%,
    transparent 55%);
}
/* Per-tool gradient tint using color approach */
body[data-tool="text"]       .tool-hero::before { background: linear-gradient(135deg, rgba(79,70,229,.22) 0%, transparent 55%); }
body[data-tool="pdf"]        .tool-hero::before { background: linear-gradient(135deg, rgba(225,29,72,.22)  0%, transparent 55%); }
body[data-tool="image"]      .tool-hero::before { background: linear-gradient(135deg, rgba(124,58,237,.22) 0%, transparent 55%); }
body[data-tool="calculator"] .tool-hero::before { background: linear-gradient(135deg, rgba(2,132,199,.22)  0%, transparent 55%); }
body[data-tool="qr"]         .tool-hero::before { background: linear-gradient(135deg, rgba(5,150,105,.22)  0%, transparent 55%); }
body[data-tool="csv"]        .tool-hero::before { background: linear-gradient(135deg, rgba(217,119,6,.22)  0%, transparent 55%); }

.tool-hero-inner {
  position: relative; z-index: 1;
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.4);
  margin-bottom: 4px;
}
.breadcrumb a:hover { color: rgba(255,255,255,.8); }
.breadcrumb svg { width: 11px; height: 11px; opacity: .5; }
.tool-hero-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--tool-color);
}
.tool-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900; letter-spacing: -.025em; line-height: 1.1; color: #fff;
}
.tool-hero p { font-size: 15px; color: rgba(255,255,255,.5); max-width: 540px; line-height: 1.7; }

/* ── Tool main area ──────────────────────────────── */
.tool-main { padding: 28px 0 64px; }

.runner-card {
  background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 16px;
}
.runner-heading {
  font-size: 15px; font-weight: 800; letter-spacing: -.01em;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}

/* Form layouts */
.form-row { display: grid; gap: 14px; }
.form-row.c2 { grid-template-columns: repeat(2, 1fr); }
.form-row.c3 { grid-template-columns: repeat(3, 1fr); }
.form-field  { display: flex; flex-direction: column; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Metric grids */
.stats-row { display: grid; gap: 10px; }
.stats-row.c3 { grid-template-columns: repeat(3, 1fr); }
.stats-row.c4 { grid-template-columns: repeat(4, 1fr); }
.stats-row.c6 { grid-template-columns: repeat(6, 1fr); }

.stat-cell {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 12px;
}
.stat-val {
  display: block; font-size: 20px; font-weight: 900;
  letter-spacing: -.025em; color: var(--ink); overflow-wrap: anywhere;
}
.stat-lbl {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-top: 4px;
}

/* Inline pair (calculator) */
.inline-pair {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 8px; align-items: center;
}
.inline-pair .sep {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-align: center; padding: 0 4px; white-space: nowrap;
}

/* Calculator mini-tools */
.calc-grid  { display: flex; flex-direction: column; gap: 20px; }
.mini-tool  { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 20px; }
.mini-tool:first-child { border-top: 0; padding-top: 0; }
.mini-title { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }

/* Output */
output {
  display: block; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--tool-color-light); border: 1.5px solid rgba(0,0,0,.06);
  font-size: 22px; font-weight: 900; letter-spacing: -.025em;
  color: var(--tool-color);
}

/* Preview boxes */
.preview-box {
  min-height: 220px; border: 2px dashed var(--border-2);
  border-radius: var(--radius); background: var(--surface-2);
  display: grid; place-items: center; padding: 16px; overflow: hidden;
}

/* Two-pane (QR/Image) */
.two-pane {
  display: grid; grid-template-columns: 1fr minmax(200px, 0.55fr);
  gap: 20px; align-items: start;
}

/* Download button */
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 100px;
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 700;
  transition: background 150ms;
}
.dl-btn:hover { background: var(--dark-3); }

.status { min-height: 20px; font-size: 13px; color: var(--muted); }

/* Result box */
.result-box {
  min-height: 100px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 14px; font-size: 14px; line-height: 1.6;
}
.result-box dl { margin: 0; display: grid; gap: 5px; }
.result-box dt { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.result-box dd { margin: 0; font-size: 14px; font-weight: 500; }

/* Table */
.table-wrap { overflow: auto; max-height: 320px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; }
th {
  position: sticky; top: 0; background: var(--surface-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}

/* ── Info strip (below runner) ───────────────────── */
.info-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 20px;
}
.info-block { background: var(--surface); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.info-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Badges */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: 100px;
  background: var(--surface-2); color: var(--body);
  font-size: 11px; font-weight: 600; padding: 3px 10px;
}

/* Tip list */
.tip-list { display: grid; gap: 6px; }
.tip-list li { padding-left: 15px; position: relative; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tip-list li::before { content: '›'; position: absolute; left: 0; color: var(--tool-color); font-weight: 900; }

/* Link chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); border-radius: 100px;
  background: var(--surface-2); color: var(--body);
  font-size: 12px; font-weight: 600; padding: 4px 12px;
  transition: all 150ms;
}
.chip:hover { border-color: var(--tool-color); color: var(--tool-color); background: var(--tool-color-light); }

/* ── Content cards ───────────────────────────────── */
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.content-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.content-card h2 {
  font-size: 16px; font-weight: 800; letter-spacing: -.01em;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.content-card ol  { padding-left: 18px; display: grid; gap: 6px; }
.content-card li  { font-size: 14px; color: var(--body); line-height: 1.6; }
.content-card p   { font-size: 14px; color: var(--body); line-height: 1.65; }

/* FAQ */
details { border-top: 1px solid var(--border); padding: 12px 0; }
details:first-of-type { border-top: 0; }
summary {
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary:hover { color: var(--tool-color); }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 18px; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: '−'; }
details p { margin-top: 10px; font-size: 14px; color: var(--body); line-height: 1.65; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-top {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto; padding: 52px 0 40px;
  display: grid; grid-template-columns: 260px 1fr;
  gap: 56px; align-items: start;
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-logo { display: flex; align-items: center; gap: 9px; color: #fff; font-size: 15px; font-weight: 800; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,.4); line-height: 1.65; max-width: 240px; }

.footer-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.footer-col h4 {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.25); margin-bottom: 12px;
}
.footer-col a {
  display: block; font-size: 13px; color: rgba(255,255,255,.45);
  font-weight: 500; padding: 3px 0; transition: color 150ms;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto; padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,.22); }

/* ── Download tool accent ──────────────────────────── */
body[data-tool="download"] { --tool-color: #0891b2; --tool-color-light: #ecfeff; }
body[data-tool="download"] .tool-hero::before { background: linear-gradient(135deg, rgba(8,145,178,.22) 0%, transparent 55%); }
.tc-dl { --tc: #0891b2; --tc-bg: #ecfeff; }

/* ── Nav dropdown ─────────────────────────────────── */
.nav-item { position: relative; }

/* Invisible bridge: keeps hover alive when mouse moves from link to dropdown */
.nav-item::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0; right: 0;
  height: 8px;
}
.has-sub > a::after {
  content: ''; display: inline-block; vertical-align: middle;
  width: 0; height: 0; margin-left: 5px;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 4px solid currentColor; opacity: .5;
  transition: transform 150ms;
}
.nav-item:hover > a::after,
.nav-item:focus-within > a::after { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  min-width: 170px; background: #1e293b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 6px;
  display: none; flex-direction: column; gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown { display: flex; }
.nav-dropdown a {
  padding: 8px 12px; border-radius: 7px; height: auto;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: rgba(255,255,255,.55);
  display: flex; align-items: center; gap: 8px;
}
.nav-dropdown a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-dropdown a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.nav-tag {
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
  background: var(--brand); color: #fff;
  padding: 2px 5px; border-radius: 4px; text-transform: uppercase;
  margin-left: auto;
}

/* ── Tool sub-nav ─────────────────────────────────── */
.tool-subnav {
  background: rgba(15,23,42,.96);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.tool-subnav-inner {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
  display: flex; gap: 2px; padding: 6px 0;
}
.subnav-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.4);
  white-space: nowrap; transition: all 150ms;
  border: none; background: transparent; cursor: pointer;
}
.subnav-link:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }
.subnav-link.active { background: rgba(255,255,255,.1); color: var(--tool-color); }
.subnav-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Expression mode toggle ───────────────────────── */
.mode-toggle {
  display: inline-flex;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 100px;
  padding: 3px; gap: 2px;
}
.mode-btn {
  height: 32px; padding: 0 16px; border-radius: 100px;
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: all 150ms;
}
.mode-btn.active { background: var(--tool-color); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* ── Concept chips ────────────────────────────────── */
.concept-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.concept-chip {
  height: 34px; padding: 0 14px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--body); transition: all 150ms; white-space: nowrap;
}
.concept-chip:hover { border-color: var(--tool-color); color: var(--tool-color); }
.concept-chip.active { border-color: var(--tool-color); background: var(--tool-color-light); color: var(--tool-color); }

/* ── Diff output ──────────────────────────────────── */
.diff-output {
  min-height: 120px; line-height: 1.9;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 16px;
  font-size: 15px; word-break: keep-all;
}
.diff-output:empty::before { content: '결과가 여기에 표시됩니다.'; color: var(--muted); font-size: 14px; }
mark.diff-added {
  background: #dcfce7; color: #166534;
  border-radius: 3px; padding: 0 2px;
  font-style: normal; font-weight: 600;
}
del.diff-removed {
  background: #fee2e2; color: #9f1239;
  text-decoration-color: #f87171;
  border-radius: 3px; padding: 0 2px;
}

/* ── API key settings ─────────────────────────────── */
.api-settings { border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.api-settings > summary {
  padding: 10px 14px; background: var(--surface-2);
  font-size: 12px; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.api-settings > summary::after { content: none; }
.api-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.api-note { font-size: 12px; color: var(--muted); line-height: 1.65; }

/* ── Wide tool card (full-width) ───────────────────── */
.tool-entry-full {
  grid-column: 1 / -1; flex-direction: row; align-items: stretch;
}
.tool-entry-full .tool-entry-top {
  width: 90px; height: auto; min-height: unset; border-radius: 0; flex-shrink: 0;
}
.tool-entry-full .tool-entry-body { flex: 1; }
.tool-entry-full .tool-entry-foot {
  flex-shrink: 0; border-top: 0; border-left: 1px solid var(--border);
  align-items: center; padding: 20px 24px; min-width: 120px;
  justify-content: center;
}

[hidden] { display: none !important; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 960px) {
  .header-inner {
    height: auto; flex-direction: column; align-items: flex-start;
    padding: 12px 0; gap: 6px;
  }
  .site-nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav-dropdown { display: none !important; }
  .hero-inner  { padding: 64px 0 60px; }
  .tools-grid  { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .info-strip    { grid-template-columns: 1fr; }
  .content-grid  { grid-template-columns: 1fr; }
  .two-pane      { grid-template-columns: 1fr; }
  .stats-row.c6  { grid-template-columns: repeat(3, 1fr); }
  .footer-top    { grid-template-columns: 1fr; gap: 32px; }
  .footer-links  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .footer-top, .footer-bottom { width: calc(100% - 32px); }
  .hero-inner { padding: 52px 0 48px; gap: 16px; }
  .hero-inner h1 { font-size: 32px; }
  .hero-inner > p { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; justify-content: center; }
  .tools-grid { grid-template-columns: 1fr; }
  #home-stats { grid-template-columns: repeat(2, 1fr); }
  #home-stats div:nth-child(2) { border-right: 0; }
  #home-stats div:nth-child(3),
  #home-stats div:nth-child(4) { border-top: 1px solid var(--border); }
  .form-row.c2, .form-row.c3 { grid-template-columns: 1fr; }
  .inline-pair { grid-template-columns: 1fr; }
  .inline-pair .sep { display: none; }
  .stats-row.c3, .stats-row.c4, .stats-row.c6 { grid-template-columns: repeat(2, 1fr); }
  .runner-card { padding: 18px; }
  .content-card { padding: 18px; }
  .toolbar { flex-direction: column; }
  .toolbar .btn { width: 100%; }
  .footer-links { grid-template-columns: 1fr; }
}

/* ── PDF Tool ─────────────────────────────────────────────────────────────── */
.pdf-upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pdf-upload-zone:hover,
.pdf-upload-zone.drag-over {
  border-color: var(--tool-color);
  background: var(--tool-color-light, #fff1f2);
}
.pdf-upload-zone .upload-icon { color: var(--muted); margin-bottom: 4px; }
.pdf-upload-zone .upload-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.pdf-upload-zone .upload-sub { font-size: 13px; color: var(--muted); }
.pdf-upload-zone .upload-add {
  margin-top: 4px; font-size: 12px; font-weight: 600;
  color: var(--tool-color); text-decoration: underline; cursor: pointer;
}

.pdf-grid-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.pdf-grid-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.pdf-grid-add {
  font-size: 12px; font-weight: 600; color: var(--tool-color);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.pdf-grid-add:hover { background: var(--tool-color-light, #fff1f2); }

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  user-select: none;
}

.pdf-page-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;
  cursor: grab;
  transition: border-color 0.12s, box-shadow 0.12s, opacity 0.15s;
  outline: none;
}
.pdf-page-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.pdf-page-card.is-selected {
  border-color: var(--tool-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool-color) 18%, transparent);
}
.pdf-page-card.is-drag-source { opacity: 0.28; cursor: grabbing; }
.pdf-page-card.drop-target {
  border-color: var(--tool-color);
  border-style: dashed;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool-color) 25%, transparent);
}

.pdf-thumb-wrap {
  position: relative;
  background: #e8e8e8;
  border-radius: calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0 0;
  overflow: hidden;
  aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
}
.pdf-thumb-wrap img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.pdf-page-num {
  position: absolute; bottom: 5px; right: 6px;
  background: rgba(0,0,0,0.52);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; line-height: 1.6;
  pointer-events: none;
}
.pdf-file-badge {
  position: absolute; top: -8px; left: 6px;
  background: var(--tool-color); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px; z-index: 2;
  max-width: calc(100% - 12px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.6;
}
.pdf-page-footer {
  padding: 4px 6px 5px;
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4; border-top: 1px solid var(--border);
}

/* Drag ghost */
.pdf-drag-ghost {
  position: fixed; z-index: 9999; pointer-events: none;
  opacity: 0.88; transform: scale(1.05) rotate(1.5deg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--tool-color);
  overflow: hidden;
  transition: transform 0.08s ease;
}

/* Lightbox */
.pdf-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(3px);
}
.lb-inner {
  position: relative; z-index: 1;
  max-width: 92vw; max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
}
.lb-canvas {
  max-width: 100%; max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: opacity 0.15s;
}
.lb-close {
  position: absolute; top: -42px; right: 0;
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.12s;
}
.lb-close:hover { background: rgba(255,255,255,0.28); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.12s;
}
.lb-nav:hover { background: rgba(255,255,255,0.28); }
.lb-prev { left: -52px; }
.lb-next { right: -52px; }
.lb-info {
  position: absolute; bottom: -36px; left: 0; right: 0;
  text-align: center; font-size: 12px; color: rgba(255,255,255,0.7);
}

.pdf-range-row {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.pdf-range-row .form-field { flex: 1; min-width: 200px; }

@media (max-width: 600px) {
  .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .lb-prev { left: -44px; }
  .lb-next { right: -44px; }
}
