:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-tint: #f8faff;
  --text: #14171f;
  --text-2: #4b5262;
  --muted: #767f91;
  --border: #e5e8ee;
  --border-strong: #d3d8e2;

  --accent: #3162f5;
  --accent-hover: #2350d9;
  --accent-soft: #eef3ff;

  --up: #d92d20;
  --up-bg: #fef3f2;
  --dn: #1d5fd6;
  --dn-bg: #eff5ff;

  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --violet: #6d28d9;
  --violet-bg: #f5f3ff;

  --radius-card: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px -6px rgba(16, 24, 40, 0.05);
  --shadow-toast: 0 10px 25px -5px rgba(15, 23, 42, 0.25);

  --font: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

body.paper::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--violet), #8b5cf6);
  z-index: 60;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sticky Top Header */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 58px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.brand h1 small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.sp {
  flex: 1 1 auto;
}

/* Mode Pill */
.mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.mode i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mode.off {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.mode.on {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bbf7d0;
}

.mode.on i {
  animation: pulse-dot 1.8s var(--ease) infinite;
}

.mode.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #fde68a;
}

.mode.paper {
  background: var(--violet-bg);
  color: var(--violet);
  border-color: #ddd6fe;
}

.mode.paper i {
  animation: pulse-dot 1.8s var(--ease) infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.82);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: #c2c9d6;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.go {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.btn.go:hover:not(:disabled) {
  background: #166534;
  border-color: #166534;
}

.btn.stop {
  background: var(--up);
  border-color: var(--up);
  color: #ffffff;
}

.btn.stop:hover:not(:disabled) {
  background: #b42318;
  border-color: #b42318;
}

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

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn.mini {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* Main Container */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Notes */
#notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.note b {
  font-weight: 700;
  margin-right: 4px;
}

.note.red {
  background: var(--up-bg);
  color: #912018;
  border-color: #fecdca;
}

.note.amber {
  background: var(--warn-bg);
  color: #92400e;
  border-color: #fde68a;
}

.note.gray {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.note.violet {
  background: var(--violet-bg);
  color: #5b21b6;
  border-color: #ddd6fe;
}

/* Stats Grid */
.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stat .k {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.stat .v {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.stat .v.sm {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  align-items: center;
}

.stat .v i {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.stat .s {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Market Colour & Numerics */
.up {
  color: var(--up);
  font-variant-numeric: tabular-nums;
}

.dn {
  color: var(--dn);
  font-variant-numeric: tabular-nums;
}

.sub {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* Cards & Fold Details */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-h h2,
details.card.fold > summary h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-h .cnt,
details.card.fold > summary .cnt {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

details.card.fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s var(--ease);
}

details.card.fold > summary::-webkit-details-marker {
  display: none;
}

details.card.fold > summary:hover {
  background: var(--surface-tint);
}

details.card.fold > summary .cnt {
  margin-right: auto;
}

details.card.fold > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}

details.card.fold[open] > summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

details.card.fold[open] > summary {
  border-bottom: 1px solid var(--border);
}

details.card.fold > :not(summary) {
  padding-left: 20px;
  padding-right: 20px;
}

details.card.fold > :not(summary):first-of-type {
  padding-top: 16px;
}

details.card.fold > :not(summary):last-child {
  padding-bottom: 20px;
}

details.card.fold > table.tbl:first-of-type,
details.card.fold > table.tbl:last-child {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

/* Tables */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.tbl thead th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.tbl th.n,
table.tbl td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.tbl tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.12s var(--ease);
}

table.tbl tbody tr:last-child {
  border-bottom: 0;
}

table.tbl tbody tr:not(.morerow):hover {
  background: var(--surface-tint);
}

table.tbl tbody tr.sel {
  background: var(--accent-soft);
}

table.tbl tbody td {
  padding: 12px 14px;
  vertical-align: middle;
}

table.tbl tbody td.act {
  text-align: right;
  white-space: nowrap;
}

table.tbl tbody td.act .btn + .btn {
  margin-left: 6px;
}

table.tbl tbody tr.morerow {
  background: var(--surface-tint);
}

table.tbl tbody tr.morerow > td {
  padding: 0 14px 14px;
}

.more {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
}

.more > b {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
}

.more ul {
  margin: 8px 0;
  padding-left: 18px;
}

.more li {
  margin: 4px 0;
}

/* Tags, Chips, Dots, Ladder, Bar */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.tag.t-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.tag.t-wait {
  background: var(--dn-bg);
  color: var(--dn);
}

.tag.t-reason {
  background: var(--up-bg);
  color: var(--up);
}

.tag.t-unsure {
  background: var(--warn-bg);
  color: var(--warn);
}

.tag.t-gray {
  background: var(--surface-2);
  color: var(--text-2);
}

.tag.t-held {
  background: var(--violet-bg);
  color: var(--violet);
}

.vn {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  margin: 2px 4px 2px 0;
  font-variant-numeric: tabular-nums;
}

.vn.y {
  background: var(--ok-bg);
  color: var(--ok);
}

.vn.p {
  background: var(--warn-bg);
  color: var(--warn);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa3b2;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.dot.g {
  background: #16a34a;
}

.dot.r {
  background: var(--up);
}

.dot.o {
  background: #ea580c;
}

.ladder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.ladder i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--border-strong);
}

.ladder i.on {
  background: #f59e0b;
}

.bar {
  width: 100%;
  min-width: 72px;
  max-width: 140px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 4px;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: #16a34a;
  transition: width 0.25s var(--ease);
}

/* Exchange Cards */
.exs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ex {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-tint);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ex h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.ex .st {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.ex input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}

.ex input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 98, 245, 0.14);
  outline: none;
}

.ex .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* Forms & Settings */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.f label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.f input,
.f select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.f input:focus,
.f select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 98, 245, 0.14);
  outline: none;
}

