:root {
  --td-bg: #07110f;
  --td-panel: #0a1712;
  --td-border: #28443a;
  --td-muted: #9fb3aa;
  --td-text: #e9f3ee;
  --td-accent: #83dfb9;
  --td-accent-strong: #46c58e;
  --td-glow: #123a30;
  --td-scrollbar-thumb: #38584a;
  --td-scrollbar-thumb-hover: #527564;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scrollbar-color: var(--td-scrollbar-thumb) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: var(--td-scrollbar-thumb); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--td-scrollbar-thumb-hover); background-clip: padding-box; }

a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--td-accent-strong);
  outline-offset: 3px;
  scroll-margin-block: 88px;
}

button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
:where(button, a, summary, input, select, textarea) {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
:where(main) :where(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-radius: 9px;
}
:where(main) :where(.card, .panel, .setting-card) {
  box-shadow: 0 12px 36px #0002;
}
textarea { min-height: 96px; resize: none; }
.td-search-wrap { display:inline-flex; min-width:0; align-items:center; gap:4px; }
.td-search-wrap > input[type="search"] { min-width:0; flex:1 1 auto; }
.td-search-clear { display:grid; flex:0 0 30px; width:30px; height:30px; place-items:center; padding:0; border:1px solid var(--td-border); border-radius:7px; background:var(--td-panel); color:var(--td-muted); font-size:18px; line-height:1; }
.td-search-clear:hover { border-color:var(--td-accent-strong); color:var(--td-text); }
.td-search-clear[hidden] { display:none !important; }
button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #e0787e;
  box-shadow: 0 0 0 1px #e0787e55;
}
input[aria-invalid="true"]:focus-visible,
select[aria-invalid="true"]:focus-visible,
textarea[aria-invalid="true"]:focus-visible {
  outline-color: #ff9ca5;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    /* Override page-level motion so the operating-system preference applies everywhere. */
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  html { scrollbar-color: auto; }
  *::-webkit-scrollbar-thumb { border-color: Canvas; background: ButtonText; }
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 6% 0, var(--td-glow) 0, transparent 35%), var(--td-bg);
  color: var(--td-text);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid #1c332b;
  background: #081410ed;
  backdrop-filter: blur(14px);
}

