:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --canvas: #090c0a;
  --canvas-soft: #0d110e;
  --surface: #121713;
  --surface-raised: #171d18;
  --surface-hover: #1a211b;
  --line: #293129;
  --line-soft: #202720;
  --text: #f2f6f2;
  --muted: #98a49b;
  --muted-strong: #bac4bc;
  --green: #55d45c;
  --green-bright: #73e46d;
  --green-deep: #147447;
  --green-wash: rgba(85, 212, 92, 0.11);
  --amber: #f3b562;
  --amber-wash: rgba(243, 181, 98, 0.1);
  --red: #ff8b7a;
  --red-wash: rgba(255, 139, 122, 0.1);
  --blue: #8bb8ff;
  --purple: #c4a8ff;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-variant-numeric: tabular-nums;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #071007;
  background: var(--green-bright);
  border-radius: 9px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 3px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--green-bright);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.17em;
  line-height: 1.2;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
}

.wordmark {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.wordmark b {
  color: var(--green-bright);
  font: inherit;
}

.reveal {
  animation: reveal 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sign in */

.login-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 17% 28%, rgba(62, 190, 78, 0.13), transparent 30rem),
    var(--canvas);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(440px, 0.84fr);
  min-height: 100vh;
}

.login-story,
.login-access {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 6vw, 96px);
}

.login-story {
  overflow: hidden;
  align-items: flex-end;
  justify-content: flex-start;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(7, 10, 8, 0.1), rgba(7, 10, 8, 0.82)),
    linear-gradient(135deg, #101711, #0b100c 62%, #101b11);
}

.login-story::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.login-glow {
  position: absolute;
  top: -18vw;
  left: -15vw;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: rgba(60, 203, 70, 0.14);
  filter: blur(110px);
  pointer-events: none;
}

.login-brand {
  position: absolute;
  z-index: 1;
  top: clamp(24px, 5vw, 72px);
  left: clamp(24px, 5vw, 72px);
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-logo {
  width: clamp(74px, 8vw, 112px);
  height: clamp(74px, 8vw, 112px);
  object-fit: contain;
  filter: drop-shadow(0 20px 32px rgba(39, 210, 76, 0.12));
}

.login-brand .wordmark {
  font-size: clamp(1.45rem, 2.6vw, 2.25rem);
}

.login-story-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.login-story-copy h1 {
  max-width: 520px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 6.5vw, 6.5rem);
}

.login-story-copy > p:not(.eyebrow) {
  max-width: 570px;
  margin-bottom: 30px;
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
}

.access-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 0;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 700;
  list-style: none;
}

.access-points li {
  display: flex;
  gap: 8px;
  align-items: center;
}

.access-points span {
  color: var(--green-bright);
  font-size: 0.64rem;
}

.login-access {
  background: var(--canvas-soft);
}

.login-card {
  width: min(100%, 430px);
  animation-delay: 100ms;
}

.login-access-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 46px;
}

.login-mark {
  width: 58px;
  height: 58px;
  padding: 8px;
  border: 1px solid rgba(85, 212, 92, 0.25);
  border-radius: 16px;
  background: var(--green-wash);
  object-fit: contain;
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.045em;
}

.login-card form {
  display: grid;
  margin-top: 42px;
}

.login-card label {
  margin-bottom: 9px;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 750;
}

