@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css");

/* ==========================================================================
   Pagu.info Design System v2 — Toss-like light finance
   Applied page-by-page starting from the home page.
   Pages not yet migrated keep using src/styles.css.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --------------------------------------------------------------------
     Stripe 기반 팔레트 (docs/architecture.md §5)
     값의 원본은 src/tokens.css 의 --pagu-* 다. 모든 페이지가 tokens.css 를
     먼저 불러온다. 뒤에 적힌 값은 tokens.css 가 없을 때의 대비책이다.
     색을 바꾸려면 여기가 아니라 tokens.css 를 고친다.
     -------------------------------------------------------------------- */

  /* Gray scale — 네이비 톤 */
  --gray-50: var(--pagu-bg, #f6f9fc);
  --gray-100: var(--pagu-bg-subtle, #eef3f9);
  --gray-200: var(--pagu-line, #e3e9f2);
  --gray-300: var(--pagu-line-strong, #cfd9e8);
  --gray-400: #8fa0b5;
  --gray-500: #607084;  /* 2026-10-13: #6b7c93 은 연회색 배경 위 3.8:1 로 미달이었다 */
  --gray-600: var(--pagu-muted, #425466);
  --gray-700: #33475b;
  --gray-800: #1b3a5c;
  --gray-900: var(--pagu-fg, #0a2540);

  /* Brand — Stripe accent */
  --blue-50: var(--pagu-accent-weak, #eeedff);
  --blue-100: #d7d4ff;
  --blue-500: var(--pagu-accent, #635bff);
  --blue-600: var(--pagu-accent-strong, #4b45cc);
  --blue-700: #3a35a3;

  /* Semantic */
  --green-bg: var(--pagu-up-weak, #e6f5f0);
  --green: var(--pagu-up, #0a966f);
  --red-bg: var(--pagu-down-weak, #fdecef);
  --red: var(--pagu-down, #e0415b);
  --amber-bg: var(--pagu-warn-weak, #fdf4e4);
  --amber: var(--pagu-warn, #b4762e);

  --bg: var(--pagu-bg, #f6f9fc);
  --surface: var(--pagu-panel, #ffffff);
  --on-accent: #ffffff;
  --text: var(--gray-900);
  --text-sub: var(--gray-600);
  --text-soft: var(--gray-500);
  --line: var(--gray-200);
  --line-soft: var(--gray-100);

  /* Shape & elevation */
  --radius-sm: var(--pagu-radius-sm, 8px);
  --radius-md: var(--pagu-radius-md, 12px);
  --radius-lg: var(--pagu-radius-lg, 18px);
  --radius-full: 999px;
  --shadow-sm: var(--pagu-shadow-sm, 0 1px 2px rgba(10, 37, 64, 0.06));
  --shadow-md: var(--pagu-shadow-md, 0 4px 14px rgba(10, 37, 64, 0.08));
  --shadow-lg: var(--pagu-shadow-lg, 0 18px 40px rgba(10, 37, 64, 0.1));

  /* Motion */
  --ease: var(--pagu-ease, cubic-bezier(0.2, 0.8, 0.2, 1));
  --fast: 140ms;
  --normal: 220ms;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Pretendard Variable",
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Segoe UI",
    Roboto,
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
summary {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow-wrap: break-word;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--blue-100);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--gray-900);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--fast) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Numbers: always tabular, right-aligned where tagged */
.numeric-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: right;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 64px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--glass, rgba(255, 255, 255, 0.82));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.top-nav > a,
.top-nav summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: var(--radius-full);
  color: var(--gray-700);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  list-style: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.top-nav summary::-webkit-details-marker {
  display: none;
}

.top-nav summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--fast) var(--ease);
}

.top-nav details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.top-nav > a:hover,
.top-nav summary:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.top-nav > a[aria-current="page"],
.top-nav summary[aria-current="page"] {
  background: var(--blue-50);
  color: var(--blue-600);
}

.top-nav details {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 2px;
  min-width: 224px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.menu-panel a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: 14.5px;
  font-weight: 550;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.menu-panel a:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.menu-panel a[aria-current="page"] {
  background: var(--blue-50);
  color: var(--blue-600);
}

.menu-panel a[data-calculator-home] {
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 4px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--gray-600);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.header-search:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.header-search strong {
  font-size: 14px;
  font-weight: 600;
}

.header-search-icon {
  width: 16px;
  height: 16px;
}

.header-search kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.language-select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--gray-600);
  font-size: 13.5px;
  font-weight: 600;
}

.language-status {
  padding: 8px 12px;
  border-radius: var(--radius-full);
  color: var(--gray-600);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--gray-500);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.social-link:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.social-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ==========================================================================
   Page shell
   ========================================================================== */

.page-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 96px;
}

.home-shell > section + section {
  margin-top: clamp(56px, 8vw, 88px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 750;
}

.section-head .section-sub {
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 14.5px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--blue-600);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: background var(--fast) var(--ease);
}

.section-link:hover {
  background: var(--blue-50);
}

.section-link::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-top: 1.8px solid currentColor;
  transform: rotate(45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-top: clamp(8px, 2vw, 24px);
}

.hero-copy .eyebrow {
  margin-bottom: 10px;
}

.hero-copy h1 {
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 800;
  line-height: 1.28;
}

.hero-copy .lede {
  margin-top: 14px;
  color: var(--text-sub);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.6;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 6px 6px 6px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.command-search:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--blue-50);
}

.command-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 700;
}

.command-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.command-search input::placeholder {
  color: var(--gray-400);
}

.command-search input::-webkit-search-cancel-button {
  display: none;
}

.command-search button {
  flex-shrink: 0;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--blue-500);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.command-search button:hover {
  background: var(--blue-600);
}

.command-search button:active {
  transform: scale(0.97);
}

.search-help {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  min-height: 36px;
}

.search-suggestions a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--gray-700);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.search-suggestions a:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-600);
}

.search-no-result {
  color: var(--text-soft);
  font-size: 13.5px;
  align-self: center;
}

/* Market preview card */
.market-overview {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--gray-50), var(--surface) 65%);
  box-shadow: var(--shadow-md);
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.summary-header span {
  color: var(--gray-800);
  font-size: 15px;
  font-weight: 750;
}

.data-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.data-source {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.data-source.sample {
  background: var(--amber-bg);
  color: var(--amber);
}

.data-source.live {
  background: var(--green-bg);
  color: var(--green);
}

.summary-rows {
  margin-top: 14px;
  display: grid;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value" "label sub";
  align-items: center;
  column-gap: 12px;
  padding: 13px 0;
}

.summary-row + .summary-row {
  border-top: 1px solid var(--line-soft);
}

.summary-row > span {
  grid-area: label;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 550;
}

.summary-row > strong {
  grid-area: value;
  font-size: 17px;
  font-weight: 750;
}

.summary-row > small {
  grid-area: sub;
  color: var(--text-soft);
  font-size: 12px;
  text-align: right;
}

.summary-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 14.5px;
  font-weight: 700;
  transition: background var(--fast) var(--ease);
}

.summary-link:hover {
  background: var(--blue-100);
}

/* ==========================================================================
   Calculator cards
   ========================================================================== */

.calculator-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.calculator-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 168px;
  padding: 22px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition:
    transform var(--normal) var(--ease),
    border-color var(--normal) var(--ease),
    box-shadow var(--normal) var(--ease);
}

.calculator-card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.calculator-card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-600);
}

.calculator-card .card-icon svg {
  width: 20px;
  height: 20px;
}

.calculator-card span.card-tag {
  color: var(--blue-600);
  font-size: 12.5px;
  font-weight: 700;
}

.calculator-card strong {
  font-size: 16.5px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.calculator-card p {
  color: var(--text-sub);
  font-size: 13.5px;
  line-height: 1.55;
}

.calculator-card em {
  position: absolute;
  top: 22px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gray-300);
  border-top: 2px solid var(--gray-300);
  transform: rotate(45deg);
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
  font-size: 0;
}

.calculator-card:hover em {
  border-color: var(--blue-500);
  transform: rotate(45deg) translate(2px, -2px);
}

.calculator-card.primary-card {
  background: linear-gradient(160deg, var(--blue-50), var(--surface) 70%);
  border-color: var(--blue-100);
}

/* ==========================================================================
   Market panels (Stable / DeFi)
   ========================================================================== */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 14px;
}

