@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn[wght].woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color: #241b0d;
  background: #f6f1e7;
  font-family: Vazirmatn, Tahoma, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-inline-size: 320px;
}

body {
  min-block-size: 100vh;
  margin: 0;
  font-weight: 400;
  background:
    radial-gradient(circle at 85% 10%, rgb(211 171 78 / 22%), transparent 26rem),
    #f6f1e7;
}

button,
output {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #185f63;
  outline-offset: 3px;
}

.page-shell {
  inline-size: min(calc(100% - 2rem), 68rem);
  margin-inline: auto;
  padding-block: clamp(1.25rem, 8vw, 4rem);
}

.portal-brand { display: flex; align-items: center; gap: .65rem; }
.portal-header #account-manage { display: grid; place-items: center; flex-shrink: 0; inline-size: 2.75rem; block-size: 2.75rem; padding: .65rem; }
#account-manage svg, #account-sidebar-close svg, .account-settings svg { inline-size: 1.2rem; block-size: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#account-manage .sidebar-toggle-mobile { display: none; }
#account-manage[aria-expanded=false] .sidebar-toggle-arrow { transform: translateX(20px) scaleX(-1); }
.portal-header #account-manage:hover, #accounts-panel .account-settings:hover, #accounts-panel #account-sidebar-close:hover { background: #eee5d5; }
#account-manage[hidden] { display: none; }

.quote-card {
  inline-size: min(100%, 34rem);
  margin-inline: auto;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: clamp(1rem, 5vw, 1.75rem);
  border: 1px solid #d8c9a4;
  border-radius: 1rem;
  background: rgb(255 253 247 / 94%);
  box-shadow: 0 1rem 2.5rem rgb(84 59 12 / 10%);
}

.trades-panel, .copy-panel {
  inline-size: 100%;
  overflow-x: auto;
  margin-block-start: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid #d8c9a4;
  border-radius: 1rem;
  background: rgb(255 253 247 / 94%);
  box-shadow: 0 1rem 2.5rem rgb(84 59 12 / 8%);
}

.accounts-heading { display: flex; justify-content: flex-start; align-items: center; gap: 0.6rem; }
#accounts-panel button, #account-dialog button {
  min-block-size: 2.5rem; padding: 0.35rem 0.75rem; border: 1px solid #9b741f;
  border-radius: 0.5rem; color: #4e370b; background: #fff4d4; font: inherit; cursor: pointer;
}
#accounts-panel ul { display: grid; gap: 0.5rem; margin: 1rem 0; padding: 0; list-style: none; }
#accounts-panel li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding-block: 0.5rem; border-block-start: 1px solid #eee5d5; }
#accounts-panel li span { flex: 1 1 12rem; overflow-wrap: anywhere; }
#account-other-server[hidden], #account-public-field[hidden], #account-form[hidden], #accounts-panel[hidden] { display: none; }
#selected-account-status, #account-form-error { color: #9d3e30; }
#account-dialog { inline-size: min(94vw, 38rem); max-block-size: 92vh; overflow: auto; border: 1px solid #dbcba6; border-radius: 1rem; color: #241b0d; background: #fffcf5; font-family: Vazirmatn, Tahoma, sans-serif; }
#account-dialog::backdrop { background: rgb(28 28 24 / 54%); }
#account-form { display: grid; gap: 0.8rem; }
#account-form h2 { margin: 0; }
#account-form label { display: grid; gap: 0.3rem; font-weight: 700; }
#account-form input:not([type="checkbox"]), #account-form select { inline-size: 100%; min-block-size: 2.7rem; padding-inline: 0.6rem; border: 1px solid #cfc09e; border-radius: 0.5rem; background: #fff; font: inherit; }
#account-form #account-public-field { display: flex; align-items: center; gap: 0.5rem; }
#account-public { inline-size: 1rem; block-size: 1rem; margin: 0; flex-shrink: 0; }
#account-form-error { min-block-size: 1.3rem; margin: 0; }

