/* OKAPISCAN 세금·수수료 비교 계산기 v1
   /kr/tools/ 전용. 기존 simple-calc(수익률·레버리지·수수료) 블록은 건드리지 않고
   그 위에 새 시뮬레이터 섹션만 얹는다. 톤은 ui-polish-v1 의 다크 금융 대시보드 토큰을 따른다. */

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

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

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

/* ── 입력 패널 ── */
.txc-inputs {
  border: 1px solid var(--txc-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--txc-surface-2), var(--txc-surface));
  padding: 6px 16px 14px;
}
.txc-field { padding: 13px 0; border-bottom: 1px solid #141b25; }
.txc-field:last-child { border-bottom: 0; padding-bottom: 4px; }
.txc-field-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.txc-field-top label {
  font-size: 12.5px;
  font-weight: 700;
  color: #ced8e5;
}
.txc-field-top .txc-hint-inline {
  font-size: 11px;
  color: var(--txc-dim);
  font-weight: 600;
}
.txc-value {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.txc-value small { font-size: 11px; font-weight: 700; color: var(--txc-muted); margin-left: 3px; }

/* 슬라이더 */
.txc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.txc-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: #1b2533;
  border: 1px solid #23303f;
}
.txc-range::-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);
}
.txc-range::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: #1b2533;
  border: 1px solid #23303f;
}
.txc-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eaf7f4;
  border: 3px solid #1aa88f;
}
.txc-range:focus-visible { outline: 2px solid var(--txc-accent); outline-offset: 3px; }

/* 숫자 입력 */
.txc-num {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--txc-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;
}
.txc-num:focus {
  outline: none;
  border-color: #2f9c8b;
  box-shadow: 0 0 0 3px rgba(111, 227, 208, .1);
}
.txc-num-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.txc-num-row label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--txc-dim);
}