.home-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h2 {
  font-size: 18px;
  font-weight: 750;
}

.panel-title .eyebrow {
  margin-bottom: 4px;
  font-size: 12.5px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.panel-actions a {
  color: var(--blue-600);
  font-size: 14px;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  transition: background var(--fast) var(--ease);
}

.panel-actions a:hover {
  background: var(--blue-50);
}

/* Stable board rows */
.stable-board {
  display: grid;
  flex: 1;
}

.stable-board > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.stable-board > div + div {
  border-top: 1px solid var(--line-soft);
}

.stable-board span {
  font-size: 15px;
  font-weight: 650;
}

.stable-board strong {
  font-size: 16px;
  font-weight: 720;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  white-space: nowrap;
}

.status-pill.good {
  background: var(--green-bg);
  color: var(--green);
}

.status-pill.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-pill.bad {
  background: var(--red-bg);
  color: var(--red);
}

.status-pill.neutral {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

thead th {
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
}

thead th:not(:first-child) {
  text-align: right;
}

tbody td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 550;
}

tbody td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background var(--fast) var(--ease);
}

tbody tr:hover {
  background: var(--gray-50);
}

td:first-child {
  font-weight: 700;
}

/* ==========================================================================
   Feed cards
   ========================================================================== */

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feed-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  transition:
    transform var(--normal) var(--ease),
    background var(--normal) var(--ease),
    border-color var(--normal) var(--ease),
    box-shadow var(--normal) var(--ease);
}