.chart-panel { margin-block-start: 1rem; padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid #d8c9a4; border-radius: 1rem; background: rgb(255 253 247 / 94%); box-shadow: 0 1rem 2.5rem rgb(84 59 12 / 8%); }
.chart-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.chart-heading .mock-notice { margin: 0; }
.chart-account-info { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.8rem; color: #665735; font-size: 0.9rem; }
.chart-account-info[hidden] { display: none; }
.chart-timeframe { display: flex; align-items: center; gap: 0.55rem; margin-inline-start: auto; white-space: nowrap; }
.chart-timeframe select { min-block-size: 2.5rem; padding-inline: 0.7rem; border: 1px solid #bba875; border-radius: 0.45rem; color: #241b0d; background: #fffdf7; font: inherit; direction: ltr; }
.chart-wrap { position: relative; margin-block-start: 0.75rem; }
.chart-prices { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 700; }
.chart-prices[hidden] { display: none; }
.chart-price { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem; border: 1px solid; border-radius: 0.6rem; font: inherit; font-weight: 700; cursor: pointer; }
.chart-price-ask { border-color: #9ccdb9; color: #126349; background: #edf8f1; }
.chart-price-bid { border-color: #e7aca4; color: #a33d36; background: #fff0ed; }
.chart-prices bdi { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
#candlestick-chart { inline-size: 100%; block-size: clamp(16rem, 42vw, 25rem); margin-block-start: 0.5rem; }

.trades-panel h2 { margin: 0; color: #4e370b; font-size: 1.35rem; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.trade-action, #trade-submit, #trade-dismiss { display: inline-grid; place-items: center; inline-size: 2.5rem; min-block-size: 2.5rem; padding: 0; border: 1px solid #9b741f; border-radius: 0.45rem; color: #4e370b; background: #fff4d4; font: inherit; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.trade-action { inline-size: 2.15rem; min-block-size: 2.15rem; margin-inline-start: 0.25rem; }
.trade-action svg, .dialog-actions svg { inline-size: 1.25rem; block-size: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#trade-dialog, #bulk-trade-dialog { inline-size: min(94vw, 35rem); max-block-size: min(92vh, 50rem); padding: 0; overflow: auto; border: 1px solid #dbcba6; border-radius: 1.25rem; color: #241b0d; background: #fffcf5; box-shadow: 0 2rem 5rem rgb(33 24 9 / 22%); font-family: Vazirmatn, Tahoma, sans-serif; }
#trade-dialog::backdrop, #bulk-trade-dialog::backdrop { background: rgb(28 28 24 / 54%); backdrop-filter: blur(3px); }
#trade-form { padding: clamp(1rem, 4vw, 1.6rem); }
.ticket-header { padding-block-end: 1rem; border-block-end: 1px solid #eadfc8; }
.ticket-eyebrow { margin: 0 0 0.2rem; color: #876c36; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em; }
.ticket-direction { display: inline-block; margin: 0; padding: 0.3rem 0.7rem; border-radius: 0.5rem; color: #126349; background: #edf8f1; font-size: 1rem; font-weight: 700; }
.ticket-direction.sell { color: #a33d36; background: #fff0ed; }
.ticket-direction[hidden] { display: none; }
#trade-form h2 { margin: 0; color: #35290f; font-size: 1.45rem; line-height: 1.4; }
.new-order-ticket .ticket-eyebrow, .new-order-ticket #trade-dialog-title { display: none; }
.new-order-ticket #trade-form { padding: 1rem; }
.new-order-ticket .ticket-header { padding-block-end: 0.7rem; }
.new-order-ticket #trade-form .ticket-direction { color: #126349; font-size: 1rem; }
.new-order-ticket #trade-form .ticket-direction.sell { color: #a33d36; }
.ticket-prices { display: flex; gap: 0.5rem; padding-block-start: 0.7rem; }
.ticket-prices[hidden] { display: none; }
.ticket-prices span { display: flex; justify-content: space-between; gap: 0.5rem; flex: 1; padding: 0.4rem 0.65rem; border: 1px solid #e0d5bf; border-radius: 0.55rem; font-size: 0.83rem; font-weight: 700; }
.ticket-prices span:first-child { color: #126349; background: #edf8f1; }
.ticket-prices span:last-child { color: #a33d36; background: #fff0ed; }
.ticket-prices bdi { font-variant-numeric: tabular-nums; }
#trade-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.85rem; padding-block: 1.2rem; }
#trade-editor-fields label { display: flex; flex-direction: column; gap: 0.38rem; min-inline-size: 0; }
#trade-editor-fields .ticket-field-price { grid-column: 1 / -1; }
.new-order-ticket #trade-editor-fields { gap: 0.75rem; padding-block: 0.8rem; }
.new-order-ticket #trade-editor-fields .ticket-field-price { grid-column: auto; }
.new-order-ticket #trade-editor-fields input:not([type="hidden"]) { min-block-size: 2.5rem; }
.ticket-label { color: #46391d; font-size: 0.9rem; font-weight: 700; }
.ticket-hint { color: #766e5d; font-size: 0.74rem; line-height: 1.55; }
#trade-editor-fields input:not([type="hidden"]) { inline-size: 100%; min-block-size: 2.9rem; min-inline-size: 0; padding-inline: 0.85rem; border: 1px solid #cfc09e; border-radius: 0.65rem; color: #292315; background: #fff; direction: ltr; font: inherit; font-weight: 600; }
#trade-editor-fields input:focus { border-color: #18636a; outline: 2px solid rgb(24 99 106 / 18%); }
#order-type-explanation.ticket-summary { margin: 0 0 1rem; padding: 0.8rem 1rem; border: 1px solid #cfdfd8; border-inline-start: 3px solid #287d71; border-radius: 0.7rem; color: #22574f; background: #eff8f4; line-height: 1.65; }
.new-order-ticket #order-type-explanation.ticket-summary { margin-block-end: 0.6rem; padding: 0.55rem 0.7rem; font-size: 0.85rem; }
#order-type-explanation[hidden] { display: none; }
#trade-action-result { margin: 0; color: #8b422d; line-height: 1.6; }
.dialog-actions { justify-content: flex-end; gap: 0.65rem; margin-block-start: 0.35rem; padding-block-start: 1rem; border-block-start: 1px solid #eadfc8; }
.new-order-ticket .dialog-actions { padding-block-start: 0.7rem; }
.dialog-actions #trade-submit, .dialog-actions #trade-dismiss { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; inline-size: auto; min-block-size: 2.75rem; padding-inline: 1rem; border-radius: 0.65rem; font-weight: 700; }
.dialog-actions #trade-submit { border-color: #185f63; color: #fff; background: #185f63; }
.dialog-actions #trade-dismiss { border-color: #d7cbb3; color: #5c5140; background: #fff; }
@media (max-width: 480px) { #trade-editor-fields { gap: 0.9rem 0.65rem; } .ticket-hint { font-size: 0.7rem; } }
.trade-notice { min-block-size: 1.5rem; margin-block: 0.6rem; color: #68480b; line-height: 1.7; }
.table-scroll { max-inline-size: 100%; overflow-x: auto; border: 1px solid #e3d8c2; border-radius: 0.5rem; }
.trades-panel table { inline-size: 100%; border-collapse: collapse; direction: rtl; text-align: right; white-space: nowrap; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 0.84rem; }
.trades-panel th, .trades-panel td { padding: 0.55rem 0.7rem; border-block-end: 1px solid #eee5d5; border-inline-start: 1px solid #eee5d5; }
.trades-panel tr.orders-separator td { border-block-start: 2px solid #cbb98f; }
.trades-panel tr > :last-child { border-inline-start: 0; }
.trades-panel td.trade-number { direction: ltr; text-align: right; }
.trades-panel .trade-profit-positive { color: #126349; }
.trades-panel .trade-profit-negative { color: #a33d36; }
.trades-panel th { color: #4e370b; background: #fff7df; font-weight: 700; }
.trades-panel td[colspan] { text-align: center; color: #665f51; }

.insights-panel { margin-block-start: 1rem; padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid #d8c9a4; border-radius: 1rem; background: rgb(255 253 247 / 94%); box-shadow: 0 1rem 2.5rem rgb(84 59 12 / 8%); }
.insights-panel h2 { margin: 0; color: #4e370b; font-size: 1.35rem; }
.insights-lede { margin: 0.4rem 0 0; color: #665735; font-size: 0.9rem; line-height: 1.7; }
.insights-panel .mock-notice { margin-block: 0.9rem 0; }
.insights-panel .status { margin-block: 0.9rem 0 0; }
/* Daily comparison and accessible, compact explanations. */
.insights-comparison { overflow-x: auto; margin-block-start: 1rem; }
#insights-table { inline-size: 100%; font-size: .8rem; border-collapse: collapse; }
#insights-table th, #insights-table td { padding: .65rem .4rem; border-block-end: 1px solid #e3d8c2; text-align: start; vertical-align: top; }
.insight-date { min-inline-size: 9rem; line-height: 1.8; }
.insight-date small { display: block; font-weight: normal; color: #766e5d; }
.insight-explain { padding: .15rem .25rem; border: 0; border-block-end: 1px dotted #956700; border-radius: .25rem; color: inherit; background: transparent; font: inherit; text-align: start; cursor: pointer; }
.insight-explain:focus-visible { outline: 2px solid #956700; outline-offset: 3px; }
.insight-explanation { position: fixed; inset: auto; margin: 0; inline-size: min(20rem, calc(100vw - 2rem)); max-block-size: 65dvh; overflow: auto; padding: .9rem; border: 1px solid #d8c9a4; border-radius: .7rem; background: #fff7df; color: #46391d; box-shadow: 0 .4rem 1.5rem #46391d30; font: inherit; font-weight: normal; line-height: 1.8; }
.insight-explanation p { margin: 0 0 .6rem; }
.insight-explanation-close { display: block; margin-inline-start: auto; padding: .3rem .7rem; border: 1px solid #956700; border-radius: .4rem; background: #fffdf7; color: #46391d; font: inherit; cursor: pointer; }
#insights-days { display: none; }
@media (max-width: 760px) {
  .insights-comparison { display: none; }
  #insights-days:not([hidden]) { display: grid; gap: .8rem; margin-block-start: 1rem; }
  .insight-day { padding: .8rem; border: 1px solid #e3d8c2; border-radius: .7rem; background: #fffdf7; min-inline-size: 0; }
  .insight-day h3 { margin: 0 0 .6rem; }
  .insight-day dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: .5rem; margin: 0; }
  .insight-explanation { inset: auto 0 1rem; margin-inline: auto; inline-size: calc(100vw - 2rem); }
  .insight-day dd { margin: 0; overflow-wrap: anywhere; }
}

.gold-identity {
  margin: 0;
  color: #4e370b;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.55;
}

.gold-identity bdi,
.price {
  direction: ltr;
  unicode-bidi: isolate;
}

.mock-notice {
  margin-block: 0.9rem 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid #8b671d;
  border-radius: 0.6rem;
  color: #5d4109;
  background: #fff4d4;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
}

.quote-value {
  min-inline-size: 0;
  margin-block: 1rem 0.75rem;
}

.price {
  display: block;
  max-inline-size: 100%;
  color: #664607;
  font-size: clamp(2.35rem, 14vw, 4.75rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: start;
  white-space: nowrap;
}

.status {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.8rem;
  border-inline-start: 0.3rem solid #8b671d;
  border-radius: 0.35rem;
  background: #fff7df;
  line-height: 1.75;
  font-weight: 400;
}

.status[hidden] {
  display: none;
}

.status::before {
  content: "•";
  flex: 0 0 auto;
  font-weight: 700;
}

.retry-button {
  min-block-size: 2.75rem;
  margin-block-start: 0.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid #185f63;
  border-radius: 0.6rem;
  color: #fff;
  background: #185f63;
  cursor: pointer;
  font-weight: 700;
}

.retry-button:hover:not(:disabled) {
  background: #10494c;
}

.retry-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.noscript-message {
  margin-block: 1rem 0;
  line-height: 1.8;
}

@media (max-width: 420px) {
  .page-shell {
    inline-size: min(calc(100% - 1rem), 34rem);
  }

  .quote-card {
    border-radius: 0.75rem;
  }

  .price {
    font-size: clamp(2rem, 13.5vw, 3.75rem);
  }
}

.insight-extremes { display: grid; gap: .35rem; }
/* Optional login follows the portal's ivory, gold and teal palette. */
.portal-header, .auth-controls { display: flex; align-items: center; gap: 0.75rem; }
.portal-header { flex-wrap: wrap; justify-content: space-between; margin-block-end: 0.8rem; }
.portal-header button { padding: 0.5rem 1rem; border: 1px solid #d7cbb3; border-radius: 0.65rem; font: inherit; color: #241b0d; background: #fffcf5; cursor: pointer; }
#auth-header-status { flex-basis: 100%; margin: 0; }
#auth-dialog {
  inline-size: min(calc(100vw - 2rem), 27rem);
  max-block-size: calc(100dvh - 2rem);
  overflow: auto;
  padding: 2rem;
  border: 1px solid #e5dcc9;
  border-radius: 1.5rem;
  color: #241b0d;
  background: radial-gradient(ellipse at 100% 0, #f6ecd4 0, transparent 48%), #fffcf7;
  box-shadow: 0 2rem 6rem rgb(30 26 16 / 24%), 0 0 0 6px rgb(255 252 245 / 12%);
  font-family: Vazirmatn, Tahoma, sans-serif;
}
#auth-dialog::backdrop { background: rgb(24 30 28 / 58%); backdrop-filter: blur(5px); }
#auth-dialog svg { inline-size: 1.25rem; block-size: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-dialog-top { display: flex; align-items: flex-start; justify-content: space-between; margin-block-end: 1.5rem; }
.auth-mark { display: grid; place-items: center; inline-size: 3.25rem; block-size: 3.25rem; border: 1px solid #d9c48e; border-radius: 1rem; color: #8c6c2a; background: linear-gradient(135deg, #fff8e7, #efe0b9); box-shadow: inset 0 1px 0 #fff; }
#auth-dialog .auth-mark svg { inline-size: 1.55rem; block-size: 1.55rem; }
#auth-dialog button { font: inherit; cursor: pointer; transition: background 150ms, border-color 150ms, box-shadow 150ms; }
#auth-dialog #auth-close { display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; padding: 0; border: 1px solid #e6dfd1; border-radius: 50%; color: #7c7466; background: rgb(255 255 255 / 60%); }
#auth-dialog #auth-close:hover { color: #241b0d; background: #f0e9dc; }
.auth-eyebrow { margin: 0 0 0.4rem; color: #8c7442; font-size: 0.75rem; font-weight: 600; }
#auth-title { margin: 0; font-size: 1.65rem; font-weight: 750; letter-spacing: -0.035em; line-height: 1.6; }
#auth-description { margin: 0.5rem 0 0; color: #7c7466; font-size: 0.85rem; line-height: 1.9; }
.auth-steps { display: flex; gap: 1rem; margin: 1.5rem 0; padding: 0 0 1.5rem; list-style: none; border-block-end: 1px solid #eae3d7; }
.auth-steps li { display: flex; align-items: center; gap: 0.45rem; color: #9b9487; font-size: 0.75rem; }
.auth-steps li + li::before { content: ''; inline-size: 1.5rem; block-size: 1px; margin-inline-end: 0.5rem; background: #ddd5c5; }
.auth-steps span { display: grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem; border: 1px solid #ded7ca; border-radius: 50%; font-size: 0.7rem; }
.auth-steps [aria-current] { color: #185f63; font-weight: 650; }
.auth-steps [aria-current] span { border-color: #185f63; color: #fff; background: #185f63; }
#auth-dialog label { display: block; margin-block-end: 0.65rem; font-size: 0.85rem; font-weight: 650; }
#auth-dialog input { box-sizing: border-box; display: block; inline-size: 100%; block-size: 3.5rem; padding: 0.75rem 1rem; border: 1px solid #dcd4c4; border-radius: 0.8rem; outline: none; color: #2c302b; background: rgb(255 255 255 / 85%); font: inherit; font-variant-numeric: tabular-nums; transition: border-color 150ms, box-shadow 150ms; }
#auth-dialog input::placeholder { color: #bbb3a3; }
#auth-dialog input:focus { border-color: #347c7d; box-shadow: 0 0 0 3px rgb(24 95 99 / 10%); }
#auth-dialog input[aria-invalid=true] { border-color: #bb5c4c; box-shadow: 0 0 0 3px rgb(187 92 76 / 8%); }
.auth-phone-field { position: relative; }
#auth-dialog .auth-phone-field svg { position: absolute; inset-block-start: 1.1rem; inset-inline-start: 1rem; color: #9c9484; pointer-events: none; }
#auth-dialog #auth-phone { padding-right: 3rem; font-size: 1.1rem; letter-spacing: 0.06em; }
.auth-hint { margin: 0.6rem 0 0; color: #948a78; font-size: 0.73rem; line-height: 1.8; }
.auth-number-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-block-end: 1.25rem; }
.auth-number-row p { margin: 0; color: #7c7466; font-size: 0.75rem; }
.auth-number-row bdi { margin-inline-start: 0.3rem; color: #413c32; font-size: 0.9rem; font-weight: 600; }
#auth-dialog #auth-change-phone, #auth-dialog #auth-resend { padding: 0.25rem 0; border: 0; color: #185f63; background: transparent; font-size: 0.75rem; font-weight: 650; }
#auth-dialog #auth-change-phone:hover, #auth-dialog #auth-resend:hover:not(:disabled) { color: #10494c; text-decoration: underline; text-underline-offset: 0.25rem; }
#auth-dialog #auth-code { block-size: 4.25rem; padding-inline: 0.75rem; text-align: center; font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 600; letter-spacing: 0.45em; text-indent: 0.45em; }
#auth-code::placeholder { font-weight: 400; }
#auth-expiry { text-align: center; }
#auth-error { margin: 1rem 0 0; padding: 0.7rem 0.85rem; border-radius: 0.65rem; color: #9a392e; background: #fbede8; font-size: 0.78rem; line-height: 1.9; }
#auth-error:empty { display: none; }
#auth-dialog #auth-submit { display: flex; align-items: center; justify-content: center; gap: 0.75rem; inline-size: 100%; min-block-size: 3.25rem; margin-block-start: 1.5rem; padding: 0.75rem 1rem; border: 1px solid #185f63; border-radius: 0.8rem; color: #fff; background: #185f63; box-shadow: 0 4px 10px rgb(24 95 99 / 10%); font-size: 0.9rem; font-weight: 650; }
#auth-dialog #auth-submit:hover:not(:disabled) { border-color: #10494c; background: #10494c; box-shadow: 0 5px 14px rgb(24 95 99 / 18%); }
#auth-dialog #auth-submit[aria-busy=true] svg { animation: auth-pulse 900ms ease-in-out infinite alternate; }
#auth-dialog button:disabled { opacity: 0.5; cursor: default; }
#auth-dialog button:focus-visible { outline: 2px solid #347c7d; outline-offset: 4px; }
#auth-resend-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-block-start: 1rem; color: #948a78; font-size: 0.73rem; }
#auth-resend-row[hidden] { display: none; }
.auth-footer { margin: 1.5rem 0 0; padding-block-start: 1.25rem; border-block-start: 1px solid #eae3d7; color: #a29886; font-size: 0.68rem; line-height: 1.9; text-align: center; }
@keyframes auth-pulse { to { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { #auth-dialog *, #auth-dialog *::before { animation: none !important; transition: none !important; } }
@media (max-width: 420px) {
  #auth-dialog { padding: 1.25rem; border-radius: 1.25rem; }
  #auth-title { font-size: 1.4rem; }
  #auth-description { font-size: 0.78rem; }
  .auth-dialog-top { margin-block-end: 1rem; }
  .auth-mark { inline-size: 2.75rem; block-size: 2.75rem; border-radius: 0.8rem; }
  .auth-steps { gap: 0.6rem; margin-block: 1rem; padding-block-end: 1rem; }
  .auth-steps li + li::before { inline-size: 1rem; margin-inline-end: 0; }
  .auth-number-row { margin-block-end: 1rem; }
  #auth-dialog #auth-submit { min-block-size: 3rem; margin-block-start: 1rem; }
  #auth-resend-row { margin-block-start: 0.75rem; }
  .auth-footer { margin-block-start: 1rem; padding-block-start: 1rem; }
}
.copy-panel h2 { margin: 0 0 0.75rem; color: #4e370b; font-size: 1.35rem; }
.copy-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.copy-form label { display: grid; gap: 0.3rem; }

/* Saved-account switcher shares the RTL workspace with the account views. */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.workspace.sidebar-open { grid-template-columns: 18rem minmax(0, 1fr); }
.workspace-content { min-inline-size: 0; }
.page-shell:has(.workspace.sidebar-open) { inline-size: min(calc(100% - 2rem), 88rem); }
#account-sidebar { position: sticky; top: 1rem; margin-block-start: 1rem; max-block-size: calc(100dvh - 2rem); overflow-y: auto; padding: 1rem; border: 1px solid #d8c9a4; border-radius: 1rem; background: #fffcf5; }
#account-sidebar[hidden], #account-sidebar-backdrop[hidden] { display: none; }
.accounts-heading { justify-content: space-between; }
.accounts-heading h2 { margin: 0; font-size: 1.1rem; }
#accounts-panel li.account-group-heading { display: block; margin-block-start: .5rem; border: 0; padding-block: .25rem; color: #665735; font-size: .85rem; font-weight: 700; }
#accounts-panel li.account-card { position: relative; display: block; padding: 0; border: 1px solid #e3d8c2; border-radius: .65rem; }
#accounts-panel .account-select { position: relative; display: grid; gap: .35rem; inline-size: 100%; min-inline-size: 0; padding: .6rem .7rem; border: 0; border-radius: .6rem; background: transparent; text-align: start; line-height: 1.6; }
#accounts-panel .account-card-title { display: grid; justify-items: start; align-content: start; gap: .1rem; min-inline-size: 0; min-block-size: 2.4rem; margin-inline-end: 4.5rem; }
#accounts-panel .account-identity { min-inline-size: 0; overflow-wrap: anywhere; font-size: .8rem; font-weight: 650; }
#accounts-panel .account-login { flex-shrink: 0; color: #766e5d; font-size: .65rem; font-weight: 400; }
#accounts-panel .account-copy-indicator { display: inline-block; margin-inline-start: .25em; white-space: nowrap; font-size: .8rem; }
#accounts-panel .account-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .7rem; margin-block-start: .15rem; padding-block-start: .5rem; border-block-start: 1px solid #e3d8c2; font-variant-numeric: tabular-nums; }
#accounts-panel .account-metric, #accounts-panel .account-return { display: flex; align-items: baseline; justify-content: space-between; gap: .3rem; font-size: .68rem; font-weight: 400; color: #766e5d; }
#accounts-panel .account-metric > span, #accounts-panel .account-return > span { flex: 0 1 auto; white-space: nowrap; }
#accounts-panel .account-metric bdi { color: #302719; font-size: .85rem; font-weight: 600; }
#accounts-panel .account-profit-positive { color: #1b7755; }
#accounts-panel .account-profit-negative { color: #ad5145; }
#accounts-panel .account-return-value { font-size: .8rem; font-variant-numeric: tabular-nums; }
#accounts-panel .account-summary-age { font-size: .65rem; font-weight: 400; color: #766e5d; }
#accounts-panel .account-summary-age[hidden] { display: none; }
#accounts-panel .account-summary-age.account-warning { color: #97602e; }
#accounts-panel .account-broker-logo { position: absolute; inset-block-start: .25rem; inset-inline-end: .25rem; inline-size: 2.25rem; block-size: 2rem; overflow: hidden; opacity: .5; mix-blend-mode: multiply; pointer-events: none; background-repeat: no-repeat; }
#accounts-panel .account-broker-capitalxtend { background-image: url('/brokers/capitalxtend.png'); background-size: 7rem auto; background-position: center -.25rem; }
#accounts-panel .account-broker-orbex { background-image: url('/brokers/orbex.png'); background-size: 3.25rem auto; background-position: center; }
#accounts-panel .account-broker-xchief { background-image: url('/brokers/xchief.svg'); background-size: contain; background-position: center; }
#accounts-panel .account-settings { position: absolute; z-index: 1; inset-block-start: .25rem; inset-inline-end: 2.75rem; display: grid; place-items: center; inline-size: 2rem; min-block-size: 2rem; padding: 0; border: 0; color: #665f51; background: transparent; }
#accounts-panel #account-sidebar-close { display: grid; place-items: center; inline-size: 2.75rem; min-block-size: 2.75rem; padding: 0; border-color: transparent; background: transparent; }
#accounts-panel #accounts-status:empty, #accounts-panel #broker-status:empty { display: none; }
#accounts-panel #accounts-list { margin-block: .65rem 0; gap: .35rem; }
#accounts-panel .account-card:has([aria-pressed=true]) { border-color: #185f63; background: #eaf2ef; }
#accounts-panel .account-select[aria-pressed=true] { font-weight: 700; }
#account-sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  #account-manage .sidebar-toggle-desktop { display: none; }
  #account-manage .sidebar-toggle-mobile { display: block; }
  #accounts-panel .account-settings { inline-size: 2.75rem; min-block-size: 2.75rem; inset-block-start: 0; inset-inline-end: 2.75rem; }
  #accounts-panel .account-card-title { margin-inline-end: 5rem; }
  #accounts-panel .account-broker-logo { inset-block-start: .375rem; inset-inline-end: 0; inline-size: 2.75rem; block-size: 2rem; }
  .workspace.sidebar-open { grid-template-columns: minmax(0, 1fr); }
  #account-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; inline-size: min(22rem, calc(100% - 2rem)); max-block-size: 100dvh; margin: 0; z-index: 21; border-radius: 0; }
  #account-sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: #1c1c188a; z-index: 20; }
  body:has(#account-sidebar[aria-modal=true]) { overflow: hidden; }
}

.bulk-toolbar { display: flex; justify-content: flex-start; margin-block-end: 0.7rem; }
#manage-trades { min-block-size: 2.75rem; padding: .55rem 1rem; border: 1px solid #cbb98e; border-radius: .65rem; color: #4e370b; background: #fff9eb; font-weight: 600; cursor: pointer; }
#manage-trades:hover:enabled { border-color: #9b741f; background: #fff4d4; }
#bulk-trade-dialog { inline-size: min(94vw, 40rem); }
#bulk-trade-form { --bulk-padding: clamp(1rem, 4vw, 1.6rem); padding: var(--bulk-padding) var(--bulk-padding) 0; }
.bulk-header { padding-block-end: 1.1rem; border-block-end: 1px solid #eadfc8; }
.bulk-heading { display: flex; align-items: center; gap: .8rem; }
.bulk-heading-icon { display: grid; place-items: center; flex-shrink: 0; inline-size: 2.8rem; block-size: 2.8rem; border: 1px solid #e2d5b7; border-radius: .85rem; color: #886722; background: #f8efd9; }
.bulk-heading svg, .bulk-empty svg { inline-size: 1.5rem; block-size: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bulk-heading h2 { margin: 0; color: #35290f; font-size: 1.35rem; }
.bulk-heading p { margin: .2rem 0 0; color: #766e5d; font-size: .8rem; line-height: 1.7; }
.bulk-account { display: inline-block; max-inline-size: 100%; margin: .9rem 0 0; padding: .25rem .65rem; border: 1px solid #e2d8c4; border-radius: .45rem; color: #665735; background: #f7f2e8; font-size: .78rem; overflow-wrap: anywhere; }
#bulk-inputs { display: grid; gap: 1.25rem; min-inline-size: 0; margin: 1.2rem 0; padding: 0; border: 0; }
.bulk-field { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.bulk-field legend, .bulk-price-label { margin-block-end: .6rem; padding: 0; color: #46391d; font-size: .85rem; font-weight: 700; }
.bulk-segments { display: flex; gap: .25rem; padding: .3rem; border: 1px solid #e2d8c4; border-radius: .75rem; background: #f3eee4; }
.bulk-segments label, .bulk-choice { position: relative; cursor: pointer; }
.bulk-segments label { flex: 1; min-inline-size: 0; }
.bulk-segments input, .bulk-choice input { position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: 0; opacity: 0; }
.bulk-segments span { display: grid; place-items: center; min-block-size: 2.5rem; padding: .35rem .4rem; border: 1px solid transparent; border-radius: .5rem; color: #766e5d; font-size: .85rem; text-align: center; }
.bulk-segments input:checked + span { border-color: #c7d9d2; color: #185f63; background: #fff; box-shadow: 0 2px 5px rgb(33 24 9 / 6%); font-weight: 700; }
.bulk-segments .bulk-buy input:checked + span { border-color: #9ccdb9; color: #126349; background: #edf8f1; }
.bulk-segments .bulk-sell input:checked + span { border-color: #e7aca4; color: #a33d36; background: #fff0ed; }
.bulk-segments label:has(input:focus-visible), .bulk-choice:has(input:focus-visible) { outline: 3px solid #185f63; outline-offset: 3px; border-radius: .65rem; }
.bulk-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.bulk-choice { display: flex; align-items: center; gap: .6rem; min-block-size: 4.4rem; padding: .7rem .8rem; border: 1px solid #e0d5bf; border-radius: .75rem; background: #fffefa; transition: border-color .15s, background-color .15s; }
.bulk-choice:hover { border-color: #b8a987; }
.bulk-choice:has(input:checked) { border-color: #28756e; background: #edf5f1; box-shadow: inset 0 0 0 1px #28756e; }
.bulk-choice-mark { display: grid; place-items: center; flex-shrink: 0; inline-size: 1rem; block-size: 1rem; border: 1.5px solid #c9bfa9; border-radius: 50%; background: #fff; }
input:checked + .bulk-choice-mark { border-color: #28756e; background: #28756e; }
input:checked + .bulk-choice-mark::after { content: ''; inline-size: .35rem; block-size: .35rem; border-radius: 50%; background: #fff; }
.bulk-choice strong { display: block; color: #423820; font-size: .83rem; font-weight: 600; line-height: 1.7; }
.bulk-choice small { display: block; margin-block-start: .15rem; color: #766e5d; font-size: .7rem; line-height: 1.65; }
.bulk-profitable strong { color: #126349; }
.bulk-losing strong, .bulk-close-all strong { color: #a33d36; }
.bulk-close-all { grid-column: 1 / -1; background: #fff8f4; }
.bulk-close-all:has(input:checked) { border-color: #b75e50; background: #fff0eb; box-shadow: inset 0 0 0 1px #b75e50; }
.bulk-close-all input:checked + .bulk-choice-mark { border-color: #b75e50; background: #b75e50; }
.bulk-group-label { margin: 1rem 0 .55rem; color: #766e5d; font-size: .75rem; font-weight: 600; }
#bulk-inputs:disabled .bulk-choice, #bulk-inputs:disabled .bulk-segments { opacity: .55; cursor: not-allowed; }
#bulk-sl-inputs { display: grid; gap: .8rem; padding: 1rem; border: 1px solid #ded4bd; border-radius: .85rem; background: #f7f3eb; }
.bulk-price-label { display: grid; gap: .45rem; margin: 0; }
#bulk-stop-loss { inline-size: 100%; min-inline-size: 0; min-block-size: 2.9rem; padding: .5rem .85rem; border: 1px solid #cfc09e; border-radius: .65rem; color: #292315; background: #fff; font: inherit; font-variant-numeric: tabular-nums; }
.bulk-hint { margin: 0; color: #766e5d; font-size: .75rem; line-height: 1.8; }
.bulk-info { margin: 0; padding: .8rem 1rem; border-inline-start: 3px solid #287d71; border-radius: .6rem; color: #22574f; background: #eff8f4; font-size: .8rem; line-height: 1.9; }
#bulk-message { margin: .8rem 0; color: #805333; font-size: .82rem; line-height: 1.9; overflow-wrap: anywhere; }
#bulk-message:empty { display: none; }
#bulk-confirmation, #bulk-results, #bulk-progress { margin-block: 1rem; padding: 1rem; border: 1px solid #cdded6; border-radius: .85rem; background: #f2f7f3; }
#bulk-confirmation h3 { margin: 0 0 .25rem; color: #22574f; font-size: 1rem; }
#bulk-confirm-summary { display: grid; gap: .45rem; margin: .85rem 0 0; font-size: .82rem; }
#bulk-confirm-summary > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; padding-block: .35rem; border-block-end: 1px solid #dce6df; }
#bulk-confirm-summary dt { color: #766e5d; }
#bulk-confirm-summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
#bulk-confirmation > p:not(.bulk-hint) { margin-block: .8rem 0; font-size: .8rem; line-height: 1.9; }
#bulk-copy-disclosure { color: #805333; }
#bulk-progress-bar { inline-size: 100%; accent-color: #28756e; }
#bulk-progress-text, #bulk-result-counts { margin: .4rem 0; color: #22574f; font-size: .85rem; font-weight: 600; }
#bulk-results { border-color: #dfd3b9; background: #fffefa; }
#bulk-result-list { display: grid; gap: .6rem; margin-block-end: 0; padding-inline-start: 1.3rem; font-size: .8rem; line-height: 1.9; overflow-wrap: anywhere; }
#bulk-result-list li { padding-inline-start: .2rem; }
#bulk-result-list p { margin-block: .25rem; }
#bulk-result-list [data-status="failed"] { color: #a33d36; }
#bulk-result-list [data-status="succeeded"] { color: #126349; }
.bulk-empty { padding: 2.5rem .5rem; text-align: center; }
.bulk-empty svg { inline-size: 2.5rem; block-size: 2.5rem; color: #a08c61; }
.bulk-empty h3 { margin: .8rem 0 .35rem; color: #46391d; font-size: 1rem; }
.bulk-empty p { margin: 0; color: #766e5d; font-size: .85rem; line-height: 1.9; }
#bulk-trade-form .dialog-actions { position: sticky; inset-block-end: 0; margin-inline: calc(-1 * var(--bulk-padding)); padding: .85rem var(--bulk-padding); background: #fffcf5; box-shadow: 0 -.5rem 1rem rgb(255 252 245 / 90%); }
#bulk-trade-form .dialog-actions button { min-block-size: 2.75rem; padding: .55rem 1.1rem; border: 1px solid #d7cbb3; border-radius: .65rem; color: #5c5140; background: #fff; font-weight: 600; cursor: pointer; }
#bulk-trade-form #bulk-preview, #bulk-trade-form #bulk-confirm { margin-inline-end: auto; border-color: #185f63; color: #fff; background: #185f63; }
#bulk-trade-form #bulk-preview:hover:enabled, #bulk-trade-form #bulk-confirm:hover:enabled { background: #124d50; }
#bulk-trade-dialog [hidden] { display: none; }
@media (max-width: 420px) {
  .bulk-heading-icon { display: none; }
  .bulk-choice { gap: .4rem; padding: .6rem; }
  .bulk-choice strong { font-size: .76rem; }
  .bulk-choice small { font-size: .65rem; }
  #bulk-scope .bulk-segments span { font-size: .72rem; }
}
