/* ── Design tokens ── */
:root {
  --bg: #121416;
  --surface-low: #1a1c1e;
  --surface-container: #1e2022;
  --surface-highest: #333537;
  --border: #3a4a3f;
  --outline: #849588;
  --text: #e2e2e5;
  --muted: #b9cbbd;
  --secondary-text: #c6c6c9;
  --accent: #00ffa3;
  --accent-dim: #00e290;
  --on-accent: #003920;
  --error: #ffb4ab;
}

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('./fonts/material-symbols-outlined.ttf') format('truetype');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0, 226, 144, 0.03) 0.5px, transparent 0.5px);
  background-size: 8px 8px;
  min-height: 100vh;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }

input[readonly].locked-input {
  color: var(--muted);
  border-color: rgba(132, 149, 136, 0.45);
  background: rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
}

/* ── Typography ── */
.font-grotesk { font-family: 'Space Grotesk', sans-serif; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.1rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* ── Fixed chrome ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(10, 12, 14, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-highest);
  z-index: 50;
}

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.security-bar {
  position: fixed;
  top: 56px; left: 0; right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-container);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.security-bar .material-symbols-outlined { font-size: 13px; }

.file-mode-banner {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 180, 171, 0.12);
  border-bottom: 1px solid rgba(255, 180, 171, 0.32);
  color: var(--error);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 39;
  text-align: center;
}

.file-mode-banner .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Landing page ── */
.landing-view {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0, 226, 144, 0.03) 0.5px, transparent 0.5px);
  background-size: 8px 8px;
  z-index: 110;
  overflow-y: auto;
}

.landing-nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: rgba(10, 12, 14, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-highest);
  z-index: 5;
}

.landing-nav-cta {
  background: transparent;
  color: var(--accent-dim);
  border: 1px solid rgba(0, 226, 144, 0.3);
  border-radius: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 150ms, border-color 150ms;
}

.landing-nav-cta:hover { background: rgba(0, 226, 144, 0.06); border-color: var(--accent-dim); }
.landing-nav-cta .material-symbols-outlined { font-size: 15px; }

.landing-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 4rem 1.5rem 3rem;
}

.landing-hero-inner {
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 226, 144, 0.06);
  border: 1px solid rgba(0, 226, 144, 0.18);
  border-radius: 9999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 1.5rem;
}

.landing-eyebrow .material-symbols-outlined { font-size: 13px; }

.landing-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.landing-sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 2rem;
}

.landing-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  box-shadow: 0 0 32px rgba(0, 255, 163, 0.18);
  transition: opacity 150ms, transform 100ms, box-shadow 150ms;
}

.landing-cta-btn:hover { opacity: 0.9; box-shadow: 0 0 48px rgba(0, 255, 163, 0.28); }
.landing-cta-btn:active { transform: scale(0.98); }
.landing-cta-btn .material-symbols-outlined { font-size: 18px; }

.landing-trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.landing-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--secondary-text);
}

.landing-chip .material-symbols-outlined { font-size: 13px; color: var(--accent-dim); }

.landing-features {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--surface-highest);
}

.landing-features-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.landing-feature-card {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 200ms;
}

.landing-feature-card:hover { border-color: rgba(0, 226, 144, 0.25); }

.landing-feat-icon {
  display: block;
  font-size: 28px;
  color: var(--accent-dim);
  margin-bottom: 0.9rem;
}

.landing-feature-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.landing-feature-card p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}

.landing-how {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--surface-highest);
}

.landing-section-title {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.landing-steps {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
}

.landing-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.landing-step-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
  background: rgba(0, 226, 144, 0.06);
  border: 1px solid rgba(0, 226, 144, 0.18);
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.landing-step strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.landing-step p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}

.landing-footer-cta {
  padding: 5rem 1.5rem 6rem;
  border-top: 1px solid var(--surface-highest);
  text-align: center;
}

.landing-footer-cta h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.landing-footer-cta p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* ── Entry view back button ── */
.entry-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.3rem 0;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: color 150ms;
}

