@import url("/ui-icons.css");

:root {
  --ink: #f5f2e9;
  --muted: #8e9187;
  --quiet: #5e625b;
  --gold: #d7b96c;
  --gold-soft: #f0d991;
  --gold-deep: #75602d;
  --green: #77d39c;
  --red: #ef8e82;
  --blue: #85aef7;
  --surface: rgba(15, 17, 14, 0.82);
  --surface-strong: #121410;
  --surface-soft: rgba(25, 28, 23, 0.72);
  --line: rgba(232, 224, 195, 0.1);
  --line-bright: rgba(225, 199, 119, 0.24);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  font-family: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #070806;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 8%, rgba(143, 119, 48, 0.08), transparent 32%),
    radial-gradient(circle at 38% 104%, rgba(56, 84, 58, 0.08), transparent 34%),
    #070806;
}

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

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

.ambient-field,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-field {
  z-index: 0;
  opacity: 0.68;
}

.noise {
  z-index: 20;
  opacity: 0.022;
  background:
    repeating-radial-gradient(circle at 17% 29%, #fff 0 0.35px, transparent 0.7px 4px),
    repeating-radial-gradient(circle at 71% 63%, #fff 0 0.3px, transparent 0.65px 5px);
  background-size: 9px 11px, 13px 15px;
  mix-blend-mode: soft-light;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100vh;
}

.side-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 27px 18px 19px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(15, 17, 14, 0.94), rgba(8, 10, 8, 0.96)),
    #0a0b09;
  backdrop-filter: blur(30px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 25px;
  color: inherit;
  text-decoration: none;
}

.brand-sigil {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(140, 227, 210, 0.22);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(140, 227, 210, 0.08), rgba(215, 185, 108, 0.025)), #090c0a;
  box-shadow: inset 0 0 20px rgba(140, 227, 210, 0.035);
}

.brand-sigil::before {
  position: absolute;
  top: 9px;
  right: 7px;
  left: 7px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-soft), #8ce3d2);
  box-shadow: 0 0 8px rgba(140, 227, 210, 0.32);
  content: "";
}

.sigil-axis {
  position: absolute;
  top: 9px;
  bottom: 7px;
  left: 50%;
  width: 1px;
  background: linear-gradient(var(--gold-soft), rgba(140, 227, 210, 0.16));
}

.sigil-core {
  position: absolute;
  top: 7px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff3c4;
  box-shadow: 0 0 9px rgba(240, 217, 145, 0.68);
  animation: core-breathe 4.2s ease-in-out infinite;
}

.sigil-orbit {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 0;
  transform: none;
}

.sigil-orbit-one { top: 17px; left: 7px; border-bottom: 1px solid var(--gold-soft); border-left: 1px solid var(--gold-soft); }
.sigil-orbit-two { right: 7px; bottom: 7px; border-top: 1px solid #8ce3d2; border-right: 1px solid #8ce3d2; opacity: .8; }

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 19px;
  letter-spacing: 0.22em;
}

.brand-copy small {
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  width: 0;
}

.nav-label {
  margin: 20px 12px 8px;
  color: #55594f;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #80857a;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.nav-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  content: "";
  background: var(--gold-soft);
  box-shadow: 0 0 14px rgba(240, 217, 145, 0.8);
  opacity: 0;
}

.nav-item:hover {
  color: #b9baaf;
  background: rgba(255, 255, 255, 0.025);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--ink);
  border-color: rgba(215, 185, 108, 0.1);
  background:
    linear-gradient(90deg, rgba(215, 185, 108, 0.11), rgba(215, 185, 108, 0.025)),
    rgba(255, 255, 255, 0.015);
}

.nav-item.is-active::before {
  opacity: 1;
}

.nav-icon {
  color: #787b73;
  font-family: "DM Mono", monospace;
  font-size: 16px;
}

.nav-item.is-active .nav-icon {
  color: var(--gold-soft);
  text-shadow: 0 0 12px rgba(240, 217, 145, 0.45);
}

.nav-availability {
  padding: 3px 5px;
  border: 1px solid rgba(215, 185, 108, 0.12);
  border-radius: 999px;
  color: #77776e;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-item[aria-disabled="true"] {
  color: #686c63;
}

.nav-signal {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 10px rgba(240, 217, 145, 0.65);
}

.rail-footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.connection-card,
.user-card {
  display: grid;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  text-align: left;
}

.connection-card {
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  padding: 13px 12px;
  border-radius: var(--radius-md);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.connection-card:hover {
  border-color: var(--line-bright);
  background: rgba(215, 185, 108, 0.05);
  transform: translateY(-2px);
}

.connection-card strong,
.user-card strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.connection-card small,
.user-card small {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 9px;
}

.connection-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(215, 185, 108, 0.6);
}

.connection-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(215, 185, 108, 0.38);
  border-radius: 50%;
  content: "";
  animation: pulse-ring 2.3s ease-out infinite;
}

.user-card {
  grid-template-columns: 33px 1fr auto;
  gap: 9px;
  padding: 9px;
  border-radius: var(--radius-md);
}

.workspace-user {
  position: relative;
  min-width: 0;
}

.user-card[aria-expanded="true"] {
  border-color: rgba(215, 185, 108, 0.2);
  background: rgba(215, 185, 108, 0.045);
}

