/* Lamha engine — base look (what Streamlit's own styles used to give); Lamha's page styles still come on top. */
:root {
  --lm-text: #31333f; --lm-bg: #ffffff; --lm-bg2: #f0f2f6; --lm-primary: #2f5bea; --lm-line: rgba(49, 51, 63, .2);
  --lm-radius: .5rem; --lm-font: "Source Sans Pro", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
  --lm-sb-w: 336px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--lm-font); font-size: 1rem; line-height: 1.6; color: var(--lm-text); background: var(--lm-bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lm-primary); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.stApp { position: absolute; inset: 0; overflow: hidden; color: inherit; background: inherit; }
header.stAppHeader { position: fixed; top: 0; left: 0; right: 0; height: 0; z-index: 999990; pointer-events: none; }
header.stAppHeader * { pointer-events: auto; }
.stAppViewContainer { position: absolute; inset: 0; display: flex; overflow: hidden; }
/* The page's own min-height:100vh made this taller than the visible screen on phones (iOS counts the area behind the
   browser bar), so the page bottom sat off-screen and couldn't be scrolled to. It must match the screen exactly. */
.stApp .stAppViewContainer { min-height: 0 !important; }
.stSidebar { position: relative; flex: 0 0 var(--lm-sb-w); width: var(--lm-sb-w); max-width: 85vw; height: 100%; background: var(--lm-bg2);
  overflow: hidden; z-index: 999991; transition: margin-left .25s ease, transform .25s ease; }
.stSidebar.lm-sb-empty { display: none; }
.lm-sb-content { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.lm-sb-head { display: flex; justify-content: flex-end; padding: .5rem .75rem 0; min-height: 2.5rem; }
.lm-sb-collapse button, .lm-sb-open button { border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; line-height: 1;
  padding: .35rem .6rem; border-radius: .5rem; opacity: .7; }
.lm-sb-collapse button:hover, .lm-sb-open button:hover { background: rgba(127, 127, 127, .15); opacity: 1; }
.lm-sb-user { padding: 0 1.5rem 4rem; }
.lm-sb-open { position: fixed; top: .5rem; left: .5rem; z-index: 999992; display: none; }
html.lm-sb-closed .stSidebar { margin-left: calc(-1 * var(--lm-sb-w)); }
html.lm-sb-closed .lm-sb-open { display: block; }
.stMain { flex: 1 1 auto; min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; }
.stMainBlockContainer { width: 100%; max-width: 46rem; margin: 0 auto; padding: 3rem 1rem 8rem; }
.stApp.lm-wide .stMainBlockContainer { max-width: initial; padding-left: 5rem; padding-right: 5rem; }
@media (max-width: 768px) {
  .stSidebar { position: fixed; top: 0; bottom: 0; left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  html.lm-sb-closed .stSidebar { margin-left: 0; transform: translateX(-105%); box-shadow: none; }
  .stApp.lm-wide .stMainBlockContainer, .stMainBlockContainer { padding-left: 1rem; padding-right: 1rem; }
  .lm-sb-content { overscroll-behavior: contain; }
  .lm-sb-head { position: sticky; top: 0; z-index: 5; background: var(--lm-bg2); padding-bottom: .4rem; }
  html.lm-sb-modal .stMain { overflow: hidden; }
  html.lm-sb-modal .stMain::after { content: ""; position: fixed; inset: 0; z-index: 999990; background: rgba(3, 6, 14, .5); }
}
#lm-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2147483600; background: linear-gradient(90deg, #2f5bea, #7c9cff);
  opacity: 0; transition: opacity .2s; pointer-events: none; }
#lm-bar.on { opacity: 1; width: 100%; animation: lm-bar 1.2s ease-in-out infinite; }
@keyframes lm-bar { 0% { transform: translateX(-100%) scaleX(.3); } 50% { transform: translateX(0) scaleX(.6); } 100% { transform: translateX(100%) scaleX(.3); } }
#lm-conn { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2147483001; background: #1d2b4a; color: #fff;
  padding: 8px 16px; border-radius: 999px; font: 600 13px/1.5 system-ui, sans-serif; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  pointer-events: none; white-space: nowrap; }

