/* ============ Index Lane app (extends styles.css tokens) ============ */
.app { --app-max: 1240px; --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--bg); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.upper { text-transform: uppercase; }
.app-shell { width: min(100% - 2 * var(--gutter), var(--app-max)); margin-inline: auto; }

/* state switching */
.app[data-state="gate"] [data-when="app"],
.app[data-state="app"] [data-when="gate"] { display: none !important; }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgb(250 247 242 / 0.9); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header-inner { width: min(100% - 2 * var(--gutter), var(--app-max)); margin-inline: auto; height: 68px; display: flex; align-items: center; gap: var(--space-4); }
.app-header .brand img { height: 28px; }
.app-badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.25rem 0.5rem; border-radius: 6px; background: var(--ink); color: #fff; }
.app-tabs { display: flex; gap: 0.25rem; margin-left: var(--space-6); }
.app-tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 0.4rem;
  height: 40px; padding: 0 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.925rem; font-weight: 600; color: var(--muted); text-decoration: none;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.app-tabs a:hover { color: var(--ink); background: var(--bg-alt); }
.app-tabs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.app-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0.9rem; right: 0.9rem; bottom: -14px; height: 2px; background: var(--brand); border-radius: 2px; }
.app[data-state="gate"] .app-tabs { visibility: hidden; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; display: inline-grid; place-items: center; }