.portal-announcements {
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  width: calc(100% - 2 * clamp(18px, 5vw, 72px));
  max-width: 1600px;
  margin: 10px auto 0;
}
.portal-announcement-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 13px;
  border: 1px solid #345b49;
  border-radius: 10px;
  background: linear-gradient(100deg,#10271d,#0b1713);
  box-shadow: 0 6px 24px #0002;
}
.portal-announcement-card[data-severity="success"] { border-color:#317353; background:linear-gradient(100deg,#10291e,#0b1713); }
.portal-announcement-card[data-severity="warning"] { border-color:#80683a; background:linear-gradient(100deg,#292311,#11150f); }
.portal-announcement-card[data-severity="outage"] { border-color:#85454b; background:linear-gradient(100deg,#30181b,#171112); }
.portal-announcement-copy { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:3px 9px; min-width:0; }
.portal-announcement-type { color:#83dfb9; font-size:9px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.portal-announcement-card[data-severity="warning"] .portal-announcement-type { color:#efcc7a; }
.portal-announcement-card[data-severity="outage"] .portal-announcement-type { color:#ff9ca5; }
.portal-announcement-copy strong { color:#ecf7f1; font-size:12px; }
.portal-announcement-copy p { grid-column:2; margin:0; color:#a9bdb3; font-size:11px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.portal-announcement-dismiss { display:grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid #355346; border-radius:8px; background:#08140f; color:#b7c9c1; font:inherit; font-size:18px; cursor:pointer; }
.portal-announcement-dismiss:hover { border-color:#83dfb9; color:#ecf7f1; }
.portal-announcement-dismiss:disabled { opacity:.5; cursor:wait; }
body:has(> header) > .portal-announcements[hidden] { display:none !important; }
body:has(> header) > .portal-announcements:not([hidden]) { flex:0 0 auto; }

.app-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: #effaf4;
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.03em;
}

.paper-brand-badge, .live-brand-badge {
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid #2d7964;
  border-radius: 99px;
  color: #83dfb9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-mode="live"] .live-brand-badge {
  border-color: #9c6039;
  color: #f5a66b;
}

.app-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #2d7964;
  border-radius: 12px;
  background: #123329;
  color: #72e3b7;
  font-size: 21px;
}

.app-brand-logo {
  display: block;
  width: 64px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.app-mode-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid #28443a;
  border-radius: 10px;
  background: #07110f;
}

.app-mode-switch a {
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--td-muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

[data-live-mode][hidden] {
  display: none !important;
}

.app-mode-switch a[aria-current="true"] {
  background: #174331;
  color: #a2e9c5;
  box-shadow: inset 0 0 0 1px #327859;
}

.app-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: visible;
  color: var(--td-muted);
  font-size: 12px;
}

.app-nav-link {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.app-nav-link:hover {
  border-color: #315244;
  background: #10251c;
  color: var(--td-accent);
}

.app-nav-link.active {
  border-color: #327859;
  background: #123329;
  color: #a2e9c5;
  box-shadow: inset 0 0 0 1px #32785933;
}

.app-profile { position: relative; flex: 0 0 auto; }

.app-notifications { position: relative; flex: 0 0 auto; }
.app-notification-trigger {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid #315244;
  border-radius: 50%;
  background: #123329;
  color: var(--td-accent);
  cursor: pointer;
  list-style: none;
}
.app-notification-trigger::-webkit-details-marker { display: none; }
.app-notification-trigger::marker { content: ""; }
.app-notification-trigger:hover,
.app-notifications[open] .app-notification-trigger { border-color: var(--td-accent-strong); }
.app-notification-trigger svg { display: block; flex: 0 0 18px; width: 18px !important; height: 18px !important; max-width: 18px; max-height: 18px; }
.app-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid var(--td-bg);
  border-radius: 99px;
  background: #ed626b;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}
.app-notification-panel {
  position: absolute;
  z-index: 31;
  top: calc(100% + 9px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 160px));
  max-height: min(440px, calc(100dvh - 160px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #315244;
  border-radius: 11px;
  background: var(--td-panel);
  box-shadow: 0 12px 32px #0009;
}
.app-notification-panel[hidden] { display: none !important; }
.app-notification-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--td-border); background: var(--td-panel); color: var(--td-text); font-size: 12px; }
.app-notification-head h2 { margin:0; color:var(--td-text); font-size:13px; line-height:1.3; }
.app-notification-actions, .app-notification-item-actions { display:flex; align-items:center; gap:6px; }
.app-notification-head button, .app-notification-item-actions button, .app-notification-item-actions a { padding: 5px 7px; border: 1px solid var(--td-border); border-radius: 6px; background: transparent; color: var(--td-accent); font: inherit; font-size: 10px; text-decoration:none; cursor: pointer; }
.app-notification-head button.app-notification-icon-action { display:grid; flex:0 0 32px; width:32px; height:32px; padding:6px; place-items:center; }
.app-notification-head button:disabled { opacity:.45; cursor:not-allowed; }
.app-notification-head button:focus-visible, .app-notification-item-actions :is(button,a):focus-visible { outline:2px solid var(--td-accent-strong); outline-offset:2px; }
.app-notification-icon-action svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.app-notification-icon-action:hover:not(:disabled) { border-color:var(--td-accent-strong); background:#123329; }
.app-notification-icon-action:focus-visible { outline:2px solid var(--td-accent-strong); outline-offset:2px; }
.app-notification-icon-action:disabled { opacity:.55; cursor:wait; }
.app-notification-head button[aria-pressed="true"] { background:#123329; }
.app-notification-action-status { flex:0 0 auto; margin:0; padding:8px 12px 0; color:var(--td-accent); font-size:10px; line-height:1.4; }
.app-notification-action-status[hidden] { display:none !important; }
.app-notification-list { min-height:0; flex:1 1 auto; overflow:auto; overscroll-behavior:contain; padding:4px 12px; }
.app-notification-item { padding: 10px 0; border-bottom: 1px solid var(--td-border); color: var(--td-muted); font-size: 11px; line-height: 1.45; }
.app-notification-item:last-child { border-bottom: 0; }
.app-notification-item.unread { color: var(--td-text); }
.app-notification-item strong { display: block; color: var(--td-text); font-size: 11px; }
.app-notification-item time { display: block; margin-top: 3px; color: var(--td-muted); font-size: 9px; }
.app-notification-item-actions { margin-top:7px; }
.app-notification-empty { margin: 0; padding: 18px 0; color: var(--td-muted); font-size: 11px; }
@media (max-width: 380px) {
  .app-notification-head { display:grid; gap:8px; }
  .app-notification-actions { width:100%; justify-content:space-between; }
  .app-notification-head button { min-height:32px; }
}
.app-trade-toast { position: fixed; z-index: 100; top: 82px; right: 20px; width: min(360px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid #327859; border-radius: 10px; background: var(--td-panel); color: var(--td-text); box-shadow: 0 12px 32px #0009; font-size: 12px; line-height: 1.45; animation: app-toast-in .18s ease-out; }
.app-trade-toast strong { display: block; margin-bottom: 3px; color: var(--td-accent); }
@keyframes app-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.app-profile-trigger {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid #315244;
  border-radius: 50%;
  background: #123329;
  color: var(--td-accent);
  cursor: pointer;
  list-style: none;
}

.app-profile-trigger::-webkit-details-marker { display: none; }
.app-profile-trigger:hover,
.app-profile[open] .app-profile-trigger { border-color: var(--td-accent-strong); }
.app-profile-trigger svg { width: 19px; height: 19px; }

.app-profile-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  min-width: min(190px, calc(100vw - 28px));
  max-width: min(320px, calc(100vw - 28px));
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid #315244;
  border-radius: 11px;
  background: #0a1712;
  box-shadow: 0 12px 32px #0009;
}

.app-profile:not([open]) > .app-profile-menu { display: none; }
.app-profile-menu #userLabel { min-width: 0; overflow-wrap: anywhere; padding: 9px 10px; color: #83dfb9; font-size: 11px; }
.app-profile-menu a,
.app-profile-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d2e3da;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.app-profile-menu a:hover,
.app-profile-menu button:hover { background: #174331; color: #a2e9c5; }
.app-profile-menu [hidden] { display: none !important; }
.app-profile-menu .app-mode-switch { display: flex; width: calc(100% - 16px); margin: 4px 8px 8px; }
.app-profile-menu .app-mode-switch a { display: block; flex: 1 1 100%; width: auto; padding: 7px 9px; text-align: center; }
.app-profile-menu .app-mode-switch a[aria-current="true"] { display: none; }

/* Keep desktop app pages inside the viewport below their header. */
@media (min-width: 1181px) and (min-height: 700px) {
  body:has(> header) {
    display: flex;
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  body:has(> header) > header { flex: 0 0 auto; }

  body:has(> header) > main {
    flex: 1 1 auto;
    min-height: 0;
    margin: 12px auto !important;
    overflow: auto;
  }
}

@media (max-width: 700px) {
  .app-notification-panel { position: fixed; top: auto; left: 12px; right: 12px; width: auto; margin-top: 9px; }
  .app-header { min-height: 64px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; }
  .portal-announcements { width:calc(100% - 28px); margin-top:8px; }
  .portal-announcement-card { align-items:start; padding:9px; }
  .portal-announcement-copy { grid-template-columns:1fr; gap:3px; }
  .portal-announcement-copy p { grid-column:1; }
  .app-brand { gap: 8px; font-size: 13px; }
  .app-brand-mark { width: 34px; height: 34px; }
  .app-mode-switch { margin-left: auto; }
  .app-nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 3px; padding: 2px 0; font-size: 11px; }
  .app-nav-link { min-height: 34px; padding-inline: 9px; }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .app-header { flex-wrap: nowrap; gap: 7px 12px; padding: 8px clamp(12px, 2.3vw, 28px); }
  .app-nav { flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 2px; }
}

/* Let authenticated app pages, including the journal, use the full workspace width. */
@media (min-width: 701px) {
  body:has(> header) > main:not(.fyers-config-main):not(.membership-main):not(.settings-main) {
    width: 100% !important;
    max-width: none !important;
    padding-inline: clamp(18px, 3vw, 56px) !important;
  }
}

/* Keep the Journal at a readable width and use the page scrollbar. */
@media (min-width: 1181px) {
  body.journal-page:has(> header) {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.journal-page:has(> header) > main.journal-main {
    flex: none;
    min-height: auto;
    margin: 36px auto 56px !important;
    overflow: visible;
  }
}

/* Settings stays centered and uses the document scrollbar instead of filling the workspace. */
@media (min-width: 1181px) {
  body.settings-page:has(> header) {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.settings-page:has(> header) > main.settings-main {
    flex: none;
    min-height: auto;
    margin: 36px auto 56px !important;
    overflow: visible;
  }
}

/* Use the available desktop height on lower-resolution or scaled displays. */
@media (min-width: 1181px) and (max-height: 850px) {
  body:has(> header) > header { min-height: 54px !important; padding-block: 6px !important; }
  body:has(> header) > main { margin-block: 8px !important; }
  body:has(> header) > main h1 { margin-block: 4px !important; font-size: clamp(24px, 3vw, 34px) !important; }
  body:has(> header) > main .intro { margin-bottom: 12px !important; }
  body:has(> header) > main .panel,
  body:has(> header) > main .setting-card,
  body:has(> header) > main .card:not(.chart-card) { padding: 14px !important; }
  body:has(> header) > main .settings-grid,
  body:has(> header) > main .strategy-layout,
  body:has(> header) > main .content-grid { gap: 10px !important; }
}

/* Live mode uses a graphite and amber palette so it is unmistakable beside Paper mode. */
body[data-mode="live"] {
  --td-bg: #0b1018;
  --td-panel: #111923;
  --td-border: #3a4656;
  --td-muted: #a2adba;
  --td-text: #edf2f7;
  --td-accent: #ffc078;
  --td-accent-strong: #ef8954;
  --td-glow: #39261d;
  --td-scrollbar-thumb: #536475;
  --td-scrollbar-thumb-hover: #75879a;
  background: radial-gradient(ellipse at 6% 0, var(--td-glow) 0, transparent 36%), var(--td-bg);
  color: var(--td-text);
}

body[data-mode="live"] .app-header {
  border-bottom-color: #303b49;
  background: #0c131bee;
}

body[data-mode="live"] .app-brand-mark,
body[data-mode="live"] .app-profile-trigger {
  border-color: #815536;
  background: #2b211a;
  color: var(--td-accent);
}

body[data-mode="live"] .app-mode-switch {
  border-color: #3a4656;
  background: #0b1018;
}

body[data-mode="live"] .app-mode-switch a[aria-current="true"] {
  background: #38271d;
  color: #ffd5a0;
  box-shadow: inset 0 0 0 1px #98613b;
}

body[data-mode="live"] .app-nav-link:hover,
body[data-mode="live"] .app-nav-link.active {
  border-color: #815536;
  background: #2b211a;
  color: var(--td-accent);
}

body[data-mode="live"] .app-nav-link.active {
  border-color: #98613b;
  background: #38271d;
  color: #ffd5a0;
}

body[data-mode="live"] .app-nav-link:hover {
  border-color: #815536;
  background: #2b211a;
}

body[data-mode="live"] .app-profile-menu {
  border-color: #3a4656;
  background: #111923;
}

body[data-mode="live"] .app-profile-menu #userLabel { color: var(--td-accent); }
body[data-mode="live"] .app-profile-menu a:hover,
body[data-mode="live"] .app-profile-menu button:hover { background: #38271d; color: #ffd5a0; }

body[data-mode="live"] .card,
body[data-mode="live"] .strategy-sidebar {
  border-color: #344252;
  background: linear-gradient(145deg, #17212c, #101720);
}

body[data-mode="live"] .metric,
body[data-mode="live"] .backtest-metric,
body[data-mode="live"] .calendar,
body[data-mode="live"] .day-group {
  border-color: #344252;
  background-color: #111923;
}

body[data-mode="live"] .controls,
body[data-mode="live"] .strategy-page-tabs {
  border-color: #344252;
  background: #101720;
}

body[data-mode="live"] .fetch,
body[data-mode="live"] .control-button.start,
body[data-mode="live"] .button.primary,
body[data-mode="live"] .paper-form button,
body[data-mode="live"] .paper-exit-form button,
body[data-mode="live"] .order-exit button,
body[data-mode="live"] .journal-form button {
  border-color: #ef8954;
  background: #ef8954;
  color: #1b120d;
}

body[data-mode="live"] .fetch:hover,
body[data-mode="live"] .button.primary:hover { background: #ffa96f; }

body[data-mode="live"] .interval[aria-pressed="true"],
body[data-mode="live"] .order-tab[aria-selected="true"],
body[data-mode="live"] .strategy-page-tabs button[aria-selected="true"],
body[data-mode="live"] .backtest-controls button[aria-pressed="true"],
body[data-mode="live"] .paper-subtabs button[aria-selected="true"],
body[data-mode="live"] .config-tab[aria-selected="true"] {
  border-color: #98613b;
  background: #38271d;
  color: #ffd5a0;
}

body[data-mode="live"] .interval:hover,
body[data-mode="live"] .strategy-link:hover,
body[data-mode="live"] .strategy-link.active {
  border-color: #98613b;
  background: #2b211a;
  color: #ffd5a0;
}

body[data-mode="live"] .status.ready,
body[data-mode="live"] .status.connected,
body[data-mode="live"] .paper-only-badge,
body[data-mode="live"] .badge {
  border-color: #98613b;
  background: #38271d;
  color: #ffd5a0;
}

body[data-mode="live"] .spot-summary,
body[data-mode="live"] .strike-list,
body[data-mode="live"] .app-mode-switch,
body[data-mode="live"] .backtest-metric {
  border-color: #344252;
}

body[data-mode="live"] .spot-summary .atm strong,
body[data-mode="live"] .strike-pick.active,
body[data-mode="live"] .config-tab[aria-selected="true"] { color: var(--td-accent); }

body[data-mode="live"] .strike-pick.active,
body[data-mode="live"] .strike-pick:hover { border-color: var(--td-accent-strong); background: #38271d; }

body[data-mode="live"] input:focus,
body[data-mode="live"] select:focus { border-color: var(--td-accent-strong); box-shadow: 0 0 0 3px #ef895426; }

body[data-mode="live"] .table th,
body[data-mode="live"] .table td,
body[data-mode="live"] .step,
body[data-mode="live"] .sidebar-note,
body[data-mode="live"] .paper-subtabs,
body[data-mode="live"] .spot-summary,
body[data-mode="live"] .strike-row { border-color: #2b3745; }

/* Fyers setup uses a centered column but keeps normal viewport scrolling. */
@media (min-width: 1181px) {
  body:has(> header):has(> main.fyers-config-main) {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:has(> header) > main.fyers-config-main {
    flex: none;
    min-height: auto;
    margin: 36px auto 56px !important;
    overflow: visible;
  }
}
/* App-owned confirmations use native dialog semantics and shared button styles. */
.td-confirm-dialog{width:min(30rem,calc(100vw - 2rem));max-width:none;max-height:calc(100vh - 2rem);max-height:calc(100dvh - 2rem);overflow:auto;overscroll-behavior:contain;padding:0;border:1px solid var(--line,#ddd);border-radius:1rem;background:var(--surface,#fff);color:var(--text,#17151d);box-shadow:0 1.5rem 5rem #0005}
.td-confirm-dialog::backdrop{background:#111827a8;backdrop-filter:blur(3px)}
.td-confirm-dialog-panel{padding:1.35rem}
.td-confirm-dialog h2{margin:0 0 .65rem;font-size:1.15rem}
.td-confirm-dialog p{margin:0;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
.td-confirm-dialog-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.65rem;margin-top:1.25rem}
.td-confirm-dialog-actions button{min-height:2.65rem;padding:.55rem 1rem;border:1px solid var(--line,#ddd);border-radius:.6rem;background:var(--surface,#fff);color:inherit;font:inherit;font-weight:650;cursor:pointer}
.td-confirm-dialog-actions button.primary{background:var(--accent,#7355b5);border-color:var(--accent,#7355b5);color:#fff}
.td-confirm-dialog-actions button.danger{background:#b42318;border-color:#b42318;color:#fff}
.td-confirm-dialog-actions button:focus-visible{outline:3px solid #9678d5;outline-offset:2px}
@media(max-width:480px){.td-confirm-dialog-actions{flex-direction:column-reverse}.td-confirm-dialog-actions button{width:100%}}