.h3 {
  margin: 20px 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

#steps {
  width: auto;
  border-collapse: collapse;
  margin-bottom: 10px;
}

#steps td {
  padding: 5px 8px 5px 0;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

#steps input[type="number"] {
  width: 130px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#steps input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 98, 245, 0.14);
  outline: none;
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}

.chk input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.savebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Log */
.log {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.log > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
}

.log > div:hover {
  background: var(--surface-tint);
}

.log time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.k-enter {
  color: var(--ok);
  font-weight: 700;
}

.k-close {
  color: var(--dn);
  font-weight: 700;
}

.k-add {
  color: var(--warn);
  font-weight: 700;
}

.k-err {
  color: var(--up);
  font-weight: 600;
}

.k-ask,
.k-claude {
  color: var(--violet);
  font-weight: 600;
}

.k-info {
  color: var(--text);
}

/* Toast */
#toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: #14171f;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-toast);
  white-space: nowrap;
}

/* Tablet & Mobile Breakpoints */
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  header.top {
    padding: 8px 14px;
  }

  main {
    padding: 16px;
    gap: 14px;
  }

  .btn {
    min-height: 40px;
  }

  .btn.mini {
    min-height: 36px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 14px;
  }

  .stat .v {
    font-size: 24px;
  }

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

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  details.card.fold > :not(summary) {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Responsive Stacked Table Cards */
  table.tbl.stack {
    display: block;
    padding: 10px;
  }

  table.tbl.stack thead {
    display: none;
  }

  table.tbl.stack tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  table.tbl.stack tbody tr:not(.morerow) {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 6px 12px;
    gap: 2px;
  }

  table.tbl.stack tbody tr.sel {
    border-color: #b7cbff;
    background: var(--accent-soft);
  }

  table.tbl.stack tbody tr:not(.morerow) > td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }

  table.tbl.stack tbody tr:not(.morerow) > td:last-child {
    border-bottom: 0;
  }

  table.tbl.stack tbody tr:not(.morerow) > td[data-l]::before {
    content: attr(data-l);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }

  table.tbl.stack tbody tr:not(.morerow) > td > div {
    text-align: right;
  }

  table.tbl.stack tbody tr:not(.morerow) > td.act {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  table.tbl.stack tbody tr:not(.morerow) > td.act .btn + .btn {
    margin-left: 0;
  }

  table.tbl.stack tbody tr.morerow {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-tint);
    padding: 10px;
  }

  table.tbl.stack tbody tr.morerow > td {
    display: block;
    padding: 0;
    border: 0;
  }

  table.tbl.stack tbody tr.morerow > td::before {
    content: none;
  }
}

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

