:root {
  color-scheme: dark;
  --bg: #0f1218;
  --panel: #171b22;
  --panel-strong: #222936;
  --line: #303948;
  --text: #f5f7fb;
  --muted: #9da9bb;
  --green: #28c76f;
  --red: #b84533;
  --blue: #075472;
  --yellow: #d67b10;
  --brand-orange: #df6818;
  --brand-teal: #0a6672;
  --brand-plum: #5d2859;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(223, 104, 24, 0.18), transparent 30%),
    linear-gradient(145deg, #0b1017 0%, #111823 50%, #17121b 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.brand-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: center;
  justify-items: start;
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin: 0 auto 12px;
  padding: 8px 8px 8px 14px;
  overflow: hidden;
}

.brand-header img {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(68px, 8vw, 96px);
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
}

.india-clock {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  align-self: center;
  justify-self: end;
  justify-items: end;
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(10, 16, 28, 0.92);
  color: var(--text);
  padding: 9px 10px;
  text-align: right;
  overflow: hidden;
}

.india-clock::before {
  content: "";
  position: absolute;
  inset: -54px -48px auto auto;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(223, 104, 24, 0.24), transparent 68%);
}

.india-clock span,
.india-clock strong,
.india-clock small {
  position: relative;
  z-index: 1;
}

.india-clock span {
  color: var(--brand-orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.india-clock strong {
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.india-clock small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.eyebrow,
.label,
.panel-heading span,
small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 18px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav-links a,
.bottom-nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 10px 14px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav-links a:hover,
.bottom-nav a:hover,
.button:hover {
  border-color: var(--brand-orange);
}

.bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button {
  border-color: var(--brand-orange);
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-orange));
  color: #fffaf2;
  font-weight: 700;
}

.primary-button:hover {
  border-color: var(--brand-plum);
}

.full-width {
  width: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-grid > .panel {
  grid-column: 1 / -1;
}

.success-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  border: 1px solid rgba(40, 199, 111, 0.48);
  border-radius: 8px;
  background: rgba(40, 199, 111, 0.12);
  color: var(--green);
  font-weight: 700;
  padding: 11px 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  animation: toastFade 900ms ease forwards;
}

.error-toast {
  border-color: rgba(184, 69, 51, 0.58);
  background: rgba(184, 69, 51, 0.16);
  color: #ff9b8e;
}

@keyframes toastFade {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  15%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-card {
  min-height: 92px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.summary-card.wide,
.panel.wide,
.notification-strip.wide,
.connection-strip.wide {
  grid-column: 1 / -1;
}

.notification-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.84);
  padding: 9px 12px;
}

.notification-content {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.notification-content strong {
  font-size: 13px;
}

.notification-content span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-content small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.notification-content small:empty {
  display: none;
}

.notification-content span:empty {
  display: none;
}

.risk-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.risk-switch span {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-switch.active span {
  color: #ffb4a8;
  font-weight: 700;
}

.button.danger {
  border-color: rgba(184, 69, 51, 0.58);
  background: rgba(184, 69, 51, 0.18);
  color: #ffb4a8;
}

.button.danger:hover {
  border-color: rgba(255, 180, 168, 0.8);
}

.button.safe {
  border-color: rgba(40, 199, 111, 0.42);
  background: rgba(40, 199, 111, 0.12);
  color: #94f2bb;
}

.strip-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.strip-actions a,
.strip-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.strip-actions a:hover,
.strip-actions .button:hover {
  border-color: var(--brand-orange);
}

.strip-actions .button.active {
  border-color: rgba(223, 104, 24, 0.68);
  background: rgba(223, 104, 24, 0.16);
  color: #fed7aa;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(7, 84, 114, 0.18);
}

.notification-dot.success {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 199, 111, 0.16);
}

.notification-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 69, 51, 0.18);
}

.summary-card.wide {
  min-height: auto;
  flex-direction: row;
  align-items: center;
}

.label {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}

.summary-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  font-size: 12px;
  line-height: 1.2;
}

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

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

.panel {
  padding: 18px;
}

.connection-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.72);
  padding: 12px 14px;
}

.connection-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.connection-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stack-list,
.trail-grid {
  display: grid;
  gap: 10px;
}

.main-trail-desk {
  display: grid;
  gap: 12px;
}

.main-position-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.main-position-pill {
  display: grid;
  gap: 3px;
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 41, 54, 0.72);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.main-position-pill.selected {
  border-color: var(--brand-orange);
}

.main-position-pill span,
.main-position-pill em,
.main-trail-card small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.main-position-pill em {
  color: var(--green);
}