.feed-card:hover {
  transform: translateY(-3px);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.feed-card strong {
  font-size: 16px;
  font-weight: 720;
}

.feed-card p {
  color: var(--text-sub);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--gray-50);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.footer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.footer-note {
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Command dialog (global search) — injected by app.js
   ========================================================================== */

.command-dialog[hidden],
.mobile-sheet-layer[hidden] {
  display: none;
}

.command-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 10vh, 96px) 16px 16px;
}

.command-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 37, 64, 0.45);
  backdrop-filter: blur(2px);
  cursor: default;
}

.command-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(560px, 80vh);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: command-pop var(--normal) var(--ease);
}

@keyframes command-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.command-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.command-input-icon {
  display: inline-flex;
  color: var(--gray-400);
}

.command-input-icon svg {
  width: 18px;
  height: 18px;
}

.command-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.command-input-row input::placeholder {
  color: var(--gray-400);
}

.command-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--gray-500);
  transition: background var(--fast) var(--ease);
}

.command-close:hover {
  background: var(--gray-100);
}

.command-close svg {
  width: 16px;
  height: 16px;
}

.command-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.command-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  transition: background var(--fast) var(--ease);
}

.command-result.is-active {
  background: var(--blue-50);
}

.command-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.command-result.is-active .command-result-icon {
  background: var(--blue-100);
  color: var(--blue-600);
}

.command-result-icon svg {
  width: 17px;
  height: 17px;
}

.command-result-copy {
  flex: 1;
  min-width: 0;
}

.command-result-copy strong {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
}

.command-result-copy small {
  display: block;
  color: var(--text-soft);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-result-group {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 11.5px;
  font-weight: 650;
}

.command-chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--gray-300);
}

.command-result.is-active .command-chevron {
  color: var(--blue-500);
}

.command-empty {
  display: grid;
  gap: 4px;
  padding: 32px 16px;
  text-align: center;
}

.command-empty strong {
  font-size: 15px;
}

.command-empty span {
  color: var(--text-soft);
  font-size: 13px;
}

.command-footer {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-soft);
  font-size: 12px;
}

body.modal-open,
body.sheet-open {
  overflow: hidden;
}

/* ==========================================================================
   Mobile bottom nav + more sheet — injected by app.js
   ========================================================================== */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass-strong, rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 650;
  transition: color var(--fast) var(--ease);
}

.mobile-nav-item svg {
  width: 21px;
  height: 21px;
}

.mobile-nav-item.is-active {
  color: var(--blue-600);
}

.mobile-sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
}

.mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 37, 64, 0.45);
  cursor: default;
}