.login-card input:not([type="hidden"]) {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  margin-bottom: 21px;
  color: var(--text);
  border: 1px solid #343d35;
  border-radius: 12px;
  background: #101511;
  caret-color: var(--green-bright);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.login-card input:hover {
  border-color: #465148;
}

.login-card input:focus {
  border-color: var(--green);
  outline: 0;
  background: #121914;
  box-shadow: 0 0 0 4px rgba(85, 212, 92, 0.12);
}

.primary-button {
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  margin-top: 7px;
  color: #071007;
  border: 0;
  border-radius: 12px;
  background: var(--green-bright);
  box-shadow: 0 12px 38px rgba(66, 203, 70, 0.17);
  font-weight: 850;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: #88f080;
  box-shadow: 0 14px 40px rgba(66, 203, 70, 0.24);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(0);
}

.login-footnote {
  margin: 24px 0 0;
  color: #77817a;
  font-size: 0.72rem;
  text-align: center;
}

.form-alert {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  margin: 24px 0 -18px;
  color: #ffd8d2;
  border: 1px solid rgba(255, 139, 122, 0.24);
  border-radius: 10px;
  background: var(--red-wash);
  font-size: 0.8rem;
}

.form-alert > span {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: #29100c;
  border-radius: 50%;
  background: var(--red);
  font-size: 0.68rem;
  font-weight: 900;
}

.form-alert p {
  margin-bottom: 0;
}

/* Dashboard frame */

.dashboard-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 18px 20px;
  border-right: 1px solid var(--line-soft);
  background: #0b0f0c;
}

.brand-panel {
  display: flex;
  width: 100%;
  gap: 11px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid #212821;
  border-radius: 13px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

.brand-panel:hover {
  border-color: rgba(85, 212, 92, 0.58);
  transform: translateY(-2px);
}

.brand-panel img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-panel .wordmark {
  font-size: 1rem;
}

.section-nav {
  display: grid;
  gap: 5px;
  margin-top: 30px;
}

.section-nav a {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 10px 12px;
  color: #8f9a91;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.section-nav a span {
  color: #505b52;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.section-nav a:hover,
.section-nav a.active {
  color: var(--text);
  border-color: var(--line-soft);
  background: var(--surface);
}

.section-nav a.active span {
  color: var(--green-bright);
}

.sidebar-bottom {
  margin-top: auto;
}

.read-only-seal {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  color: var(--green-bright);
  border: 1px solid rgba(85, 212, 92, 0.16);
  border-radius: 12px;
  background: rgba(85, 212, 92, 0.06);
}

.read-only-seal > span {
  font-size: 1.25rem;
}

.read-only-seal div {
  display: flex;
  flex-direction: column;
}

.read-only-seal strong {
  font-size: 0.72rem;
}

.read-only-seal small {
  color: #7f8c82;
  font-size: 0.62rem;
}

.sign-out {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  transition: color 160ms ease, background-color 160ms ease;
}

.sign-out:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.mobile-header {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.dashboard-main {
  width: 100%;
  max-width: 1540px;
  min-width: 0;
  padding: 52px clamp(26px, 4vw, 70px) 34px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 34px;
}

.dashboard-header h1 {
  font-size: clamp(2.35rem, 4.5vw, 4.65rem);
}

.header-statuses {
  display: flex;
  max-width: 510px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
}

.env-badge,
.demo-badge,
.count-badge,
.target-pill {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.env-badge.live {
  color: #ffd4c5;
  border: 1px solid rgba(255, 139, 122, 0.2);
  background: var(--red-wash);
}

.env-badge.paper {
  color: #d3e2ff;
  border: 1px solid rgba(139, 184, 255, 0.2);
  background: rgba(139, 184, 255, 0.1);
}

.demo-badge {
  color: #e0d2ff;
  border: 1px solid rgba(196, 168, 255, 0.2);
  background: rgba(196, 168, 255, 0.1);
}

.freshness {
  display: flex;
  flex: 1 1 100%;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 8px;
  text-align: right;
}

.freshness-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 900;
}

.freshness.fresh .freshness-icon {
  color: #071007;
  background: var(--green-bright);
}

.freshness.stale .freshness-icon {
  color: #1c1207;
  background: var(--amber);
}

.freshness div {
  display: flex;
  flex-direction: column;
}

.freshness strong {
  font-size: 0.75rem;
}

.freshness small {
  color: var(--muted);
  font-size: 0.65rem;
}

/* Dashboard content */

.panel,
.metric-card,
.event-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.1);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.panel:hover,
.metric-card:hover,
.event-card:hover {
  border-color: #3b473d;
  background: var(--surface-hover);
}

.account-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  padding: 23px;
}

.metric-card:nth-child(1) {
  animation-delay: 40ms;
}

.metric-card:nth-child(2) {
  animation-delay: 80ms;
}

.metric-card:nth-child(3) {
  animation-delay: 120ms;
}

.metric-card:nth-child(4) {
  animation-delay: 160ms;
}

.metric-card.equity {
  border-color: rgba(85, 212, 92, 0.35);
  background:
    linear-gradient(135deg, rgba(85, 212, 92, 0.11), transparent 70%),
    var(--surface);
}

.metric-card.cash {
  border-color: rgba(139, 184, 255, 0.22);
}

.metric-label {
  margin-bottom: 28px;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 750;
}

.metric-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.metric-card.equity strong {
  color: var(--green-bright);
}

.metric-note {
  margin: auto 0 0;
  padding-top: 20px;
  color: #7f8a81;
  font-size: 0.66rem;
  line-height: 1.4;
}

.primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
  scroll-margin-top: 24px;
}