.main-trail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
}

.main-trail-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 41, 54, 0.66);
  padding: 12px;
}

.main-trail-card strong {
  font-size: 16px;
}

.active-trail-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.main-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.main-profile-grid .button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 46px;
  align-items: center;
  border-color: rgba(223, 104, 24, 0.26);
  background: rgba(16, 20, 27, 0.86);
  white-space: normal;
}

.main-profile-grid small {
  color: var(--muted);
  font-size: 11px;
}

.trail-mode-panel {
  padding: 0;
  overflow: hidden;
}

.embedded-trail-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.7fr) minmax(280px, 0.75fr);
  gap: 10px;
  padding: 10px;
  align-items: start;
}

.trail-panel {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 25, 37, 0.94);
  overflow: hidden;
}

.trail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.trail-panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.trail-panel-header span,
.position-meta,
.trail-mini,
.event-meta {
  color: var(--muted);
  font-size: 12px;
}

.positions-list,
.profile-card,
.events-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.embedded-position-card,
.profile-option,
.active-profile,
.event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
}

.embedded-position-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.embedded-position-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.embedded-position-card.selected {
  border-color: rgba(223, 104, 24, 0.72);
  background: rgba(223, 104, 24, 0.08);
}

.position-head,
.trail-line,
.event-head,
.active-profile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.position-symbol {
  display: grid;
  gap: 3px;
}

.position-stats,
.trail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.stat-chip {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.24);
}

.stat-chip span {
  color: var(--muted);
  font-size: 11px;
}

.stat-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.select-button,
.stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(30, 41, 59, 0.86);
}

.stop-button {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.14);
  color: #fecaca;
}

.position-close-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
}

.position-close-group {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.24);
  padding: 8px;
}

.position-close-group.pnl-exit-armed {
  border-color: rgba(223, 104, 24, 0.36);
  background: rgba(223, 104, 24, 0.09);
}

.position-close-label {
  color: var(--muted);
  font-size: 11px;
}

.close-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.trail-price-input {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10141b;
  color: var(--text);
  font-size: 12px;
  padding: 6px 7px;
  text-align: right;
}

.sell-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(40, 199, 111, 0.35);
  border-radius: 7px;
  background: rgba(40, 199, 111, 0.12);
  color: var(--green);
  padding: 6px 9px;
  font-size: 12px;
}

.profile-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 11px;
  color: var(--text);
  text-align: left;
}

.profile-name {
  display: grid;
  gap: 4px;
}

.profile-name span,
.profile-risk {
  color: var(--muted);
  font-size: 12px;
}

.profile-risk {
  align-self: center;
  justify-self: end;
  color: var(--brand-orange);
}

.active-profile {
  display: grid;
  gap: 11px;
  margin: 10px;
  padding: 11px;
  border-color: rgba(40, 199, 111, 0.38);
  background: rgba(40, 199, 111, 0.08);
}

.active-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.active-badge,
.trail-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(40, 199, 111, 0.14);
  font-size: 11px;
}

.trail-badge {
  color: #fed7aa;
  background: rgba(223, 104, 24, 0.14);
}

.events-panel {
  grid-column: 1 / -1;
  min-height: 180px;
}

.events-list {
  max-height: 260px;
  overflow-y: auto;
}

.event-row {
  display: grid;
  gap: 5px;
  padding: 8px;
}

.event-row.error {
  border-color: rgba(255, 107, 107, 0.38);
  background: rgba(255, 107, 107, 0.09);
}

.event-type {
  color: var(--brand-orange);
  font-size: 12px;
  font-weight: 700;
}

