/* Shared page and component contract. Keep strategy layouts and state colors in their feature files. */
:root {
  --ui-content-width: 1440px;
  --ui-page-gutter: 28px;
  --ui-section-gap: 20px;
  --ui-panel-padding: 24px;
  --ui-panel-radius: 12px;
  --ui-control-radius: 8px;
  --ui-control-height: 40px;
  --ui-panel-shadow: 0 2px 8px rgb(23 32 42 / 3%);
}

.shell {
  width: min(var(--ui-content-width), calc(100% - var(--ui-page-gutter) * 2));
  padding: 28px 0 48px;
}

.shell > .page-intro {
  display: grid;
  grid-template-areas: "eyebrow" "title" "subtitle";
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0 0 24px;
}

.shell .page-intro .eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  letter-spacing: .1em;
}

.shell .page-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.shell .page-intro #subtitle {
  min-height: 42px;
  max-width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.shell > .page-module {
  display: flow-root;
  min-width: 0;
  margin: 0;
}

.shell > .page-module[hidden] { display: none; }

.shell .page-module > .account-settings-panel {
  display: flow-root;
  max-width: none;
}

.shell .page-module > :is(.section, .config-panel, .opportunity-panel),
.shell .page-module > .account-settings-panel > .trading-card {
  width: 100%;
  max-width: none;
  margin: 0 0 var(--ui-section-gap);
  padding: var(--ui-panel-padding);
  border: 1px solid var(--line);
  border-radius: var(--ui-panel-radius);
  background: var(--panel);
  box-shadow: var(--ui-panel-shadow);
}

.shell .page-module > .account-settings-panel > .trading-card > :is(.trading-card-head, .section-head) {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.shell .page-module > .account-settings-panel > .trading-card > :is(.trading-card-head, .section-head) h3 {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}

.shell .page-module :is(.section-head, .trading-manual-test-summary) {
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.shell .page-module :is(.section-head, .trading-manual-test-summary) > div {
  min-width: 0;
}

.shell .page-module :is(.section-head h2, .trading-manual-test-summary h3) {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.015em;
}

.shell .page-module :is(.section-head p, .trading-manual-test-summary p) {
  max-width: 80ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.65;
  text-align: left;
  overflow-wrap: anywhere;
}

.shell .page-module :is(.trading-card, .trading-live-card, .notification-card, .notification-block, .institutional-loan-card) {
  padding: 18px;
  border-radius: 10px;
  box-shadow: none;
}

.shell .page-module :is(.trading-card-head h3, .institutional-loan-card h3, .notification-category-head h3, .trading-v2-block-heading strong) {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}

.shell .page-module :is(.trading-card-head p, .hint, .credential-purpose) {
  font-size: 12px;
  font-weight: 450;
  line-height: 1.65;
}

/* Preserve primary, secondary, dangerous and pending states; unify their geometry. */
.shell .page-module .btn:not(.btn-sm):not(.btn-xs) {
  min-height: var(--ui-control-height);
  height: auto;
  padding: 9px 14px;
  border-radius: var(--ui-control-radius);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  white-space: normal;
  box-shadow: none;
}

.shell .page-module :is(.input, .select, .styled-select-trigger, .contract-combobox-trigger, .simple-combobox-trigger):not(.native-select-proxy) {
  min-height: var(--ui-control-height);
  height: var(--ui-control-height);
  min-width: 0;
  border-radius: var(--ui-control-radius);
  border-color: var(--line);
  padding-block: 0;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.shell .page-module :is(.input, .select, .styled-select-trigger, .contract-combobox-trigger, .simple-combobox-trigger):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell .page-module textarea.input {
  height: auto;
  min-height: 96px;
  padding-block: 10px;
}

.shell .page-module .table :is(th, td) {
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.shell .page-module .table th {
  font-size: 12px;
  font-weight: 600;
}

.shell .page-module .table td { font-size: 13px; }

.shell .page-module :is(.summary, .alpha-summary, .institutional-loan-summary, .risk-summary-grid, .forex-summary) > article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.shell .page-module :is(.summary, .alpha-summary, .institutional-loan-summary, .risk-summary-grid, .forex-summary) > article > strong {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.shell .page-module :is(.summary, .alpha-summary, .institutional-loan-summary, .risk-summary-grid, .forex-summary) > article > span {
  font-size: 12px;
  font-weight: 550;
}

@media (max-width: 900px) {
  :root { --ui-page-gutter: 20px; --ui-panel-padding: 20px; }
  .shell .page-module .section-head { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  :root {
    --ui-page-gutter: 14px;
    --ui-panel-padding: 16px;
    --ui-section-gap: 16px;
    --ui-control-height: 44px;
  }
  .shell { padding-top: 22px; }
  .shell > .page-intro { gap: 6px; margin-bottom: 20px; }
  .shell .page-intro h1 { font-size: 24px; }
  .shell .page-intro #subtitle { min-height: 42px; }
  .shell .page-module :is(.section-head, .trading-manual-test-summary) { gap: 12px; margin-bottom: 16px; padding-bottom: 14px; }
  .shell .page-module :is(.section-head h2, .trading-manual-test-summary h3) { font-size: 18px; }
  .shell .page-module > .account-settings-panel > .trading-card > :is(.trading-card-head, .section-head) h3 { font-size: 18px; }
  .shell .page-module :is(.trading-card, .trading-live-card, .notification-card, .notification-block, .institutional-loan-card) { padding: 14px; }
  .shell .page-module :is(.input, .select, .styled-select-trigger, .contract-combobox-trigger, .simple-combobox-trigger):not(.native-select-proxy) { font-size: 16px; }
  .shell .page-module :is(.summary, .alpha-summary, .institutional-loan-summary, .risk-summary-grid, .forex-summary) > article { padding: 16px; }
}
