/* falakbin.ir/lab/<slug>: the simulators (SimPages, Views/public/sim_*).
   A scene and its panel side by side, the panel under it on a phone; the
   scene is dark on both themes, since it is space (and the night map). */

.flk-sim-hero .flk-kicker a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.flk-sim-hero .flk-kicker a:hover { color: var(--orange-hi); }

.flk-sim { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; margin-top: 18px; align-items: start; }
.flk-sim-pair { display: flex; flex-direction: column; gap: 0; }
.flk-sim-stage {
    position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
    background: #03141a; min-height: 300px; box-shadow: var(--shadow);
}
.flk-sim-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.flk-sim-canvas:active { cursor: grabbing; }
.flk-sim-stage-map .flk-sim-canvas, .flk-sim-energy .flk-sim-canvas { touch-action: manipulation; cursor: crosshair; }
.flk-sim-energy .flk-sim-canvas { cursor: default; }
.flk-sim-wait { position: absolute; inset: 0; margin: 0; padding: 16px; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: #8fb2b0; font-size: .9rem; }
.flk-sim-wait .flk-i { width: 22px; height: 22px; color: #6fe0d8; }
.flk-sim-hud { position: absolute; top: 12px; inset-inline-end: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 0; pointer-events: none; }
.flk-sim-hud b { color: #e7f5f3; font-size: 1.05rem; font-weight: 850; text-shadow: 0 1px 6px #03141a; }
.flk-sim-hud small { color: #8fb2b0; font-size: .78rem; text-shadow: 0 1px 6px #03141a; }
.flk-sim-tools { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 6px; }
.flk-sim-tools .flk-icon-btn { width: 36px; height: 36px; background: rgba(10, 46, 52, .85); color: #e7f5f3; border: 1px solid rgba(147, 184, 182, .25); }
.flk-sim-tools .flk-icon-btn:hover { background: #0f3b42; }
.flk-sim-minus { display: block; width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
.flk-sim-hint { margin: 0; padding: 7px 14px 9px; border-top: 1px solid rgba(147, 184, 182, .14); color: #8fb2b0; font-size: .78rem; line-height: 1.7; }

.flk-sim-panel { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.flk-sim-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flk-sim-row .flk-btn { border: 0; cursor: pointer; font: inherit; font-size: .9rem; }
.flk-sim-row-sm { margin-top: -6px; }
.flk-sim-row-sm .flk-chip, .flk-sim-chips .flk-chip { cursor: pointer; font: inherit; font-size: .82rem; }
.flk-sim-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.flk-chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); }
.flk-chip[hidden] { display: none; }
.flk-sim-pace { color: var(--muted); font-size: .84rem; margin-inline-start: auto; }
.flk-sim-pace b { color: var(--fg); font-variant-numeric: tabular-nums; }
.flk-sim-ctl { display: flex; flex-direction: column; gap: 8px; }
.flk-sim-ctl-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.flk-sim-ctl-head .flk-sim-out { color: var(--fg); font-weight: 800; font-variant-numeric: tabular-nums; }
.flk-sim-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 12px; }
.flk-sim-seg button { flex: 1 1 auto; padding: 5px 8px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.flk-sim-seg button:hover { color: var(--fg); }
.flk-sim-seg button[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal-ink); }
.flk-sim-select { font: inherit; font-size: .9rem; color: var(--fg); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.flk-sim-note { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.9; }
.flk-sim-key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 5px; }
.flk-sim-key-p { background: #3fcac3; } .flk-sim-key-s { background: #ff8c1a; }
.flk-sim-p { color: var(--teal-ink); } .flk-sim-s { color: var(--orange-ink); }

.flk-sim-read { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.flk-sim-read div { min-width: 0; }
.flk-sim-read-wide { grid-column: 1 / -1; }
.flk-sim-read dt { color: var(--muted); font-size: .76rem; }
.flk-sim-read dd { margin: 2px 0 0; font-weight: 800; font-size: .98rem; font-variant-numeric: tabular-nums; line-height: 1.6; }
.flk-sim-read dd small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.flk-sim-hit { color: var(--orange-ink); }

.flk-sim-about .flk-sim-cols { columns: 2 320px; column-gap: 32px; max-width: none; }
.flk-sim-about .flk-sim-cols p { break-inside: avoid; margin-top: 0; }

.flk-sim-events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.flk-sim-events li { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.flk-sim-events button, .flk-sim-static { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: none; border: 0; color: var(--fg); font: inherit; text-align: start; }
.flk-sim-events button { cursor: pointer; }
.flk-sim-events button:hover { background: var(--teal-soft); }
.flk-sim-events .flk-hm-li { flex: 1; }
.flk-sim-events .flk-hm-li small { line-height: 1.8; }
.flk-sim-go { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--orange-ink); font-size: .78rem; font-weight: 800; }
.flk-sim-go .flk-i { width: 14px; height: 14px; }
.flk-sim-more { padding: 0 14px 10px; padding-inline-start: 64px; margin-top: -6px; color: var(--teal-ink); font-size: .8rem; text-decoration: none; }
.flk-sim-more:hover { text-decoration: underline; }

/* The earthquake bot's magnitude badges (as on the home page's card). */
.flk-hm-mag { flex: none; width: 3rem; text-align: center; font-weight: 900; font-size: 1rem; border-radius: 10px; padding: 4px 0; color: #1a0d00; font-variant-numeric: tabular-nums; }
.flk-hm-mag-a { background: #e9c46a; } .flk-hm-mag-b { background: #f4a259; } .flk-hm-mag-c { background: #ff8c1a; }
.flk-hm-mag-d { background: #f2542d; color: #fff; } .flk-hm-mag-e { background: #c81d25; color: #fff; }

@media (max-width: 920px) {
    .flk-sim { grid-template-columns: minmax(0, 1fr); }
    .flk-sim-read { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 560px) {
    .flk-sim { gap: 10px; margin-top: 12px; }
    .flk-sim-panel { padding: 14px 12px; }
    .flk-sim-read { grid-template-columns: 1fr 1fr; }
    .flk-sim-events { grid-template-columns: minmax(0, 1fr); }
}
.flk-sim-canvas:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: -2px; }

/* The bar under a scene (fb-simkit.js tools()): its hint, then share, picture and the whole screen. */
.flk-sim-bar { display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(147, 184, 182, .14); padding-inline-end: 6px; min-height: 40px; }
.flk-sim-bar .flk-sim-hint { flex: 1 1 auto; border-top: 0; }
.flk-sim-bar-tools { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.flk-sim-bar-tools .flk-icon-btn { width: 34px; height: 34px; border-radius: 10px; color: #cfe9e6; }
.flk-sim-bar-tools .flk-icon-btn:hover { background: rgba(63, 202, 195, .18); }
.flk-sim-bar-tools .flk-icon-btn .flk-i { width: 19px; height: 19px; }
.flk-sim-said { color: #8fb2b0; font-size: .76rem; padding-inline-end: 6px; }
/* The whole screen: the browser's own, or (an iPhone) the section over the page. */
.flk-sim:fullscreen { margin: 0; padding: 14px; background: var(--bg); overflow-y: auto; align-content: start; }
.flk-sim.flk-sim-max { position: fixed; inset: 0; z-index: 50; margin: 0; padding: 12px; background: var(--bg); overflow-y: auto; align-content: start; }

/* The eclipse lab (sim_eclipse): a wider scene, the event list, «only what my city sees». */
@media (min-width: 921px) { .flk-sim-wide { grid-template-columns: minmax(0, 1fr) 320px; } }
.flk-sim-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; cursor: pointer; }
.flk-sim-check input { accent-color: var(--teal); }
.flk-sim-note .flk-i { width: 1em; height: 1em; vertical-align: -2px; margin-inline-end: 4px; color: var(--orange-ink); }
.flk-sim-select { width: 100%; }

/* Eclipse controls remain easy to tap when the panel stacks below the canvas. */
[data-widget="sim-eclipse"] .flk-sim-seg button,
[data-widget="sim-eclipse"] .flk-sim-select,
[data-widget="sim-eclipse"] [data-sim-step],
[data-widget="sim-eclipse"] .flk-sim-check { min-height: 44px; }
[data-widget="sim-eclipse"] button:disabled { opacity: .45; cursor: default; }

/* Touch targets for the three sky labs; keep narrow panels within their grid column. */
:is([data-widget="sim-constellations"], [data-widget="sim-planetarium"], [data-widget="sim-satellites"]) .flk-sim-panel { min-width: 0; }
:is([data-widget="sim-constellations"], [data-widget="sim-planetarium"], [data-widget="sim-satellites"]) :is(.flk-sim-seg button, .flk-chip, .flk-sim-select, .flk-pt-step button) { min-height: 44px; }

:is([data-widget="sim-telescope"], [data-widget="sim-gravity"], [data-widget="sim-worlds"], [data-widget="sim-light"], [data-widget="sim-scale"]) .flk-sim-panel { min-width: 0; }
:is([data-widget="sim-telescope"], [data-widget="sim-gravity"], [data-widget="sim-worlds"], [data-widget="sim-light"], [data-widget="sim-scale"]) :is(.flk-sim-seg button, .flk-chip, .flk-sim-select) { min-height: 44px; }
.flk-sim-read [hidden] { display: none; }

/* The constellation quiz (sim_constellations): the four names, then which was right. */
.flk-quiz-ask { margin: 0; font-weight: 800; line-height: 1.8; }
.flk-quiz-choices .flk-chip { font-size: .92rem; padding: 7px 14px; }
.flk-quiz-choices .flk-chip:disabled { cursor: default; opacity: .75; }
.flk-chip.flk-quiz-right { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); opacity: 1; }
.flk-chip.flk-quiz-wrong { border-color: var(--bad, #ff6b5d); color: var(--bad, #ff6b5d); opacity: 1; }
[data-sim-atlas], [data-sim-quiz] { display: flex; flex-direction: column; gap: 14px; }
[data-sim-atlas][hidden], [data-sim-quiz][hidden] { display: none; }

/* The planetarium (sim_planetarium): search, the chosen thing's card, the clock, the ready scenes. */
.flk-pt-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--teal); border-radius: 12px; background: var(--teal-soft); }
.flk-pt-card[hidden], .flk-pt [data-pl-con][hidden] { display: none; }
.flk-pt-card .flk-sim-read { padding-top: 8px; }
.flk-pt-name { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.flk-pt-name b { font-size: 1.15rem; }
.flk-pt-name small { color: var(--muted); font-size: .8rem; }
.flk-pt-time { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.flk-pt-when { margin: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.8; }
.flk-pt-when > span { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.flk-pt-when .flk-live:empty { display: none; }
/* The panel in three parts (time, the view, the sky), each under a small rule-topped label. */
.flk-pt-label { margin: 4px 0 -6px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.flk-pt .flk-sim-panel > .flk-pt-label:first-of-type { margin-top: 0; }
/* A step in time: − unit + for each unit, the four in a 2 × 2 grid so the pairs line up. */
.flk-pt-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.flk-pt-step { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.flk-pt-step span { flex: 1 1 auto; min-width: 0; text-align: center; font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flk-pt-step button { flex: 0 0 auto; width: 34px; height: 32px; border: 0; border-radius: 999px; background: none; color: var(--teal-ink); font: inherit; font-size: 1.05rem; font-weight: 800; line-height: 1; cursor: pointer; }
.flk-pt-step button:hover { background: var(--teal-soft); }
.flk-pt-step button:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: -2px; }
.flk-pt input[type="datetime-local"], .flk-pt input[type="number"] { direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.flk-pt-date { min-width: 0; }
.flk-pt .flk-sim-ctl-head small { font-weight: 400; }
.flk-pt-year { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.flk-pt-year .flk-sim-select { width: 7.5em; flex: 0 0 auto; }
.flk-pt-year small { font-weight: 400; font-size: .78rem; }
/* The four sides in one row and «overhead» under them, full width. */
.flk-pt-face { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flk-pt-face .flk-chip { justify-content: center; }
.flk-pt-face .flk-chip:last-child { grid-column: 1 / -1; }
/* A long panel beside the sky: the sky stays in view while the panel scrolls, where it fits the screen. */
@media (min-width: 921px) and (min-height: 860px) {
    .flk-pt .flk-sim-stage { position: sticky; top: calc(var(--top-h) + 12px); }
}
.flk-sim-events .flk-pt-scene { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; color: var(--fg); text-decoration: none; }
.flk-sim-events .flk-pt-scene:hover { background: var(--teal-soft); }
.flk-pt.flk-pt-red .flk-sim-panel { filter: sepia(1) hue-rotate(-40deg) saturate(3) brightness(.75); }

/* The satellites lab (sim_satellites): the globe's box, the groups' colours, the card, the antenna table. */
.flk-sat-globe { position: relative; aspect-ratio: 1.15; min-height: 360px; background: radial-gradient(circle at 50% 50%, #0b2a30 0%, #041417 70%, #020b0d 100%); }
.flk-sat-globe[hidden] { display: none; }
.flk-sat-globe .flk-globe-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.flk-sat .flk-sim-stage { position: relative; }
.flk-sat-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-inline-end: 4px; vertical-align: -1px; background: currentColor; }
.flk-sat-g[aria-pressed="false"] { opacity: .55; }
.flk-sat-g-stations .flk-sat-dot { color: #ffb054; } .flk-sat-g-visual .flk-sat-dot { color: #eef6ff; box-shadow: 0 0 0 1px var(--line); } .flk-sat-g-nav .flk-sat-dot { color: #7fd0ff; }
.flk-sat-g-weather .flk-sat-dot { color: #7ee0a0; } .flk-sat-g-geo .flk-sat-dot { color: #c4b5ff; } .flk-sat-g-iran .flk-sat-dot { color: #ff8fa3; }
.flk-sat-g small { color: var(--muted); font-variant-numeric: tabular-nums; }
.flk-sat-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--teal); border-radius: 12px; background: var(--teal-soft); }
.flk-sat-card[hidden], .flk-sat [data-sat-pass][hidden] { display: none; }
.flk-sat-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.flk-sat-name { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.flk-sat-name b { font-size: 1.08rem; }
.flk-sat-name small { color: var(--muted); font-size: .8rem; }
.flk-sat-line { margin: 0; font-size: .86rem; line-height: 1.8; }
.flk-sat-line:empty { display: none; }
.flk-sat-passes { margin: 0; padding: 0 1.2em 0 0; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.flk-sat-passes:empty { display: none; }
.flk-sat-passes li { display: flex; flex-direction: column; }
.flk-sat-passes .flk-next-go { align-self: flex-start; min-height: 26px; font-size: .8rem; }
.flk-sat-passes span { color: var(--muted); }
.flk-sat-iran { list-style: none; margin: 0; padding: 0; }
.flk-sat-iran:empty { display: none; }
.flk-sat-aq { max-width: 420px; margin-bottom: 10px; }
.flk-sat-antenna td.flk-num { font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.flk-sat-aname button { background: none; border: 0; padding: 0; color: var(--teal-ink); font: inherit; font-weight: 700; cursor: pointer; text-align: start; direction: ltr; }
.flk-sat-awrap { max-height: min(70vh, 560px); overflow: auto; }
.flk-sat-awrap thead th { position: sticky; top: 0; background: var(--surface); }

/* The telescope lab (sim_telescope): the eyepiece is the canvas; the targets wrap; a warning in the warm ink. */
.flk-tel-bodies { flex-wrap: wrap; }
.flk-tel-bodies button { flex: 1 0 22%; }
.flk-tel-warn { color: var(--orange-ink); font-weight: 700; }
.flk-tel-warn:empty { display: none; }
.flk-tel .flk-sim-canvas { cursor: default; }

/* The six small labs (phase 6). */
.flk-grav-part { display: flex; flex-direction: column; gap: 14px; }
.flk-grav-part[hidden] { display: none; }
.flk-w-born { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.flk-w-born input { direction: ltr; text-align: center; }
.flk-w-name { white-space: nowrap; font-weight: 700; }
.flk-w-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-inline-end: 6px; background: var(--c, #888); }
.flk-w-table td.flk-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flk-light-swatch { display: inline-block; width: 3em; height: 1.4em; border-radius: 6px; background: var(--c, #fff); box-shadow: 0 0 14px var(--c, #fff); vertical-align: middle; }
[data-light-for] { display: flex; flex-direction: column; gap: 14px; }
[data-light-for][hidden] { display: none; }
.flk-sh-stick { width: 5em; display: inline-block; margin-inline-start: 6px; direction: ltr; }
.flk-scale-jumps .flk-chip { font-size: .76rem; padding: 4px 9px; }

/* L11–L15: comfortable touch controls without widening the panel. */
:is([data-widget="sim-shadow"],[data-widget="sim-nowruz"],[data-widget="sim-solar"],[data-widget="sim-moon"],[data-widget="sim-seasons"]) .flk-sim-panel{min-width:0}
:is([data-widget="sim-shadow"],[data-widget="sim-nowruz"],[data-widget="sim-solar"],[data-widget="sim-moon"],[data-widget="sim-seasons"]) :is(.flk-chip,.flk-sim-seg button,.flk-sim-select){min-height:44px}

/* L16–L20 touch targets. */
:is([data-widget="sim-orbit"],[data-widget="sim-quake"],[data-widget="sim-system-builder"],[data-widget="sim-galaxies"],[data-widget="sim-dark-matter"]) :is(.flk-chip,.flk-sim-seg button,.flk-sim-select){min-height:44px}