.event-card {
  position: relative;
  display: flex;
  min-height: 264px;
  overflow: hidden;
  align-items: flex-end;
  padding: 30px;
  border-color: rgba(85, 212, 92, 0.26);
  background:
    linear-gradient(125deg, rgba(85, 212, 92, 0.14), transparent 68%),
    var(--surface);
  animation-delay: 90ms;
}

.event-card::after {
  position: absolute;
  inset: auto -15% -65% 30%;
  height: 100%;
  content: "";
  border-radius: 50%;
  background: rgba(76, 220, 87, 0.08);
  filter: blur(55px);
  pointer-events: none;
}

.event-copy {
  position: relative;
  z-index: 2;
  max-width: 70%;
}

.event-copy h2 {
  color: var(--muted-strong);
  font-size: 0.94rem;
}

.event-value {
  margin: 12px 0 14px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.event-mark {
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 14px;
  width: min(35%, 210px);
  height: auto;
  opacity: 0.32;
  filter: saturate(0.75);
}

.panel {
  padding: 26px;
}

.attention-panel {
  animation-delay: 140ms;
}

.panel-heading,
.section-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.count-badge {
  min-height: 26px;
  color: var(--muted-strong);
  border: 1px solid var(--line);
  background: #0f1410;
  letter-spacing: 0.03em;
}

.alerts {
  display: grid;
  max-height: 174px;
  gap: 8px;
  padding: 0;
  margin: 21px 0 0;
  overflow: auto;
  list-style: none;
}

.alert-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #0f1410;
}

.alert-symbol {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 900;
}

.alert-item div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.alert-item strong {
  font-size: 0.7rem;
}

.alert-item div span {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.alert-item.ok .alert-symbol {
  color: #081008;
  background: var(--green-bright);
}

.alert-item.warning .alert-symbol {
  color: #201507;
  background: var(--amber);
}

.alert-item.critical .alert-symbol {
  color: #210d0a;
  background: var(--red);
}

.strategy-panel,
.holdings-panel,
.limits-panel,
.activity-section {
  margin-bottom: 18px;
  scroll-margin-top: 24px;
}

.strategy-panel {
  animation-delay: 170ms;
}

.target-pills {
  display: flex;
  max-width: 55%;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.target-pill {
  gap: 5px;
  min-height: 27px;
  color: #bdeabe;
  border: 1px solid rgba(85, 212, 92, 0.2);
  background: rgba(85, 212, 92, 0.07);
  letter-spacing: 0;
}

.target-pill b {
  color: var(--green-bright);
}

.target-pill.unavailable {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-raised);
}

.detail-grid,
.limit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--line-soft);
}

.detail {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 17px;
  background: #101511;
}

.detail span {
  color: #7f8a81;
  font-size: 0.67rem;
  line-height: 1.35;
}

.detail strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.4;
}

.decision-note {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 18px;
  margin: 22px 0 0;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  font-size: 0.68rem;
}

.decision-note strong {
  color: var(--text);
}

.decision-note span {
  margin-left: auto;
}

.holdings-panel {
  animation-delay: 210ms;
}

.table-scroll {
  max-width: 100%;
  margin-top: 22px;
  overflow: auto;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
}

