/* HWPX-Intelligence Viewer — Design Tokens (Toss-inspired, 2026) */
:root {
  /* Typography */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "D2Coding", "D2Coding ligature", ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  --font-serif: "Source Serif Pro", "Noto Serif KR", "Apple SD Gothic Neo", serif;

  /* Gray scale (Toss palette) */
  --gray-0: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f2f4f6;
  --gray-200: #e5e8eb;
  --gray-300: #d1d6db;
  --gray-400: #b0b8c1;
  --gray-500: #8b95a1;
  --gray-600: #6b7684;
  --gray-700: #4e5968;
  --gray-800: #333d4b;
  --gray-900: #191f28;

  /* Brand */
  --blue: #3182f6;
  --blue-strong: #1b64da;
  --blue-soft: #e8f3ff;
  --green: #00bf40;
  --green-soft: #e6f9eb;
  --red: #f04452;
  --red-soft: #fdeded;
  --amber: #ff9c33;
  --amber-soft: #fff4e6;

  /* Spacing (4pt grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radius */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(0, 19, 43, 0.04), 0 0 0 1px rgba(0, 19, 43, 0.04);
  --shadow-2: 0 4px 16px rgba(0, 19, 43, 0.06), 0 0 0 1px rgba(0, 19, 43, 0.04);
  --shadow-3: 0 12px 32px rgba(0, 19, 43, 0.10);

  /* Type scale */
  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-15: 15px;
  --t-16: 16px;
  --t-18: 18px;
  --t-20: 20px;
  --t-22: 22px;
  --t-26: 26px;
  --t-32: 32px;

  --lh-tight: 1.3;
  --lh-snug: 1.45;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
}

/* Base reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--gray-50); color: var(--gray-900); }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "tnum";
  font-size: var(--t-14);
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Typography utilities */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.t-eyebrow {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}

/* Components */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  background: var(--gray-100);
  color: var(--gray-700);
  letter-spacing: 0;
}
.tag.brand { background: var(--blue-soft); color: var(--blue-strong); }
.tag.warn { background: var(--red-soft); color: var(--red); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.solid { background: var(--gray-900); color: white; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 16px;
  border-radius: var(--r);
  border: none;
  font: inherit;
  font-size: var(--t-13);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn.primary { background: var(--gray-900); color: white; }
.btn.primary:hover { background: var(--gray-800); }
.btn.secondary { background: var(--gray-100); color: var(--gray-900); }
.btn.secondary:hover { background: var(--gray-200); }
.btn.ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn.ghost:hover { background: var(--gray-100); }

input[type="search"], input[type="text"], select {
  font: inherit;
  font-size: var(--t-13);
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  background: white;
  color: var(--gray-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
input[type="search"]::placeholder { color: var(--gray-500); }
input[type="search"]:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