/* 세그먼트 버튼 */
.txc-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.txc-seg button {
  flex: 1 1 0;
  min-width: 62px;
  appearance: none;
  border: 1px solid var(--txc-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;
}
.txc-seg button:hover { color: #e4ecf7; border-color: #33455a; }
.txc-seg button[aria-pressed="true"] {
  background: rgba(111, 227, 208, .13);
  border-color: #2f9c8b;
  color: #d8fbf4;
  box-shadow: 0 0 0 1px rgba(111, 227, 208, .08) inset;
}
.txc-seg button[aria-pressed="true"] em {
  font-style: normal;
  color: var(--txc-accent);
}
.txc-seg button:focus-visible { outline: 2px solid var(--txc-accent); outline-offset: 2px; }
.txc-seg-tight { gap: 5px; }
.txc-seg-tight button { font-size: 12px; padding: 7px 5px; }

/* 칩 */
.txc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.txc-chips button {
  appearance: none;
  border: 1px dashed #2c3d4f;
  border-radius: 7px;
  background: transparent;
  color: #90a0b3;
  font: 700 11px/1 Inter, 'Noto Sans KR', system-ui, sans-serif;
  padding: 6px 9px;
  cursor: pointer;
}
.txc-chips button:hover { color: #d6e3f2; border-color: #3d556c; }
.txc-chips button[aria-pressed="true"] {
  border-style: solid;
  border-color: #2f9c8b;
  background: rgba(111, 227, 208, .12);
  color: #d8fbf4;
}

/* 고급 설정 */
.txc-more { margin-top: 12px; border-top: 1px solid #141b25; padding-top: 11px; }
.txc-more summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #8fa0b3;
  list-style: none;
}
.txc-more summary::-webkit-details-marker { display: none; }
.txc-more summary::before { content: '＋'; margin-right: 6px; color: #5f7183; font-weight: 800; }
.txc-more[open] summary::before { content: '－'; }
.txc-more summary:hover { color: #c9d5e3; }
.txc-more-body { padding-top: 12px; display: grid; gap: 12px; }
.txc-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.5;
  color: #a8b5c5;
  cursor: pointer;
}
.txc-check input { margin: 2px 0 0; accent-color: #22a58f; width: 15px; height: 15px; flex: none; }

/* ── 결과 패널 ── */
.txc-out { display: grid; gap: 10px; }
.txc-case {
  border: 1px solid var(--txc-line);
  border-radius: 14px;
  background: linear-gradient(160deg, #0d141d, #0a0f16);
  padding: 14px 16px 13px;
  position: relative;
}
.txc-case::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 99px;
}
.txc-case--stock::before { background: #3f6ea8; }
.txc-case--crypto::before { background: #2f9c8b; }
.txc-case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.txc-case-head h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #c9d5e3;
}
.txc-case-head h3 span { color: #7a8b9e; font-weight: 700; }
.txc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid #2c3a4a;
  color: #9fb0c3;
  background: #0b1118;
  white-space: nowrap;
}
.txc-tag--tax { border-color: #4b2b33; background: #170d11; color: #ff9aa6; }
.txc-tag--zero { border-color: #245247; background: #081613; color: #56e0bd; }
.txc-tag--ref { border-color: #2f4a72; background: #0a1420; color: #8fc0ff; }
.txc-net {
  margin: 9px 0 2px;
  font-size: clamp(23px, 2.7vw, 30px);
  font-weight: 850;
  letter-spacing: -.035em;
  color: #f4f9ff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.txc-net small { font-size: 12px; font-weight: 700; color: var(--txc-muted); margin-left: 4px; letter-spacing: 0; }
.txc-net.is-negative { color: #ff8d99; }
.txc-net-sub { font-size: 11.5px; color: #7f8d9d; font-weight: 600; }

/* 스택 바 */
.txc-bar {
  display: flex;
  height: 7px;
  margin: 11px 0 10px;
  border-radius: 99px;
  overflow: hidden;
  background: #141b24;
  border: 1px solid #1b2531;
}
.txc-bar i { display: block; height: 100%; transition: width .28s ease; }
.txc-bar .s-net { background: linear-gradient(90deg, #2aa98f, #6fe3d0); }
.txc-bar .s-tax { background: linear-gradient(90deg, #b8485a, #e26677); }
.txc-bar .s-fee { background: linear-gradient(90deg, #b6833f, #d9a25f); }
.txc-bar-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 10.5px;
  font-weight: 700;
  color: #7f8d9d;
  margin-bottom: 4px;
}
.txc-bar-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 1px;
}
.txc-bar-legend .s-net { background: #4fceb6; }
.txc-bar-legend .s-tax { background: #e26677; }
.txc-bar-legend .s-fee { background: #d9a25f; }

.txc-rows { display: grid; gap: 5px; margin-top: 4px; }
.txc-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #8d9aab;
  font-variant-numeric: tabular-nums;
}
.txc-row strong { color: #e4ebf4; font-weight: 700; }
.txc-row strong.is-cost { color: #ff9aa6; font-weight: 700; }
.txc-row strong.is-zero { color: #5fe0be; }
.txc-row--total {
  border-top: 1px solid #18202b;
  margin-top: 3px;
  padding-top: 6px;
  color: #a9b7c7;
}
.txc-row--total strong { color: #fff; font-weight: 800; }
.txc-row-delta { color: #8fc0ff; font-weight: 800; }

/* 결과 요약 */
.txc-verdict {
  border: 1px solid #234339;
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(56, 217, 169, .12), rgba(56, 217, 169, 0) 62%),
    linear-gradient(140deg, #0b1a19, #0a1015);
  padding: 15px 16px;
}
.txc-verdict.is-worse {
  border-color: #4a2b31;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 123, 138, .12), rgba(255, 123, 138, 0) 62%),
    linear-gradient(140deg, #1a0e11, #0a1015);
}
.txc-verdict-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #5fe0be;
}
.txc-verdict.is-worse .txc-verdict-top { color: #ff9aa6; }
.txc-verdict strong {
  display: block;
  margin: 7px 0 5px;
  font-size: clamp(21px, 2.5vw, 27px);
  font-weight: 850;
  letter-spacing: -.035em;
  color: #f2fff9;
  font-variant-numeric: tabular-nums;
}
.txc-verdict.is-worse strong { color: #fff0f2; }
.txc-verdict p { margin: 0; font-size: 12px; line-height: 1.6; color: #9dabbd; word-break: keep-all; }
.txc-verdict p b { color: #dfeaf6; }

/* ── CTA ── */
.txc-cta {
  margin-top: 14px;
  border: 1px solid #234339;
  border-radius: 16px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background:
    radial-gradient(90% 160% at 0% 0%, rgba(47, 156, 139, .16), rgba(47, 156, 139, 0) 66%),
    linear-gradient(110deg, #0c1b1d, #0a1015 62%);
}
.txc-cta-copy h3 {
  margin: 0 0 5px;
  font-size: 15.5px;
  letter-spacing: -.02em;
  color: #f2fbf9;
}
.txc-cta-copy p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: #9dabbd;
  word-break: keep-all;
}
.txc-cta-copy p b { color: #d8fbf4; font-weight: 800; }
.txc-cta-copy .txc-cta-fine {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.55;
  color: #6f7d8d;
}
.txc-cta-side { display: flex; flex-direction: column; gap: 7px; align-items: stretch; min-width: 232px; }
.txc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid #2ecfa8;
  background: linear-gradient(180deg, #33d6ae, #1cae8d);
  color: #04130f;
  font-size: 13.5px;
  font-weight: 850;
  letter-spacing: -.015em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(28, 174, 141, .18);
  transition: transform .13s ease, filter .13s ease;
}
.txc-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.txc-btn:focus-visible { outline: 2px solid #9ff5e2; outline-offset: 2px; }
.txc-btn[aria-disabled="true"] {
  background: #131b23;
  border-color: #2a3746;
  color: #74818f;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.txc-btn-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #8fa0b3;
  text-decoration: none;
}
.txc-btn-sub:hover { color: #cfe0f2; }
.txc-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px 7px 11px;
  border: 1px dashed #2f4a44;
  border-radius: 9px;
  background: #08120f;
  font-size: 11px;
  color: #7f9a94;
}
.txc-code b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  letter-spacing: .06em;
  color: #c8fbee;
}
.txc-copy {
  appearance: none;
  border: 1px solid #2f4a44;
  border-radius: 6px;
  background: #0d1a17;
  color: #9fe6d6;
  font: 700 10.5px/1 Inter, system-ui, sans-serif;
  padding: 5px 7px;
  cursor: pointer;
}
.txc-copy:hover { background: #122421; }

/* ── 기준/유의사항 ── */
.txc-refs {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
.txc-ref-card {
  border: 1px solid #161e2a;
  border-radius: 14px;
  background: #090e15;
  padding: 15px 17px;
  min-width: 0;
}
.txc-ref-card h3 {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #cfdae7;
}
.txc-table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.txc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
  color: #93a1b2;
}
.txc-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .06em;
  font-weight: 800;
  color: #7b8998;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid #1b2431;
  white-space: nowrap;
}
.txc-table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid #131a24;
  vertical-align: top;
  line-height: 1.5;
}
.txc-table tr:last-child td { border-bottom: 0; }
.txc-table td strong { color: #e4ebf4; font-weight: 700; }
.txc-table .txc-num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.txc-ref-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: #838f9f;
  word-break: keep-all;
}
.txc-ref-card p + p { margin-top: 7px; }
.txc-ref-card a { color: #8fc0ff; text-decoration: underline; text-underline-offset: 2px; }
.txc-ref-card ul { margin: 0; padding-left: 16px; }
.txc-ref-card li { font-size: 11.5px; line-height: 1.7; color: #838f9f; }
.txc-stamp {
  display: inline-block;
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #66727f;
}

/* ── 보조 ── */
.txc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.txc-label { font-size: 12.5px; font-weight: 700; color: #ced8e5; }

/* 기존 계산기 블록 위 소제목 */
.tools-subhead { margin: 38px 0 4px; }
.tools-subhead .eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  color: #6fe3d0;
}
.tools-subhead h2 {
  margin: 8px 0 6px;
  font-size: clamp(19px, 2.2vw, 24px);
  letter-spacing: -.035em;
  color: #f1f6fc;
}
.tools-subhead p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #8b98ab;
  word-break: keep-all;
}
@media (max-width: 600px) {
  .tools-subhead { margin-top: 28px; }
  .tools-subhead h2 { font-size: 18px; }
}

/* ── 반응형 ── */
@media (min-width: 1001px) {
  .txc-out { position: sticky; top: 78px; }
}

@media (max-width: 1000px) {
  .txc-grid { grid-template-columns: minmax(0, 1fr); }
  .txc-cta { grid-template-columns: minmax(0, 1fr); }
  .txc-cta-side { min-width: 0; }
}

@media (max-width: 620px) {
  .txc-table { min-width: 0; row-gap: 0; }
  .txc-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .txc-table,
  .txc-table tbody,
  .txc-table tr,
  .txc-table td { display: block; width: 100%; }
  .txc-table tr {
    padding: 11px 0;
    border-bottom: 1px solid #141b25;
  }
  .txc-table tr:last-child { border-bottom: 0; }
  .txc-table td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    padding: 3px 0;
    border: 0;
    font-size: 11.5px;
    white-space: normal;
  }
  .txc-table td > .txc-cell { min-width: 0; }
  .txc-table td > .txc-cell .txc-stamp { display: block; margin-top: 2px; }
  .txc-table td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #66727f;
  }
  .txc-table td:first-child {
    font-size: 13px;
    padding-bottom: 6px;
  }
  .txc-table td:first-child::before { content: none; }
  .txc-table .txc-num-cell { white-space: normal; }
}

@media (max-width: 600px) {
  .txc { margin-top: 16px; }
  .txc-head h2 { font-size: 19px; }
  .txc-head p { font-size: 12.5px; }
  .txc-inputs { padding: 4px 13px 12px; border-radius: 14px; }
  .txc-case { padding: 13px 13px 12px; }
  .txc-net { font-size: 25px; }
  .txc-seg button { min-width: 54px; font-size: 11.5px; padding: 8px 4px; }
  .txc-num { font-size: 16px; min-height: 44px; }
  .txc-cta { padding: 14px 14px 15px; }
  .txc-cta-copy h3 { font-size: 14.5px; }
  .txc-btn { padding: 13px 16px; }
  .txc-ref-card { padding: 13px 13px; }
  .txc-table { font-size: 11.5px; }
}
