/* Studio add-ons (public/studio-plus.js) and the embed disclosure (public/embed.js). */

/* ---------- Accessible colouring panel ---------- */
.a11y-panel, .embed { margin: 0 0 18px; background: var(--sun-field); border-radius: var(--radius-lg); padding: 0 16px; max-width: 860px; }
.a11y-panel > summary, .embed > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 800; padding: 8px 0; list-style-position: inside; }
.a11y-panel > summary::-webkit-details-marker, .embed > summary::-webkit-details-marker { margin-right: 8px; }
.a11y-list { display: grid; gap: 10px; padding: 4px 0 8px; }
.a11y-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
@media (min-width: 640px) { .a11y-row { grid-template-columns: 230px minmax(0, 1fr); align-items: center; gap: 16px; } }
.a11y-t { justify-content: space-between; width: 100%; gap: 12px; padding: 8px 8px 8px 18px; }
.a11y-st { min-width: 3.2em; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: .9rem; text-align: center; }
.a11y-t[aria-pressed="true"] { --b-bg: var(--sun-soft); }
.a11y-t[aria-pressed="true"] .a11y-st { background: var(--ink); color: #fff; }
.a11y-d { margin: 0; color: var(--ink); font-size: .95rem; }
.a11y-time { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.a11y-time[hidden] { display: none; }
.a11y-time label { font-weight: 700; }
.a11y-time select { font: inherit; min-height: 44px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.a11y-more { margin: 4px 0 14px; }

/* ---------- Switch mode: scan bar and highlights ---------- */
.scanbar[hidden] { display: none; }
.scan-btns { display: grid; grid-template-columns: 1fr 1.3fr 1.6fr; gap: 8px; }
.scan-btns button { min-height: 64px; font-size: 1.1rem; padding: 6px 10px; }
.scan-status { margin: 6px 0 0; font-weight: 700; font-size: 1rem; min-height: 1.5em; }
.art .r.scan { stroke: #1f62d6; stroke-width: 7px; vector-effect: non-scaling-stroke; }
.palette.scan { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
.sw.scan { outline: 5px solid var(--focus); outline-offset: 2px; }

/* ---------- Dwell to select ---------- */
.art .r.dwelling { stroke: #c8401c; stroke-width: 6px; vector-effect: non-scaling-stroke; stroke-dasharray: 10 6; }
.sw.dwelling { outline: 5px dashed var(--coral); outline-offset: 2px; }

/* A tall side panel (scan bar, bigger colours) must not push the picture down: extra height goes to the picture's row. */
@media (min-width: 900px) { .studio { grid-template-rows: auto 1fr; } }

/* ---------- Bigger palette ---------- */
.a11y-bigpal .sw { width: 64px; height: 64px; }
@media (min-width: 900px) { .a11y-bigpal .palette { grid-template-columns: repeat(4, 64px); gap: 8px; } }

/* ---------- Thick lines: the tiniest shapes join the lines ---------- */
.a11y-thick .art .r.tiny { fill: #111; pointer-events: none; }

/* ---------- High contrast: yellow lines on a black picture (screen only) ---------- */
@media screen {
  .a11y-hc .art { background: #000; border-radius: 12px; padding: 6px; }
  .a11y-hc .art svg { background: #000; }
  .a11y-hc .art svg [stroke]:not([stroke="none"]) { stroke: #ffd400; }
  .a11y-hc .art svg [fill="#fff"], .a11y-hc .art svg [fill="#ffffff"], .a11y-hc .art svg [fill="white"] { fill: #000; }
  .a11y-hc .art svg [fill="#111"], .a11y-hc .art svg [fill="#000"], .a11y-hc .art svg [fill="#222"], .a11y-hc .art svg text { fill: #ffd400; }
  .a11y-hc .art .r:not([fill]) { fill: #000; }
  .a11y-hc.a11y-thick .art .r.tiny { fill: #ffd400; }
  .a11y-hc .art .r.scan { stroke: #00e5ff; }
}

/* ---------- Share card dialog ---------- */
.share-dlg { border: 0; border-radius: var(--radius-lg); padding: 16px 18px 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-float); color: var(--ink); background: #fff; }
.share-dlg::backdrop { background: rgba(29, 29, 59, .55); }
.share-dlg h2 { margin: 0 0 10px; font-size: 1.3rem; }
.share-img img { display: block; width: 100%; height: auto; max-height: 56vh; object-fit: contain; border-radius: 12px; background: var(--sun-field); }
.share-note { margin: 10px 0; font-size: .95rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btns > * { flex: 1 1 auto; }
.share-status { margin: 8px 0 0; min-height: 1.2em; }

/* ---------- Embed snippet ---------- */
.embed p { margin: .4em 0; }
.embed label { display: block; font-weight: 700; margin-top: 6px; }
.embed textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.4; resize: vertical; margin: 4px 0 8px; }
.embed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-bottom: 12px; }
.embed-status { margin: 0; font-weight: 700; }

.embed-code { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; padding: 12px 14px; border-radius: 12px; font-size: .9rem; max-width: 760px; }

@media print { .a11y-panel, .embed, .scanbar { display: none !important; } }
