/* 아이스 자동매매 도감 — 빌더 커뮤니티. 다크 전용.
   색은 아이스(ITH) 브랜드를 따른다: 거의 검은 바탕에 시안 하나. 시안 위 글자는 흰색이 아니라
   짙은 남색(--on-accent)이다(www/DESIGN.md 의 Dark Ink Rule). 시세의 하락 파랑(#1261C4)과는
   색상·명도가 달라 섞이지 않는다. */
:root {
  --bg: #0B0C0E;
  --surface: #131518;
  --surface-2: #1B1E22;
  --line: #2A2E35;
  --line-2: #474D57;
  --ink: #F1F2EE;
  --ink-2: #C5C9CE;
  --muted: #9198A1;
  --accent: #22D3EE;
  --accent-soft: rgba(34, 211, 238, .12);
  --on-accent: #031428;
  --r: 6px;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Do Hyeon', var(--sans);
  --side: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-weight: 400; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; padding: 10px 14px; background: var(--accent); color: var(--on-accent); }

/* ── 틀 ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
  padding: 28px 16px 20px; border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand .botmark { flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand__mark { font-family: var(--display); font-size: 1.4375rem; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.brand__sub { font-family: var(--mono); font-size: .625rem; color: var(--muted); white-space: nowrap; }
.brand__sub i { font-style: normal; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .side__link {
  display: flex; align-items: center; min-height: 42px; padding: 0 12px;
  border-radius: var(--r); text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--ink-2);
}
.nav a:hover, .side__link:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current] { background: var(--ink); color: var(--bg); font-weight: 700; }
.side__sec { display: flex; flex-direction: column; gap: 2px; }
.side__label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 0 12px 8px; font-family: var(--mono); font-size: .6875rem; color: var(--muted);
}
.side__link { font-size: .875rem; font-weight: 400; min-height: 38px; }
.side__link--quiet { color: var(--muted); font-size: .8125rem; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.mechip {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--r); text-decoration: none; background: var(--surface);
}
.mechip strong { font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mechip span { font-family: var(--mono); font-size: .6875rem; color: var(--muted); text-transform: uppercase; }

.topbar, .tabbar { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) 64px; display: flex; flex-direction: column; gap: 36px; }
.foot { margin-top: auto; padding: 24px clamp(16px, 4vw, 48px) 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; display: flex; flex-direction: column; gap: 6px; }

/* ── 글자 ───────────────────────────────────────── */
.eyebrow { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .01em; }
.display { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); line-height: 1; letter-spacing: -.01em; text-wrap: balance; }
.display--md { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); line-height: 1.08; }
.display--sm { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); line-height: 1.1; }
.lede { font-size: clamp(1rem, .95rem + .3vw, 1.125rem); color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.lede em { font-style: normal; color: var(--ink); box-shadow: inset 0 -0.45em 0 var(--accent-soft); }
.fine { font-size: .8125rem; color: var(--muted); }

/* ── 버튼 ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--r); border: 1.5px solid var(--line-2);
  background: transparent; color: var(--ink); font-weight: 700; font-size: .9375rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: #67E8F9; border-color: #67E8F9; color: var(--on-accent); }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .875rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 24px; }
.linkbtn:hover { color: var(--accent); }

/* ── 홈: 한 줄 소개 뒤 바로 목록 ─────────────────── */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.intro__text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-top: -12px; overflow: hidden; }
.rules li { padding: 14px 18px; font-size: .8125rem; color: var(--muted); box-shadow: -1px -1px 0 var(--line); }
.rules b { display: block; font-size: .9375rem; color: var(--ink); margin-bottom: 2px; }
.rules span { display: block; }
.steps { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.steps__head { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; }
.steps__head strong { font-size: 1.0625rem; }
.steps__list { flex: 2 1 340px; display: flex; flex-direction: column; gap: 6px; }
.steps__list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-weight: 500; }
.steps__list a:hover { border-color: var(--ink); color: var(--ink); }
.steps__n { flex: 0 0 auto; min-width: 36px; text-align: center; padding: 2px 6px; border-radius: 3px; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: .75rem; font-weight: 600; }
.steps__list .done a { color: var(--muted); text-decoration: line-through; }
.steps__list .done .steps__n { background: var(--surface-2); color: var(--muted); }
.card.card--welcome { border-color: var(--accent); background: var(--accent-soft); justify-content: space-between; }
.card.card--welcome:hover { transform: none; background: var(--accent-soft); }
.card.card--example { border-style: dashed; opacity: .78; }
.card.card--example:hover { transform: none; background: var(--surface); }
.fine--center { text-align: center; margin-top: 16px; }
.stats .up { color: var(--accent); }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: -16px; }
.search input { flex: 1 1 220px; max-width: 420px; min-height: 42px; }
input[type="search"] { width: 100%; padding: 8px 12px; background: var(--bg); border: 1.5px solid var(--line-2); border-radius: var(--r); font-size: 1rem; }
.tab.tab--quiet { border-color: transparent; color: var(--muted); }
.filters + .cards, .filters + .empty { margin-top: 16px; }
a.chip { text-decoration: none; }
a.chip:hover { background: var(--line); color: var(--ink); }
.badgebox { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.badgebox img { flex: 0 0 auto; }
.badgebox .fine { flex: 1 1 240px; }
.badgebox input { flex: 1 1 320px; font-size: .75rem; min-height: 40px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.pagehead > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ── 봇 카드 ────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.card {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r);
  text-decoration: none; transition: transform .16s ease, background .16s ease;
}
.card:hover { transform: translateY(-3px); background: var(--surface-2); color: var(--ink); }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; }
.card__title { font-family: var(--display); font-weight: 400; font-size: 1.625rem; line-height: 1.15; overflow-wrap: anywhere; }
.card__title a { text-decoration: none; }
.card__title a::after { content: ''; position: absolute; inset: 0; }
.card { position: relative; }
.card__desc { font-size: .9375rem; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.card__by { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .875rem; font-weight: 700; }
.card__by a { position: relative; z-index: 1; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.stats b { color: var(--ink); font-weight: 600; }
@container (min-width: 420px) { .card__foot { flex-direction: row; justify-content: space-between; align-items: center; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 99px; font-family: var(--mono); font-size: .6875rem; color: var(--ink-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pill--backtest i { background: var(--muted); }
.pill--paper i { background: var(--ink); border-color: var(--ink); }
.pill--live i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stamp {
  display: inline-flex; flex-direction: column; align-items: flex-start; padding: 2px 10px;
  font-family: var(--display); font-size: .9375rem; line-height: 1.4; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); border-radius: 3px; transform: rotate(-4deg);
}
.stamp--lg { font-size: 1.25rem; padding: 8px 16px; }
.stamp--plain { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); transform: rotate(2deg); }
.stamp small { font-family: var(--mono); font-size: .6875rem; }
.stamps { display: flex; flex-wrap: wrap; gap: 18px; padding: 6px 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 8px; background: var(--surface-2); border-radius: 3px; font-family: var(--mono); font-size: .6875rem; color: var(--ink-2); }
.card:hover .chip { background: var(--line); }
.chips--lg .chip { padding: 5px 11px; font-size: .8125rem; }
.ranktag { font-family: var(--mono); font-size: .6875rem; font-weight: 500; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.ranktag--solid { padding: 3px 9px; background: var(--ink); color: var(--bg); border-radius: 3px; font-weight: 600; }
.ranktag--q { color: var(--accent); text-transform: none; }

/* ── 패널 · 막대 · 줄 목록 ─────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel__title { font-size: 1rem; font-weight: 700; }
.panel--invert { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.panel--invert .fine { color: #4A4F57; }
.progress { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.progress__head { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; }
.progress__head strong { font-size: 1.0625rem; }
.progress .bars { flex: 2 1 320px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { display: flex; flex-direction: column; gap: 6px; }
.bar__row { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; }
.bar__track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--ink); border-radius: 99px; min-width: 2px; }
.bar__fill--accent { background: var(--accent); }
.got { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 14px; align-items: center; font-size: .875rem; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.block { display: flex; flex-direction: column; gap: 14px; }
.block__head, .sec__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.block__head h2 { font-family: var(--display); font-weight: 400; font-size: 1.625rem; }
.block__head a, .sec__head a, .more a { font-size: .875rem; color: var(--muted); }
.more { text-align: center; margin-top: 20px; }
.rows { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 15px 20px; text-decoration: none; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--surface-2); color: var(--ink); }
.row .mono { font-size: .75rem; color: var(--muted); }
.row--empty { color: var(--ink-2); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(40px, 8vw, 80px) 24px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--r); }
.empty h2 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; }
.empty p { color: var(--ink-2); max-width: 44ch; }
.empty--sm { padding: 28px 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters__gap { flex: 0 0 12px; }
.tab { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; font-size: .875rem; text-decoration: none; color: var(--ink-2); }
.tab[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }

/* ── 상세 ───────────────────────────────────────── */
.two { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.two__main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.two__side { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.herocard { background: var(--surface); border: 2px solid var(--line-2); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .875rem; }
.byline > a:first-child { font-weight: 700; text-decoration: none; }
.byline__tools { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: .8125rem; color: var(--muted); }
.byline__tools form { display: inline; }
.praises { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.praise {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 68px; padding: 8px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r);
  font-weight: 700; cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.praise:hover { border-color: var(--ink); }
.praise__n { font-size: .8125rem; font-weight: 500; color: var(--muted); }
.praise--key { border-color: var(--accent); }
.praise[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.praise[aria-pressed="true"] .praise__n { color: #4A4F57; }
.praise--key[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.praise.pop { animation: pop .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.07); } }
.rebuilt-note { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1.5px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); font-size: .875rem; }
.rebuilt-note[hidden] { display: none; }
.rebuilt-note__row { display: flex; flex-wrap: wrap; gap: 8px; }
.rebuilt-note__row input { flex: 1 1 220px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.sec h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.sec--bare { background: none; border: 0; padding: 8px 0 0; }
.logic { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr); gap: 14px 20px; }
.logic dt { font-family: var(--mono); font-size: .75rem; color: var(--muted); padding-top: 4px; }
.logic dd, .prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.checks { display: flex; flex-direction: column; gap: 10px; font-size: .9375rem; }
.checks li { display: flex; gap: 12px; align-items: baseline; }
.checks__tag { flex: 0 0 auto; min-width: 52px; text-align: center; padding: 1px 6px; border-radius: 3px; font-family: var(--mono); font-size: .6875rem; background: var(--ink); color: var(--bg); }
.checks .off { color: var(--muted); }
.checks .off .checks__tag { background: none; color: var(--muted); border: 1px dashed var(--line-2); }
.claim { padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r); font-size: .875rem; color: var(--ink-2); }
.claim b { display: block; font-family: var(--mono); font-size: .75rem; color: var(--ink); margin-bottom: 4px; }
.repo { overflow-wrap: anywhere; font-size: .875rem; }
.comment { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; }
.comment--author { border-color: var(--line-2); background: var(--surface-2); }
.comment__by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .875rem; }
.comment__by a { font-weight: 700; text-decoration: none; }
.comment__by form { margin-left: auto; }
.commentform { display: flex; flex-direction: column; gap: 10px; }
.commentform__row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.commentform__row select { flex: 1 1 180px; }
.loginline { padding: 16px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--r); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; font-size: .9375rem; }
.rebuilt { font-size: .875rem; color: var(--ink-2); }
.rebuilt a { font-weight: 700; color: var(--ink); text-decoration: none; }

/* ── 양식 ───────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.form--narrow { max-width: 520px; }
fieldset.panel { margin: 0; min-width: 0; gap: 16px; }
fieldset.panel legend { padding: 0 8px; font-family: var(--display); font-size: 1.375rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__label { font-size: .875rem; font-weight: 700; }
input[type="text"], input[type="url"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; background: var(--bg); border: 1.5px solid var(--line-2); border-radius: var(--r);
  font-size: 1rem; line-height: 1.6;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: #6E757E; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1.5px solid var(--line-2); border-radius: var(--r); font-size: .9375rem; font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkline { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 6px 0; font-size: .9375rem; cursor: pointer; }
.checkline input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.checkline--pledge { color: var(--ink-2); font-size: .875rem; }
.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.errors { padding: 14px 18px; border: 1.5px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); font-size: .9375rem; max-width: 760px; }

/* ── 프로필 · 등급 사다리 ───────────────────────── */
.profilehead { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px 24px; }
.profilehead__body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.profilehead__name { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.profilehead__name h1 { overflow-wrap: anywhere; }
.avatar { flex: 0 0 auto; width: 88px; height: 88px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border-radius: var(--r); font-family: var(--display); font-size: 2.75rem; }
.ladder { display: flex; flex-direction: column; gap: 12px; }
.rung { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: 12px 28px; align-items: baseline; padding: 20px 24px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r); }
.rung h2 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.2; }
.rung > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rung p { font-size: .9375rem; color: var(--ink-2); }
.rung--me { box-shadow: 0 0 0 4px var(--accent-soft); }
.rung--me .rung__name .eyebrow { color: var(--accent); }
.plain { display: flex; flex-direction: column; gap: 10px; padding-left: 18px; list-style: disc; font-size: .9375rem; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 18px; background: var(--ink); color: var(--bg); border-radius: var(--r); font-size: .9375rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 40; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 등급별 테두리 — 카드, 프로필 머리, 사다리가 같이 쓴다.
   각 컴포넌트의 기본 border 선언보다 뒤에 있어야 이긴다. */
.rank-hello { border-style: dashed; border-color: var(--line-2); }
.rank-backtester { border-color: #5D646E; }
.rank-paper { border-color: var(--muted); border-width: 2px; }
.rank-live { border-color: var(--ink); border-width: 2px; }
.rank-alpha { border-color: var(--accent); border-width: 2px; }
.rank-market_maker { border-color: var(--accent); border-width: 2px; background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); }


/* ── 멤버십 · 문서 ─────────────────────────────── */
.block__links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tiers { display: flex; flex-direction: column; gap: 12px; }
.tier { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(0, 2fr); gap: 12px 28px; align-items: baseline; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tier h2 { font-family: var(--display); font-weight: 400; font-size: 1.625rem; line-height: 1.2; }
.tier__name { display: flex; flex-direction: column; gap: 4px; }
.tier--me { border-color: var(--ink); }
.tier--me .eyebrow { color: var(--accent); }
.tier ul { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; list-style: disc; font-size: .9375rem; color: var(--ink-2); }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px 24px; border: 1.5px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); }
.callout p { max-width: 56ch; color: var(--ink-2); }
.callout strong { display: block; color: var(--ink); font-size: 1.0625rem; }
.doc { max-width: 72ch; display: flex; flex-direction: column; gap: 28px; }
.doc section { display: flex; flex-direction: column; gap: 10px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.doc p, .doc li { color: var(--ink-2); font-size: 1rem; }
.doc ul { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; list-style: disc; }
.doc b { color: var(--ink); }

/* ── 좁은 화면: 사이드바 대신 상단 바 + 하단 탭 ── */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { display: none; }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(11, 12, 14, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; }
  .topbar .brand__mark { font-size: 1.25rem; }
  .topbar .brand__sub { display: none; }
  .topbar__me { font-size: .875rem; font-weight: 700; text-decoration: none; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: rgba(11, 12, 14, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; font-size: .6875rem; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current] { color: var(--ink); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar__add { justify-self: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent) !important; }
  .tabbar__add svg { stroke-width: 2.4; }
  .foot { padding-bottom: 96px; }
  .toast { bottom: 88px; }
  .two__side { position: static; }
  .rung, .tier { grid-template-columns: minmax(0, 1fr); }
  .rules li { padding: 10px 14px; }
  .rules b { font-size: .875rem; margin: 0; }
  .rules span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