.workspace-menu {
  position: absolute;
  z-index: 30;
  inset: auto 0 calc(100% + 8px);
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(215, 185, 108, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(215, 185, 108, 0.05), transparent 55%),
    rgba(12, 14, 11, 0.98);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.workspace-menu[hidden] {
  display: none;
}

.workspace-menu > span {
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-menu > strong {
  max-width: 100%;
  margin-bottom: 7px;
  overflow: hidden;
  color: #c7c9bf;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-menu a,
.workspace-menu button {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #9ea198;
  background: rgba(255, 255, 255, 0.018);
  font-family: inherit;
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.workspace-menu a:hover,
.workspace-menu button:hover {
  border-color: rgba(215, 185, 108, 0.22);
  color: var(--ink);
  background: rgba(215, 185, 108, 0.05);
}

.workspace-menu button {
  color: #cfa59d;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid rgba(215, 185, 108, 0.24);
  border-radius: 9px;
  color: var(--gold-soft);
  background: linear-gradient(145deg, rgba(215, 185, 108, 0.15), rgba(215, 185, 108, 0.03));
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.more-dot {
  color: var(--quiet);
  font-size: 9px;
  letter-spacing: 1px;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.top-bar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 31px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 7, 0.73);
  backdrop-filter: blur(24px);
}

.mobile-menu {
  display: none;
}

.breadcrumb,
.top-actions,
.date-control {
  display: flex;
  align-items: center;
}

.breadcrumb {
  gap: 10px;
  color: var(--quiet);
  font-size: 11px;
}

.breadcrumb strong {
  color: #b4b6ad;
  font-weight: 500;
}

.breadcrumb-line {
  width: 18px;
  height: 1px;
  background: #3c3f38;
}

.top-actions {
  gap: 9px;
}

.concept-badge,
.demo-chip {
  border: 1px solid rgba(133, 174, 247, 0.2);
  border-radius: 999px;
  color: #9bb6e6;
  background: rgba(73, 106, 160, 0.08);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.concept-badge {
  padding: 7px 10px;
}

.date-control,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #9a9d94;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.date-control {
  gap: 8px;
  padding: 0 11px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.date-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(215, 185, 108, 0.55);
}

.icon-button {
  position: relative;
  display: grid;
  width: 34px;
  place-items: center;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}

.workspace-scroll {
  min-height: 0;
  padding: 35px 31px 48px;
  overflow: auto;
  scrollbar-color: #383b34 transparent;
  scrollbar-width: thin;
}

.command-intro {
  display: flex;
  max-width: 1500px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto 27px;
}

.eyebrow,
.panel-kicker {
  color: #6f7369;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
}

.eyebrow span {
  width: 18px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(215, 185, 108, 0.35);
}

.command-intro h1 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.command-intro h1 span {
  color: var(--gold-soft);
}

.intro-copy {
  max-width: 650px;
  margin: 12px 0 0;
  color: #777b72;
  font-size: 12px;
  line-height: 1.7;
}

.intro-copy strong {
  color: #c8c9bf;
  font-weight: 500;
}

.intro-actions {
  display: flex;
  gap: 9px;
}

.ghost-action,
.primary-action,
.secondary-action,
.text-action,
.quiet-button {
  border: 0;
  cursor: pointer;
}

.ghost-action,
.primary-action {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.ghost-action {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: #9ca098;
  background: rgba(255, 255, 255, 0.018);
}

.primary-action {
  position: relative;
  padding: 0 16px;
  overflow: hidden;
  color: #17150e;
  background: linear-gradient(135deg, #f0d991, #b9994f);
  box-shadow: 0 9px 30px rgba(176, 140, 59, 0.12);
}

.primary-action::after {
  position: absolute;
  top: -120%;
  left: -20%;
  width: 30px;
  height: 300%;
  content: "";
  background: rgba(255, 255, 255, 0.28);
  filter: blur(5px);
  transform: rotate(25deg);
  transition: left 500ms ease;
}

.primary-action:hover::after {
  left: 120%;
}

.action-pulse {
  width: 6px;
  height: 6px;
  border: 1px solid #3d3319;
  border-radius: 50%;
  background: #675220;
  box-shadow: 0 0 0 3px rgba(55, 46, 23, 0.1);
}

.account-ribbon {
  position: relative;
  display: grid;
  max-width: 1500px;
  grid-template-columns: minmax(235px, 1.5fr) repeat(3, minmax(115px, 0.72fr)) minmax(165px, 0.8fr) 28px;
  align-items: center;
  margin: 0 auto 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(100deg, rgba(215, 185, 108, 0.055), transparent 23%),
    rgba(16, 18, 15, 0.82);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.18);
}

.account-ribbon::after {
  position: absolute;
  top: 0;
  left: -22%;
  width: 15%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  animation: ribbon-scan 7s ease-in-out infinite;
}

.account-identity,
.account-stat,
.sync-state {
  min-width: 0;
  padding: 16px 18px;
}

.account-stat,
.sync-state {
  border-left: 1px solid var(--line);
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.broker-mark {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(133, 174, 247, 0.26);
  border-radius: 10px;
  color: #a8c6ff;
  background: linear-gradient(145deg, rgba(75, 110, 171, 0.18), rgba(50, 65, 93, 0.05));
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.account-picker {
  min-width: 0;
}

.account-picker label {
  display: block;
  margin-bottom: 3px;
  color: var(--quiet);
  font: 7px "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-picker select {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 0 19px 0 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font: 600 11px "Manrope", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-picker select:focus-visible {
  color: var(--gold-soft);
}

.account-picker option {
  color: var(--paper);
  background: #11130f;
}

.account-identity p {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-picker > span,
.account-stat span,
.sync-state small {
  display: block;
  overflow: hidden;
  color: var(--quiet);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat strong {
  display: block;
  margin-top: 5px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-state strong {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
}

.sync-radar {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(119, 211, 156, 0.28);
  border-radius: 50%;
}

.sync-radar::before,
.sync-radar::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.sync-radar::before {
  inset: 7px;
  background: var(--green);
  box-shadow: 0 0 9px rgba(119, 211, 156, 0.62);
}

.sync-radar::after {
  inset: -1px;
  border-top: 1px solid var(--green);
  animation: spin 2.6s linear infinite;
}

.account-menu {
  border: 0;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 1px;
}

.command-grid {
  display: grid;
  max-width: 1500px;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.72fr) minmax(250px, 0.72fr);
  gap: 15px;
  margin: 0 auto;
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 45%),
    var(--surface);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(18px);
  transition:
    border-color 250ms ease,
    transform 250ms ease,
    box-shadow 250ms ease;
}

.panel::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  background: radial-gradient(
    380px circle at var(--pointer-x, 50%) var(--pointer-y, 50%),
    rgba(215, 185, 108, 0.055),
    transparent 47%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.panel:hover {
  border-color: rgba(225, 199, 119, 0.16);
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.panel:hover::before {
  opacity: 1;
}

.performance-panel {
  min-height: 422px;
  grid-column: span 2;
  padding: 23px 24px 18px;
}

.intelligence-panel {
  min-height: 422px;
  padding: 23px 22px;
}

.consistency-panel,
.risk-panel {
  min-height: 294px;
  padding: 22px;
}

.executions-panel {
  min-height: 350px;
  grid-column: span 2;
  padding: 22px 22px 10px;
}

.sync-panel {
  min-height: 350px;
  padding: 22px;
}

.calendar-preview-panel {
  min-height: 290px;
  grid-column: 1 / -1;
  padding: 22px;
}

.calendar-preview-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, 0.42fr) minmax(420px, 1.58fr);
  align-items: center;
  gap: 34px;
  min-height: 215px;
  margin-top: 13px;
}

.calendar-preview-copy > span,
.calendar-preview-copy > small { display: block; color: var(--quiet); font-size: 8px; }
.calendar-preview-copy > strong { display: block; margin: 10px 0 8px; color: var(--gold-soft); font-family: "DM Mono", monospace; font-size: 24px; font-weight: 400; }
.calendar-preview-ledgers { display: grid; gap: 6px; margin-top: 19px; }
.calendar-preview-ledgers span { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid rgba(215, 185, 108, 0.08); border-radius: 8px; color: #70766d; background: rgba(255, 255, 255, 0.012); font-family: "DM Mono", monospace; font-size: 7px; }
.calendar-preview-ledgers strong { color: #c9c6bb; font-weight: 400; }
.calendar-preview-map { min-width: 0; padding: 13px; border: 1px solid rgba(215, 185, 108, 0.08); border-radius: 13px; background: rgba(0, 0, 0, 0.13); }
.calendar-preview-weekdays,
.calendar-preview-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-preview-weekdays span { padding: 0 2px 6px; color: #555b53; font-family: "DM Mono", monospace; font-size: 6px; text-align: center; }
.calendar-preview-day { position: relative; min-height: 25px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.035); border-radius: 5px; background: rgba(255, 255, 255, 0.012); }
.calendar-preview-day::after { position: absolute; inset: 0; content: ""; opacity: calc(0.08 + var(--calendar-intensity, 0) * 0.055); background: var(--calendar-tone, transparent); }
.calendar-preview-day.is-positive { --calendar-tone: #77d39c; }
.calendar-preview-day.is-negative { --calendar-tone: #db8589; }
.calendar-preview-day.is-mixed { --calendar-tone: #9e8bd5; }
.calendar-preview-day.is-flat { --calendar-tone: #d7b96c; }

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-kicker {
  margin: 0 0 7px;
}

.panel h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.period-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.15);
}

.period-switcher button {
  min-width: 35px;
  height: 25px;
  border: 0;
  border-radius: 6px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.period-switcher button.is-active {
  color: var(--gold-soft);
  background: rgba(215, 185, 108, 0.1);
  box-shadow: inset 0 0 0 1px rgba(215, 185, 108, 0.08);
}

.performance-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 24px;
  margin-top: 25px;
}

.performance-summary > div:not(:first-child) {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.performance-summary span,
.performance-summary small {
  display: block;
  color: var(--quiet);
  font-size: 9px;
}

.performance-summary strong {
  display: block;
  margin: 7px 0;
  font-family: "DM Mono", monospace;
  font-size: 20px;
  font-weight: 400;
}

.performance-summary > div:first-child strong {
  color: var(--green);
  font-size: 27px;
}

.performance-summary small {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trend-chip {
  display: inline-flex !important;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--green) !important;
  background: rgba(119, 211, 156, 0.08);
  font-family: "DM Mono", monospace;
  font-size: 7px !important;
}

.chart-wrap {
  position: relative;
  height: 238px;
  margin-top: 9px;
  margin-left: 39px;
}

.chart-wrap::before {
  position: absolute;
  inset: 18px 0 21px;
  content: "";
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 48px,
    rgba(255, 255, 255, 0.045) 49px,
    transparent 50px
  );
}

.chart-y-axis {
  position: absolute;
  top: 15px;
  right: calc(100% + 9px);
  bottom: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #4f534b;
  font-family: "DM Mono", monospace;
  font-size: 7px;
}

#equity-chart {
  position: relative;
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  top: 42px;
  left: 65%;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid rgba(215, 185, 108, 0.18);
  border-radius: 8px;
  background: rgba(11, 12, 10, 0.92);
  box-shadow: var(--shadow);
  font-family: "DM Mono", monospace;
  pointer-events: none;
  transform: translateX(-50%);
}

.chart-tooltip::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 76px;
  content: "";
  background: linear-gradient(rgba(215, 185, 108, 0.32), transparent);
}

.chart-tooltip span,
.chart-tooltip small {
  color: var(--quiet);
  font-size: 7px;
}

.chart-tooltip strong {
  color: var(--green);
  font-size: 9px;
  font-weight: 400;
}

.intelligence-state,
.risk-state,
.demo-chip {
  display: inline-flex;
  align-items: center;
}

.intelligence-state {
  gap: 6px;
  color: var(--gold);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.intelligence-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(215, 185, 108, 0.75);
  animation: core-breathe 1.8s ease-in-out infinite;
}

.intelligence-core {
  position: relative;
  display: grid;
  width: 106px;
  height: 106px;
  margin: 24px auto 16px;
  place-items: center;
}

.core-ring {
  position: absolute;
  border: 1px solid rgba(215, 185, 108, 0.22);
  border-radius: 45% 55% 51% 49%;
}

.core-ring-one {
  inset: 11px;
  animation: spin 18s linear infinite;
}

.core-ring-two {
  inset: 2px 20px;
  border-color: rgba(119, 211, 156, 0.16);
  transform: rotate(58deg);
  animation: reverse-spin 13s linear infinite;
}

.core-ring-three {
  inset: 25px 5px;
  transform: rotate(-42deg);
  animation: spin 22s linear infinite;
}

.core-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(240, 217, 145, 0.26);
  border-radius: 50%;
  color: var(--gold-soft);
  background: radial-gradient(circle, rgba(215, 185, 108, 0.18), rgba(215, 185, 108, 0.02));
  box-shadow:
    0 0 32px rgba(215, 185, 108, 0.13),
    inset 0 0 18px rgba(215, 185, 108, 0.08);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
}

.intelligence-copy {
  color: #a6a99f;
  font-size: 10px;
  line-height: 1.75;
}

.briefing-factors {
  display: grid;
  gap: 7px;
  margin: 16px 0 18px;
}

.briefing-factors span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6f736a;
  font-size: 8px;
}

.briefing-factors i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.factor-positive {
  background: var(--green);
  box-shadow: 0 0 7px rgba(119, 211, 156, 0.45);
}

.factor-neutral {
  background: var(--blue);
}

.factor-warning {
  background: var(--gold);
}

.text-action {
  padding: 0;
  color: var(--gold);
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-align: left;
}

.text-action span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 180ms ease;
}

.text-action:hover span {
  transform: translateX(3px);
}

.consistency-panel {
  grid-column: span 2;
}

.quiet-button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--quiet);
  background: rgba(255, 255, 255, 0.015);
}

.consistency-body {
  display: grid;
  grid-template-columns: minmax(155px, 0.7fr) minmax(180px, 1.3fr);
  align-items: center;
  gap: 28px;
  height: 210px;
}

.consistency-orbit {
  position: relative;
  display: grid;
  place-items: center;
}

.score-ring {
  --angle: calc(var(--score) * 3.6deg);
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #10120e 58%, transparent 59%),
    conic-gradient(var(--gold-soft) var(--angle), rgba(255, 255, 255, 0.06) 0);
  box-shadow:
    0 0 28px rgba(215, 185, 108, 0.06),
    inset 0 0 28px rgba(0, 0, 0, 0.35);
}

.score-ring::after {
  position: absolute;
  width: 98px;
  height: 98px;
  border: 1px solid rgba(215, 185, 108, 0.1);
  border-radius: 50%;
  content: "";
}

.score-ring span {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: "DM Mono", monospace;
}

.score-ring strong {
  font-size: 28px;
  font-weight: 300;
}

.score-ring small {
  color: var(--quiet);
  font-size: 8px;
}

.score-satellite {
  position: absolute;
  width: 148px;
  height: 148px;
  border: 1px dashed rgba(215, 185, 108, 0.08);
  border-radius: 50%;
  animation: spin 35s linear infinite;
}

.score-satellite::before {
  position: absolute;
  top: 18px;
  left: 15px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 8px rgba(215, 185, 108, 0.65);
}

.consistency-breakdown {
  display: grid;
  gap: 18px;
}

.consistency-breakdown > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.consistency-breakdown span,
.consistency-breakdown strong {
  font-size: 9px;
}

.consistency-breakdown span {
  color: #777b72;
}

.consistency-breakdown strong {
  font-family: "DM Mono", monospace;
  font-weight: 400;
}

.consistency-breakdown i {
  display: block;
  height: 3px;
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.consistency-breakdown b {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 10px rgba(215, 185, 108, 0.2);
  animation: reveal-bar 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.risk-state {
  padding: 5px 7px;
  border: 1px solid rgba(119, 211, 156, 0.17);
  border-radius: 6px;
  color: var(--green);
  background: rgba(119, 211, 156, 0.06);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  text-transform: uppercase;
}

.risk-total {
  margin-top: 34px;
}

.risk-total span,
.risk-total small {
  display: block;
  color: var(--quiet);
  font-size: 8px;
}

.risk-total strong {
  display: block;
  margin: 7px 0 5px;
  font-family: "DM Mono", monospace;
  font-size: 28px;
  font-weight: 300;
}

.risk-track {
  position: relative;
  height: 4px;
  margin: 24px 0 23px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(119, 211, 156, 0.15), rgba(215, 185, 108, 0.12), rgba(239, 142, 130, 0.12));
}

.risk-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 28%;
  border-radius: inherit;
  background: var(--green);
  box-shadow: 0 0 12px rgba(119, 211, 156, 0.35);
  animation: reveal-bar 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.risk-fill::after {
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 8px;
  border: 2px solid #192119;
  border-radius: 50%;
  content: "";
  background: var(--green);
  transform: translateY(-50%);
}

.risk-threshold {
  position: absolute;
  top: -4px;
  right: 0;
  width: 1px;
  height: 12px;
  background: rgba(239, 142, 130, 0.58);
}

.risk-threshold i {
  position: absolute;
  top: 15px;
  right: 0;
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 6px;
  font-style: normal;
  transform: translateX(50%);
}

.risk-positions {
  display: grid;
  gap: 9px;
}

.risk-positions div {
  display: flex;
  justify-content: space-between;
  color: #7c8076;
  font-size: 8px;
}

.risk-positions span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.risk-positions strong {
  color: #b4b6ad;
  font-family: "DM Mono", monospace;
  font-weight: 400;
}

.market-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.market-dot.gold {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(215, 185, 108, 0.55);
}

.market-dot.blue {
  background: var(--blue);
  box-shadow: 0 0 6px rgba(133, 174, 247, 0.45);
}

.execution-table {
  display: grid;
  margin-top: 18px;
}

.execution-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(90px, 0.8fr) minmax(100px, 0.85fr) minmax(65px, 0.45fr) minmax(90px, 0.72fr);
  align-items: center;
  min-height: 67px;
  padding: 0 10px;
  border: 0;
  border-top: 1px solid var(--line);
  color: #9da098;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, transform 180ms ease;
}

button.execution-row:hover {
  background: rgba(215, 185, 108, 0.028);
  transform: translateX(2px);
}

.execution-row span {
  font-size: 9px;
}

.execution-row small {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 7px;
}

.execution-row.table-labels {
  min-height: 29px;
  border-top: 0;
  color: #555950;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.execution-row.table-labels span {
  font-size: 7px;
}

.instrument {
  display: flex;
  align-items: center;
  gap: 10px;
}

.instrument > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(215, 185, 108, 0.04);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-style: normal;
}

.instrument b {
  font-size: 9px;
  font-weight: 600;
}

.quality-a,
.quality-b {
  display: grid;
  width: 27px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-style: normal;
}

.quality-a {
  border: 1px solid rgba(119, 211, 156, 0.17);
  color: var(--green);
  background: rgba(119, 211, 156, 0.06);
}

.quality-b {
  border: 1px solid rgba(215, 185, 108, 0.17);
  color: var(--gold);
  background: rgba(215, 185, 108, 0.06);
}

.source-chip {
  display: inline-flex;
  max-width: max-content;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(119, 211, 156, 0.12);
  border-radius: 6px;
  color: #84b497;
  background: rgba(119, 211, 156, 0.04);
  font-family: "DM Mono", monospace;
  font-size: 7px !important;
}

.source-chip i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(119, 211, 156, 0.5);
}

.source-chip.imported {
  border-color: rgba(133, 174, 247, 0.12);
  color: #849ec9;
  background: rgba(133, 174, 247, 0.04);
}

.source-chip.imported i {
  background: var(--blue);
}

.compact {
  align-self: center;
}

.demo-chip {
  padding: 5px 7px;
}

.sync-visual {
  display: grid;
  grid-template-columns: 55px 1fr 62px;
  align-items: center;
  margin: 28px 0 24px;
}

.sync-source,
.sync-destination {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.sync-source small,
.sync-destination small {
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 6px;
  text-align: center;
}

.compact-mark {
  width: 33px;
  height: 33px;
  font-size: 8px;
}

.sync-destination > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(215, 185, 108, 0.22);
  border-radius: 50%;
  color: var(--gold-soft);
  background: radial-gradient(circle, rgba(215, 185, 108, 0.13), transparent);
  box-shadow: 0 0 18px rgba(215, 185, 108, 0.08);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11px;
}

.sync-path {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, rgba(133, 174, 247, 0.2), rgba(215, 185, 108, 0.35));
}

.sync-path span {
  position: absolute;
  top: -1px;
  left: 0;
  width: 25px;
  height: 3px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  filter: blur(1px);
  animation: data-travel 2.5s linear infinite;
}

.sync-path i {
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #474b43;
}

.sync-path i:nth-of-type(1) {
  left: 25%;
}

.sync-path i:nth-of-type(2) {
  left: 52%;
}

.sync-path i:nth-of-type(3) {
  left: 78%;
}

.sync-events {
  display: grid;
  gap: 12px;
}

.sync-events > div {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: start;
  gap: 8px;
}

.sync-events > div > span {
  width: 5px;
  height: 5px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(119, 211, 156, 0.45);
}

.sync-events p {
  margin: 0;
}

.sync-events strong,
.sync-events small {
  display: block;
  font-size: 8px;
}

.sync-events small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 7px;
}

.sync-events time {
  color: #4f534b;
  font-family: "DM Mono", monospace;
  font-size: 7px;
}

.secondary-action {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 21px;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(215, 185, 108, 0.04);
  font-size: 8px;
}

.connect-dialog {
  width: min(590px, calc(100% - 30px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(225, 199, 119, 0.18);
  border-radius: 25px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(215, 185, 108, 0.05), transparent 35%),
    #10120f;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
}

.connect-dialog::backdrop {
  background: rgba(4, 5, 4, 0.77);
  backdrop-filter: blur(12px);
}

.dialog-glow {
  position: absolute;
  top: -150px;
  left: 38%;
  width: 300px;
  height: 220px;
  border-radius: 50%;
  background: rgba(215, 185, 108, 0.12);
  filter: blur(80px);
  pointer-events: none;
}

.dialog-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 27px 28px 19px;
}

.dialog-head h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.dialog-head p:not(.panel-kicker) {
  max-width: 430px;
  margin: 10px 0 0;
  color: #777b72;
  font-size: 10px;
  line-height: 1.65;
}

.dialog-close {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--quiet);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 17px;
}

