/* 어두운 돌 바탕에 금빛 테두리 (게임 화면 느낌). 색은 의미(능력치, 아이템 등급, 오르내림)에 쓴다. */
:root {
  color-scheme: dark;
  --bg: #0b0a08;
  --panel: #14120e;
  --panel-2: #1b1813;
  --field: #0a0907;
  --fg: #d9d0bd;
  --muted: #8d8471;
  --faint: #5f574a;
  --line: #3a3224;
  --line-soft: #241f17;
  --gold: #c9a45c;
  --gold-hi: #e8cf8f;
  --gold-dim: #7d6538;
  --red: #e0574b;
  --green: #6cc46c;
  --blue: #6e9cff;
  --amber: #e0a24a;
  --here: #33290f;
  --point-bg: #3a1714;
  --trial-bg: #142339;
  --top-h: 56px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --glow: 0 0 10px rgba(201, 164, 92, .35);
  scrollbar-color: #2e271c var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-gutter: stable; }   /* 페이지 길이와 상관없이 폭이 같게 */
body {
  margin: 0; color: var(--fg); min-height: 100vh; display: flex; flex-direction: column;
  font: 14px/1.55 "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #2a2013 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%, #1a130b 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
::selection { background: #5a4520; color: #fff; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ---------------------------------------------------------------- 위쪽 메뉴 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(rgba(23, 20, 15, .97), rgba(12, 10, 8, .97));
  border-bottom: 1px solid var(--gold-dim);
  box-shadow: 0 1px 0 #000, 0 8px 24px rgba(0, 0, 0, .65);
}
.top-row { display: flex; align-items: center; gap: 28px; height: var(--top-h); }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap;
  font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .04em;
  color: var(--gold-hi); text-shadow: var(--glow);
}
.brand:hover { color: #fff1c9; }
.emblem {
  width: 14px; height: 14px; flex: none; transform: rotate(45deg); border: 1px solid var(--gold);
  background: radial-gradient(circle, var(--gold-hi) 0 2px, #3a2c14 3px, #120e08 100%);
  box-shadow: var(--glow), inset 0 0 3px #000;
}
.tabs { display: flex; height: 100%; }
.tabs a {
  position: relative; display: flex; align-items: center; justify-content: center; padding: 0 14px; white-space: nowrap;
  font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.tabs a:hover { color: var(--gold-hi); }
.tabs a.on { color: var(--gold-hi); text-shadow: var(--glow); background: radial-gradient(ellipse at 50% 100%, rgba(201, 164, 92, .16), transparent 70%); }
.tabs a.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); box-shadow: 0 0 10px var(--gold);
}
.tabs a.on::before {
  content: ""; position: absolute; bottom: -4px; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  transform: rotate(45deg); background: var(--gold-hi); box-shadow: 0 0 6px var(--gold);
}

main.wrap { flex: 1; padding-top: 24px; padding-bottom: 32px; }

/* ---------------------------------------------------------------- 제목 */
h1, h2, h3 { font-family: var(--serif); color: var(--gold-hi); font-weight: 700; }
h1 { font-size: 24px; margin: 0; line-height: 1.3; text-shadow: 0 0 14px rgba(201, 164, 92, .2); }
h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 28px 0 10px; color: var(--gold); }
h2::before {
  content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg);
  background: var(--gold); box-shadow: 0 0 6px rgba(201, 164, 92, .6);
}
h2::after { content: ""; flex: 1; min-width: 20px; height: 1px; background: linear-gradient(90deg, var(--gold-dim), transparent); }
.page-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .meta { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- 공통 부품 */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
b { color: #ece3cf; }
.pill { display: inline-block; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 700; line-height: 20px; }
.pill.point { background: var(--point-bg); color: #ff8a7a; border: 1px solid #6b2a22; }
.pill.trial { background: var(--trial-bg); color: #8fb4ff; border: 1px solid #2a4470; }

/* 칩: 고르는 단추 */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px; }
.chips.flow { display: flex; flex-wrap: wrap; }
.chips.flow .chip { white-space: nowrap; padding: 6px 13px; }
.chip {
  border: 1px solid var(--line); background: linear-gradient(#1c1913, #110f0a); padding: 6px 8px; border-radius: 2px;
  text-align: center; cursor: pointer; font: inherit; font-size: 13px; color: var(--fg); transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--gold-dim); color: var(--gold-hi); }
.chip.on {
  border-color: var(--gold); color: var(--gold-hi); font-weight: 700;
  background: linear-gradient(#3a2e17, #1e180e); box-shadow: 0 0 8px rgba(201, 164, 92, .25), inset 0 0 6px rgba(0, 0, 0, .6);
}

/* 입력란 */
select, input[type=text], input[type=number], textarea {
  font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 2px; background-color: var(--field); color: var(--fg);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7); transition: border-color .15s;
}
select:hover, input[type=text]:hover, input[type=number]:hover, textarea:hover { border-color: #4a4030; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold-dim); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 0 0 1px rgba(201, 164, 92, .15); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23c9a45c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input.search {
  padding-left: 31px; min-width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d8471' stroke-width='1.6'%3E%3Ccircle cx='6' cy='6' r='4.6'/%3E%3Cpath d='M9.5 9.5L13 13'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
input[type=number] { text-align: right; }
input[type=checkbox] {
  appearance: none; width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; vertical-align: -3px;
  display: inline-grid; place-content: center; border: 1px solid var(--gold-dim); border-radius: 2px; background: var(--field);
}
input[type=checkbox]::before {
  content: ""; width: 9px; height: 9px; transform: scale(0); transition: transform .1s; background: var(--gold-hi);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type=checkbox]:checked { border-color: var(--gold); }
input[type=checkbox]:checked::before { transform: scale(1); }
/* 스위치 (켜고 끄기) */
input.switch {
  width: 32px; height: 18px; border-radius: 9px; place-content: center start; padding: 0 2px; border-color: var(--line);
  transition: background .15s, border-color .15s;
}
input.switch::before { width: 12px; height: 12px; border-radius: 50%; clip-path: none; transform: none; background: var(--muted); transition: translate .15s, background .15s; }
input.switch:checked { background: #3a2e17; border-color: var(--gold); }
input.switch:checked::before { translate: 14px 0; background: var(--gold-hi); }
label.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

/* 단추 */
button.btn {
  font: inherit; font-family: var(--serif); font-weight: 600; padding: 6px 16px; cursor: pointer; color: var(--gold-hi); white-space: nowrap;
  border: 1px solid var(--gold-dim); border-radius: 2px; background: linear-gradient(#3b2f19, #1d170d);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, .12), 0 1px 2px #000; transition: border-color .15s, color .15s;
}
button.btn:hover { border-color: var(--gold); color: #fff1c9; background: linear-gradient(#4a3a1e, #251d10); }
button.btn:active { background: linear-gradient(#1d170d, #2e2414); }
button.btn:disabled { opacity: .6; cursor: default; }
button.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); box-shadow: none; font-family: inherit; font-weight: 400; }
button.btn.ghost:hover { border-color: var(--gold-dim); color: var(--gold-hi); }

/* 패널: 왼쪽 위·오른쪽 아래 모서리에 금빛 장식 (패널·표·카드·분류 목록 모두 같게) */
.box, .card, .mod-group, .side, table.grid, .tooltip { position: relative; }
.box::before, .box::after, .card::before, .card::after, .mod-group::before, .mod-group::after,
.side::before, .side::after, table.grid::before, table.grid::after, .tooltip::before, .tooltip::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none; border: 0 solid var(--gold); z-index: 3;
}
.box::before, .card::before, .mod-group::before, .side::before, table.grid::before, .tooltip::before {
  top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px;
}
.box::after, .card::after, .mod-group::after, .side::after, table.grid::after, .tooltip::after {
  bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px;
}
.box {
  border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px;
  background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 0 0 1px #000, 0 2px 12px rgba(0, 0, 0, .45);
}

/* ---------------------------------------------------------------- 표 */
table.grid {
  width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
table.grid th {
  background: linear-gradient(#231e15, #18140e); color: var(--gold); font-family: var(--serif); font-size: 12.5px;
  text-align: left; padding: 7px 10px; font-weight: 700; border-bottom: 1px solid var(--gold-dim);
}
table.grid td { padding: 7px 10px; vertical-align: top; border-top: 1px solid var(--line-soft); }
table.grid tr:nth-child(2) td { border-top: 0; }
table.grid tr:nth-child(even) td { background: #17140f; }
table.grid tr:hover td { background: #211b12; }
table.grid tr.here td { background: var(--here); }
td.name { font-weight: 700; white-space: nowrap; color: #ece3cf; }
table.grid th { white-space: nowrap; }
td.dim, td.name.dim { color: var(--muted); }
td.dim, td.npc { white-space: nowrap; }
td.special { color: var(--amber); }
.reward-point { color: #ff8a7a; font-weight: 700; }
.reward-regret { color: #8fb4ff; font-weight: 700; }

/* 젬 색 */
.g-red { color: var(--red); }
.g-green { color: var(--green); }
.g-blue { color: var(--blue); }
.g-white { color: #b8b0a0; }
.mine { font-weight: 700; text-shadow: 0 0 3px currentColor; }   /* 빌드 젬: 젬 색(힘·민첩·지능)은 그대로 */
.gem-line { display: block; }
.gem-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 20px; }
.gem-cols ul { list-style: none; margin: 0; padding: 0; }
.gem-cols li { display: flex; gap: 8px; line-height: 1.7; }
.gem-cols .lv { color: var(--muted); width: 22px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 액트 */
.page-head .job { margin-left: auto; min-width: 140px; }
.act-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 22px; }
.act-name { font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--gold-hi); }

/* ---------------------------------------------------------------- 빌드: 카드는 아이템 설명 창처럼 */
.pob-input input { flex: 1; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card {
  border: 1px solid var(--line); border-radius: 2px; padding: 8px 12px 10px; background: linear-gradient(#18150f, #0f0d0a);
  box-shadow: inset 0 0 0 1px #000, 0 2px 10px rgba(0, 0, 0, .4);
}
.card-head {
  font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 13px; margin: -8px -12px 8px; padding: 6px 12px;
  background: linear-gradient(#262015, #17130d); border-bottom: 1px solid var(--line); text-align: center;
}
.card-head.main { color: #ff8a7a; }
ul.gem-list { list-style: none; margin: 0; padding: 0; }
ul.gem-list li { display: flex; gap: 8px; line-height: 1.7; }
ul.gem-list .lv { color: var(--muted); width: 24px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
/* 장비: 게임 아이템 설명 창처럼. 머리는 희귀도 색, 옵션은 가운데 정렬, 오른쪽에 옵션 종류 표시 */
.tooltips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; align-items: start; }
.tooltip { --rc: #c8c8c8; border: 1px solid var(--line); border-radius: 2px; background: #0c0b09; box-shadow: inset 0 0 0 1px #000, 0 2px 10px rgba(0, 0, 0, .45); }
.t-unique { --rc: #d8813a; } .t-relic { --rc: #82ad6a; } .t-rare { --rc: #ffff77; } .t-magic { --rc: #8888ff; }
.tt-head {
  text-align: center; padding: 6px 10px 8px; border-bottom: 1px solid color-mix(in srgb, var(--rc) 35%, #000);
  background: linear-gradient(color-mix(in srgb, var(--rc) 22%, transparent), color-mix(in srgb, var(--rc) 5%, transparent));
}
.tt-top { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.tt-slot { font-size: 11.5px; color: var(--muted); }
.tt-name, .tt-base { color: var(--rc); font-family: var(--serif); font-weight: 700; line-height: 1.4; }
.tt-name { font-size: 15px; }
.tt-base { font-size: 13.5px; }
.tt-body { padding: 8px 8px 10px; font-size: 13px; line-height: 1.55; }
.tt-line { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 4px; color: #8888ff; }
.tt-text { grid-column: 2; text-align: center; white-space: pre-line; }
.tt-badge {
  grid-column: 3; justify-self: end; font-size: 11px; line-height: 16px; padding: 0 5px; white-space: nowrap;
  border: 1px solid currentColor; border-radius: 2px; opacity: .85;
}
.tt-line.k-implicit .tt-badge { color: var(--muted); }
.tt-line.k-crafted, .tt-line.k-enchant { color: #b4b4ff; }
.tt-line.k-fractured { color: #a29162; }
.tt-line.exarch .tt-badge { color: #e0773a; }
.tt-line.eater .tt-badge { color: #b57ce0; }
.tt-sep { height: 1px; margin: 6px 24px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }
.tt-links { margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); }
/* 장비의 '거래소' 링크 (카카오 거래소 검색을 새 창으로) */
a.item-trade {
  padding: 1px 9px; font-size: 12px; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: rgba(0, 0, 0, .3);
}
a.item-trade:hover { border-color: var(--gold-dim); color: var(--gold-hi); }
.r-unique { color: #d8813a; }
.r-relic { color: #82ad6a; }
.r-rare { color: #ffff77; }
.r-magic { color: #8888ff; }

/* ---------------------------------------------------------------- 시세 */
/* 왼쪽 분류 목록 */
.prices-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 20px; align-items: start; }
.side {
  padding: 4px 0 10px;
  border: 1px solid var(--line); background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 0 0 1px #000;
}
.side-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px;
  font-family: var(--serif); font-weight: 700; font-size: 12.5px; color: var(--gold); letter-spacing: .03em;
}
.side-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.side-item {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; color: var(--fg); cursor: pointer;
  background: none; border: 0; border-left: 2px solid transparent; padding: 4px 14px 4px 16px;
}
.side-item:hover { color: var(--gold-hi); background: #1c1811; }
.side-item.on {
  color: var(--gold-hi); font-weight: 700; border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 164, 92, .18), transparent);
}
.side-toggle { display: none; }
.side-item.special { color: #ece3cf; }
/* 관심 아이템 ☆ */
button.star {
  font: inherit; background: none; border: 0; padding: 0 6px 0 0; cursor: pointer; color: var(--faint); font-size: 14px; line-height: 1;
}
button.star:hover { color: var(--gold-hi); }
button.star.on { color: var(--gold); }
.toolbar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 14px 0 12px; }
.toolbar .pick { display: inline-flex; align-items: center; gap: 6px; }
.toolbar .pick b { font-weight: 400; color: var(--muted); font-size: 13px; }
table.prices th { cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: var(--top-h); z-index: 2; }
table.prices th:hover { color: var(--gold-hi); }
table.prices th.sorted { color: var(--gold-hi); }
table.prices td { padding: 5px 10px; vertical-align: middle; }
table.prices .col-name { color: #ece3cf; }
table.prices .col-price { color: var(--gold-hi); }
table.prices .col-price, table.prices .col-change, table.prices .col-volume { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.prices .col-variant, table.prices .col-trend { text-align: center; white-space: nowrap; color: var(--muted); }
table.prices tr.thin td { color: var(--muted); }
td.up { color: var(--red); }
td.down { color: var(--blue); }
svg.spark { width: 72px; height: 18px; display: block; margin: 0 auto; }
svg.spark polyline { fill: none; stroke: var(--fg); stroke-width: 1.5; }
svg.spark circle { fill: var(--fg); }
svg.spark.up polyline { stroke: var(--red); } svg.spark.up circle { fill: var(--red); }
svg.spark.down polyline { stroke: var(--blue); } svg.spark.down circle { fill: var(--blue); }
svg.spark .base { stroke: var(--faint); stroke-dasharray: 2 2; }

/* ---------------------------------------------------------------- 검색식 */
.seg { display: inline-flex; gap: 4px; }
.seg .chip { min-width: 72px; }
.shop-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.shop-row > b { width: 96px; flex: none; color: var(--gold); font-family: var(--serif); }
.shop-mods { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.shop-mods label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mins { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.mins label { display: inline-flex; align-items: center; gap: 8px; }
.mins label span { color: var(--muted); font-size: 13px; }
.mins input { width: 74px; }
.regex-out { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.regex-out input {
  flex: 1; min-width: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 15px; padding: 9px 12px; color: var(--gold-hi);
}
.regex-out .btn { padding: 9px 20px; }
.meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.meter .bar { flex: 1; height: 4px; background: var(--field); border: 1px solid var(--line-soft); }
.meter .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .2s; }
.meter.over .fill { background: var(--red); }
.mod-group {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 2px;
  background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 0 0 1px #000, 0 2px 12px rgba(0, 0, 0, .45);
}
.mod-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: linear-gradient(#262015, #17130d); border-bottom: 1px solid var(--gold-dim);
}
.mod-head h3 { margin: 0; font-size: 14px; color: var(--gold-hi); }
.mod-head .muted { font-size: 12px; }
.mod-head .picked {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--red);
  padding: 0 8px; line-height: 20px; border: 1px solid #6b2a22; background: var(--point-bg); border-radius: 2px;
}
.mods .mod-cols { columns: 2 380px; column-gap: 28px; padding: 8px 14px 10px; }
.mods label {
  display: flex; align-items: flex-start; gap: 8px; padding: 3px 6px; margin: 0 -6px; border-radius: 2px;
  cursor: pointer; break-inside: avoid; color: #8888ff;
}
.mods label input { margin-top: 3px; }
.mods label:hover { color: #aaaaff; background: #17140f; }
.mods label.on { color: var(--red); text-decoration: line-through; text-decoration-color: rgba(224, 87, 75, .6); }
.mods label.on input { border-color: var(--red); }
.mods label.on input::before { background: var(--red); }

/* ---------------------------------------------------------------- 개선 요청 (누르면 열린다) */
#feedback { padding-bottom: 28px; }
#feedback details { border-top: 1px solid var(--line-soft); padding-top: 14px; }
#feedback summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--muted); font-size: 13px;
}
#feedback summary::-webkit-details-marker { display: none; }
#feedback summary::before { content: "✎"; color: var(--gold-dim); }
#feedback summary:hover { color: var(--gold-hi); }
#feedback details[open] summary { color: var(--gold); margin-bottom: 8px; }
#feedback textarea { display: block; width: 100%; padding: 8px 10px; resize: vertical; }
#feedback .trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.ok { color: var(--green); }
.warn { color: var(--red); }

/* ---------------------------------------------------------------- 아래쪽 */
.foot { color: var(--faint); font-size: 12px; padding: 18px 0 26px; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .4)); }
.foot::before {
  content: ""; display: block; max-width: 420px; height: 1px; margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ---------------------------------------------------------------- 좁은 화면 */
@media (max-width: 640px) {
  :root { --top-h: 96px; }
  .top-row { flex-direction: column; align-items: stretch; gap: 0; height: auto; padding: 0; }
  .brand { justify-content: center; height: 46px; font-size: 18px; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; border-top: 1px solid var(--line-soft); }
  .tabs a { padding: 0; height: 40px; }
  main.wrap { padding-top: 18px; }
  .mins { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px 10px; align-items: center; }
  .mins label { display: contents; }
  .mins input { width: 100%; }
  input.search { min-width: 0; flex: 1; }
  .toolbar input.search { flex-basis: 100%; }
  /* 분류 목록은 단추를 눌러 펼친다 */
  .prices-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .side-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; cursor: pointer; color: var(--fg);
    padding: 9px 12px; border: 1px solid var(--gold-dim); border-radius: 2px; background: linear-gradient(#211b12, #14110c);
  }
  .side-toggle b { color: var(--gold-hi); font-family: var(--serif); }
  .side-toggle .caret { color: var(--gold); }
  .side { display: none; margin-top: 4px; }
  .side.open { display: block; }
  .side-group { display: grid; grid-template-columns: 1fr 1fr; }
  .side-head { grid-column: 1 / -1; }
  .page-head .job { margin-left: 0; width: 100%; }
  .tabs a { font-size: 14px; }
  /* 표의 줄을 카드처럼 위아래로 쌓는다. 칸 이름은 data-label 로 앞에 붙인다 */
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr:first-child { display: none; }
  table.grid tr { border-top: 1px solid var(--line-soft); padding: 7px 0; }
  table.grid tr:nth-child(2) { border-top: 0; }
  table.grid td { border: 0; padding: 1px 12px; }
  table.grid td:empty { display: none; }
  table.grid td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-weight: 400; }
  table.grid tr:nth-child(even) td, table.grid tr:hover td { background: none; }
  table.grid tr:nth-child(even) { background: #17140f; }
  td.name { white-space: normal; font-size: 15px; }
  .hide-sm { display: none; }
  .tt-line { grid-template-columns: 0 1fr auto; }
  .regex-out { flex-wrap: wrap; }
  .regex-out input { flex-basis: 100%; }
  .regex-out .btn { flex: 1; }
  /* 시세: 이름 한 줄, 그 밑에 가격·변동·흐름·거래량을 한 줄로 */
  table.grid.prices tr:not(:first-child) { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; padding: 7px 12px; }
  table.grid.prices td { display: block; width: auto; padding: 0; text-align: left; }
  table.grid.prices td.col-name { width: 100%; font-weight: 700; }
  table.grid.prices td.col-price { font-weight: 700; }
  table.grid.prices td.col-volume { margin-left: auto; }
  table.grid.prices svg.spark { margin: 0; }
}