.entry-back-btn:hover { color: var(--text); }
.entry-back-btn:active { transform: none; }
.entry-back-btn .material-symbols-outlined { font-size: 16px; }

/* ── Entry view (full-screen vault entry) ── */
.entry-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0, 226, 144, 0.03) 0.5px, transparent 0.5px);
  background-size: 8px 8px;
  z-index: 100;
  padding: 1.5rem;
  overflow-y: auto;
}

.entry-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.entry-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 226, 144, 0.06);
  border: 1px solid rgba(0, 226, 144, 0.2);
  display: grid;
  place-items: center;
  margin: 0 auto 1.25rem;
  color: var(--accent-dim);
  box-shadow: 0 0 40px rgba(0, 226, 144, 0.08);
}

.entry-icon-wrap .material-symbols-outlined { font-size: 32px; }

.entry-card h1 {
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.entry-tagline {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.entry-fields { text-align: left; display: grid; gap: 0.7rem; margin-bottom: 1rem; }

.btn-full {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: opacity 150ms, transform 100ms;
}

.btn-full:hover { opacity: 0.88; }
.btn-full:active { transform: scale(0.98); }
.btn-full:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full .material-symbols-outlined { font-size: 18px; }

.entry-security-note {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  background: rgba(0, 226, 144, 0.04);
  border: 1px solid rgba(0, 226, 144, 0.12);
  border-radius: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

.entry-security-note .material-symbols-outlined { font-size: 14px; flex-shrink: 0; color: var(--accent-dim); margin-top: 1px; }

/* ── Dashboard ── */
#dashboard {
  padding-top: calc(56px + 26px);
  padding-bottom: 72px; /* bottom nav height */
  min-height: 100vh;
}

body.file-mode #dashboard {
  padding-top: calc(56px + 26px + 40px);
}

body.insecure-mode #dashboard {
  padding-top: calc(56px + 26px + 40px);
}

body.file-mode .landing-view,
body.file-mode .entry-view {
  padding-top: 40px;
}

body.insecure-mode .landing-view,
body.insecure-mode .entry-view {
  padding-top: 40px;
}

.dashboard-grid {
  padding: 1rem;
  display: grid;
  gap: 0;
}

/* ── Tab panels (mobile: one-at-a-time) ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Settings panel (mobile: regular tab panel) ── */
.settings-panel-wrap {
  /* On mobile: tab panel — hidden/shown via .active class */
}

.settings-panel-inner {
  padding: 0 1rem 1rem;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  background: rgba(10, 12, 14, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-highest);
  z-index: 50;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-top: 2px solid transparent;
  border-radius: 0;
  color: #454749;
  cursor: pointer;
  padding: 6px 4px;
  transition: color 150ms, border-color 150ms;
  font-family: 'Space Grotesk', sans-serif;
}

.nav-btn .material-symbols-outlined { font-size: 22px; }

.nav-btn .nav-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.nav-btn.active {
  color: var(--accent-dim);
  border-top-color: var(--accent-dim);
}

/* ── Settings backdrop (desktop only, hidden on mobile) ── */
.settings-backdrop { display: none; }

/* ── Desktop-only / mobile-only ── */
.desktop-only { display: none; }
.mobile-only { display: block; }