.mobile-sheet {
  position: relative;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: sheet-up var(--normal) var(--ease);
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.mobile-sheet::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin: 4px auto 10px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
}

.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
}

.mobile-sheet-header strong {
  font-size: 17px;
  font-weight: 750;
}

.mobile-sheet-header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
}

.mobile-sheet-header button svg {
  width: 16px;
  height: 16px;
}

.mobile-sheet-links {
  display: grid;
  gap: 2px;
}

.mobile-sheet-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--fast) var(--ease);
}

.mobile-sheet-links a:hover,
.mobile-sheet-links a:focus-visible {
  background: var(--gray-50);
}

.mobile-sheet-links a > svg:first-child {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--gray-600);
}

.mobile-sheet-links a span {
  flex: 1;
  min-width: 0;
}

.mobile-sheet-links a span strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
}

.mobile-sheet-links a span small {
  display: block;
  color: var(--text-soft);
  font-size: 12.5px;
}

.mobile-sheet-links a > svg:last-child {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--gray-300);
}

.mobile-sheet-footer {
  display: flex;
  gap: 12px;
  padding: 14px 10px 0;
  color: var(--text-soft);
  font-size: 12.5px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .calculator-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .top-nav,
  .language-status,
  .language-select,
  .header-search strong,
  .header-search kbd {
    display: none;
  }

  .header-search {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    min-height: 58px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .page-shell {
    padding-bottom: 120px;
  }

  .home-shell > section + section {
    margin-top: 48px;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .calculator-card-grid {
    grid-template-columns: 1fr;
  }

  .calculator-card {
    min-height: 0;
  }

  .command-search {
    flex-wrap: nowrap;
  }

  .command-key {
    display: none;
  }

  .home-panel,
  .market-overview {
    padding: 20px 18px;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Inner pages — shared layout
   ========================================================================== */

.page-shell.narrow {
  max-width: 880px;
}

.inner-shell > section + section {
  margin-top: 20px;
}

.page-title {
  margin-bottom: clamp(24px, 4vw, 36px);
}

.page-title h1 {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
}

.page-title h1 + p,
.page-title div > h1 + p {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 640px;
}

.page-title .data-meta {
  margin-top: 14px;
}

.page-title.with-control {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.inline-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  color: var(--gray-700);
  font-size: 13.5px;
  font-weight: 650;
}

/* Shared panel base */
.tool-card,
.data-panel,
.stable-card,
.protocol-card,
.lab-card,
.metric-card,
.project-detail {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 19px;
  font-weight: 750;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
  font-size: 12.5px;
}

.section-heading > p {
  color: var(--text-soft);
  font-size: 13px;
}

/* Form controls */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--gray-700);
  font-size: 13.5px;
  font-weight: 650;
}

.form-grid input,
.form-grid select,
.inline-control input,
.page-title select,
#projectSelect {
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.form-grid input:hover,
.form-grid select:hover,
.inline-control input:hover,
#projectSelect:hover {
  border-color: var(--gray-300);
}

.form-grid input:focus,
.form-grid select:focus,
.inline-control input:focus,
#projectSelect:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--blue-50);
}

/* ==========================================================================
   Calculators
   ========================================================================== */

.calculator-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text-soft);
  font-size: 12.5px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.calculator-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.calculator-section-title h2 {
  font-size: 16.5px;
  font-weight: 750;
}

.calculator-section-title .eyebrow {
  margin-bottom: 2px;
  font-size: 12px;
}

.calculator-section-title > span {
  color: var(--text-soft);
  font-size: 12.5px;
  white-space: nowrap;
}

.calculator-results {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
}

.result-grid {
  display: grid;
  gap: 8px;
}

.result-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.result-strip span {
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 550;
}

