/* OKAPISCAN 청산가·포지션 사이즈·손익분기 계산기 v1
   /kr/tools/ 전용. 세금 비교(txc)와 간편 계산기(simple-calc)는 그대로 두고
   그 위에 청산가 섹션과 도구 바로가기만 얹는다. 톤은 tax-compare-v1 의 다크 토큰을 따른다. */

.liq {
  --liq-bg: #080c12;
  --liq-surface: #0b1017;
  --liq-surface-2: #0d141d;
  --liq-line: #1a2230;
  --liq-line-2: #24303f;
  --liq-text: #e9eef6;
  --liq-muted: #8b98ab;
  --liq-dim: #6b7686;
  --liq-accent: #6fe3d0;
  --liq-accent-dim: #2f7d70;
  --liq-up: #38d9a9;
  --liq-down: #ff7b8a;
  --liq-warn: #d9a25f;
  margin: 8px 0 10px;
  color: var(--liq-text);
  font-family: Inter, 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  letter-spacing: -.012em;
}
.liq *, .liq *::before, .liq *::after { box-sizing: border-box; }

/* ── 도구 바로가기 ── */
.tools-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
}
.tools-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #24303f;
  border-radius: 10px;
  background: #0c131b;
  color: #a5b2c2;
  font: 700 12.5px/1.3 Inter, 'Noto Sans KR', system-ui, sans-serif;
  text-decoration: none;
  letter-spacing: -.01em;
}
.tools-jump a:hover { color: #e4ecf7; border-color: #33455a; }
.tools-jump a:focus-visible { outline: 2px solid var(--liq-accent, #6fe3d0); outline-offset: 2px; }
.tools-jump a.is-primary { border-color: #2f9c8b; background: rgba(111, 227, 208, .09); color: #d8fbf4; }

/* ── 헤더 ── */
.liq-head { margin: 0 0 14px; }
.liq-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--liq-accent);
}
.liq-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(21px, 2.4vw, 27px);
  line-height: 1.28;
  letter-spacing: -.035em;
  color: #f3f7fc;
}
.liq-head p {
  margin: 0;
  max-width: 800px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--liq-muted);
  word-break: keep-all;
}

/* ── 본문 그리드 ── */
.liq-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 14px;
  align-items: start;
}