/* ------------------------------------------------------------------ 다듬기 (Claude) — 위는 Gemini 가 준 그대로 */
.fold-b > .exs:first-child,
.fold-b > .grid:first-child,
.fold-b > .log:first-child {
  margin-top: 0;
}

.fold-b > .note {
  margin-bottom: 12px;
}

.stat .v.sm {
  gap: 6px;
}

.stat .v .dot {
  margin-right: 0;
}

.tbl b.up,
.tbl b.dn {
  font-weight: 700;
}

td .tag + .sub,
td .bar + .sub,
td .ladder + .sub {
  margin-top: 3px;
}

td .tag + .tag {
  margin-left: 4px;
}

.scroll-x {
  overflow-x: auto;
}

.card-f {
  padding: 10px 20px 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.lnk {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}

.lnk:hover {
  text-decoration: underline;
}

details.adv {
  margin-top: 18px;
}

details.adv > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  user-select: none;
}

.foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 0 20px;
}

#toast {
  max-width: 86vw;
  white-space: normal;
  text-align: center;
}

.keybox {
  max-width: 420px;
  margin: 12vh auto 0;
  padding: 24px 20px;
}

.keybox input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-family: var(--font);
  font-size: 15px;
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.tabs button {
  border: 0;
  background: transparent;
  height: 28px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

.tabs button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

@media (max-width: 720px) {
  .card-h,
  details.card.fold > summary {
    padding: 14px;
  }

  .card-h {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .brand h1 small {
    display: none;
  }

  header.top .btn {
    min-height: 36px;
  }

  #steps input[type="number"] {
    width: 104px;
  }

  .log > div {
    padding: 6px 2px;
  }
}

.tbl td.n .sub {
  white-space: nowrap;
}

/* 휴대폰: 줄 하나가 카드 하나. 첫 줄은 이름(왼쪽)과 큰 숫자(오른쪽), 그 아래는 두 칸씩 이름표 위 · 값 아래 */
@media (max-width: 720px) {
  table.tbl.stack tbody tr:not(.morerow) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2px 14px;
    padding: 12px 14px;
  }

  table.tbl.stack tbody tr:not(.morerow) > td {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 3px;
    padding: 6px 0;
    border-bottom: 0;
    text-align: left;
    min-width: 0;
  }

  table.tbl.stack tbody tr:not(.morerow) > td > div {
    text-align: left;
    max-width: 100%;
  }

  table.tbl.stack tbody tr:not(.morerow) > td[data-l]::before {
    font-size: 11.5px;
  }

  table.tbl.stack tbody tr:not(.morerow) > td:first-child::before,
  table.tbl.stack tbody tr:not(.morerow) > td:nth-child(2)::before {
    content: none;
  }

  table.tbl.stack tbody tr:not(.morerow) > td:first-child b {
    font-size: 15px;
  }

  table.tbl.stack tbody tr:not(.morerow) > td:nth-child(2) {
    align-items: flex-end;
    text-align: right;
    font-size: 15px;
  }

  table.tbl.stack tbody tr:not(.morerow) > td:nth-child(2) > div {
    text-align: right;
  }

  table.tbl.stack tbody tr:not(.morerow) > td.wide {
    grid-column: 1 / -1;
  }

  table.tbl.stack tbody tr:not(.morerow) > td.act {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 6px 0;
  }

  table.tbl.stack tbody tr:not(.morerow) > td.act:empty {
    display: none;
  }
}
