/* Isomer & Chirality Builder: the Model Bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Left: the molecule card (skeletal drawing, a pair of drawings, or the 3D mirror models).
 * Right: the coach line and the task card (one control per item kind). */
.ic { position: absolute; inset: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; font-size: 17px; line-height: 1.3;
  color: #1f2933; background: linear-gradient(#ece8f6, #dcd6ec);
  --ic-card: #ffffff; --ic-line: #b3abc9; --ic-soft: #4a4560; --ic-accent: #5f3dc4; --ic-head: #ece6fb; --ic-in: #ffffff;
  --ic-ok: #1f7a44; --ic-ok-bg: #e3f6e8; --ic-bad: #b42318; --ic-bad-bg: #fde7e4; }
html[data-theme="dark"] .ic { color: #eef2f6; background: linear-gradient(#1a1726, #121019);
  --ic-card: #231f33; --ic-line: #5d5679; --ic-soft: #d0cbe2; --ic-accent: #b7a4ff; --ic-head: #312a4d; --ic-in: #16131f;
  --ic-ok: #7fdca0; --ic-ok-bg: #173d27; --ic-bad: #ffb4a8; --ic-bad-bg: #4a1e1a; }
.ic *, .ic *::before, .ic *::after { box-sizing: border-box; }
.ic { text-align: left; }
.ic-mol .ic-tap:focus { outline: none; }
.ic-mol .ic-tap:focus-visible { outline: none; stroke: #b84c00; stroke-width: 4; stroke-opacity: 1; }
html[data-theme="dark"] .ic-mol .ic-tapring circle { fill: #3b2f6b; stroke: #b197fc; }
.ic p { margin: 0; }
.ic-left, .ic-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.ic-card { background: var(--ic-card); border: 1.5px solid var(--ic-line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.ic-k { font-weight: 800; color: var(--ic-accent); }

/* the molecule card */
.ic-diagram { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ic-dhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; }
.ic-tier { color: var(--ic-soft); font-weight: 700; }
.ic-svghost { flex: 1 1 auto; align-self: stretch; width: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: auto; gap: 6px; }
.ic-svghost > svg { display: block; width: 100%; height: auto; flex: 0 1 auto; }
.ic-svghost.is-pair { flex-direction: row; align-items: stretch; gap: 10px; }
.ic-pairfig { flex: 1 1 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1.5px dashed var(--ic-line); border-radius: 10px; padding: 6px; }
.ic-pairlab { font-weight: 800; color: var(--ic-accent); text-align: center; }
.ic-pairsvg { flex: 1 1 auto; width: 100%; display: flex; align-items: center; justify-content: center; overflow-x: auto; }
.ic-pairsvg svg { display: block; width: 100%; height: auto; }
.ic-xname { font-weight: 700; text-align: center; }
.ic-legend { color: var(--ic-soft); font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; justify-content: center; }
.ic-lg { display: inline-block; width: 34px; height: 12px; }
.ic-lg-w { background: currentColor; clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 55%); color: #1d2733; }
.ic-lg-d { background: repeating-linear-gradient(90deg, #1d2733 0 3px, transparent 3px 7px); clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 55%); }
html[data-theme="dark"] .ic-lg-w { color: #e6edf3; } html[data-theme="dark"] .ic-lg-d { background: repeating-linear-gradient(90deg, #e6edf3 0 3px, transparent 3px 7px); }
.ic-lg-glass { display: inline-block; width: 10px; height: 22px; border-radius: 2px; background: linear-gradient(90deg, #a5d8ff55, #e7f5ff, #a5d8ff55); border: 1.5px solid #74c0fc; }
.ic-3dhost { touch-action: none; cursor: grab; user-select: none; border-radius: 10px; }
.ic-3dhost:active { cursor: grabbing; }
.ic-3dhost:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.ic-3dhost > svg { max-height: 420px; align-self: stretch; width: 100%; }
.ic-3d { background: radial-gradient(ellipse at 50% 30%, #ffffff, #e3e9f0 70%); border-radius: 10px; }
html[data-theme="dark"] .ic-3d { background: radial-gradient(ellipse at 50% 30%, #3b4656, #1f2732 70%); }
html[data-theme="dark"] .ic-3d .ic-3dlab { fill: #e6edf3; }

/* coach line */
.ic-coachbar { display: flex; align-items: center; gap: 10px; background: var(--ic-card); border: 1.5px solid var(--ic-line); border-left: 6px solid var(--ic-accent); border-radius: 10px; padding: 6px 10px; min-height: 46px; }
.ic-coach-k { flex: none; font-weight: 800; color: var(--ic-accent); text-transform: uppercase; letter-spacing: .06em; }
.ic-coach { line-height: 1.25; }

/* task card */
.ic-task { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; box-shadow: 0 6px 16px rgba(40, 25, 80, .1); }
.ic-say { color: var(--ic-soft); }
.ic-eq { padding: 6px 10px; border-radius: 8px; background: var(--ic-head); font-weight: 600; }
.ic-eq b { color: var(--ic-accent); }
.ic-msg { color: var(--ic-bad); font-weight: 700; }
.ic-msg:empty, .ic-ok-note:empty { display: none; }
.ic-ok-note { color: var(--ic-ok); font-weight: 700; }
.ic-live { font-weight: 800; }
.ic button { font: inherit; color: inherit; }
.ic .ic-btn { min-height: 44px; min-width: 44px; padding: 6px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; background: var(--ic-in); border: 2px solid var(--ic-line); border-radius: 10px; cursor: pointer; }
.ic .ic-btn[aria-checked="true"], .ic .ic-btn[aria-pressed="true"] { border: 3px solid var(--ic-accent); background: var(--ic-head); }
.ic .ic-btn:disabled { cursor: default; }
.ic .ic-btn.is-right, .ic .ic-icard.is-right { border: 3px solid var(--ic-ok); background: var(--ic-ok-bg); }
.ic .ic-btn.is-wrong, .ic .ic-icard.is-wrong { border: 3px solid var(--ic-bad); background: var(--ic-bad-bg); }
.ic .ic-btn:focus-visible, .ic .ic-in:focus-visible, .ic .ic-pm:focus-visible, .ic .ic-icard:focus-visible, .ic .ic-tap:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.ic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ic .ic-chip--big { min-width: 96px; min-height: 52px; font-size: 20px; }
.ic-rsicon { font-size: 24px; line-height: 1; }
.ic-choices { display: flex; flex-direction: column; gap: 8px; align-self: stretch; width: 100%; }
.ic .ic-choice { justify-content: flex-start; text-align: left; width: 100%; padding: 8px 12px; font-weight: 600; line-height: 1.3; }
.ic-choice .ic-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--ic-line); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 900; }
.ic-choice[aria-checked="true"] .ic-dot { border-color: var(--ic-accent); background: var(--ic-accent); box-shadow: inset 0 0 0 3px var(--ic-card); }
.ic-choice.is-right .ic-dot { border-color: var(--ic-ok); background: var(--ic-ok); box-shadow: none; color: #fff; }
.ic-choice.is-wrong .ic-dot { border-color: var(--ic-bad); background: var(--ic-bad); box-shadow: none; color: #fff; }
html[data-theme="dark"] .ic-choice.is-right .ic-dot, html[data-theme="dark"] .ic-choice.is-wrong .ic-dot { color: #111; }
.ic .ic-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: start; justify-items: start; text-align: left; width: 100%; font-weight: 600; }
.ic-stepn { width: 30px; height: 30px; border-radius: 50%; background: var(--ic-head); color: var(--ic-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.ic-step[aria-checked="true"] .ic-stepn { background: var(--ic-accent); color: var(--ic-card); }
.ic-step.is-right .ic-stepn { background: var(--ic-ok); color: #fff; } .ic-step.is-wrong .ic-stepn { background: var(--ic-bad); color: #fff; }
.ic-turns { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ic-ticon { font-size: 22px; line-height: 1; }
.ic-zchip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; border-radius: 13px; background: #fff4d6; border: 2px solid #b45309; color: #7a3b00; font-weight: 900; }
.ic .ic-helper { justify-content: flex-start; }
.ic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ic-rowlab { font-weight: 800; }
.ic .ic-none { align-self: flex-start; }
.ic .ic-clear { align-self: flex-start; }
.ic .ic-in { width: 90px; height: 50px; padding: 0 10px; font: inherit; font-size: 22px; font-weight: 800; text-align: center; color: inherit; background: var(--ic-in); border: 2px solid var(--ic-accent); border-radius: 8px; }
.ic .ic-in:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.ic .ic-in.is-ok { border-color: var(--ic-ok); background: var(--ic-ok-bg); } .ic .ic-in.is-bad { border-color: var(--ic-bad); background: var(--ic-bad-bg); }
.ic .ic-pm { width: 50px; height: 50px; flex: none; font-size: 24px; font-weight: 800; background: var(--ic-head); border: 2px solid var(--ic-line); border-radius: 8px; cursor: pointer; }
.ic .ic-pm:disabled { opacity: .55; cursor: default; }
.ic-numrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ic-numrow label { font-weight: 800; }
.ic-mark { font-weight: 800; white-space: nowrap; } .ic-mark:empty { display: none; }
.ic-mark.is-ok { color: var(--ic-ok); } .ic-mark.is-bad { color: var(--ic-bad); }

/* isomer cards */
.ic-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ic .ic-icard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; min-height: 120px; background: #ffffff; color: #1f2933; border: 2px solid var(--ic-line); border-radius: 10px; cursor: pointer; }
.ic .ic-icard[aria-checked="true"] { border: 3px solid var(--ic-accent); box-shadow: 0 0 0 3px #d0bfff; }
.ic-cardlab { align-self: flex-start; font-weight: 900; color: #5f3dc4; }
.ic-cardsvg { flex: 1 1 auto; width: 100%; display: flex; align-items: center; justify-content: center; }
.ic-cardsvg svg { width: 100%; height: auto; max-height: 120px; }
.ic-cardname { font-size: 16px; font-weight: 700; text-align: center; }
.ic-cardname:empty { display: none; }

/* skeletal drawings: light colours are inline in art.js; dark overrides here */
.ic-mol .ic-tap { cursor: pointer; }
.ic-mol .ic-tap:hover { fill-opacity: .08; }
html[data-theme="dark"] .ic-mol .ic-bonds { stroke: #e6edf3; }
html[data-theme="dark"] .ic-mol .ic-fill, html[data-theme="dark"] .ic-mol .ic-dots { fill: #e6edf3; }
html[data-theme="dark"] .ic-mol .ic-hash { stroke: #e6edf3; }
html[data-theme="dark"] .ic-mol .ic-at-O { fill: #ff8787; } html[data-theme="dark"] .ic-mol .ic-at-N { fill: #74c0fc; }
html[data-theme="dark"] .ic-mol .ic-at-Cl, html[data-theme="dark"] .ic-mol .ic-at-F { fill: #8ce99a; } html[data-theme="dark"] .ic-mol .ic-at-Br { fill: #ffa94d; }
html[data-theme="dark"] .ic-mol .ic-at-H { fill: #ced4da; } html[data-theme="dark"] .ic-mol .ic-at-I { fill: #b197fc; }
html[data-theme="dark"] .ic-mol .ic-axis { stroke: #a5b4c4; }
html[data-theme="dark"] .ic-mol .ic-sel { stroke: #74c0fc; fill: #74c0fc; }
/* cards keep a white paper in both themes */
html[data-theme="dark"] .ic-icard .ic-mol .ic-bonds { stroke: #1d2733; } html[data-theme="dark"] .ic-icard .ic-mol .ic-fill { fill: #1d2733; } html[data-theme="dark"] .ic-icard .ic-mol .ic-hash { stroke: #1d2733; }
html[data-theme="dark"] .ic-icard .ic-mol .ic-at-O { fill: #c92a2a; } html[data-theme="dark"] .ic-icard .ic-mol .ic-at-N { fill: #1c5fd1; } html[data-theme="dark"] .ic-icard .ic-mol .ic-at-Cl { fill: #2b8a3e; } html[data-theme="dark"] .ic-icard .ic-mol .ic-at-Br { fill: #9c3d10; }
html[data-theme="dark"] .ic .ic-icard { background: #f4f1fb; color: #1f2933; }

/* Briefing example and Start art */
.ic-example { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; color: #1f2933; }
html[data-theme="dark"] .ic-example { color: #eef2f6; }
.ic-exwrap { width: 100%; overflow-x: auto; display: flex; justify-content: safe center; }
.ic-example svg { width: 100%; min-width: 300px; max-width: 420px; height: auto; }
.ic-example figcaption { font-weight: 700; text-align: center; }
html[data-theme="dark"] .ic-example .ic-bonds { stroke: #e6edf3; } html[data-theme="dark"] .ic-example .ic-fill { fill: #e6edf3; } html[data-theme="dark"] .ic-example .ic-hash { stroke: #e6edf3; }
html[data-theme="dark"] .ic-example .ic-at-O { fill: #ff8787; } html[data-theme="dark"] .ic-example .ic-at-H { fill: #ced4da; }
.ic-start { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ic-start svg { width: 100%; height: auto; }

@media (min-width: 901px) { html.ps-locked .lga-card { right: auto !important; left: 12px; max-width: 276px; } }

/* narrower than 1180: one column, the molecule above the task */
@media (max-width: 1180px) {
  .ic { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .ic-left, .ic-right { min-height: auto; }
  .ic-diagram { flex: none; }
  .ic-svghost > svg { max-height: 360px; }
  .ic-task { overflow: visible; }
}
@media (max-width: 560px) {
  .ic { padding: 8px; }
  .ic-svghost > svg.ic-mol { max-height: 300px; }
  .ic-pairsvg svg { max-height: 210px; }
  .ic-svghost.is-pair { flex-direction: column; }
  .ic-turns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ic .ic-turn { font-size: 16px; padding: 6px 8px; }
}