.connection-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 28px;
}

.provider-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr 14px;
  align-items: center;
  gap: 10px;
  min-height: 67px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.014);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.provider-option:hover {
  border-color: rgba(215, 185, 108, 0.15);
  transform: translateY(-2px);
}

.provider-option.is-selected {
  border-color: rgba(215, 185, 108, 0.31);
  background: rgba(215, 185, 108, 0.055);
  box-shadow: inset 0 0 30px rgba(215, 185, 108, 0.02);
}

.provider-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(133, 174, 247, 0.18);
  border-radius: 10px;
  color: #a6bfe9;
  background: rgba(133, 174, 247, 0.055);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.provider-option strong,
.provider-option small {
  display: block;
}

.provider-option strong {
  font-size: 9px;
}

.provider-option small {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 7px;
}

.provider-option i {
  width: 7px;
  height: 7px;
  border: 1px solid #54584f;
  border-radius: 50%;
}

.provider-option.is-selected i {
  border-color: var(--gold-soft);
  background: var(--gold);
  box-shadow: 0 0 8px rgba(215, 185, 108, 0.45);
}

.dialog-security {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 18px 28px;
  padding: 12px 13px;
  border: 1px solid rgba(119, 211, 156, 0.1);
  border-radius: 11px;
  color: var(--green);
  background: rgba(119, 211, 156, 0.035);
}