.wallet-slot { margin-left: auto; position: relative; }
.wallet-pill-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; height: 42px; padding: 0 0.85rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 0.875rem; font-weight: 600;
  transition: border-color var(--dur) var(--ease);
}
.wallet-pill-btn:hover { border-color: var(--ink); }
.wallet-pill-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: #22A559; box-shadow: 0 0 0 3px rgb(34 165 89 / 0.18); }
.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 0.9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover); display: grid; gap: 0.35rem;
}
.wallet-menu-label, .wallet-menu-bal { font-size: 0.8rem; color: var(--muted); }
.wallet-menu-addr { font-size: 0.78rem; word-break: break-all; padding: 0.5rem 0.6rem; background: var(--bg-alt); border-radius: var(--radius-sm); }
.wallet-menu button { text-align: left; height: 38px; padding: 0 0.6rem; border: 0; border-radius: var(--radius-sm); background: none; font-weight: 600; font-size: 0.875rem; cursor: pointer; }
.wallet-menu button:hover { background: var(--bg-alt); }
.wallet-menu [data-disconnect] { color: #B42318; }

/* ---------- gate ---------- */
.gate { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: var(--space-7) var(--gutter);
  background: radial-gradient(1200px 500px at 85% -10%, #FBE7D6 0%, transparent 60%), var(--bg); }
.gate-card {
  width: min(100%, 980px); display: grid; grid-template-columns: 0.85fr 1.15fr; align-items: center; gap: var(--space-6);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow-card);
}
.gate-art { background: var(--bg-alt); border-radius: 18px; aspect-ratio: 1; display: grid; place-items: center; }
.gate-art img { width: 82%; }
.gate h1 { font-size: clamp(1.9rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -0.04em; line-height: 1.04; margin-bottom: var(--space-4); }
.gate-lede { color: var(--ink-2); margin-bottom: var(--space-5); max-width: 42ch; }
.connect-list { display: grid; gap: 0.6rem; }
.connect-option {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 0.85rem; text-align: left;
  min-height: 66px; padding: 0.6rem 1rem 0.6rem 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.connect-option:hover { border-color: var(--ink); background: var(--bg); }
.connect-option:active { transform: scale(0.995); }
.connect-option[aria-busy="true"] .connect-go { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin 700ms linear infinite; color: transparent; overflow: hidden; }
.connect-option:disabled { opacity: 0.55; cursor: not-allowed; }
.connect-option[aria-busy="true"] { opacity: 1; }
.connect-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-alt); display: grid; place-items: center; }
.connect-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.connect-icon.is-brand svg { stroke: none; width: 18px; height: 18px; }
.connect-text strong { display: block; font-size: 0.975rem; }
.connect-text small { color: var(--muted); font-size: 0.8rem; }
.connect-go { color: var(--muted); font-size: 1.1rem; }
.connect-status { margin-top: var(--space-3); font-size: 0.875rem; min-height: 1.3em; }
.connect-status.is-error { color: #B42318; }
.gate-fine { margin-top: var(--space-4); font-size: 0.75rem; color: var(--muted); }

/* ---------- views ---------- */
.view { padding: var(--space-7) 0 var(--space-9); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-6); }
.view-head .eyebrow { margin-bottom: var(--space-3); }
.view h1 { font-size: clamp(2rem, 1.3rem + 2.2vw, 3rem); letter-spacing: -0.045em; line-height: 1; }
.view-lede { color: var(--ink-2); margin-top: var(--space-3); max-width: 52ch; }
.fineprint { margin-top: var(--space-6); font-size: 0.78rem; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  height: 38px; padding: 0 0.95rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.field-search {
  display: flex; align-items: center; gap: 0.6rem; height: 44px; padding: 0 0.9rem; width: min(100%, 360px);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(254 83 1 / 0.18); }
.field-search svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 0.9rem; }
.result-note { font-size: 0.85rem; color: var(--muted); margin-bottom: var(--space-3); }
.result-note:empty { display: none; }

/* ---------- ticker badge ---------- */
.tk {
  --tk-bg: var(--ink);
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%; background: var(--tk-bg); color: #fff;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.tk.sm { width: 28px; height: 28px; font-size: 0.55rem; }
.tk-stack { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tk-pill { display: inline-flex; align-items: center; gap: 0.35rem; height: 26px; padding: 0 0.55rem 0 0.35rem; border-radius: 999px; background: var(--bg-alt); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; color: var(--ink); }
.tk-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tk-bg, var(--ink)); }
.tk-pill.tk-more { padding: 0 0.55rem; color: var(--muted); }
.tk-pill.tk-more::before { display: none; }
.type-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 0.5rem; border-radius: 6px; font-size: 0.7rem; font-weight: 600; background: var(--bg-alt); color: var(--ink-2); white-space: nowrap; }
.type-tag.is-preipo { background: #FFE9DC; color: #9A3200; }

/* ---------- template cards ---------- */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.tpl {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-card); transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.tpl-media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: #E9E3D9; }
.tpl-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.tpl:hover .tpl-media img { transform: scale(1.04); }
.tpl-cat { position: absolute; left: 12px; top: 12px; padding: 0.25rem 0.55rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: rgb(255 255 255 / 0.92); }
.tpl-body { padding: 1.1rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.tpl h3 { font-size: 1.15rem; letter-spacing: -0.025em; }
.tpl-tag { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.tpl-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; padding-top: 0.25rem; }
.tpl-stats { display: flex; gap: 1rem; }
.tpl-stats div { display: grid; gap: 0.1rem; }
.tpl-stats span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tpl-stats strong { font-size: 0.95rem; }
.gain-text { color: var(--green); }
.tpl-actions { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; padding-top: 0.25rem; }
.tpl-actions .btn { min-height: 44px; }

.empty-block { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--space-6); display: grid; gap: var(--space-4); justify-items: start; }
.empty-block p { color: var(--ink-2); }

/* ---------- stepper + builder ---------- */
.stepper { display: flex; gap: 0.5rem; margin-bottom: var(--space-5); counter-reset: s; }
.stepper button {
  display: inline-flex; align-items: center; gap: 0.55rem; height: 44px; padding: 0 1rem 0 0.5rem; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.stepper button span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); font-size: 0.8rem; }
.stepper button:hover { border-color: var(--line-strong); color: var(--ink); }
.stepper button[aria-current="step"] { color: var(--ink); border-color: var(--ink); }
.stepper button[aria-current="step"] span { background: var(--ink); color: #fff; }
.stepper button.is-done span { background: var(--green); color: #fff; }

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.5vw, 1.75rem); box-shadow: var(--shadow-card); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-4); }
.panel-title { font-size: 1.35rem; letter-spacing: -0.03em; line-height: 1.15; }
.panel-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; margin-bottom: var(--space-5); }
.panel-tools { display: flex; gap: 0.5rem; }
.panel-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }

.narrative-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.7rem; }
.narrative {
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 0.75rem; align-items: center; text-align: left;
  padding: 0.6rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.narrative:hover { border-color: var(--ink); }
.narrative[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); background: var(--bg); }
.narrative[aria-checked="true"]::after { content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.narrative img, .narrative .nar-blank { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.nar-blank { display: grid; place-items: center; background: var(--bg-alt); font-size: 1.4rem; font-weight: 300; }
.narrative strong { display: block; font-size: 0.9rem; letter-spacing: -0.01em; line-height: 1.2; padding-right: 1.2rem; }
.narrative small { color: var(--muted); font-size: 0.75rem; }

.add-asset { position: relative; margin-bottom: var(--space-4); }
.add-asset .field-search { width: 100%; }
.asset-results {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow: auto; padding: 0.35rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover);
}
.asset-results li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); cursor: pointer; }
.asset-results li[aria-selected="true"], .asset-results li:hover { background: var(--bg-alt); }
.asset-results li[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.asset-results .res-name { font-size: 0.875rem; font-weight: 600; }
.asset-results .res-name small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.asset-results .res-empty { display: block; color: var(--muted); font-size: 0.875rem; cursor: default; }

.holdings { display: grid; gap: 0.5rem; }
.holding {
  display: grid; grid-template-columns: 34px minmax(120px, 1.1fr) minmax(140px, 1.5fr) 92px 36px; align-items: center; gap: 0.85rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.holding:hover { border-color: var(--line-strong); }
.holding.is-new { animation: flash 900ms var(--ease); }
@keyframes flash { from { background: #FFF1E8; } }
.h-name { min-width: 0; }
.h-name strong { display: block; font-size: 0.9rem; }
.h-name span { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-range { width: 100%; accent-color: var(--ink); height: 28px; cursor: pointer; }
.h-weight { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 0.5rem; background: var(--surface); }
.h-weight:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(254 83 1 / 0.18); }
.h-weight input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; text-align: right; font-family: var(--font-mono); font-size: 0.9rem; -moz-appearance: textfield; }
.h-weight input::-webkit-inner-spin-button { -webkit-appearance: none; }
.h-weight span { color: var(--muted); font-size: 0.85rem; margin-left: 2px; }
.h-remove { width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font-size: 1.25rem; cursor: pointer; }
.h-remove:hover { background: #FDECEA; color: #B42318; }

.total-bar { margin-top: var(--space-5); }
.total-track { height: 8px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.total-fill { height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width 300ms var(--ease), background-color 300ms var(--ease); }
.total-bar.is-ok .total-fill { background: var(--green); }
.total-bar.is-over .total-fill { background: #B42318; }
.total-text { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.total-hint { font-weight: 500; color: var(--muted); }
.total-bar.is-over .total-hint, .total-bar.is-under .total-hint { color: #B42318; }
.total-bar.is-ok .total-hint { color: var(--green); }

/* form grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-5); }
.form-grid .field { margin: 0; }
.span-2 { grid-column: 1 / -1; }
.field input[type="number"], .field textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); resize: vertical;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); font: inherit;
}
.field input[type="number"] { height: 48px; }
.field input[type="number"]:focus, .field textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(254 83 1 / 0.2); }
.field label output { float: right; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.field input[type="range"] { width: 100%; accent-color: var(--brand); height: 32px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-alt); gap: 2px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 36px; padding: 0 0.95rem; border-radius: 999px; font-size: 0.875rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all var(--dur) var(--ease); }
.seg label { margin: 0 !important; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(20 14 6 / 0.12); }
.seg input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 1px; }
.input-affix { position: relative; }
.input-affix input { padding-right: 4.2rem !important; }
.affix-btn { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 0.75rem; border: 0; border-radius: 6px; background: var(--bg-alt); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.affix-btn:hover { background: var(--line); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 3px rgb(180 35 24 / 0.12); }

/* ---------- summary ---------- */
.summary { position: sticky; top: 88px; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-hover); }
.summary-kicker { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: #FF9A66; font-weight: 700; margin-bottom: 0.6rem; }
.summary-name { font-size: 1.35rem; letter-spacing: -0.03em; line-height: 1.15; word-break: break-word; }
.summary-symbol { color: #A8A29A; font-size: 0.85rem; margin-top: 0.25rem; }
.donut-wrap { position: relative; width: 180px; margin: 1.25rem auto 1rem; }
.donut { width: 100%; height: auto; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; transition: stroke-dasharray 400ms var(--ease), stroke-dashoffset 400ms var(--ease); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 1.8rem; letter-spacing: -0.04em; line-height: 1; }
.donut-center span { font-size: 0.75rem; color: #A8A29A; }
.legend { display: grid; gap: 0.35rem; margin-bottom: 1rem; max-height: 210px; overflow: auto; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 0.55rem; font-size: 0.8rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .mono { color: #D9D4CC; }
.summary-facts { display: grid; gap: 0.1rem; border-top: 1px solid rgb(255 255 255 / 0.12); padding-top: 0.8rem; }
.summary-facts div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; font-size: 0.82rem; }
.summary-facts dt { color: #A8A29A; }
.summary-facts dd { text-align: right; font-weight: 600; }
.summary-facts .is-bad { color: #FF8A7A; }
.summary-facts .is-good { color: #6EE7A0; }

/* ---------- vaults ---------- */
.portfolio-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-5); }
.portfolio-strip div { background: var(--surface); padding: 1rem 1.25rem; display: grid; gap: 0.2rem; }
.portfolio-strip span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.portfolio-strip strong { font-size: 1.5rem; letter-spacing: -0.03em; }
.vault-list { display: grid; gap: var(--space-4); }
.vault {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: var(--space-5); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.35rem; box-shadow: var(--shadow-card);
}
.vault h3 { font-size: 1.15rem; letter-spacing: -0.025em; }
.vault-sub { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: center; margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.vault-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-alt); }
.vault-bar i { display: block; height: 100%; }
.vault-alloc p { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; gap: 1rem; }
.vault-alloc .tk-stack { margin-top: 0.6rem; }
.vault-right { text-align: right; display: grid; gap: 0.5rem; justify-items: end; }
.vault-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; }
.vault-actions { display: flex; gap: 0.4rem; }
.icon-btn { height: 36px; padding: 0 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.is-danger:hover { border-color: #B42318; color: #B42318; }
.empty-hero { grid-template-columns: 160px 1fr; align-items: center; gap: var(--space-5); padding: var(--space-6); }
.empty-hero img { width: 160px; }
.empty-hero h2 { font-size: 1.5rem; letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.empty-hero p { margin-bottom: var(--space-4); }

/* ---------- dialogs ---------- */
.modal-wide { width: min(100% - 2rem, 640px); }
.app .modal { max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; }
.detail-media { margin: -2rem -1.75rem 1.25rem; aspect-ratio: 16 / 5.5; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-list { display: grid; gap: 0.45rem; margin: 1rem 0 1.25rem; }
.detail-row { display: grid; grid-template-columns: 34px 1fr auto 56px; align-items: center; gap: 0.7rem; }
.detail-row .h-name strong { font-size: 0.875rem; }
.detail-row .w { font-family: var(--font-mono); font-size: 0.85rem; text-align: right; }
.detail-bar { grid-column: 2 / -1; height: 4px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-top: -0.2rem; }
.detail-bar i { display: block; height: 100%; background: var(--ink); }
.review-list { display: grid; gap: 0; margin-bottom: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review-list div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.9rem; font-size: 0.875rem; }
.review-list div + div { border-top: 1px solid var(--line); }
.review-list dt { color: var(--muted); }
.review-list dd { font-weight: 600; text-align: right; }
.progress-list { display: grid; gap: 0.8rem; margin-top: 0.5rem; counter-reset: p; }
.progress-list li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 0.75rem; color: var(--muted); font-weight: 500; }
.progress-list li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); box-sizing: border-box; }
.progress-list li.is-active { color: var(--ink); }
.progress-list li.is-active::before { border-color: var(--line-strong); border-top-color: var(--brand); animation: spin 700ms linear infinite; }
.progress-list li.is-done { color: var(--ink); }
.progress-list li.is-done::before { border: 0; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }
.done-text { color: var(--ink-2); margin-bottom: var(--space-5); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%);
  padding: 0.75rem 1.1rem; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-hover); animation: rise 300ms var(--ease);
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .builder { grid-template-columns: 1fr; }
  .summary { position: static; display: grid; grid-template-columns: 180px 1fr; column-gap: 1.5rem; }
  .summary-kicker, .summary-name, .summary-symbol { grid-column: 1 / -1; }
  .donut-wrap { margin: 1rem 0; grid-row: span 2; }
  .vault { grid-template-columns: 1fr 1fr; }
  .vault-right { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; text-align: left; justify-items: start; }
  .vault-actions { justify-self: end; }
}
@media (max-width: 860px) {
  .app-header-inner { height: auto; min-height: 60px; flex-wrap: wrap; padding: 0.6rem 0; row-gap: 0.4rem; }
  .app-tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .app-tabs a[aria-current="page"]::after { bottom: -7px; }
  .app[data-state="gate"] .app-tabs { display: none; }
  .gate-card { grid-template-columns: 1fr; }
  .gate-art { aspect-ratio: auto; height: 170px; }
  .gate-art img { width: auto; height: 150px; }
  .view { padding-top: var(--space-6); }
  .view-head { flex-direction: column; align-items: flex-start; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .field-search { width: 100%; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; width: 100%; min-width: 0; }
  .toolbar > * { min-width: 0; }
  .chip { flex-shrink: 0; }
  .stepper { overflow-x: auto; }
  .stepper button { flex-shrink: 0; }
  .holding { grid-template-columns: 34px 1fr 84px 36px; row-gap: 0.4rem; }
  .h-range { grid-column: 2 / -1; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .donut-wrap { margin: 1rem auto; }
  .vault { grid-template-columns: 1fr; }
  .portfolio-strip { grid-template-columns: 1fr 1fr 1fr; }
  .portfolio-strip strong { font-size: 1.15rem; }
  .empty-hero { grid-template-columns: 1fr; }
  .empty-hero img { width: 120px; }
}
@media (max-width: 520px) {
  .app-badge { display: none; }
  .wallet-slot .btn-sm { padding: 0 0.8rem; }
  .panel-actions .btn { flex: 1; }
  .panel-head .panel-tools { width: 100%; }
  .panel-tools .btn { flex: 1; }
  .portfolio-strip div { padding: 0.75rem 0.8rem; }
  .portfolio-strip span { font-size: 0.65rem; }
  .portfolio-strip strong { font-size: 1rem; }
  .tpl-actions { grid-template-columns: 1fr 1fr; }
}
