#mobile-stock-editor {
  --editor-bg:#0f1d25; --editor-field:#091720; --editor-text:#e8edf2;
  --editor-muted:#a6b3c2; --editor-border:#2b4554; --editor-accent:#25d5df;
  box-sizing:border-box; width:min(400px,calc(100% - 28px)); max-height:calc(100dvh - 28px);
  margin:auto; padding:16px; border:1px solid var(--editor-border); border-radius:14px;
  background:var(--editor-bg); color:var(--editor-text); overflow-y:auto;
  box-shadow:0 24px 70px #0006; color-scheme:dark; overscroll-behavior:contain;
}
#mobile-stock-editor:not([open]) { display:none !important; }
#mobile-stock-editor::backdrop { background:#030a10bf; backdrop-filter:blur(6px); }
html[data-appearance="light"] #mobile-stock-editor {
  --editor-bg:#fff; --editor-field:#f2f7fb; --editor-text:#173353;
  --editor-muted:#607c99; --editor-border:#c7dce9; --editor-accent:#009c93; color-scheme:light;
}
html body #mobile-stock-editor form { display:grid; gap:12px; margin:0; }
html body #mobile-stock-editor header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
html body #mobile-stock-editor h2 { margin:0; color:var(--editor-text); font-size:18px; line-height:1.3; }
html body #mobile-stock-editor .stock-editor-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:10px 10px; }
html body #mobile-stock-editor label { display:grid; gap:4px; min-width:0; color:var(--editor-muted); font-size:11px; font-weight:650; }
html body #mobile-stock-editor .wide { grid-column:1 / -1; }
html body #mobile-stock-editor .stock-editor-broker { min-width:0; }
html body #mobile-stock-editor .stock-editor-sector { min-width:0; }
html body #mobile-stock-editor #stock-editor-sector-options { max-height:180px; overflow-y:auto; margin-top:6px; border:1px solid var(--editor-border); border-radius:9px; background:var(--editor-field); overscroll-behavior:contain; }
html body #mobile-stock-editor #stock-editor-sector-options[hidden] { display:none !important; }
html body #mobile-stock-editor #stock-editor-sector-options button { display:block; width:100%; min-height:44px; text-align:left; border:0; border-radius:0; font-size:14px; font-weight:500; white-space:normal; overflow-wrap:anywhere; }
html body #mobile-stock-editor #stock-editor-sector-options button:is(:hover,:focus-visible) { color:var(--editor-accent); outline:1px solid var(--editor-accent); outline-offset:-1px; }
html body #mobile-stock-editor #stock-editor-broker-options { max-height:180px; overflow-y:auto; margin-top:6px; border:1px solid var(--editor-border); border-radius:9px; background:var(--editor-field); overscroll-behavior:contain; }
html body #mobile-stock-editor #stock-editor-broker-options[hidden] { display:none !important; }
html body #mobile-stock-editor #stock-editor-broker-options button { display:block; width:100%; min-height:44px; text-align:left; border:0; border-radius:0; font-size:14px; font-weight:500; white-space:normal; overflow-wrap:anywhere; }
html body #mobile-stock-editor #stock-editor-broker-options button:is(:hover,:focus-visible) { color:var(--editor-accent); outline:1px solid var(--editor-accent); outline-offset:-1px; }
html body #mobile-stock-editor :is(input,select) {
  box-sizing:border-box !important; display:block !important; min-width:0 !important; width:100% !important;
  height:38px !important; margin:0 !important; padding:6px 8px !important; border:1px solid var(--editor-border) !important;
  border-radius:7px !important; background:var(--editor-field) !important; color:var(--editor-text) !important;
  -webkit-text-fill-color:var(--editor-text) !important; font:inherit !important; font-size:16px !important; opacity:1 !important;
}
html body #mobile-stock-editor :is(input,select):focus { outline:2px solid var(--editor-accent) !important; outline-offset:2px; }
html body #mobile-stock-editor input::placeholder { color:var(--editor-muted) !important; -webkit-text-fill-color:var(--editor-muted) !important; opacity:.7; }
html body #mobile-stock-editor footer { display:grid; grid-template-columns:.8fr 1.2fr; gap:10px; }
html body #mobile-stock-editor button { min-height:40px; padding:8px 10px; margin:0; border:1px solid var(--editor-border); border-radius:8px; background:var(--editor-field); color:var(--editor-text); font-size:13px; font-weight:700; }
html body #mobile-stock-editor button[type="submit"] { background:var(--editor-accent); border-color:var(--editor-accent); color:#05282d; }
html[data-appearance="light"] body #mobile-stock-editor button[type="submit"] { color:#fff; }
html body #mobile-stock-editor header button { min-height:30px; width:30px; padding:0; font-size:20px; }
html body #mobile-stock-editor button:disabled { opacity:.55; }
html body #mobile-stock-editor :is(input[readonly],select:disabled) { cursor:default; border-style:dashed !important; font-size:14px !important; }
html body #mobile-stock-editor [role="status"] { margin:0; color:var(--editor-muted); font-size:13px; }
html body #mobile-stock-editor [role="alert"] { margin:0; color:#ed7373; font-size:13px; }
html[data-appearance="light"] body #mobile-stock-editor [role="alert"] { color:#be3030; }
html body #mobile-stock-editor button.stock-editor-delete { color:#ed7373; border-color:#ed7373; }
html[data-appearance="light"] body #mobile-stock-editor button.stock-editor-delete { color:#be3030; border-color:#be3030; }
@media (max-width:760px) {
  @keyframes stocks-mobile-refresh-spin {
    to { transform:rotate(360deg); }
  }
  html body #stocks-section .stocks-mobile-refresh.is-refreshing svg {
    animation:stocks-mobile-refresh-spin .8s linear infinite !important;
    transform-origin:center;
    transform-box:fill-box;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools .stocks-mobile-refresh.is-refreshing {
    opacity:1 !important;
    cursor:progress;
  }
  html:not([data-appearance="light"]) body #stocks-section .stocks-mobile-row .stocks-mobile-broker .stocks-mobile-risk:is(.high,.medium,.safe,.very-safe) {
    filter:brightness(.9);
  }
  /* Four explicit columns keep the search/action proportions and all gaps equal. */
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-toolbar {
    grid-template-columns:minmax(0,1fr) 76px 40px 36px !important;
    gap:9px !important;
    padding:12px !important;
    align-items:stretch !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-search-control {
    height:41px !important;
    margin:0 !important;
    padding:0 11px !important;
    gap:12px !important;
    border-radius:6px !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-search-control svg {
    width:18px !important;
    height:18px !important;
    flex:0 0 18px !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools {
    display:contents !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools > button {
    grid-row:1 !important;
    width:100% !important;
    min-width:0 !important;
    height:41px !important;
    min-height:41px !important;
    margin:0 !important;
    padding:0 !important;
    border:1px solid var(--mobile-stocks-border) !important;
    border-radius:6px !important;
    background:var(--mobile-stocks-panel) !important;
    color:var(--mobile-stocks-text) !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools > button:nth-child(1) {
    grid-column:2 !important;
    background:#00c8d7 !important;
    border-color:#15d7e3 !important;
    color:#04242b !important;
    font-size:14px !important;
    font-weight:750 !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools > button:nth-child(2) { grid-column:3 !important; }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools > button:nth-child(3) { grid-column:4 !important; }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools > button[aria-expanded="true"] {
    color:var(--mobile-stocks-accent) !important;
    border-color:var(--mobile-stocks-accent) !important;
  }
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section .stocks-mobile-tools svg {
    width:23px !important;
    height:23px !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-panel#stocks-mobile-filters {
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:10px !important;
    padding:12px !important;
    border:1px solid #176575 !important;
    border-radius:14px !important;
    background:linear-gradient(135deg,#10232e,#0c1a23) !important;
    box-shadow:0 8px 22px #02090d35 !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-panel#stocks-mobile-filters[hidden] {
    display:none !important;
  }
  html[data-appearance="light"] body #stocks-section#stocks-section#stocks-section .stocks-mobile-panel#stocks-mobile-filters {
    border-color:#c3dfea !important;
    background:linear-gradient(135deg,#f2f9fd,#eaf4f9) !important;
    box-shadow:0 8px 22px #24445c12 !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-heading {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto auto !important;
    grid-column:1 / -1 !important;
    align-items:center !important;
    gap:10px !important;
    min-width:0 !important;
    margin-bottom:1px !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-heading strong {
    color:var(--mobile-stocks-text) !important;
    font-size:15px !important;
    font-weight:750 !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-heading button.stocks-mobile-panel-reset {
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:5px !important;
    width:auto !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 4px !important;
    border:0 !important;
    background:transparent !important;
    color:var(--mobile-stocks-accent) !important;
    font-size:13px !important;
    font-weight:550 !important;
    white-space:nowrap !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-heading button.stocks-mobile-panel-close {
    width:32px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    color:var(--mobile-stocks-muted) !important;
    font-size:28px !important;
    font-weight:300 !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-field {
    display:block !important;
    min-width:0 !important;
    margin:0 !important;
  }
  html body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-field select {
    height:42px !important;
    padding:0 8px !important;
    border-radius:8px !important;
    border-color:var(--mobile-stocks-border) !important;
    background:var(--mobile-stocks-panel) !important;
    color:var(--mobile-stocks-text) !important;
    font-size:14px !important;
  }
  html[data-appearance="light"] body #stocks-section#stocks-section#stocks-section #stocks-mobile-filters .stocks-mobile-panel-field select {
    background:#fff !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools {
    align-items:stretch !important;
    gap:6px !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools button {
    flex:0 0 40px !important;
    width:40px !important;
    height:40px !important;
    min-height:40px !important;
    box-sizing:border-box !important;
    padding:6px !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools button.stocks-mobile-add {
    flex:1 1 auto !important;
    width:auto !important;
    min-width:76px !important;
    padding:0 10px !important;
    border-color:var(--mobile-stocks-accent) !important;
    background:var(--mobile-stocks-accent) !important;
    color:#06262b !important;
    font-size:14px !important;
    font-weight:750 !important;
    white-space:nowrap !important;
    text-align:center !important;
  }
  html[data-appearance="light"] body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools button.stocks-mobile-add {
    color:#06262b !important;
  }
  html body #stocks-section#stocks-section#stocks-section .stocks-mobile-tools button:disabled {
    opacity:.55 !important;
  }
  /* iOS Safari zooms focused inputs when their computed font is below 16px. */
  html body #stocks-section#stocks-section#stocks-section #stocks-search-input {
    font-size:16px !important;
  }
  html body #stocks-section.active .stocks-mobile-holding > .stocks-mobile-row,
  html body #stocks-section#stocks-section#stocks-section.active .stocks-mobile-head {
    grid-template-columns:minmax(0,1.2fr) minmax(0,.92fr) minmax(0,.72fr) minmax(0,.9fr) minmax(0,1.15fr) !important;
  }
  html body #stocks-section#stocks-section#stocks-section.active .stocks-mobile-head {
    padding-left:10px !important; padding-right:10px !important;
  }
  html body #stocks-section.active .stocks-mobile-holding > .stocks-mobile-row {
    padding-left:10px !important; padding-right:10px !important;
  }
  html body #stocks-section.active .stocks-mobile-risk {
    white-space:normal !important; overflow-wrap:anywhere !important; line-height:1.15 !important;
  }
  html body #stocks-section.active .stocks-mobile-holding > .stocks-mobile-row {
    min-height:49.3px !important;
    padding-top:4px !important; padding-bottom:4px !important;
  }
  html body #stocks-section#stocks-section#stocks-section.active .stocks-mobile-weight > span {
    color:#009c93 !important;
    font-weight:700 !important;
  }
  html:not([data-appearance="light"]) body #stocks-section#stocks-section#stocks-section.active .stocks-mobile-weight > span {
    color:#25d5df !important;
  }
  /* Keep the monetary value teal even when theme-specific muted-text rules target all spans. */
  html body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section.active .stocks-mobile-row .stocks-mobile-weight > span {
    color:#00aaa2 !important;
    font-weight:700 !important;
  }
  html:not([data-appearance="light"]) body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section.active .stocks-mobile-row .stocks-mobile-weight > span {
    color:#25d5df !important;
  }
  html[data-appearance="light"] body #stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section#stocks-section.active .stocks-mobile-row .stocks-mobile-weight > span {
    color:#00aaa2 !important;
  }
  html body #stocks-section.active .stocks-mobile-change {
    justify-self:start !important;
    text-align:left !important;
  }
  html body #stocks-section.active .stocks-mobile-check,
  html body #stocks-section.active .stocks-mobile-risk-dot,
  html body #stocks-section.active .stocks-mobile-head > span:first-child,
  html body #stocks-section.active #stocks-tbody .select-td { display:none !important; }
}