.dialog-security p {
  margin: 0;
}

.dialog-security strong,
.dialog-security small {
  display: block;
}

.dialog-security strong {
  font-size: 8px;
}

.dialog-security small {
  margin-top: 3px;
  color: #61776a;
  font-size: 7px;
}

.dialog-action {
  width: calc(100% - 56px);
  justify-content: center;
  margin: 0 28px 27px;
}

.mt5-dialog {
  width: min(900px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(225, 199, 119, 0.2);
  border-radius: 25px;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 8%, rgba(111, 143, 211, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(215, 185, 108, 0.05), transparent 34%),
    #10120f;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.76);
  scrollbar-color: #3e423a transparent;
  scrollbar-width: thin;
}

.mt5-dialog::backdrop {
  background: rgba(4, 5, 4, 0.82);
  backdrop-filter: blur(14px);
}

.mt5-dialog-head {
  padding-bottom: 17px;
}

.mt5-safety-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}

.mt5-safety-rail span {
  display: flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #7eb393;
  background: #111410;
  font: 7px "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mt5-safety-rail i {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid rgba(119, 211, 156, 0.2);
  border-radius: 50%;
  font-style: normal;
}

.mt5-safety-rail .is-blocked {
  color: #695f5b;
}

.mt5-safety-rail .is-blocked i {
  border-color: rgba(176, 117, 102, 0.18);
}