/* ── Cards ── */
.card {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.1rem;
  margin-bottom: 0.75rem;
  transition: border-color 200ms;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.section-head h3 { margin: 0; }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tab-header h2 { margin: 0; }

/* ── Form elements ── */
label, .field-label {
  display: block;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.field-label-caps {
  display: block;
  color: var(--accent-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

input, textarea, select {
  width: 100%;
  background: var(--surface-container);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(0, 226, 144, 0.08);
}

textarea { resize: vertical; }
select option { background: var(--surface-low); color: var(--text); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.space-y > * + * { margin-top: 0.65rem; }

.row { display: flex; gap: 0.5rem; align-items: center; }
.row > * { flex: 1; }

.passphrase-wrap { position: relative; display: flex; align-items: center; }
.passphrase-wrap input { padding-left: 2.4rem; padding-right: 2.5rem; }

.passphrase-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 17px;
  color: var(--muted);
  pointer-events: none;
}

#togglePassphraseBtn {
  position: absolute;
  right: 0.4rem;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
}

#togglePassphraseBtn:hover { color: var(--text); }
#togglePassphraseBtn .material-symbols-outlined { font-size: 17px; }

/* ── Buttons ── */
/* ── Segmented toggle (BUY / SELL) ── */
.segment-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 3px;
  gap: 3px;
}

.segment-btn {
  border-radius: calc(0.5rem - 3px);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.segment-btn.active {
  background: var(--accent);
  color: var(--on-accent);
}

.segment-btn:active { transform: scale(0.97); }

/* ── DECRYPTED badge (feed items) ── */
.decrypted-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(0, 226, 144, 0.06);
  border: 1px solid rgba(0, 226, 144, 0.18);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.decrypted-badge .material-symbols-outlined { font-size: 11px; }

/* ── Feed item header row (ticker + decrypted badge) ── */
.feed-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

button {
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: opacity 150ms, transform 100ms;
  white-space: nowrap;
}

button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button .material-symbols-outlined { font-size: 17px; }

@keyframes sync-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.primary {
  background: var(--accent);
  color: var(--on-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.primary:hover { opacity: 0.88; }

.primary.is-syncing,
.secondary.is-syncing {
  box-shadow: 0 0 0 1px rgba(0, 226, 144, 0.16), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.is-syncing .material-symbols-outlined {
  animation: sync-spin 1s linear infinite;
}

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary:hover { border-color: var(--outline); background: rgba(255, 255, 255, 0.03); }

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px dashed var(--border);
}

.ghost:hover { border-color: var(--outline); }

.danger { color: var(--error) !important; }
.ghost.danger { border-color: rgba(255, 180, 171, 0.28); }
.ghost.danger:hover { border-color: var(--error); background: rgba(255, 180, 171, 0.04); }

.icon-btn {
  background: transparent;
  border: none;
  padding: 0.3rem;
  border-radius: 50%;
  color: var(--accent-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 150ms;
}

.icon-btn:hover { background: rgba(0, 226, 144, 0.08); }
.icon-btn .material-symbols-outlined { font-size: 22px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin-top: 0.4rem; }
.accent-dim { color: var(--accent-dim); }

/* ── Portfolio summary header ── */
.portfolio-summary-header {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.summary-stat-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.summary-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ── Position cards ── */
.positions { display: grid; gap: 0.55rem; }

.position-card {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 0.9rem;
  transition: border-color 200ms;
}

.position-card:hover { border-color: rgba(0, 226, 144, 0.2); }

.position-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.position-asset {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.position-exposure {
  color: var(--accent-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.1rem;
  letter-spacing: 0.02em;
}

.position-value-block { text-align: right; }

.position-market-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.position-pnl {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.08rem;
}

.position-pnl-positive { color: var(--accent-dim); }
.position-pnl-negative { color: var(--error); }

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.position-grid label { font-size: 9px; margin-bottom: 0.15rem; }

.position-input { padding: 0.4rem 0.55rem; font-size: 0.85rem; }

.position-stat {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.position-actions { display: flex; gap: 0.45rem; }
.position-actions > * { flex: 1; font-size: 0.78rem; padding: 0.45rem 0.65rem; }

/* ── Import panel ── */
.import-panel {
  border: 1px solid var(--border);
  border-left: 3px solid rgba(0, 226, 144, 0.4);
  border-radius: 0.5rem;
  background: rgba(0, 226, 144, 0.02);
  padding: 0.85rem;
  margin-top: 0.65rem;
}

/* ── Feed ── */
.feed { display: grid; gap: 0.5rem; }

.feed-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.8rem;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: border-color 200ms;
}

.feed-item:hover { border-color: rgba(0, 226, 144, 0.16); }

.feed-body { display: flex; flex-direction: column; gap: 0.18rem; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 226, 144, 0.1);
  color: var(--accent-dim);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.feed-ticker-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(0, 226, 144, 0.08);
  color: var(--accent-dim);
  border: 1px solid rgba(0, 226, 144, 0.18);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.feed-line { font-size: 0.88rem; line-height: 1.4; }
.feed-line strong { font-weight: 600; }

.feed-exposure { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.12rem; }
.move-size { color: var(--secondary-text); }
.feed-note { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.feed-meta { font-size: 0.74rem; color: var(--outline); }

.feed-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.panel-guidance {
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.panel-guidance strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
}

.mobile-only { display: none; }

/* ── Settings specific ── */
.about-table { display: grid; gap: 0; }

.about-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.about-row:last-child { border-bottom: none; }
.about-row span:first-child { color: var(--muted); }
.about-row span:last-child { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--accent-dim); }

.danger-zone { border-color: rgba(255, 180, 171, 0.2); }

.node-link-display {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: var(--accent-dim);
  word-break: break-all;
  letter-spacing: 0.01em;
  min-height: 34px;
}

/* ── Portfolio donut chart card ── */
.portfolio-chart-card {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portfolio-chart-card .chart-svg-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.portfolio-chart-card .chart-svg-wrap svg {
  width: 100%;
  height: 100%;
}

.portfolio-chart-card .chart-legend {
  flex: 1;
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

/* ── Member snapshots (group allocation charts) ── */
.member-snapshots { margin-bottom: 0.75rem; }

.snapshots-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.5rem;
}

.snapshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.snapshot-card {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: border-color 200ms;
}

.snapshot-card:hover { border-color: rgba(0, 226, 144, 0.2); }

.snapshot-author {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.snapshot-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 226, 144, 0.1);
  color: var(--accent-dim);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  flex-shrink: 0;
}

.snapshot-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-body {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.snapshot-chart {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}

.snapshot-chart svg { width: 100%; height: 100%; }

.snapshot-legend {
  flex: 1;
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

/* Shared legend item style */
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  min-width: 0;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-pct { color: var(--muted); flex-shrink: 0; }

/* ── Portfolio hero ── */
.portfolio-hero {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.35rem;
}

/* ── Quick add trade ── */
.trade-form-card {
  margin-top: 0.5rem;
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.trade-form-card.collapsed {
  position: sticky;
  top: 0.85rem;
  z-index: 8;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.trade-form-head {
  align-items: flex-start;
  gap: 0.75rem;
}

.trade-form-hint {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.trade-toggle-btn {
  flex-shrink: 0;
  min-width: 108px;
}

.trade-form-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 220ms ease, opacity 180ms ease, margin-top 180ms ease;
}

.trade-form-card.collapsed .trade-form-body {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
  visibility: hidden;
}

.trade-form-body-inner {
  overflow: hidden;
  min-height: 0;
}

.trade-form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

.hero-chart { flex-shrink: 0; width: 110px; height: 110px; }
.hero-chart svg { width: 100%; height: 100%; }

.hero-stats { flex: 1; min-width: 0; }

.hero-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.hero-pnl {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.hero-reset-btn {
  background: transparent;
  border: none;
  color: var(--outline);
  padding: 0.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  align-self: flex-start;
  margin-left: auto;
  flex-shrink: 0;
  transition: color 150ms;
}
.hero-reset-btn:hover { color: var(--error); }
.hero-reset-btn .material-symbols-outlined { font-size: 16px; }

/* ── Position table ── */
.position-table {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.position-table-header {
  display: grid;
  grid-template-columns: 10px 1fr 80px 60px 18px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.position-table-header button {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  justify-content: flex-start;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.position-table-header button:hover {
  color: var(--text);
}

.position-table-header button.is-active {
  color: var(--accent-dim);
}

.sort-icon {
  font-size: 13px;
  opacity: 0.6;
}

.position-table-header button.is-active .sort-icon {
  opacity: 1;
}

.position-row {
  display: grid;
  grid-template-columns: 10px 1fr 80px 60px 18px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 120ms, transform 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.position-row:last-of-type { border-bottom: none; }
.position-row:hover { background: rgba(255,255,255,0.025); }
.position-row.expanded {
  background: var(--surface-container);
  border-bottom: none;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.pos-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pos-ticker-wrap { min-width: 0; }

.pos-ticker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-name {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-bar-col {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pos-bar-track {
  flex: 1;
  height: 3px;
  background: var(--surface-highest);
  border-radius: 2px;
  overflow: hidden;
}

.pos-bar { height: 100%; border-radius: 2px; }

.pos-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

.pos-pnl {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.pos-chevron {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms;
}

.pos-chevron .material-symbols-outlined { font-size: 16px; }
.position-row.expanded .pos-chevron { transform: rotate(180deg); }

/* Expanded detail row */
.position-detail {
  background: var(--surface-container);
  border-bottom: 1px solid transparent;
  padding: 0 0.85rem 0 1.5rem;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 220ms ease, opacity 180ms ease, padding 180ms ease, border-color 180ms ease;
}

.position-detail.open {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 0.75rem 0.85rem 0.85rem 1.5rem;
  border-bottom-color: var(--border);
}

.position-detail-inner {
  overflow: hidden;
  min-height: 0;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.detail-stat-label {
  font-size: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.detail-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}

.detail-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.detail-inputs label { font-size: 9px; }
.detail-inputs input { padding: 0.38rem 0.5rem; font-size: 0.8rem; }

.detail-actions { display: flex; gap: 0.4rem; }
.detail-actions button { font-size: 0.76rem; padding: 0.4rem 0.65rem; }

/* Empty portfolio state */
.portfolio-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.portfolio-empty .material-symbols-outlined {
  font-size: 36px;
  color: var(--surface-highest);
  display: block;
  margin-bottom: 0.75rem;
}

.portfolio-empty strong { display: block; color: var(--text); margin-bottom: 0.25rem; font-size: 0.92rem; }

/* ── Member cards v2 (with allocation bars) ── */
.member-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.member-card-v2 {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem;
  cursor: pointer;
  transition: border-color 200ms, transform 160ms ease, box-shadow 160ms ease;
}

.member-card-v2:hover { border-color: rgba(0, 226, 144, 0.2); }
.member-card-v2.is-selected {
  border-color: rgba(0, 226, 144, 0.38);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.member-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.member-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card-time {
  font-size: 0.68rem;
  color: var(--outline);
  flex-shrink: 0;
}

.alloc-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.alloc-ticker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.alloc-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface-highest);
  border-radius: 2px;
  overflow: hidden;
}

.alloc-bar { height: 100%; border-radius: 2px; }

.alloc-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 28px;
  text-align: right;
}

.member-card-empty {
  font-size: 0.76rem;
  color: var(--muted);
  padding-top: 0.2rem;
}

.member-profile-card {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.member-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.member-profile-head h3 {
  margin: 0.15rem 0;
}

.member-profile-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.member-profile-chart {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
}

.member-profile-chart svg {
  width: 100%;
  height: 100%;
}

.member-holdings-list {
  display: grid;
  gap: 0.7rem;
}

.member-empty-holdings {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.2rem 0 0.1rem;
}

.member-holding-row {
  display: grid;
  gap: 0.32rem;
}

.member-holding-topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.member-holding-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.member-holding-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.member-holding-track {
  height: 6px;
  background: var(--surface-highest);
  border-radius: 9999px;
  overflow: hidden;
}

.member-holding-bar {
  height: 100%;
  border-radius: 9999px;
}

/* ── Feed timeline ── */
.feed-date-group { margin-top: 0.5rem; }

.feed-date-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
  padding: 0.4rem 0;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-date-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Last synced label ── */
.last-synced-label {
  font-size: 0.72rem;
  color: var(--outline);
  margin-top: 0.1rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .mobile-only { display: block; }

  .trade-form-card.collapsed {
    position: static;
    top: 0.5rem;
    box-shadow: none;
  }

  .trade-form-head {
    align-items: center;
  }

  .trade-toggle-btn {
    min-width: 0;
  }
}

/* ── Topbar avatar button ── */
.avatar-topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
  transition: opacity 150ms, transform 100ms;
  padding: 0;
  flex-shrink: 0;
}

.avatar-topbar-btn:active { transform: scale(0.95); }
.avatar-topbar-btn:hover { opacity: 0.85; }

/* ── Avatar color picker ── */
.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.avatar-preview-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 120ms, border-color 120ms;
  padding: 0;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--text); }

/* ── File upload ── */
.file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms;
  margin-top: 0.5rem;
}

.file-upload-label:hover { border-color: var(--outline); }
.file-upload-label .material-symbols-outlined { font-size: 17px; }
.file-upload-label input[type="file"] { display: none; }

/* ── Import status / preview ── */
.import-status {
  margin-top: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.import-status.success {
  background: rgba(0, 226, 144, 0.06);
  border: 1px solid rgba(0, 226, 144, 0.2);
  color: var(--accent-dim);
}

.import-status.error {
  background: rgba(255, 180, 171, 0.06);
  border: 1px solid rgba(255, 180, 171, 0.25);
  color: var(--error);
}

.import-preview-list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.3rem;
  max-height: 180px;
  overflow-y: auto;
}

.import-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
}

.import-preview-row .asset-name {
  flex: 1;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-preview-row .asset-detail { color: var(--muted); flex-shrink: 0; }

/* ── Profile panel ── */
.profile-panel-wrap {
  /* Mobile: regular tab panel */
}

@media (max-width: 767px) {
  .profile-panel-wrap,
  .settings-panel-wrap {
    position: fixed;
    top: calc(56px + 26px);
    left: 0;
    right: 0;
    bottom: 64px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
    z-index: 45;
    padding-top: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  body.file-mode .profile-panel-wrap,
  body.file-mode .settings-panel-wrap,
  body.insecure-mode .profile-panel-wrap,
  body.insecure-mode .settings-panel-wrap {
    top: calc(56px + 26px + 40px);
  }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(64px + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-highest);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 768px+ (desktop dashboard)
══════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* Show desktop-only elements, hide mobile-only */
  .desktop-only { display: flex !important; }
  .mobile-only { display: none !important; }
  .bottom-nav { display: none; }

  /* Dashboard layout */
  #dashboard {
    padding-bottom: 2rem;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    padding: 0;
  }

  /* Each column scrolls independently */
  .col-left, .col-right {
    overflow-y: auto;
    height: 100%;
    padding: 1.25rem;
  }

  .col-left { border-right: 1px solid var(--border); }

  /* Always show both columns on desktop */
  #tab-signal, #tab-activity {
    display: block !important;
  }

  /* Profile: fixed sliding panel from right (same as settings) */
  .profile-panel-wrap {
    position: fixed !important;
    top: 0; right: -110%;
    width: min(420px, 100vw);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 60;
    background: var(--surface-low);
    border-left: 1px solid var(--border);
    padding-top: calc(56px + 26px);
    transition: right 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
  }

  .profile-panel-wrap.panel-open { right: 0; }
  .profile-panel-wrap .card { min-width: 0; }
  .profile-panel-wrap .row { flex-wrap: wrap; }

  /* Settings: fixed sliding panel from right */
  .settings-panel-wrap {
    position: fixed !important;
    top: 0; right: -110%;
    width: min(420px, 100vw);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 60;
    background: var(--surface-low);
    border-left: 1px solid var(--border);
    padding-top: calc(56px + 26px);
    transition: right 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
  }

  .settings-panel-wrap.panel-open { right: 0; }

  /* Ensure cards inside the settings panel don't overflow */
  .settings-panel-wrap .card { min-width: 0; }
  .settings-panel-wrap .row { flex-wrap: wrap; }

  /* Settings backdrop */
  .settings-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 59;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms;
  }

  .settings-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Toast above bottom instead of above nav */
  .toast { bottom: 1rem; }
}

/* ── Mobile adjustments ── */
@media (max-width: 580px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .position-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-summary-header { grid-template-columns: 1fr 1fr; }
  .portfolio-summary-header > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .position-grid { grid-template-columns: 1fr; }
}

/* ── Circle owner chip ── */
.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  background: rgba(0,226,144,0.08);
  border: 1px solid rgba(0,226,144,0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}