.result-strip strong {
  font-size: 16.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.calculator-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.calculator-note summary {
  cursor: pointer;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 650;
  list-style-position: inside;
}

.calculator-note p {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 13.5px;
  line-height: 1.6;
}

.standalone-calculator-note {
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  border-top: 1px solid var(--line-soft);
  background: var(--gray-50);
}

/* PT Looping strategy cards */
.calc-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.strategy-header {
  margin-bottom: 14px;
}

.strategy-header h2 {
  font-size: 17px;
  font-weight: 750;
}

.mini-results {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.mini-results > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.mini-results span {
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 550;
}

.mini-results strong {
  font-size: 14.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.strategy-inputs {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.strategy-inputs summary {
  cursor: pointer;
  margin-bottom: 12px;
  color: var(--gray-700);
  font-size: 13.5px;
  font-weight: 650;
}

/* ==========================================================================
   Stable Watch
   ========================================================================== */

.stable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.stable-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stable-top h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.stable-top small {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 12.5px;
}

.deviation {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deviation.good {
  background: var(--green-bg);
  color: var(--green);
}

.deviation.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.deviation.bad {
  background: var(--red-bg);
  color: var(--red);
}

.stable-card .price {
  margin: 10px 0 14px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 56px;
}

.mini-chart span {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--blue-100), var(--blue-50));
}

.chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 12px;
}

/* ==========================================================================
   DeFi Dashboard / Projects / Labs / PerpDEX
   ========================================================================== */

.data-source.loading {
  background: var(--blue-50);
  color: var(--blue-600);
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.protocol-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.protocol-top h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.protocol-top small {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 12.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 45%;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.protocol-card dl,
.lab-card dl,
.project-detail dl {
  margin: 14px 0 0;
  display: grid;
}

.protocol-card dl > div,
.lab-card dl > div,
.project-detail dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.protocol-card dt,
.lab-card dt,
.project-detail dt {
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
}

.protocol-card dt small,
.lab-card dt small,
.project-detail dt small {
  color: var(--text-soft);
  font-size: 11px;
}

.protocol-card dd,
.lab-card dd,
.project-detail dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.card-data-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 12px;
}

/* Projects */
.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px 40px;
  padding: 28px;
}

.project-detail h2 {
  font-size: 22px;
  font-weight: 800;
}

.project-summary {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 14.5px;
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 12.5px;
  font-weight: 650;
}

.project-detail dl {
  margin: 0;
  align-self: start;
}

.project-detail dl > div:first-child {
  border-top: 0;
}

.project-detail dd {
  font-variant-numeric: normal;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.project-data-meta {
  grid-column: 1 / -1;
}

/* Labs */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 750;
}

.lab-card > p {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 13.5px;
  line-height: 1.6;
}

.lab-card dd {
  font-variant-numeric: normal;
  overflow-wrap: anywhere;
  text-align: right;
}

.roadmap {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 12.5px;
  font-weight: 600;
}

/* PerpDEX */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.metric-card span {
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12.5px;
}

.metric-card .numeric-value {
  text-align: left;
}

.responsive-table table {
  min-width: 880px;
}

td.positive {
  color: var(--green);
  font-weight: 750;
}

td.negative {
  color: var(--red);
  font-weight: 750;
}

/* Inner-page responsive */
@media (max-width: 1024px) {
  .calc-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .calculator-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .page-title.with-control {
    align-items: stretch;
    flex-direction: column;
  }

  .project-detail {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   v3 — Stripe 기반 재디자인 마감 (2026-10-13, docs/architecture.md §5)
   색은 :root 가 src/tokens.css 의 --pagu-* 를 가리키게 해서 이미 바뀌었다.
   여기서는 색만으로 표현되지 않는 것(히어로 띠, 카드 반응, 숫자 정렬)을 더한다.
   ========================================================================== */

/* 1. 홈 최상단 사선 그라디언트 띠 — 홈에서 한 번만 (§5) */
body[data-page="home"] {
  position: relative;
}

body[data-page="home"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(320px, 46vw, 560px);
  background:
    radial-gradient(90% 70% at 18% 0%, rgba(99, 91, 255, 0.10) 0%, rgba(99, 91, 255, 0) 60%),
    linear-gradient(104deg, #edf2fb 0%, #f1efff 46%, var(--pagu-bg, #f6f9fc) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 0 100%);
  pointer-events: none;
  z-index: 0;
}

/* 건너뛰기 링크는 화면 밖에 숨어 있어야 하므로 제외한다 */
body[data-page="home"] > *:not(script):not(.skip-link) {
  position: relative;
  z-index: 1;
}

/* 띠 위에 올라가는 홈 헤더는 조금 더 투명하게 */
body[data-page="home"] .site-header {
  background: var(--glass-soft, rgba(255, 255, 255, 0.72));
  border-bottom-color: transparent;
}

/* 2. 마이크로 인터랙션 — 0.2초 내외로 절제 (§5) */
.calc-card,
.protocol-card,
.project-card,
.lab-card,
.stable-card,
.metric-card {
  transition:
    transform var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

@media (hover: hover) {
  .calc-card:hover,
  .protocol-card:hover,
  .project-card:hover,
  .lab-card:hover,
  .stable-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. 숫자는 전부 폭이 같은 글꼴 + 오른쪽 정렬 (AGENTS.md 규칙) */
.numeric-value,
.num,
td.num,
th.num,
.price,
.metric-card strong,
.summary-row strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 4. 표 안의 숫자 열은 오른쪽 정렬 유지 */
table .num,
table .numeric-value {
  text-align: right;
}

/* 5. 터치 영역 최소 44px (AGENTS.md 규칙) — 작은 링크/버튼 보정 */
.top-nav > a,
.top-nav summary,
.header-search,
.mobile-bottom-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* 6. 중간 폭(861~1100px)에서 상단 메뉴가 잘리던 문제 보정
      — 메뉴를 숨기는 860px 와 전체 메뉴가 들어가는 1100px 사이 구간 */
@media (min-width: 861px) and (max-width: 1100px) {
  .top-nav > a,
  .top-nav summary {
    padding: 8px 9px;
    font-size: 13.5px;
  }

  .site-header {
    gap: 12px;
    padding: 0 16px;
  }
}

/* ==========================================================================
   다크 모드 보정 (2026-10-13)

   위 :root 의 토큰은 대부분 tokens.css 의 --pagu-* 를 따라가지만, 아래 7개는
   라이트 모드 고정값이라 OS 가 다크일 때 배경만 어두워지고 글자색은 그대로
   남는다. 그래서 계산기 입력 라벨(--gray-700)이 어두운 패널 위의 어두운
   네이비 글자가 되어 거의 안 보였다.

   color-scheme:light 은 네이티브 위젯만 바꾸고 prefers-color-scheme 매칭을
   막지 못한다. tokens.css 의 "기존 페이지는 영향 없다"는 주석은 사실이 아니다.

   라이트 모드 값은 한 줄도 건드리지 않고, 다크일 때의 값만 더한다.
   밝기 순서는 라이트의 반대로 뒤집는다(400 이 가장 흐리고 900 이 가장 진하다).
   가드(:not([data-pagu-theme="light"]))는 tokens.css 와 같은 규칙을 쓴다.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-pagu-theme="light"]) {
    color-scheme: dark;

    /* --gray-50/100/200/300/600/900 은 --pagu-* 파생이라 자동으로 뒤집힌다 */
    --gray-400: #7b90a6;
    --gray-500: #8fa3b8;
    --gray-700: #c0cedd;
    --gray-800: #d6e1ec;

    /* ::selection 과 hover 배경. 연보라 그대로면 그 위의 글자가 안 읽힌다 */
    --blue-100: #2a3a6e;
    --blue-700: #cfcbff;

    /* 다크에서 accent 와 --gray-900 이 밝은 색이 되므로 그 위 글자는 어둡게 */
    --on-accent: #07182b;

    /* 반투명 유리 표면(헤더·모바일 하단바). 흰색 고정이라 다크에서 흰 띠로 남았다 */
    --glass: rgba(14, 43, 68, 0.86);
    --glass-strong: rgba(14, 43, 68, 0.95);
    --glass-soft: rgba(14, 43, 68, 0.72);
  }
}

:root[data-pagu-theme="dark"] {
  color-scheme: dark;

  --gray-400: #7b90a6;
  --gray-500: #8fa3b8;
  --gray-700: #c0cedd;
  --gray-800: #d6e1ec;

  --blue-100: #2a3a6e;
  --blue-700: #cfcbff;

  --on-accent: #07182b;

  --glass: rgba(14, 43, 68, 0.86);
  --glass-strong: rgba(14, 43, 68, 0.95);
  --glass-soft: rgba(14, 43, 68, 0.72);
}