/* ---------------------------------------------------------------- blocks */
.stVerticalBlock { display: flex; flex-direction: column; gap: 1rem; width: 100%; position: relative; min-width: 0; }
.stHorizontalBlock { display: flex; flex-wrap: wrap; width: 100%; min-width: 0; }
.stColumn { display: flex; flex-direction: column; min-width: calc(min(100%, 0px)); }
.stColumn > .stVerticalBlock { flex: 1 1 auto; }
@media (max-width: 640px) {
  /* phones: columns wrap under each other (as in Streamlit); Lamha's own styles keep some rows side by side */
  .stHorizontalBlock > .stColumn { min-width: calc(100% - 1.5rem); }
}
.lm-bordered { border: 1px solid var(--lm-line); border-radius: var(--lm-radius); padding: calc(1rem - 1px); }
.stElementContainer { width: 100%; min-width: 0; position: relative; }
.stElementContainer.lm-iframe0 { display: none; }
.stForm { border: 1px solid var(--lm-line); border-radius: var(--lm-radius); padding: calc(1rem - 1px); }
.stForm.lm-noborder { border: 0; padding: 0; }

/* ---------------------------------------------------------------- text */
.stMarkdown, [data-testid="stMarkdownContainer"] { word-wrap: break-word; overflow-wrap: anywhere; }
[data-testid="stMarkdownContainer"] > :first-child { margin-top: 0; }
[data-testid="stMarkdownContainer"] > :last-child { margin-bottom: 0; }
[data-testid="stMarkdownContainer"] p { margin: 0 0 1rem; }
[data-testid="stMarkdownContainer"] p:last-child { margin-bottom: 0; }
[data-testid="stMarkdownContainer"] ul, [data-testid="stMarkdownContainer"] ol { margin: 0 0 1rem; padding-inline-start: 1.5rem; }
[data-testid="stMarkdownContainer"] table { border-collapse: collapse; margin: 0 0 1rem; }
[data-testid="stMarkdownContainer"] th, [data-testid="stMarkdownContainer"] td { border: 1px solid var(--lm-line); padding: .25rem .5rem; }
[data-testid="stMarkdownContainer"] code { font-size: .875em; padding: .1em .25em; border-radius: .25rem; background: rgba(127, 127, 127, .14); }
[data-testid="stMarkdownContainer"] hr, .stMarkdown hr { border: 0; border-bottom: 1px solid var(--lm-line); margin: 1rem 0; }
.stHeading h1, .stHeading h2, .stHeading h3, [data-testid="stMarkdownContainer"] h1, [data-testid="stMarkdownContainer"] h2,
[data-testid="stMarkdownContainer"] h3, [data-testid="stMarkdownContainer"] h4 { margin: 0; line-height: 1.25; font-weight: 700; }
.stHeading h1, [data-testid="stMarkdownContainer"] h1 { font-size: 2.25rem; padding: 1.25rem 0 1rem; }
.stHeading h2, [data-testid="stMarkdownContainer"] h2 { font-size: 1.75rem; padding: 1rem 0; }
.stHeading h3, [data-testid="stMarkdownContainer"] h3 { font-size: 1.4rem; padding: .5rem 0 1rem; }
[data-testid="stMarkdownContainer"] h4 { font-size: 1.15rem; padding: .5rem 0; }
.lm-hdiv { border: 0; height: 2px; background: linear-gradient(90deg, #2f5bea, transparent); margin: .25rem 0 0; }
[data-testid="stCaptionContainer"] { font-size: .875rem; opacity: .65; }
.stText { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; font-size: .875rem; }
.stCode { position: relative; }
.stCode pre { margin: 0; padding: 1rem; border-radius: var(--lm-radius); background: rgba(127, 127, 127, .1); overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .875rem; white-space: pre-wrap; word-break: break-all; direction: ltr; text-align: left; }
.lm-copy { position: absolute; top: .4rem; right: .4rem; border: 0; background: rgba(127, 127, 127, .18); border-radius: .35rem; cursor: pointer;
  padding: .1rem .45rem; opacity: .7; }
.lm-copy:hover { opacity: 1; }

/* ---------------------------------------------------------------- alerts, metric, progress */
.lm-alert { border-radius: var(--lm-radius); padding: 1rem; }
.lm-alert-content { display: flex; gap: .6rem; align-items: flex-start; }
.lm-alert-info { background: rgba(28, 131, 225, .1); color: rgb(0, 66, 128); }
.lm-alert-success { background: rgba(33, 195, 84, .1); color: rgb(23, 114, 51); }
.lm-alert-warning { background: rgba(255, 227, 18, .12); color: rgb(146, 108, 5); }
.lm-alert-error { background: rgba(255, 43, 43, .09); color: rgb(125, 53, 59); }
.lm-tb { white-space: pre-wrap; font-size: .75rem; max-height: 22rem; overflow: auto; direction: ltr; text-align: left; margin: .5rem 0 0; opacity: .8; }
.lm-render-error { padding: .5rem .75rem; border-radius: .4rem; background: rgba(255, 43, 43, .09); font-size: .85rem; }
.stMetric label { display: flex; align-items: center; gap: .3rem; font-size: .875rem; min-height: 1.5rem; }
[data-testid="stMetricValue"] { font-size: 2.25rem; line-height: 1.3; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-testid="stMetricDelta"] { display: inline-flex; align-items: center; gap: .2rem; font-size: 1rem; padding: 0 .4rem; border-radius: 999px; }
[data-testid="stMetricDelta"] div { display: inline; }
.lm-up { color: rgb(9, 171, 59); background: rgba(9, 171, 59, .1); }
.lm-down { color: rgb(255, 43, 43); background: rgba(255, 43, 43, .1); }
.lm-off { opacity: .7; background: rgba(127, 127, 127, .15); }
.lm-prog { height: .5rem; border-radius: 999px; background: rgba(127, 127, 127, .2); overflow: hidden; }
.lm-prog > div { height: 100%; background: var(--lm-primary); border-radius: 999px; }
.lm-prog-text { font-size: .875rem; margin-bottom: .3rem; }

/* ---------------------------------------------------------------- labels & fields */
.lm-label { display: flex; align-items: center; gap: .3rem; min-height: 1.5rem; margin-bottom: .25rem; font-size: .875rem; }
.lm-label p { margin: 0 !important; }
.lm-label-hidden { visibility: hidden; }
.lm-label-collapsed { display: none; }
.lm-help { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; border-radius: 50%;
  border: 1px solid currentColor; font-size: .65rem; opacity: .55; cursor: help; flex: 0 0 auto; }
.lm-field { position: relative; display: flex; align-items: center; width: 100%; min-height: 2.5rem; border-radius: var(--lm-radius);
  background: rgba(127, 127, 127, .1); border: 1px solid transparent; transition: border-color .15s; }
.lm-field:focus-within { border-color: var(--lm-primary); }
.lm-base { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }
.lm-input { width: 100%; min-width: 0; height: 2.5rem; border: 0; outline: 0; background: transparent; padding: 0 .75rem; border-radius: var(--lm-radius); }
textarea.lm-input { height: auto; min-height: 6rem; padding: .6rem .75rem; resize: vertical; line-height: 1.5; }
.lm-field:has(textarea) { align-items: stretch; }
.lm-input::placeholder { opacity: .5; color: inherit; }
.lm-disabled .lm-field, .lm-input:disabled { opacity: .6; cursor: not-allowed; }
input[type=date].lm-input { padding-inline-end: .5rem; }
.lm-eye { border: 0; background: transparent; cursor: pointer; padding: 0 .6rem; opacity: .6; }
.lm-num { display: flex; gap: 0; }
.lm-num .lm-field { border-start-end-radius: 0; border-end-end-radius: 0; }
.lm-steps { display: flex; }
.lm-steps button { width: 2.5rem; min-height: 2.5rem; border: 0; background: rgba(127, 127, 127, .1); cursor: pointer; font-size: 1.1rem; margin-left: 1px; }
.lm-steps button:last-child { border-start-end-radius: var(--lm-radius); border-end-end-radius: var(--lm-radius); }
.lm-steps button:hover { background: var(--lm-primary); color: #fff; }
[dir=rtl] .lm-num .lm-field, .lm-num:dir(rtl) .lm-field { }

/* select: the real <select> sits invisible on top (phones get their own picker); the text shows underneath */
.lm-select { cursor: pointer; }
.lm-select select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; appearance: none; }
.lm-select select:disabled { cursor: not-allowed; }
.lm-select-shown { flex: 1 1 auto; min-width: 0; padding: 0 2.25rem 0 .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 2.5rem; }
.lm-select select:focus-visible + .lm-select-shown { outline: 2px solid var(--lm-primary); outline-offset: -2px; border-radius: var(--lm-radius); }
.lm-ph { opacity: .5; }
.lm-chev { position: absolute; right: .8rem; top: 50%; width: .5rem; height: .5rem; margin-top: -.35rem; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .55; pointer-events: none; }
.lm-pop { position: fixed; z-index: 2147483300; background: #fff; color: #222; border-radius: .6rem; box-shadow: 0 12px 38px rgba(0, 0, 0, .22);
  border: 1px solid rgba(0, 0, 0, .08); padding: .4rem; max-width: min(560px, calc(100vw - 16px)); }
.lm-pop-dark { background: #172238; color: #e8eefc; border-color: rgba(255, 255, 255, .12); }
.lm-pop-search { width: 100%; height: 2.3rem; border: 1px solid rgba(127, 127, 127, .35); border-radius: .45rem; padding: 0 .6rem; outline: 0;
  background: transparent; margin-bottom: .35rem; }
.lm-pop-search:focus { border-color: var(--lm-primary); }
.lm-pop-list { overflow-y: auto; }
.lm-pop-item { padding: .45rem .6rem; border-radius: .4rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-pop-item.lm-act { background: rgba(47, 91, 234, .12); }
.lm-pop-item.lm-sel { font-weight: 700; }
.lm-pop-empty { padding: .5rem; opacity: .6; text-align: center; }

/* multiselect */
.lm-multi { flex-direction: column; align-items: stretch; padding: .25rem; }
.lm-multi > select[multiple] { display: none; }
.lm-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.lm-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--lm-primary); color: #fff; border-radius: .4rem;
  padding: .1rem .3rem .1rem .55rem; font-size: .875rem; max-width: 100%; }
.lm-chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.lm-multi-add { flex: 1 1 8rem; height: 2rem; min-width: 8rem; cursor: pointer; }

/* radio & checkbox */
.lm-radios { display: flex; flex-direction: column; gap: .35rem; }
.lm-radios.lm-horizontal { flex-direction: row; flex-wrap: wrap; gap: .35rem 1rem; }
.lm-radio { display: inline-flex; align-items: flex-start; gap: .45rem; cursor: pointer; position: relative; }
.lm-radio input, .lm-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lm-dot { flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: .3rem; border-radius: 50%; border: 2px solid rgba(127, 127, 127, .6); transition: .15s; }
.lm-radio input:checked + .lm-dot { border: 5px solid var(--lm-primary); }
.lm-radio input:focus-visible + .lm-dot { outline: 2px solid var(--lm-primary); outline-offset: 2px; }
.lm-radio p { margin: 0 !important; }
.lm-radio-cap { font-size: .8rem; opacity: .65; }
.lm-check { display: inline-flex; align-items: flex-start; gap: .5rem; cursor: pointer; position: relative; min-height: 1.5rem; }
.lm-box { flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: .3rem; border-radius: .25rem; border: 2px solid rgba(127, 127, 127, .6); position: relative; transition: .15s; }
.lm-check input:checked + .lm-box { background: var(--lm-primary); border-color: var(--lm-primary); }
.lm-check input:checked + .lm-box::after { content: ""; position: absolute; left: .22rem; top: .02rem; width: .3rem; height: .55rem;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lm-check input:focus-visible + .lm-box { outline: 2px solid var(--lm-primary); outline-offset: 2px; }
.lm-toggle .lm-box { width: 2rem; height: 1.1rem; border-radius: 999px; margin-top: .25rem; background: rgba(127, 127, 127, .35); border: 0; }
.lm-toggle .lm-box::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; transition: .15s; border: 0 !important; transform: none !important; }
.lm-toggle input:checked + .lm-box { background: var(--lm-primary); }
.lm-toggle input:checked + .lm-box::after { left: 1.05rem; width: .8rem; height: .8rem; }
.lm-check-label p { margin: 0 !important; }
.lm-disabled .lm-check, .lm-disabled .lm-radio { opacity: .55; cursor: not-allowed; }
.lm-range { gap: .25rem; padding-inline-end: .25rem; }
.lm-dash { opacity: .6; }

/* ---------------------------------------------------------------- buttons */
.lm-btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.5rem; padding: .25rem .75rem; margin: 0;
  border-radius: var(--lm-radius); border: 1px solid var(--lm-line); background: var(--lm-bg); color: inherit; cursor: pointer; line-height: 1.6;
  text-decoration: none; font-weight: 400; user-select: none; -webkit-tap-highlight-color: transparent; max-width: 100%; transition: border-color .15s, color .15s, background .15s; }
.lm-btn p { margin: 0 !important; }
.lm-btn:hover { border-color: var(--lm-primary); color: var(--lm-primary); }
.lm-btn:active { transform: translateY(1px); }
.lm-btn:focus-visible { outline: 2px solid var(--lm-primary); outline-offset: 1px; }
.lm-btn:disabled, .lm-btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.lm-btn[kind^=primary] { background: var(--lm-primary); border-color: var(--lm-primary); color: #fff; }
.lm-btn[kind^=primary]:hover { filter: brightness(1.08); color: #fff; }
.lm-btn[kind=tertiary] { border: 0; background: transparent; padding: 0; min-height: 0; }
.lm-stretch, .lm-stretch > .lm-btn { width: 100%; }
.stButton, .stFormSubmitButton, .stDownloadButton, .stLinkButton, .stPopover { display: block; }
.lm-pop-wrap { position: relative; }
.stPopover { position: relative; display: inline-block; }
.stPopover.lm-stretch { display: block; }
.stPopover .lm-btn { padding-right: 2rem; position: relative; }
.lm-popbody { position: absolute; top: calc(100% + 6px); left: 0; z-index: 9000; min-width: 260px; max-width: min(560px, 92vw); padding: 1rem;
  border-radius: .6rem; background: var(--lm-bg); color: var(--lm-text); box-shadow: 0 12px 38px rgba(0, 0, 0, .25); border: 1px solid var(--lm-line); }

/* ---------------------------------------------------------------- expander & tabs */
.stExpander details { border: 1px solid var(--lm-line); border-radius: var(--lm-radius); }
.stExpander summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .7rem 2.4rem .7rem 1rem;
  position: relative; border-radius: var(--lm-radius); user-select: none; }
.stExpander summary::-webkit-details-marker { display: none; }
.stExpander summary:hover { color: var(--lm-primary); }
.stExpander summary p { margin: 0 !important; }
.stExpander summary .lm-chev { transform: rotate(45deg); transition: transform .15s; }
.stExpander details[open] > summary .lm-chev { transform: rotate(-135deg); margin-top: -.1rem; }
[data-testid="stExpanderDetails"] { padding: 0 1rem 1rem; }
.stTabs [role=tablist] { display: flex; gap: 1.25rem; overflow-x: auto; position: relative; border-bottom: 2px solid rgba(127, 127, 127, .2);
  margin-bottom: 1rem; scrollbar-width: thin; }
.stTabs [role=tab] { border: 0; background: transparent; cursor: pointer; padding: .55rem 0; margin-bottom: -2px; border-bottom: 2px solid transparent;
  white-space: nowrap; flex: 0 0 auto; }
.stTabs [role=tab] p { margin: 0 !important; font-size: .95rem; }
.stTabs [role=tab][aria-selected=true] { border-bottom-color: var(--lm-primary); color: var(--lm-primary); }
.stTabs [data-baseweb=tab-highlight], .stTabs [data-baseweb=tab-border] { display: none; }

/* ---------------------------------------------------------------- uploader */
.lm-drop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: var(--lm-radius);
  background: rgba(127, 127, 127, .1); border: 1px dashed rgba(127, 127, 127, .45); cursor: pointer; flex-wrap: wrap; }
.lm-drop.lm-over { border-color: var(--lm-primary); background: rgba(47, 91, 234, .08); }
.lm-drop-text { display: flex; align-items: center; gap: .75rem; }
.lm-drop-text small { display: block; opacity: .6; font-size: .8rem; }
.lm-drop-ico { font-size: 1.6rem; }
.lm-files { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.lm-file { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: .4rem; font-size: .9rem; }
.lm-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.lm-file small { opacity: .6; }
.lm-file-x { border: 0; background: transparent; cursor: pointer; opacity: .6; }
.lm-uploading { opacity: .75; }

/* ---------------------------------------------------------------- tables, charts, media */
.lm-df { width: 100%; }
.lm-df-scroll { overflow: auto; max-height: 420px; border: 1px solid var(--lm-line); border-radius: var(--lm-radius); }
.stTable .lm-df-scroll { max-height: none; }
.lm-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .875rem; }
.lm-table th, .lm-table td { padding: .35rem .6rem; border-bottom: 1px solid var(--lm-line); white-space: nowrap; text-align: start; }
.lm-table thead th { position: sticky; top: 0; z-index: 1; background: var(--lm-bg2); font-weight: 600; }
.lm-table td.lm-num-cell { text-align: end; font-variant-numeric: tabular-nums; }
.lm-table .lm-idx { opacity: .6; font-weight: 400; }
.lm-null { opacity: .4; }
.lm-more { font-size: .8rem; opacity: .6; padding: .25rem; }
.lm-chart { width: 100%; }
.lm-chart svg { display: block; }
.lm-chart .lm-grid { stroke: rgba(127, 127, 127, .25); stroke-width: 1; }
.lm-chart .lm-axis { fill: currentColor; opacity: .65; font-size: 11px; }
.lm-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; margin-bottom: .25rem; }
.lm-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: .15rem; margin-inline-end: .3rem; vertical-align: -1px; }
.lm-images { display: flex; flex-wrap: wrap; gap: .5rem; }
.stImage img { display: block; height: auto; border-radius: .25rem; }
.lm-imgcap { font-size: .8rem; opacity: .65; text-align: center; }
iframe.stIFrame { display: block; }