.event-message {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.report-mode-panel {
  min-height: 420px;
}

.embedded-report {
  display: grid;
  gap: 12px;
}

.embedded-report-grid {
  display: grid;
  gap: 12px;
}

.embedded-report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.embedded-report-kpi {
  display: grid;
  gap: 4px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.embedded-report-kpi span,
.embedded-report-kpi small {
  color: var(--muted);
  font-size: 12px;
}

.embedded-report-kpi strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.embedded-report-table-wrap {
  overflow-x: auto;
}

.embedded-report-table {
  min-width: 760px;
}

.embedded-report-table th,
.embedded-report-table td {
  padding: 10px 12px;
  font-size: 12px;
  text-align: left;
}

.embedded-report-table .align-right {
  text-align: right;
}

.embedded-report-table th[data-report-sort] {
  cursor: pointer;
  user-select: none;
}

.embedded-report-table th[data-report-sort]:hover {
  color: var(--brand-orange);
}

.embedded-report-table th.sorted-asc::after {
  content: " ^";
  color: var(--brand-orange);
}

.embedded-report-table th.sorted-desc::after {
  content: " v";
  color: var(--brand-orange);
}

.side-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.side-pill.buy {
  background: rgba(40, 199, 111, 0.12);
  color: var(--green);
}

.side-pill.sell {
  background: rgba(184, 69, 51, 0.16);
  color: #ff9b8e;
}

.strike-strip {
  display: grid;
  gap: 8px;
}

.home-chain-table {
  min-width: 980px;
}

.home-chain-table th,
.home-chain-table td {
  font-size: 12px;
  padding: 8px 6px;
  vertical-align: middle;
  text-align: center;
}

.atm-row td {
  background: rgba(223, 104, 24, 0.18);
  box-shadow: inset 0 1px 0 rgba(223, 104, 24, 0.22), inset 0 -1px 0 rgba(223, 104, 24, 0.22);
}

.strike-col {
  min-width: 70px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(10, 102, 114, 0.16);
  color: #9ec5ff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.home-chain-ltp {
  display: grid;
  gap: 1px;
  min-width: 76px;
}

.home-chain-ltp strong {
  font-size: 12px;
}

.home-chain-ltp small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.home-chain-button {
  min-width: 44px;
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
}

.buy-button {
  border: 1px solid rgba(40, 199, 111, 0.35);
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
}

.sell-button {
  border: 1px solid rgba(184, 69, 51, 0.45);
  border-radius: 8px;
  background: transparent;
  color: #ff9b8e;
  font-size: 12px;
}

.chain-price-cell,
.chain-qty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.price-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10141b;
  color: var(--text);
  font: inherit;
  padding: 7px 8px;
  text-align: center;
}

.chain-price-input,
.chain-qty-input {
  appearance: textfield;
  -moz-appearance: textfield;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.chain-price-input::-webkit-outer-spin-button,
.chain-price-input::-webkit-inner-spin-button,
.chain-qty-input::-webkit-outer-spin-button,
.chain-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chain-price-input {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}

.chain-qty-input {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
}

.chain-empty-cell,
.strike-empty {
  color: var(--muted);
}

.suggested-col {
  color: #7f8896;
  font-size: 11px;
}

.suggested-main,
.suggested-diff {
  display: block;
  font-size: 11px;
}

.center-col {
  text-align: center;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10141b;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

input:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(223, 104, 24, 0.14);
  outline: none;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100% - 32px));
  padding: 32px 0;
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.login-header {
  margin-bottom: 28px;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(108%, 380px);
  max-width: none;
  height: auto;
  margin: 0 auto 18px;
  transform: translateX(-50%);
  margin-left: 50%;
  border-radius: 8px;
}

.login-header h1 {
  font-size: 26px;
  color: var(--text);
}

.login-header p:last-child {
  margin: 8px auto 0;
  color: var(--muted);
  max-width: 30ch;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form .primary-button {
  margin-top: 8px;
}

.login-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.login-status strong {
  display: block;
  font-size: 18px;
}

.notice {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
}

.notice p {
  margin: 10px 0 0;
}

.notice.error {
  border-color: var(--red);
}

.hidden {
  display: none;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.safety-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
}

.safety-item strong,
.safety-item small {
  display: block;
}

.safety-item small {
  margin-top: 8px;
}

.list-row,
.trail-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
}

.order-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.small-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.row-title {
  display: block;
  font-weight: 700;
}

.pill {
  border-radius: 999px;
  background: rgba(74, 163, 255, 0.14);
  color: var(--blue);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .bottom-nav {
    justify-content: stretch;
  }

  .notification-strip,
  .notification-content {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .strip-actions {
    justify-content: stretch;
  }

  .risk-switch {
    justify-content: space-between;
  }

  .bottom-nav a {
    flex: 1;
  }

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

  .main-trail-grid,
  .main-profile-grid,
  .embedded-trail-grid,
  .embedded-report-kpis,
  .position-stats {
    grid-template-columns: 1fr;
  }

  .brand-header {
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding: 10px;
  }

  .brand-header img {
    width: 100%;
    height: auto;
    max-height: 78px;
    object-position: center;
  }

  .india-clock {
    justify-self: stretch;
    min-height: auto;
  }

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

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

  .form-grid,
  .safety-grid {
    grid-template-columns: 1fr;
  }

  .login-status {
    align-items: stretch;
    flex-direction: column;
  }

  .login-status .button-row {
    justify-content: stretch;
  }

  .login-status .button {
    flex: 1;
  }
}