.mt5-setup-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 11px;
  padding: 18px 28px 0;
}

.mt5-provision-card,
.mt5-install-card,
.mt5-credentials {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.13);
}

.mt5-provision-card,
.mt5-install-card {
  padding: 18px;
}

.mt5-provision-card::after,
.mt5-install-card::after {
  position: absolute;
  top: 0;
  left: -28%;
  width: 22%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  animation: ribbon-scan 8s ease-in-out infinite;
}

.mt5-install-card::after {
  animation-delay: -3s;
}

.mt5-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mt5-step-heading > span {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(215, 185, 108, 0.22);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(215, 185, 108, 0.045);
  font: 7px "DM Mono", monospace;
}

.mt5-step-heading h3,
.mt5-credentials-head h3 {
  margin: 4px 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.mt5-name-field {
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.mt5-name-field > span,
.mt5-credential-grid label > span {
  color: #6f7369;
  font: 7px "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mt5-name-field input {
  width: 100%;
  min-height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: #c4c6bd;
  background: rgba(0, 0, 0, 0.18);
  font: 9px "DM Mono", monospace;
}

.mt5-name-field input:focus {
  border-color: rgba(215, 185, 108, 0.33);
  box-shadow: 0 0 0 3px rgba(215, 185, 108, 0.035);
}

.mt5-create-key {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.mt5-provision-message {
  min-height: 27px;
  margin: 10px 1px 0;
  color: #666b61;
  font-size: 7px;
  line-height: 1.6;
}

.mt5-provision-message[data-tone="attention"] {
  color: #aa9665;
}

.mt5-provision-message[data-tone="success"] {
  color: #78af8e;
}

.mt5-provision-message[data-tone="error"] {
  color: #bd7868;
}

.mt5-install-list {
  display: grid;
  gap: 9px;
  margin: 18px 0 14px;
  padding: 0;
  list-style: none;
}

.mt5-install-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  color: #74786f;
  font-size: 8px;
  line-height: 1.45;
}

.mt5-install-list i {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #33372f;
  border-radius: 6px;
  color: #8b8e84;
  font: normal 7px "DM Mono", monospace;
}

.mt5-install-list strong {
  color: #a4a79e;
  font-family: "DM Mono", monospace;
  font-size: 7px;
}

.mt5-download {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 11px;
  border: 1px solid rgba(133, 174, 247, 0.14);
  border-radius: 10px;
  color: inherit;
  background: rgba(133, 174, 247, 0.03);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

.mt5-download:hover {
  border-color: rgba(133, 174, 247, 0.3);
  transform: translateY(-1px);
}

.mt5-file-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(133, 174, 247, 0.18);
  border-radius: 9px;
  color: #a6bfe9;
  background: rgba(133, 174, 247, 0.05);
  font: 7px "DM Mono", monospace;
}

.mt5-download strong,
.mt5-download small {
  display: block;
}

.mt5-download strong {
  font-size: 8px;
}

.mt5-download small {
  margin-top: 4px;
  color: #666b62;
  font-size: 7px;
}

.mt5-download > i {
  color: #8b9fc1;
  font-style: normal;
}

.mt5-source-download {
  display: inline-flex;
  margin-top: 12px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 180ms ease;
}

.mt5-source-download:hover {
  color: var(--gold-soft);
}

.execution-empty {
  padding: 32px 20px;
  border: 1px dashed rgba(240, 217, 145, 0.12);
  border-radius: 12px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  text-align: center;
}

.connection-manager {
  width: min(820px, calc(100vw - 32px));
}

.connection-manager-list {
  display: grid;
  gap: 12px;
  max-height: min(54vh, 520px);
  padding: 6px 30px 24px;
  overflow: auto;
}

.connection-manager-empty {
  padding: 34px 20px;
  border: 1px dashed rgba(240, 217, 145, 0.12);
  border-radius: 14px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.managed-connection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(240, 217, 145, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 185, 108, 0.07), transparent 34%),
    rgba(10, 12, 10, 0.76);
}

.managed-connection-main {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
}

.managed-connection-main .broker-mark {
  flex: 0 0 auto;
}

.managed-connection-copy {
  min-width: 0;
}

.managed-connection-copy strong,
.managed-connection-copy small {
  display: block;
}

.managed-connection-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-connection-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.managed-connection-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 9px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.managed-connection-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #777b70;
  content: "";
}

