.cx-panel { margin-block: 1.25rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid #cad5de; border-radius: 12px; background: #f6f8fa; color: #182535; }
.cx-form { margin-block:1.2rem; }
.cx-controls, .cx-output { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: .85rem 1.2rem; align-items:end; }
.cx-controls label { display:grid; gap:.35rem; font-weight:650; line-height:1.35; }
.cx-controls select,.cx-controls input { width:100%; max-width:100%; font:inherit; color:#162535; background:#fff; border:1px solid #8799a7; padding:.65rem; border-radius:6px; min-height:44px; }
.cx-controls select:focus-visible,.cx-controls input:focus-visible,.cx-panel a:focus-visible { outline:3px solid #236ea2; outline-offset:2px; }
.cx-output { margin-top:1.25rem; align-items:start; }
.cx-output dt { font-weight:600; } .cx-output dd { margin: .35rem 0; font-size:1.1rem; overflow-wrap:anywhere; }
.cx-total { font-size:clamp(1.8rem,3vw,2.6rem); font-weight:700; line-height:1.2; margin-block:.5rem; }
.cx-error { color:#9b2031; } .cx-error:empty { display:none; }
.cx-panel a, .cx-guide a, .cx-addition a { text-decoration: underline; text-underline-offset: .15em; }
.cx-panel [hidden], .cx-form[hidden] { display:none!important; }
.cx-demo-layout { display:grid; grid-template-columns:minmax(0, min(44vw, 460px)) minmax(0,650px); gap:clamp(1.2rem,3vw,3rem); justify-content:center; align-items:start; padding-inline:max(1rem,4vw)!important; }
.cx-demo-layout .cqg-demo { margin:0!important; width:100%!important; max-width:100%!important; grid-column:2; grid-row:1; }
.cx-demo-layout .cx-guide { grid-row:1; grid-column:1; max-width:38rem; background:white; padding:clamp(1rem,2vw,1.6rem); border:1px solid #d7dde1; border-radius:12px; }
.cx-guide figure { margin:1rem 0; } .cx-guide figure img { display:block; width:auto; height:auto; max-height:300px; max-width:100%; margin-inline:auto; }
.cx-guide figcaption { font-size:.875rem; margin-block:.45rem; text-align:center; }
.cx-guide ol { padding-inline-start:1.5rem; } .cx-guide li { margin-block:.5rem; }
.cx-addition { margin-block:1rem; } .cx-addition img.cx-phone { width:190px; max-width:100%; height:auto; border:1px solid #c4cfd7; }
.cx-archive summary { cursor:pointer; font-weight:650; padding:.6rem 0; }
.cx-hours-result { margin-block:.6rem; } .trader-row .wrap { flex-wrap:wrap; }
@media(max-width:760px) { .cx-demo-layout { display:flex; flex-direction:column; } .cx-demo-layout .cqg-demo,.cx-demo-layout .cx-guide { width:100%; }.cx-guide figure img {max-height:230px;} }

.cx-neighbors:not(:empty) { display:flex; flex-wrap:wrap; gap:.5rem; margin:.65rem 0 1rem; }
.cx-neighbors button { cursor:pointer; min-height:44px; }

/* Preserve the original ribbon, dividers and typography from the homepage. */
.trader-row .wrap h2 > a {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}
.trader-row .wrap h2 > a::after {content: none}
@media (min-width: 681px) {
  .trader-row:has(.all-tools) .wrap {grid-template-columns: auto repeat(3,minmax(0,1fr)) auto}
}
@media (max-width: 680px) {
  /* Paint the diagonal in a single 12px background strip, even when the menu grows. */
  main .trader-row {
    background: linear-gradient(to bottom right, transparent 48.5%, white 51.5%)
                right top / 12px 100% no-repeat #17263e;
  }
  [dir="rtl"] main .trader-row {
    background-image: linear-gradient(to bottom left, transparent 48.5%, white 51.5%);
    background-position: left top;
  }
  main .trader-row .wrap::before {content: none}
  main .trader-row .wrap {width:100%;padding:7px 20px 5px}
  .trader-row .wrap h2 {min-height:26px}
  .trader-row .wrap > .all-tools {display:none}
}

.trader-row .more-tools {display:none}
@media (max-width:680px) {
  .trader-row .more-tools {display:block;grid-column:1/-1}
  .trader-row .more-tools summary {
    position:absolute;inset-block-start:7px;inset-inline-end:20px;
    display:flex;align-items:center;gap:7px;min-height:26px;padding-inline:10px;
    color:white;cursor:pointer;font-size:.8125rem;font-weight:600;line-height:1.2;
    border-radius:999px;background:rgb(255 255 255 / .055);
    box-shadow:inset 0 0 0 1px rgb(215 231 249 / .31);
    list-style:none;
  }
  .trader-row .more-tools summary::before {content:"";position:absolute;inset:-5px 0 0}
  .trader-row .more-tools[open] summary {background:rgb(255 255 255 / .13)}
  .trader-row .more-tools summary::-webkit-details-marker {display:none}
  .trader-row .more-tools summary::after {
    content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;
    transform:translateY(-2px) rotate(45deg);
  }
  .trader-row .more-tools[open] summary::after {transform:translateY(2px) rotate(225deg)}
  .trader-row .more-tools summary:focus-visible {outline:2px solid white;outline-offset:2px}
  .trader-row .more-tools div {margin-block-start:4px;border-block-start:1px solid #526179}
  .trader-row .more-tools div a {border:0;padding-inline:0;min-height:44px}
  .trader-row .more-tools div a + a {border-block-start:1px solid rgb(198 215 235 / .16)}
  .trader-row .more-tools div a::after {display:block;margin-inline-end:3px}
  .trader-row .wrap h2 {max-width:56%;padding-inline-end:0}
}

.tool-directory {padding-block:clamp(24px, 3.5vw, 48px)}
.tool-directory .resource-toolbar {margin-bottom:20px}
.tool-directory .search-wrap {max-width:27rem}
.tool-directory .search-wrap input {border-radius:12px}
.tool-app-grid {
  display:grid;
  grid-template-columns:repeat(7, minmax(0,1fr));
  align-items:start;
  gap:22px 5px;
  padding:clamp(18px, 2.5vw, 35px) clamp(9px, 2vw, 28px);
  border:1px solid #dbe2ea;
  border-radius:22px;
  background:linear-gradient(150deg, #f5f8fc, #fbfcfe 57%, #f4f7fb);
}
.tool-app-grid > .card {
  display:block;
  min-width:0;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
}
.tool-app-grid > .card[hidden], .tool-app-grid > .card > :not(a),
.tool-app-grid:not(:has(> article:not([hidden]))) {display:none}
.tool-app-link {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:6px 2px;
  border-radius:14px;
  color:#182b43;
  text-align:center;
  text-decoration:none;
}
.tool-app-link:focus-visible {outline:2px solid #245b98;outline-offset:2px}
.tool-app-name {
  max-width:16ch;
  color:inherit;
  font-size:.91rem;
  font-weight:650;
  letter-spacing:-.012em;
  line-height:1.28;
  text-wrap:balance;
  overflow-wrap:anywhere;
  hyphens:auto;
}
.tool-glyph {
  --light:#477899;
  --dark:#1a3654;
  display:grid;
  place-items:center;
  width:62px;
  height:62px;
  border-radius:15px;
  color:white;
  background:
    radial-gradient(ellipse at 17% -15%, rgb(255 255 255 / .24), transparent 67%),
    linear-gradient(150deg, var(--light), var(--dark));
  box-shadow:inset 0 1px 0 rgb(255 255 255 / .38), inset 0 0 0 1px rgb(19 37 60 / .11),
             0 3px 5px -2px rgb(18 37 62 / .28);
}
.tool-glyph svg {
  width:65%;height:65%;
  fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;
}
.tool-glyph[data-icon="profit"]     {--light:#267b83;--dark:#13565e}
.tool-glyph[data-icon="ticks"]      {--light:#796aa3;--dark:#473962}
.tool-glyph[data-icon="costs"]      {--light:#ca5545;--dark:#932f35}
.tool-glyph[data-icon="margin"]     {--light:#477bc2;--dark:#224888}
.tool-glyph[data-icon="levels"]     {--light:#348477;--dark:#15554e}
.tool-glyph[data-icon="news"]       {--light:#62748c;--dark:#344155}
.tool-glyph[data-icon="blog"]       {--light:#ab7f44;--dark:#76512a}
.tool-glyph[data-icon="quotes"]     {--light:#4283ae;--dark:#205579}
.tool-glyph[data-icon="signals"]    {--light:#696dad;--dark:#40447b}
.tool-glyph[data-icon="newsletter"] {--light:#45818d;--dark:#265a68}
.tool-glyph[data-icon="webinars"]   {--light:#9d647e;--dark:#663c59}
.tool-glyph[data-icon="exchanges"]  {--light:#617e98;--dark:#344d67}
.tool-glyph[data-icon="fees"]       {--light:#a27554;--dark:#694839}
.tool-glyph[data-icon="education"]  {--light:#646e98;--dark:#394467}
.tool-app-link:focus-visible .tool-app-name {text-decoration:underline;text-underline-offset:3px}
@media (hover:hover) {
  .tool-app-link:hover {color:#235684}
  .tool-app-link:hover .tool-app-name {text-decoration:underline;text-underline-offset:3px}
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .tool-glyph {transition:transform .16s ease}
  .tool-app-link:hover .tool-glyph {transform:translateY(-2px)}
}
@media (max-width:959px) {
  .tool-app-grid {grid-template-columns:repeat(5, minmax(0,1fr))}
}
@media (max-width:680px) {
  .tool-directory .search-wrap {max-width:none}
  .tool-directory .resource-toolbar {margin-bottom:12px}
  .tool-app-grid {grid-template-columns:repeat(3, minmax(0,1fr));gap:13px 2px;border-radius:17px}
  .tool-glyph {width:53px;height:53px;border-radius:13px}
  .tool-app-link {gap:8px}
  .tool-app-name {font-size:.8125rem}
}
@media (forced-colors:active) {
  .tool-glyph {border:1px solid ButtonText;color:ButtonText;background:Canvas}
}

.trader-row .wrap > .shortcut{display:flex;align-items:center;justify-content:flex-start;gap:8px}
.trader-row .shortcut .tool-glyph{width:32px;height:32px;flex:none;border-radius:8px}
.trader-row .shortcut::after{display:none}
.tool-app-grid > h2[data-group]{grid-column:1/-1;margin:0;font-size:1.1rem;line-height:1.35}
.tool-app-grid > h2[data-group]:not(:first-child){border-block-start:1px solid #dbe2ea;padding-block-start:1rem}
.tool-app-grid:not(:has(article[data-group="plan"]:not([hidden]))) h2[data-group="plan"],
.tool-app-grid:not(:has(article[data-group="market"]:not([hidden]))) h2[data-group="market"],
.tool-app-grid:not(:has(article[data-group="learn"]:not([hidden]))) h2[data-group="learn"]{display:none}
@media (max-width:680px) {
  main .trader-row .wrap {
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:auto auto;
    gap:0;
    padding:3px 16px 8px;
    align-items:stretch;
  }
  main .trader-row .wrap h2 {grid-area:1/1/2/3;max-width:none;min-height:32px}
  main .trader-row .wrap > .all-tools {
    grid-area:1/3;display:flex;justify-self:end;align-items:center;
    min-height:32px;padding:0 4px;border:0;
  }
  main .trader-row .wrap > .shortcut {
    grid-row:2;display:flex;flex-direction:column;justify-content:flex-start;
    align-items:center;gap:5px;padding:4px 3px 0;border:0;min-width:0;
    min-height:48px;text-align:center;font-size:.875rem;line-height:1.2;
    text-wrap:balance;overflow-wrap:anywhere;
  }
  main .trader-row .shortcut .tool-glyph {width:32px;height:32px}
}

.trader-row .mobile-tool-name {display:none}
@media (max-width:680px) {
  .trader-row .full-tool-name {display:none}
  .trader-row .mobile-tool-name {display:inline}
}