/* ── 입력 패널 ── */
.liq-inputs {
  border: 1px solid var(--liq-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--liq-surface-2), var(--liq-surface));
  padding: 16px 16px 6px;
}
.liq-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.liq-mode-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--liq-dim);
  margin-bottom: 7px;
}
.liq-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.liq-seg button {
  flex: 1 1 0;
  min-width: 64px;
  min-height: 42px;
  appearance: none;
  border: 1px solid var(--liq-line-2);
  border-radius: 9px;
  background: #0c131b;
  color: #a5b2c2;
  font: 700 12.5px/1.35 Inter, 'Noto Sans KR', system-ui, sans-serif;
  padding: 9px 6px;
  cursor: pointer;
  transition: background .13s ease, border-color .13s ease, color .13s ease;
  white-space: nowrap;
}
.liq-seg button:hover { color: #e4ecf7; border-color: #33455a; }
.liq-seg button[aria-pressed="true"] { border-color: #2f9c8b; background: rgba(111, 227, 208, .13); color: #d8fbf4; }
.liq-seg[data-tone="long"] button[aria-pressed="true"] { border-color: #2c9a76; background: rgba(56, 217, 169, .14); color: #d6fff2; }
.liq-seg[data-tone="short"] button[aria-pressed="true"] { border-color: #b4475a; background: rgba(255, 123, 138, .14); color: #ffe1e5; }
.liq-seg button:focus-visible { outline: 2px solid var(--liq-accent); outline-offset: 2px; }
.liq-seg-tight button { font-size: 12px; }

.liq-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--liq-dim);
  word-break: keep-all;
}
.liq-note[data-tone="warn"] { color: var(--liq-warn); }

.liq-field { padding: 13px 0; border-bottom: 1px solid #141b25; }
.liq-field:last-child { border-bottom: 0; }
.liq-field-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.liq-field-top label, .liq-field-top .liq-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #ced8e5;
}
.liq-hint { font-size: 11px; font-weight: 600; color: var(--liq-dim); }
.liq-value {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.liq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* 두 칸이 한 줄로 붙어 보이지 않게 칸 사이에 옅은 구분선을 둔다(교차 총 잔고가 함께 열릴 때). */
.liq-two > .liq-field + .liq-field { padding-left: 16px; border-left: 1px solid #141b25; }
.liq-two.is-single > .liq-field { grid-column: 1 / -1; }
.liq-two > .liq-field { border-bottom: 1px solid #141b25; }
.liq-num {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--liq-line-2);
  border-radius: 10px;
  background: #080d13;
  color: #fff;
  font: 700 15px/1.3 Inter, 'Noto Sans KR', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.liq-num:focus {
  outline: none;
  border-color: #2f9c8b;
  box-shadow: 0 0 0 3px rgba(111, 227, 208, .1);
}
.liq-num[hidden], .liq-field[hidden], .liq-chips[hidden] { display: none !important; }

/* 슬라이더 */
.liq-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.liq-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: #1b2533;
  border: 1px solid #23303f;
}
.liq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -7px;
  border-radius: 50%;
  background: #eaf7f4;
  border: 3px solid #1aa88f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}
.liq-slider::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: #1b2533;
  border: 1px solid #23303f;
}
.liq-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eaf7f4;
  border: 3px solid #1aa88f;
}
.liq-slider:focus-visible { outline: 2px solid var(--liq-accent); outline-offset: 3px; }

/* 칩 */
.liq-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.liq-chips button {
  appearance: none;
  min-height: 34px;
  border: 1px dashed #2c3d4f;
  border-radius: 7px;
  background: transparent;
  color: #90a0b3;
  font: 700 11.5px/1 Inter, 'Noto Sans KR', system-ui, sans-serif;
  padding: 8px 10px;
  cursor: pointer;
}
.liq-chips button:hover { color: #d6e3f2; border-color: #3d556c; }
.liq-chips button[aria-pressed="true"] {
  border-style: solid;
  border-color: #2f9c8b;
  background: rgba(111, 227, 208, .12);
  color: #d8fbf4;
}
.liq-chips button:focus-visible { outline: 2px solid var(--liq-accent); outline-offset: 2px; }
.liq-chips button b { font-weight: 800; color: #dbe7f3; }
.liq-chips button[aria-pressed="true"] b { color: #fff; }

/* 고급 설정 */
.liq-more { margin-top: 12px; border-top: 1px solid #141b25; padding-top: 11px; }
.liq-more summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #8fa0b3;
  list-style: none;
}
.liq-more summary::-webkit-details-marker { display: none; }
.liq-more summary::before { content: '＋'; margin-right: 6px; color: #5f7183; font-weight: 800; }
.liq-more[open] summary::before { content: '－'; }
.liq-more summary:hover { color: #c9d5e3; }
.liq-more-body { padding-top: 4px; }

/* ── 결과 패널 ── */
.liq-out {
  border: 1px solid #1f4a4d;
  border-radius: 16px;
  background: linear-gradient(155deg, #10252f, #0b1723 55%, #0a141d);
  padding: 18px 18px 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
}
.liq-out[data-tone="short"] { border-color: #4a2b36; background: linear-gradient(155deg, #26161f, #150e15 55%, #100b11); }
.liq-out-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.liq-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; color: var(--liq-accent); }
.liq-out[data-tone="short"] .liq-kicker { color: #ff9aa6; }
.liq-badge {
  font-size: 11px;
  font-weight: 800;
  color: #cfe9e4;
  background: rgba(111, 227, 208, .12);
  border: 1px solid rgba(111, 227, 208, .25);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}
.liq-out[data-tone="short"] .liq-badge { color: #ffd7dd; background: rgba(255, 123, 138, .12); border-color: rgba(255, 123, 138, .28); }
.liq-big {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 850;
  letter-spacing: -.045em;
  color: #ffffff;
  margin: 12px 0 2px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.liq-big small { font-size: .38em; font-weight: 800; color: var(--liq-muted); margin-left: 6px; letter-spacing: 0; }
.liq-big-sub { font-size: 13px; font-weight: 700; color: #9fb5c8; margin-bottom: 6px; }
.liq-big-sub b { color: #fff; font-weight: 800; }
.liq-big-sub .liq-down { color: var(--liq-down); }
.liq-big-sub .liq-up { color: var(--liq-up); }

.liq-rows { margin-top: 12px; }
.liq-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(111, 227, 208, .14);
  font-size: 12.5px;
  color: #9fb5c8;
}
.liq-out[data-tone="short"] .liq-row { border-top-color: rgba(255, 123, 138, .14); }
.liq-row span { flex: 0 1 auto; }
.liq-row strong {
  color: #f6f9ff;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.liq-row strong small { display: block; font-size: 10.5px; font-weight: 700; color: var(--liq-dim); margin-top: 2px; }
.liq-row.lq-bep strong { color: var(--liq-accent); }
.liq-out-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #7f93a6;
  word-break: keep-all;
}

/* ── 레버리지 표 ── */
.liq-table-wrap {
  margin-top: 14px;
  border: 1px solid var(--liq-line);
  border-radius: 16px;
  background: var(--liq-surface);
  padding: 16px 16px 6px;
}
.liq-table-head h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.02em; color: #f3f7fc; }
.liq-table-head p { margin: 0 0 12px; font-size: 11.5px; line-height: 1.6; color: var(--liq-dim); word-break: keep-all; }
.liq-table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px 12px; }
.liq-table { width: 100%; border-collapse: collapse; min-width: 430px; }
.liq-table th, .liq-table td {
  padding: 10px 8px;
  text-align: right;
  font-size: 12px;
  border-bottom: 1px solid #151d27;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.liq-table th:first-child, .liq-table td:first-child { text-align: left; }
.liq-table thead th { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: #77869a; border-bottom-color: #202b39; }
.liq-table tbody tr.is-current { background: rgba(111, 227, 208, .07); }
.liq-table tbody tr.is-current td { color: #eaf9f5; font-weight: 800; }
.liq-table tbody tr.is-current td:first-child { color: var(--liq-accent); }
.liq-table td { color: #cfdae6; }
.liq-table td.lq-num { font-weight: 700; }
.liq-table td.lq-dist { color: #9fb5c8; }

/* ── 공식·주의 ── */
.liq-formula {
  margin-top: 14px;
  border: 1px solid var(--liq-line);
  border-radius: 16px;
  background: var(--liq-surface);
  padding: 16px;
}
.liq-formula h3 { margin: 0 0 10px; font-size: 14px; color: #f3f7fc; letter-spacing: -.02em; }
.liq-formula code {
  display: block;
  padding: 10px 12px;
  border: 1px solid #1d2a38;
  border-radius: 9px;
  background: #070c12;
  color: #b9e8de;
  font: 600 11.5px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.liq-formula ul { margin: 11px 0 0; padding-left: 16px; }
.liq-formula li { font-size: 12px; line-height: 1.7; color: #97a7ba; word-break: keep-all; }
.liq-formula li b { color: #dbe7f3; }

/* ── CTA ── */
.liq-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid #26364a;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f1e2c, #0a1420);
  padding: 16px;
}
.liq-cta h3 { margin: 0 0 7px; font-size: 14.5px; color: #f3f7fc; letter-spacing: -.02em; }
.liq-cta p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.7; color: #a2b4c8; word-break: keep-all; }
.liq-cta p b { color: #fff; }
.liq-cta-fine { font-size: 10.5px; line-height: 1.6; color: #6d7f92; word-break: keep-all; }
.liq-cta-side { display: grid; gap: 8px; }
.liq-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1ea98f, #147268);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  text-align: center;
  padding: 10px 14px;
}
.liq-btn:hover { filter: brightness(1.08); }
.liq-btn-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #2b3d51;
  border-radius: 10px;
  color: #a9c4d4;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 9px 12px;
  background: #0b1520;
}
.liq-btn-sub:hover { color: #e4f2ff; border-color: #3d556c; }
.liq-btn:focus-visible, .liq-btn-sub:focus-visible { outline: 2px solid var(--liq-accent); outline-offset: 2px; }

@media (max-width: 880px) {
  .liq-body { grid-template-columns: 1fr; }
  .liq-cta { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .liq-inputs { padding: 14px 13px 4px; }
  .liq-mode-grid { grid-template-columns: 1fr; }
  .liq-two { grid-template-columns: 1fr; gap: 0; }
  .liq-two > .liq-field + .liq-field { padding-left: 0; border-left: 0; }
  .liq-out { padding: 16px 15px 14px; }
  .liq-big { font-size: clamp(28px, 9vw, 36px); }
  .liq-row { font-size: 12px; }
  .liq-table-wrap, .liq-formula, .liq-cta { padding: 14px 13px; }
  .liq-table-scroll { margin: 0 -13px; padding: 0 13px 10px; overflow-x: auto; }
  /* 390px 폭에서 4열이 잘리지 않도록 표를 폭에 맞춘다. */
  .liq-table { min-width: 100%; }
  .liq-table th, .liq-table td { padding: 9px 4px; font-size: 11px; }
  .liq-table thead th { font-size: 10px; white-space: normal; line-height: 1.3; }
  .liq-chips button { min-height: 38px; }
  .liq-seg button { min-height: 44px; }
  .tools-jump { gap: 6px; }
  .tools-jump a { flex: 1 1 calc(50% - 6px); justify-content: center; min-height: 42px; padding: 9px 10px; font-size: 12px; }
}