.managed-connection-status[data-state="active"] {
  color: var(--green);
}

.managed-connection-status[data-state="active"]::before {
  background: var(--green);
  box-shadow: 0 0 10px rgba(119, 211, 156, 0.55);
}

.managed-connection-status[data-state="attention"] {
  color: var(--gold);
}

.managed-connection-status[data-state="attention"]::before {
  background: var(--gold);
}

.managed-connection-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.managed-connection-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(240, 217, 145, 0.13);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.managed-connection-actions button:hover {
  border-color: rgba(240, 217, 145, 0.28);
  color: var(--gold-soft);
}

.managed-connection-actions button[data-action="disconnect"] {
  color: #d9958f;
}

.connection-manager-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px 26px;
  border-top: 1px solid rgba(240, 217, 145, 0.08);
}

.connection-manager-footer p {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .managed-connection {
    grid-template-columns: 1fr;
  }

  .managed-connection-actions {
    justify-content: flex-start;
  }

  .connection-manager-list {
    padding-inline: 18px;
  }

  .connection-manager-footer {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 18px;
  }
}

.mt5-credentials {
  margin: 11px 28px 0;
  padding: 18px;
  border-color: rgba(119, 211, 156, 0.13);
  background:
    radial-gradient(circle at 82% 18%, rgba(119, 211, 156, 0.055), transparent 26%),
    rgba(0, 0, 0, 0.14);
  animation: import-step-enter 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mt5-credentials-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mt5-credentials-head > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #788073;
  font: 7px "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mt5-credentials-head > span b {
  font: inherit;
}

.mt5-credentials-head > span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 185, 108, 0.06), 0 0 11px rgba(215, 185, 108, 0.25);
  animation: connection-breathe 2.4s ease-in-out infinite;
}

.mt5-credentials-head > span[data-state="active"] {
  color: #79b08f;
}

.mt5-credentials-head > span[data-state="active"] i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(119, 211, 156, 0.07), 0 0 13px rgba(119, 211, 156, 0.34);
}

.mt5-credentials-head > span[data-state="attention"] {
  color: #aa9665;
}

.mt5-credentials-head > span[data-state="error"] {
  color: #bd7868;
}

.mt5-credential-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 9px;
  margin-top: 15px;
}

.mt5-credential-grid label {
  display: grid;
  gap: 7px;
}

.mt5-credential-grid .mt5-endpoint-field {
  grid-column: 1 / -1;
}

.mt5-credential-grid label > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.mt5-credential-grid code {
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  color: #b7b9b1;
  font: 8px "DM Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt5-credential-grid button {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 12px;
  color: var(--gold-soft);
  background: rgba(215, 185, 108, 0.035);
  cursor: pointer;
  font: 7px "DM Mono", monospace;
}

.mt5-secret-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #a98f55;
}

.mt5-secret-warning p {
  margin: 0;
}

.mt5-secret-warning strong,
.mt5-secret-warning small {
  display: block;
}

.mt5-secret-warning strong {
  font-size: 8px;
}

.mt5-secret-warning small {
  margin-top: 3px;
  color: #6d6656;
  font-size: 7px;
}

.mt5-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px 24px;
}

.mt5-dialog-footer p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #5f635b;
  font: 7px "DM Mono", monospace;
}

.mt5-dialog-footer p > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(119, 211, 156, 0.36);
}

.import-dialog {
  width: min(920px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(225, 199, 119, 0.18);
  border-radius: 25px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(215, 185, 108, 0.045), transparent 33%),
    #10120f;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
  scrollbar-color: #3e423a transparent;
  scrollbar-width: thin;
}

.import-dialog::backdrop {
  background: rgba(4, 5, 4, 0.79);
  backdrop-filter: blur(12px);
}

.import-dialog-head {
  padding-bottom: 16px;
}

.import-progress {
  display: grid;
  grid-template-columns: auto minmax(35px, 1fr) auto minmax(35px, 1fr) auto;
  align-items: center;
  margin: 0 28px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.import-progress span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #555950;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.import-progress span i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #373a34;
  border-radius: 50%;
  font-size: 7px;
  font-style: normal;
  transition: border-color 200ms ease, background 200ms ease;
}

.import-progress span.is-active,
.import-progress span.is-complete {
  color: var(--gold-soft);
}

.import-progress span.is-active i {
  border-color: rgba(215, 185, 108, 0.4);
  background: rgba(215, 185, 108, 0.08);
  box-shadow: 0 0 14px rgba(215, 185, 108, 0.08);
}

.import-progress span.is-complete i {
  border-color: rgba(119, 211, 156, 0.3);
  color: var(--green);
  background: rgba(119, 211, 156, 0.06);
}

.import-progress b {
  height: 1px;
  margin: 0 12px;
  background: linear-gradient(90deg, rgba(215, 185, 108, 0.15), rgba(255, 255, 255, 0.035));
}

.import-step {
  display: none;
  padding: 24px 28px 2px;
}

.import-step.is-active {
  display: block;
  animation: import-step-enter 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.import-identity-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.65fr;
  gap: 10px;
  margin-bottom: 14px;
}

.import-identity-grid label {
  display: grid;
  gap: 7px;
}

.import-identity-grid label > span,
.mapping-field label {
  color: #6f7369;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.import-identity-grid input,
.import-identity-grid select,
.mapping-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #b4b7ae;
  background: rgba(0, 0, 0, 0.16);
  font: 9px "DM Mono", monospace;
}