th {
  padding: 10px 13px;
  color: #77837a;
  border-bottom: 1px solid var(--line);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 16px 13px;
  color: var(--muted-strong);
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

td:first-child {
  color: var(--text);
  font-weight: 750;
}

.empty-state {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  color: #707b72;
  border: 1px dashed #303930;
  border-radius: 12px;
  text-align: center;
}

.empty-state span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #394239;
  border-radius: 50%;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 0.72rem;
}

.limits-panel {
  padding: 0;
  animation-delay: 240ms;
}

.limits-panel summary {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  list-style: none;
  cursor: pointer;
}

.limits-panel summary::-webkit-details-marker {
  display: none;
}

.limits-panel summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.limits-panel summary .eyebrow {
  margin-bottom: 8px;
}

.limits-panel summary strong {
  font-size: 1rem;
}

.summary-action {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.summary-action i {
  display: inline-block;
  font-size: 1rem;
  font-style: normal;
  transition: transform 180ms ease;
}

.limits-panel[open] .summary-action i {
  transform: rotate(180deg);
}

.disclosure-body {
  padding: 0 26px 26px;
  border-top: 1px solid var(--line-soft);
  animation: disclose 220ms ease both;
}

@keyframes disclose {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.provenance {
  padding-top: 19px;
  font-size: 0.7rem;
}

.limit-grid {
  margin-top: 18px;
}

.activity-section {
  padding-top: 12px;
}

.section-heading {
  align-items: flex-end;
  margin: 0 2px 17px;
}

.section-heading > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.activity-grid .panel:nth-child(1) {
  animation-delay: 100ms;
}

.activity-grid .panel:nth-child(2) {
  animation-delay: 150ms;
}

.scroll-hint {
  display: none;
}

.dashboard-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 2px 0;
  color: #6f796f;
  border-top: 1px solid var(--line-soft);
}

.dashboard-footer img {
  width: 30px;
  height: 30px;
  opacity: 0.62;
  object-fit: contain;
}

.dashboard-footer p {
  max-width: 780px;
  margin-bottom: 0;
  font-size: 0.66rem;
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .dashboard-main {
    padding-inline: 28px;
  }

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

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

  .event-card {
    min-height: 230px;
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 700px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .login-access {
    min-height: 700px;
  }

  .dashboard-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(9, 12, 10, 0.92);
    backdrop-filter: blur(16px);
  }

  .mobile-brand {
    display: flex;
    gap: 8px;
    align-items: center;
    text-decoration: none;
  }

  .mobile-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .mobile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .mobile-actions form {
    display: flex;
  }

  .mobile-sign-out {
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: var(--muted-strong);
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
  }

  .mobile-sign-out:hover {
    color: var(--text);
    border-color: #435045;
    background: var(--surface-hover);
  }

  .dashboard-main {
    padding-top: 34px;
    padding-bottom: 98px;
  }

  .dashboard-header .env-badge {
    display: none;
  }

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

  .mobile-bottom-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(72, 85, 74, 0.72);
    border-radius: 16px;
    background: rgba(14, 19, 15, 0.94);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav a {
    display: grid;
    min-width: 0;
    min-height: 42px;
    place-items: center;
    color: var(--muted);
    border-radius: 11px;
    font-size: 0.64rem;
    font-weight: 760;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
  }

  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav a:focus-visible {
    color: var(--text);
    background: var(--green-wash);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .login-story {
    display: none;
  }

  .login-access {
    min-height: 100svh;
    align-items: center;
    padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  }

  .login-card {
    width: min(100%, 420px);
  }

  .login-access-brand {
    margin-bottom: 34px;
  }

  .login-mark {
    width: 64px;
    height: 64px;
    padding: 7px;
  }

  .login-access-brand .wordmark {
    font-size: 1.35rem;
  }

  .login-card h2 {
    font-size: 2.25rem;
  }

  .login-card form {
    margin-top: 32px;
  }

  .login-card input:not([type="hidden"]) {
    height: 50px;
    margin-bottom: 17px;
  }

  .mobile-header {
    height: 58px;
    padding-inline: 16px;
  }

  .mobile-brand img {
    width: 31px;
    height: 31px;
  }

  .mobile-brand .wordmark {
    font-size: 0.88rem;
  }

  .dashboard-main {
    padding: 22px 12px 100px;
  }

  .dashboard-header {
    display: block;
    margin-bottom: 24px;
  }

  .dashboard-header h1 {
    font-size: clamp(2.15rem, 11vw, 2.7rem);
  }

  .header-statuses {
    max-width: none;
    justify-content: flex-start;
    margin-top: 20px;
  }

  .freshness {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-top: 6px;
    text-align: left;
  }

  .account-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .metric-card {
    min-height: 142px;
    padding: 14px;
    border-radius: 14px;
  }

  .metric-label {
    min-height: 30px;
    margin-bottom: 13px;
    font-size: 0.61rem;
    line-height: 1.3;
  }

  .metric-card strong {
    font-size: clamp(1.4rem, 7.4vw, 1.95rem);
  }

  .metric-note {
    padding-top: 12px;
    font-size: 0.54rem;
    line-height: 1.35;
  }

  .primary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
  }

  .event-card {
    min-height: 204px;
    padding: 19px;
    border-radius: 16px;
  }

  .event-copy {
    max-width: 84%;
  }

  .event-value {
    font-size: clamp(2rem, 11vw, 3.05rem);
  }

  .event-mark {
    width: 42%;
    opacity: 0.24;
  }

  .panel {
    padding: 18px;
    border-radius: 16px;
  }

  .panel-heading {
    gap: 12px;
  }

  .target-pills {
    max-width: 100%;
    justify-content: flex-start;
    margin-top: 16px;
  }

  .strategy-panel .panel-heading {
    display: block;
  }

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

  .detail {
    min-height: 94px;
    padding: 12px;
  }

  .decision-note {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .decision-note span {
    width: 100%;
    margin-left: 0;
  }

  .limits-panel {
    padding: 0;
  }

  .limits-panel summary {
    padding: 17px 18px;
  }

  .summary-action {
    font-size: 0;
  }

  .summary-action i {
    font-size: 1rem;
  }

  .disclosure-body {
    padding: 0 18px 18px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 8px;
  }

  .scroll-hint {
    display: block;
    margin: 12px 0 -8px;
    color: #727d74;
    font-size: 0.62rem;
  }

  table {
    min-width: 530px;
  }

  .holdings-panel table {
    min-width: 0;
    table-layout: fixed;
  }

  .holdings-panel th,
  .holdings-panel td {
    padding-inline: 8px;
  }

  .holdings-panel th:nth-child(1),
  .holdings-panel td:nth-child(1) {
    width: 20%;
  }

  .holdings-panel th:nth-child(2),
  .holdings-panel td:nth-child(2) {
    width: 48%;
  }

  .holdings-panel th:last-child,
  .holdings-panel td:last-child {
    width: 32%;
    text-align: right;
  }

  .dashboard-footer {
    align-items: flex-start;
  }
}

@media (max-width: 390px) {
  .metric-card {
    min-height: 136px;
  }

  .metric-card strong {
    font-size: 1.55rem;
  }
}

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

  .metric-label {
    min-height: auto;
  }

  .holdings-panel th {
    white-space: normal;
  }

  .holdings-panel th,
  .holdings-panel td {
    padding-inline: 4px;
    font-size: 0.62rem;
  }
}

@media (max-width: 640px) and (max-height: 650px) {
  .login-access {
    align-items: flex-start;
    padding-block: 18px;
  }

  .login-access-brand {
    margin-bottom: 20px;
  }

  .login-mark {
    width: 52px;
    height: 52px;
  }

  .login-card h2 {
    margin-bottom: 5px;
    font-size: 1.85rem;
  }

  .login-card form {
    margin-top: 20px;
  }

  .login-card input:not([type="hidden"]) {
    height: 44px;
    margin-bottom: 11px;
  }

  .primary-button {
    height: 48px;
  }

  .login-footnote {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