/* ---------------------------------------------------------------- dialog & toasts */
.lm-dialog-backdrop { position: fixed; inset: 0; z-index: 2147482000; background: rgba(10, 16, 30, .55); display: flex; align-items: flex-start;
  justify-content: center; overflow-y: auto; padding: 5vh 12px; animation: lm-fade .15s ease; }
.lm-dialog { width: 100%; background: var(--lm-bg); color: var(--lm-text); border-radius: .8rem; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); }
.lm-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .5rem; }
.lm-dialog-title { font-size: 1.25rem; font-weight: 700; }
.lm-dialog-x { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; opacity: .6; padding: .25rem .5rem; border-radius: .4rem; }
.lm-dialog-x:hover { opacity: 1; background: rgba(127, 127, 127, .15); }
.lm-dialog-body { padding: .5rem 1.25rem 1.25rem; }
@keyframes lm-fade { from { opacity: 0; } to { opacity: 1; } }
#lm-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 2147483500; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.lm-toast { background: #1d2b4a; color: #fff; padding: .75rem 1rem; border-radius: .6rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: .9rem;
  animation: lm-fade .2s ease; transition: opacity .35s, transform .35s; }
.lm-toast.lm-out { opacity: 0; transform: translateY(8px); }

/* ---------------------------------------------------------------- keep the engine's working parts hidden
   (Lamha's styles have broad «… * { opacity:1 !important }» rules written for Streamlit's own markup) */