.file-drop {
  position: relative;
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1px dashed rgba(215, 185, 108, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(215, 185, 108, 0.055), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0 69px, rgba(255, 255, 255, 0.018) 70px),
    repeating-linear-gradient(0deg, transparent 0 69px, rgba(255, 255, 255, 0.018) 70px);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.file-drop::after {
  position: absolute;
  top: 0;
  left: -30%;
  width: 18%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  animation: ribbon-scan 6s ease-in-out infinite;
}

.file-drop:hover,
.file-drop.is-dragging {
  border-color: rgba(240, 217, 145, 0.55);
  background:
    radial-gradient(circle at center, rgba(215, 185, 108, 0.09), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0 69px, rgba(255, 255, 255, 0.022) 70px),
    repeating-linear-gradient(0deg, transparent 0 69px, rgba(255, 255, 255, 0.022) 70px);
  transform: translateY(-2px);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-drop-orbit {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 4px;
  place-items: center;
  border: 1px solid rgba(215, 185, 108, 0.16);
  border-radius: 50%;
}

.file-drop-orbit::before,
.file-drop-orbit i {
  position: absolute;
  border: 1px solid rgba(215, 185, 108, 0.15);
  border-radius: 50%;
  content: "";
}

.file-drop-orbit::before {
  width: 82px;
  height: 27px;
  transform: rotate(27deg);
}

.file-drop-orbit i {
  width: 82px;
  height: 27px;
  transform: rotate(-27deg);
}

.file-drop-orbit b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(215, 185, 108, 0.08);
  box-shadow: 0 0 20px rgba(215, 185, 108, 0.08);
  font-size: 14px;
  font-weight: 400;
}

.file-drop strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.file-drop small {
  color: var(--quiet);
  font-size: 8px;
}

.file-drop em {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  color: var(--gold);
  background: rgba(215, 185, 108, 0.04);
  font-size: 8px;
  font-style: normal;
}

.import-privacy {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(119, 211, 156, 0.1);
  border-radius: 11px;
  color: var(--green);
  background: rgba(119, 211, 156, 0.025);
}

.import-privacy p {
  margin: 0;
}

.import-privacy strong,
.import-privacy small {
  display: block;
}

.import-privacy strong {
  font-size: 8px;
}

.import-privacy small {
  margin-top: 3px;
  color: #61776a;
  font-size: 7px;
}

.file-summary {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.015);
}

.file-type {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(119, 211, 156, 0.16);
  border-radius: 10px;
  color: var(--green);
  background: rgba(119, 211, 156, 0.045);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.file-summary p {
  margin: 0;
}

.file-summary strong,
.file-summary small {
  display: block;
}

.file-summary strong {
  font-size: 9px;
}

.file-summary small {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 7px;
}

.file-summary button {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #777b72;
  background: transparent;
  cursor: pointer;
  font-size: 7px;
}

.mapping-intro,
.mapping-preview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.mapping-intro {
  margin: 22px 0 12px;
}

.mapping-intro h3,
.mapping-preview h3,
.import-step[data-import-step="confirm"] h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.mapping-intro > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font: 7px "DM Mono", monospace;
}

.mapping-intro > span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(119, 211, 156, 0.5);
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.mapping-field {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.09);
}

.mapping-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mapping-field label em {
  color: var(--gold);
  font-size: 6px;
  font-style: normal;
}

.mapping-field select {
  min-height: 34px;
  padding-inline: 8px;
  border-radius: 7px;
}

.mapping-field.is-valid {
  border-color: rgba(119, 211, 156, 0.1);
}

.mapping-field.is-invalid {
  border-color: rgba(239, 142, 130, 0.22);
  background: rgba(239, 142, 130, 0.025);
}

.mapping-preview {
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mapping-preview-head > span {
  color: var(--quiet);
  font: 7px "DM Mono", monospace;
}

.preview-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-color: #3c4038 transparent;
  scrollbar-width: thin;
}

#import-preview-table {
  width: 100%;
  border-collapse: collapse;
  color: #858981;
  font-size: 7px;
  white-space: nowrap;
}

#import-preview-table th,
#import-preview-table td {
  max-width: 160px;
  padding: 9px 10px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-overflow: ellipsis;
}

#import-preview-table th {
  color: #666a61;
  background: rgba(255, 255, 255, 0.018);
  font-family: "DM Mono", monospace;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#import-preview-table tr:last-child td {
  border-bottom: 0;
}

#import-preview-table th:last-child,
#import-preview-table td:last-child {
  border-right: 0;
}

.import-step[data-import-step="confirm"] {
  min-height: 400px;
  padding-top: 34px;
  text-align: center;
}

.verify-core {
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  margin: 0 auto 21px;
  place-items: center;
}

.verify-core span,
.verify-core i {
  position: absolute;
  border: 1px solid rgba(119, 211, 156, 0.17);
  border-radius: 50%;
}

.verify-core span {
  inset: 5px 16px;
  transform: rotate(48deg);
  animation: spin 16s linear infinite;
}

.verify-core i {
  inset: 16px 5px;
  transform: rotate(-48deg);
  animation: reverse-spin 13s linear infinite;
}

.verify-core b {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(119, 211, 156, 0.26);
  border-radius: 50%;
  color: var(--green);
  background: rgba(119, 211, 156, 0.06);
  box-shadow: 0 0 25px rgba(119, 211, 156, 0.08);
  font-size: 13px;
  font-weight: 400;
}

.verify-copy {
  max-width: 570px;
  margin: 10px auto 20px;
  color: #73776e;
  font-size: 9px;
  line-height: 1.65;
}

.verify-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.verify-metrics div {
  padding: 13px;
}

.verify-metrics div + div {
  border-left: 1px solid var(--line);
}

.verify-metrics span,
.verify-metrics strong {
  display: block;
}

.verify-metrics span {
  color: var(--quiet);
  font-size: 7px;
}

.verify-metrics strong {
  margin-top: 6px;
  font: 11px "DM Mono", monospace;
}

.import-result {
  display: grid;
  grid-template-columns: 8px 1fr;
  align-items: start;
  gap: 10px;
  max-width: 700px;
  margin: 17px auto 0;
  padding: 12px 13px;
  border: 1px solid rgba(119, 211, 156, 0.13);
  border-radius: 10px;
  background: rgba(119, 211, 156, 0.035);
  text-align: left;
}

.import-result[hidden] {
  display: none;
}

.import-result > span {
  width: 6px;
  height: 6px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(119, 211, 156, 0.45);
}

.import-result p {
  margin: 0;
}

.import-result strong,
.import-result small {
  display: block;
}

.import-result strong {
  font-size: 8px;
}

.import-result small {
  margin-top: 4px;
  color: #61776a;
  font-size: 7px;
}

.import-error {
  margin: 13px 28px 0;
  padding: 10px 12px;
  border: 1px solid rgba(239, 142, 130, 0.17);
  border-radius: 9px;
  color: var(--red);
  background: rgba(239, 142, 130, 0.045);
  font-size: 8px;
}

.import-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px 28px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.08);
}

.import-footer p {
  margin: 0 auto 0 0;
  color: var(--quiet);
  font-size: 7px;
}

.import-back {
  min-width: 80px;
  justify-content: center;
}

.import-next {
  min-width: 150px;
  justify-content: center;
  border: 0;
}

.import-next:disabled {
  cursor: not-allowed;
  filter: saturate(0.3);
  opacity: 0.42;
}

@keyframes import-step-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  min-width: 300px;
  padding: 13px 14px;
  border: 1px solid var(--line-bright);
  border-radius: 13px;
  background: rgba(16, 18, 15, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(215, 185, 108, 0.6);
}

.toast p {
  margin: 0;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 9px;
}

.toast small {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 8px;
}

@keyframes core-breathe {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes pulse-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.65);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reverse-spin {
  from {
    transform: rotate(58deg);
  }
  to {
    transform: rotate(-302deg);
  }
}

@keyframes ribbon-scan {
  0%,
  10% {
    left: -22%;
  }
  62%,
  100% {
    left: 112%;
  }
}

@keyframes reveal-bar {
  from {
    width: 0;
  }
}

@keyframes data-travel {
  from {
    left: -14%;
  }
  to {
    left: 100%;
  }
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .side-rail {
    padding-inline: 12px;
  }

  .brand-lockup {
    justify-content: center;
    padding-inline: 0;
  }

  .brand-copy,
  .nav-item > span:not(.nav-icon, .nav-signal),
  .nav-availability,
  .nav-label,
  .connection-card span:not(.connection-pulse),
  .user-card > span:not(.user-avatar) {
    display: none;
  }

  .nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .nav-signal {
    position: absolute;
    top: 9px;
    right: 11px;
  }

  .connection-card,
  .user-card {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .workspace-menu {
    right: auto;
    bottom: 0;
    left: calc(100% + 12px);
    width: 230px;
  }

  .command-grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.7fr);
  }

  .performance-panel,
  .consistency-panel,
  .executions-panel {
    grid-column: span 1;
  }

  .intelligence-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .consistency-panel {
    grid-column: 1;
  }

  .risk-panel {
    grid-column: 2;
    grid-row: 2;
  }

  .executions-panel {
    grid-column: 1;
  }

  .sync-panel {
    grid-column: 2;
    grid-row: 4;
  }

  .calendar-preview-panel {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .executions-panel {
    grid-row: 4;
  }

  .account-ribbon {
    grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(110px, 0.7fr)) minmax(155px, 0.75fr) 28px;
  }

  .account-stat:nth-of-type(4) {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .side-rail {
    position: fixed;
    z-index: 15;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    padding: 24px 18px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  body.nav-open .side-rail {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .brand-lockup {
    justify-content: flex-start;
    padding-inline: 8px;
  }

  .brand-copy,
  .nav-item > span:not(.nav-icon, .nav-signal),
  .nav-label,
  .connection-card span:not(.connection-pulse),
  .user-card > span:not(.user-avatar) {
    display: initial;
  }

  .nav-item {
    grid-template-columns: 27px 1fr auto;
    justify-items: initial;
    padding: 0 12px;
  }

  .connection-card {
    grid-template-columns: 12px 1fr auto;
    justify-items: initial;
  }

  .user-card {
    grid-template-columns: 33px 1fr auto;
    justify-items: initial;
  }

  .workspace-menu {
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    width: auto;
  }

  .workspace {
    min-height: 100vh;
  }

  .top-bar {
    position: sticky;
    z-index: 10;
    top: 0;
    padding: 0 18px;
  }

  .mobile-menu {
    display: grid;
    width: 34px;
    height: 34px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
  }

  .mobile-menu span {
    width: 14px;
    height: 1px;
    background: #aaa;
  }

  .breadcrumb {
    margin-right: auto;
    margin-left: 12px;
  }

  .concept-badge {
    display: none;
  }

  .workspace-scroll {
    overflow: visible;
    padding: 26px 18px 40px;
  }

  .command-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-ribbon {
    grid-template-columns: 1.4fr 0.7fr 28px;
  }

  .account-stat:not(:nth-of-type(2)),
  .sync-state {
    display: none;
  }

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

  .performance-panel,
  .intelligence-panel,
  .consistency-panel,
  .risk-panel,
  .calendar-preview-panel,
  .executions-panel,
  .sync-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .calendar-preview-body {
    grid-template-columns: 1fr;
  }

  .execution-row {
    grid-template-columns: 1.2fr 0.75fr 0.75fr;
  }

  .execution-row > span:nth-child(4),
  .execution-row > span:nth-child(5) {
    display: none;
  }
}

@media (max-width: 620px) {
  .date-control span:last-child,
  .breadcrumb-line,
  .breadcrumb > span:first-child {
    display: none;
  }

  .top-bar {
    min-height: 60px;
  }

  .command-intro h1 {
    font-size: 29px;
  }

  .intro-actions {
    width: 100%;
  }

  .ghost-action,
  .primary-action {
    flex: 1;
    justify-content: center;
  }

  .account-ribbon {
    grid-template-columns: 1fr 28px;
  }

  .account-stat {
    display: none !important;
  }

  .performance-panel {
    min-height: 440px;
    padding-inline: 16px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .period-switcher button {
    min-width: 28px;
  }

  .performance-summary {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .performance-summary > div:nth-child(3) {
    display: none;
  }

  .performance-summary > div:not(:first-child) {
    padding-left: 15px;
  }

  .chart-wrap {
    height: 250px;
  }

  .chart-tooltip {
    display: none;
  }

  .consistency-body {
    grid-template-columns: 1fr;
    height: auto;
    padding-top: 24px;
  }

  .consistency-breakdown {
    padding-bottom: 5px;
  }

  .execution-row {
    grid-template-columns: 1.25fr 0.75fr;
  }

  .execution-row > span:nth-child(2),
  .execution-row > span:nth-child(4),
  .execution-row > span:nth-child(5) {
    display: none;
  }

  .connection-options {
    grid-template-columns: 1fr;
  }

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

  .import-identity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .import-identity-grid label:last-child {
    grid-column: span 2;
  }

  .connect-dialog {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .mt5-dialog {
    width: calc(100% - 18px);
    max-height: calc(100vh - 18px);
  }

  .mt5-safety-rail {
    grid-template-columns: 1fr 1fr;
    margin-inline: 20px;
  }

  .mt5-setup-grid {
    grid-template-columns: 1fr;
    padding-inline: 20px;
  }

  .mt5-credentials {
    margin-inline: 20px;
  }

  .mt5-credential-grid {
    grid-template-columns: 1fr;
  }

  .mt5-credential-grid .mt5-endpoint-field {
    grid-column: auto;
  }

  .mt5-dialog-footer {
    padding-inline: 20px;
  }

  .dialog-head,
  .connection-options {
    padding-inline: 20px;
  }

  .dialog-security {
    margin-inline: 20px;
  }

  .dialog-action {
    width: calc(100% - 40px);
    margin-inline: 20px;
  }

  .import-dialog {
    width: calc(100% - 18px);
    max-height: calc(100vh - 18px);
  }

  .import-dialog-head,
  .import-step {
    padding-inline: 20px;
  }

  .import-progress {
    margin-inline: 20px;
  }

  .verify-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .verify-metrics div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .verify-metrics div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .import-footer {
    padding-inline: 20px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
  }
}

@media (max-width: 470px) {
  .import-progress span {
    gap: 0;
    font-size: 0;
  }

  .import-progress span i {
    font-size: 7px;
  }

  .import-identity-grid,
  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .import-identity-grid label:last-child {
    grid-column: auto;
  }

  .file-drop {
    min-height: 220px;
  }

  .import-footer {
    flex-wrap: wrap;
  }

  .import-footer p {
    width: 100%;
    order: -1;
  }

  .import-back,
  .import-next {
    flex: 1;
  }

  .mt5-credentials-head,
  .mt5-dialog-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mt5-dialog-footer .ghost-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