#root .lm-select > select.lm-input { opacity: 0 !important; position: absolute !important; inset: 0 !important; width: 100% !important;
  height: 100% !important; z-index: 2 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 !important; }
#root .lm-radio > input, #root .lm-check > input { position: absolute !important; opacity: 0 !important; width: 1px !important;
  height: 1px !important; margin: 0 !important; padding: 0 !important; pointer-events: none !important; }
#root .lm-multi > select[multiple], #root input[type=file][hidden] { display: none !important; }
#root .lm-select-shown, #root .lm-select .lm-chev { background: transparent !important; }

/* date field: YYYY/MM/DD text + the browser's calendar */
.lm-datebox { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.lm-datebox .lm-date { flex: 1 1 auto; direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
#root .lm-date-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0 !important;
  pointer-events: none !important; border: 0 !important; padding: 0 !important; }
/* Phones: the date field didn't take a new date on iPhone (the picker opened from code, which iOS ignores). Here the
   browser's own date field lies over the whole box, invisible, so the finger taps it directly and iOS opens its picker. */
@media (pointer: coarse) {
  #root .lm-datebox .lm-date-native { top: 0 !important; left: 0 !important; bottom: auto !important; width: 100% !important;
    height: 100% !important; pointer-events: auto !important; z-index: 2; -webkit-appearance: none; appearance: none; }
}
.lm-cal { border: 0; background: transparent; cursor: pointer; padding: 0 .55rem; font-size: 1rem; opacity: .7; flex: 0 0 auto; }
.lm-cal:hover { opacity: 1; }
.lm-range .lm-datebox { flex: 1 1 0; }
.lm-datebox .lm-date { padding-right: 2.4rem !important; width: 100%; }
#root .lm-datebox .lm-cal { position: absolute; right: .2rem; top: 50%; transform: translateY(-50%); z-index: 1; background: transparent !important;
  border: 0 !important; box-shadow: none !important; min-height: 0 !important; height: 2rem; }

/* Lamha's look-switch veil was there to hide Streamlit's half-styled frames. Here the new look arrives in one piece
   (styles + page together), so switch at once, without the full-screen cover. */
#atc-veil { display: none !important; }

/* light/dark: the button answers the touch at once; the whole page then changes in one short cross-fade */
#root .lm-look-wait button { transform: scale(.96) !important; opacity: .8 !important; transition: transform .1s ease, opacity .1s ease !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .11s; }
