/* Chalchitra studio (Shunya Bots). Uses tokens from /assets/site.css. No external URLs. */
/* C1: the hidden attribute always wins inside Chalchitra */
.chal [hidden] { display: none !important; }
.chal .site-footer img { width: 21px; height: 26px; aspect-ratio: 524 / 652; }
/* C2: readable hero pill (midnight on cloud) */
.ch-pill-row { margin: 0 0 12px; }
.page-hero .status-pill { color: var(--sb-midnight); background: var(--sb-cloud); }

/* L1: compact hero so the studio starts above the fold at 1440x900 */
.ch-hero { padding-top: 28px; padding-bottom: 24px; }
.ch-hero h1 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); margin: 0 0 10px; }
.ch-hero .lead { margin: 0 0 12px; font-size: 1.02rem; }
.ch-hero .crumbs { margin-bottom: 8px; }
.ch-hero .ch-privacy { margin: 0; font-size: 0.93rem; }
.ch-hero-mark img { width: 104px; height: 130px; }
.ch-hero h1 { max-width: none; }
.ch-hero .lead { max-width: 80ch; }
.ch-hero .ch-privacy { max-width: 92ch; }
.ch-hero .crumbs a { min-height: 32px; }
.ch-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.ch-hero-mark img { filter: drop-shadow(0 18px 40px rgba(109, 91, 255, 0.45)); animation: ch-float 7s ease-in-out infinite; }
@keyframes ch-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ch-privacy { border-left: 3px solid var(--sb-cyan); padding: 10px 14px; background: rgba(34, 211, 238, 0.08); border-radius: 0 12px 12px 0; }
.ch-privacy strong { color: var(--sb-white); }

.ch-studio { background: #0E1440; color: var(--sb-cloud); padding: 40px 0 56px; }
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr); gap: 28px; align-items: start; }
.ch-panel { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(246, 247, 251, 0.1); border-radius: 20px; padding: 18px 20px 24px; min-width: 0; }
.ch-panel h2 { color: var(--sb-white); font-size: 1.45rem; margin: 6px 0 6px; }
.ch-sub { color: var(--sb-white); font-size: 1.05rem; margin: 22px 0 8px; }
.ch-hint, .ch-meta { color: var(--ink-soft); font-size: 0.93rem; margin: 0 0 12px; }
.ch-hint code { background: rgba(255, 255, 255, 0.1); padding: 1px 6px; border-radius: 6px; color: var(--sb-white); }
.ch-status.err { color: #FFB4A8; border-left: 3px solid #FF6B57; padding-left: 10px; }
.ch-status { color: var(--sb-cyan); min-height: 1.4em; margin: 8px 0; font-size: 0.95rem; }
.ch-label, .ch-field label { display: block; font-family: var(--sb-font-head); font-weight: 600; color: var(--sb-white); margin: 0 0 6px; font-size: 0.93rem; }
.ch-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ch-steps { list-style: none; display: flex; gap: 6px; padding: 4px; margin: 0 0 16px; background: rgba(0, 0, 0, 0.22); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.ch-steps li { flex: 1 0 auto; }
.ch-steps button { width: 100%; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: 600 0.93rem var(--sb-font-head); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 0 12px; transition: background 0.25s ease, color 0.25s ease; }
.ch-steps button span.n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 0.8rem; transition: background 0.25s ease; }
.ch-steps button:hover { color: var(--sb-white); }
.ch-steps button[aria-selected="true"] { background: var(--sb-gradient); color: var(--sb-midnight); }
.ch-steps button[aria-selected="true"] span.n { background: rgba(11, 16, 51, 0.2); }
.ch-steps button.done span.n { background: var(--sb-saffron); color: var(--sb-midnight); }
.ch-pane { animation: ch-in 0.35s cubic-bezier(.2, .8, .2, 1); }
@keyframes ch-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ch-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ch-tpl { text-align: left; border: 1px solid rgba(246, 247, 251, 0.14); background: rgba(255, 255, 255, 0.03); color: var(--sb-cloud); border-radius: 16px; padding: 14px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; font: inherit; }
.ch-tpl:hover { transform: translateY(-2px); border-color: rgba(139, 123, 255, 0.6); }
.ch-tpl[aria-pressed="true"] { border-color: var(--sb-saffron); background: rgba(255, 164, 27, 0.08); }
.ch-tpl canvas { width: 54px; height: 72px; border-radius: 8px; background: #000; }
.ch-tpl strong { display: block; font-family: var(--sb-font-head); color: var(--sb-white); margin-bottom: 2px; }
.ch-tpl small { display: block; color: var(--ink-soft); line-height: 1.4; }
.ch-tpl em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 0.76rem; color: var(--sb-cyan); }

textarea, .ch-field input, .ch-field select, .ch-scene textarea, .ch-scene input, .ch-scene select, .ch-transport input { font: inherit; }
#ch-script, .ch-field input[type="text"], .ch-field input[type="number"], .ch-field select, .ch-scene textarea, .ch-scene select, .ch-scene input[type="number"] {
  width: 100%; background: rgba(0, 0, 0, 0.25); color: var(--sb-white); border: 1px solid rgba(246, 247, 251, 0.18); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
#ch-script { resize: vertical; line-height: 1.5; }
#ch-script:focus, .ch-field input:focus, .ch-field select:focus, .ch-scene textarea:focus, .ch-scene select:focus, .ch-scene input:focus { outline: 2px solid var(--sb-cyan); outline-offset: 1px; }
.ch-field input[type="color"] { width: 100%; height: 44px; border: 1px solid rgba(246, 247, 251, 0.18); border-radius: 12px; background: transparent; padding: 3px; cursor: pointer; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ch-row { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.ch-wrap { flex-wrap: wrap; }
.ch-next { margin-top: 14px; }
.ch-file { position: relative; overflow: hidden; }
.ch-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ch-file:focus-within { outline: 2px solid var(--sb-cyan); outline-offset: 2px; }
.ch-brandset { border: 1px solid rgba(246, 247, 251, 0.12); border-radius: 16px; padding: 12px 14px 4px; margin: 14px 0; }
.ch-brandset legend { padding: 0 6px; font-family: var(--sb-font-head); color: var(--sb-white); font-weight: 600; }

.ch-shots { list-style: none; counter-reset: shot; padding: 0; margin: 0; display: grid; gap: 6px; }
.ch-shots li { counter-increment: shot; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 10px; background: rgba(255, 255, 255, 0.04); border-radius: 10px; animation: ch-in 0.3s ease both; }
.ch-shots li::before { content: counter(shot); font: 700 0.85rem var(--sb-font-head); color: var(--sb-saffron); }
.ch-shots .k { font-size: 0.78rem; color: var(--sb-cyan); white-space: nowrap; }

.ch-bin { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ch-bin li { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(246, 247, 251, 0.1); border-radius: 12px; overflow: hidden; animation: ch-in 0.3s ease both; }
.ch-bin canvas { display: block; width: 100%; aspect-ratio: 16 / 10; background: #000; }
.ch-bin p { margin: 0; padding: 6px 8px 0; font-size: 0.8rem; color: var(--sb-white); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ch-bin small { display: block; padding: 0 8px 8px; color: var(--ink-soft); font-size: 0.75rem; }
.ch-tag { display: inline-block; background: var(--sb-saffron); color: var(--sb-midnight); font: 700 0.68rem var(--sb-font-head); padding: 1px 6px; border-radius: 6px; margin-right: 4px; letter-spacing: 0.04em; }
.ch-cam-view { position: relative; }
.ch-cam video { width: 100%; max-height: 280px; border-radius: 12px; background: #000; display: block; }
.ch-rec { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(11, 16, 51, 0.85); color: #fff; font: 700 0.85rem var(--sb-font-head); padding: 4px 10px; border-radius: 999px; }
.ch-rec .dot, .ch-cam-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #FF3B30; animation: ch-pulse 1.1s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: 0.35; } }
.ch-cam .ch-row { flex-wrap: wrap; }
.ch-cam .ch-row .btn { white-space: nowrap; }
.ch-cam .ch-row .ch-meta { flex-basis: 100%; margin: 0; }
.ch-cam-pill { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 0; padding: 6px 8px 6px 14px; width: fit-content; border-radius: 999px; background: rgba(255, 59, 48, 0.14); border: 1px solid rgba(255, 59, 48, 0.6); color: #fff; font: 700 0.9rem var(--sb-font-head); }
.ch-cam-stop { background: #FF3B30; color: #fff; min-height: 44px; }
.ch-cam-stop:hover { background: #ff5a50; color: #fff; }
.ch-cam { margin: 10px 0; }

.ch-timeline { width: 100%; height: 96px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); cursor: pointer; display: block; }
.ch-scenes { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ch-scene { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(246, 247, 251, 0.12); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease; }
.ch-scene.sel { border-color: var(--sb-saffron); }
.ch-scene.drag { opacity: 0.45; }
.ch-scene.over { transform: translateY(3px); border-color: var(--sb-cyan); }
.ch-scene .grip { cursor: grab; color: var(--ink-soft); font: 700 0.9rem var(--sb-font-head); padding-top: 10px; user-select: none; }
.ch-scene .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; } /* M-1: Type + Media, then Camera + Seconds */
.ch-scene .acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.ch-scene .acts button { min-height: 44px; min-width: 44px; border-radius: 10px; border: 1px solid rgba(246, 247, 251, 0.2); background: transparent; color: var(--sb-cloud); cursor: pointer; font: 600 0.85rem var(--sb-font-head); padding: 0 10px; }
.ch-scene .acts button:hover { background: rgba(255, 255, 255, 0.08); }
.ch-scene textarea { min-height: 58px; resize: vertical; }
.ch-scene label { font-size: 0.75rem; color: var(--ink-soft); display: block; margin-bottom: 3px; }

.ch-stage { position: sticky; top: calc(var(--header-h) + 16px); }
.ch-screen { margin: 0 auto; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(246, 247, 251, 0.08); transition: width 0.35s cubic-bezier(.2, .8, .2, 1), aspect-ratio 0.35s ease; }
.ch-screen[data-aspect="9:16"] { aspect-ratio: 9 / 16; width: min(100%, 360px, calc((100vh - var(--header-h) - 140px) * 0.5625)); }
.ch-screen[data-aspect="4:5"] { aspect-ratio: 4 / 5; width: min(100%, 420px, calc((100vh - var(--header-h) - 140px) * 0.8)); }
.ch-screen[data-aspect="1:1"] { aspect-ratio: 1 / 1; width: min(100%, 480px, calc(100vh - var(--header-h) - 140px)); }
.ch-screen[data-aspect="16:9"] { aspect-ratio: 16 / 9; width: 100%; }
.ch-screen canvas { width: 100%; height: 100%; display: block; }
.ch-transport { display: flex; gap: 12px; align-items: center; margin: 14px auto 0; max-width: 560px; }
.ch-transport input[type="range"] { flex: 1; accent-color: var(--sb-saffron); min-height: 44px; }
.ch-time { font: 600 0.85rem var(--sb-font-head); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-scene-now { text-align: center; margin-top: 6px; }

progress { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; border: 0; background: rgba(255, 255, 255, 0.1); accent-color: var(--sb-saffron); margin: 6px 0; }
progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.1); }
progress::-webkit-progress-value { background: var(--sb-saffron); transition: width 0.2s linear; }
.ch-result { margin: 10px 0 6px; display: grid; gap: 10px; justify-items: start; animation: ch-in 0.35s ease; }
.ch-result video { width: 100%; max-height: 360px; border-radius: 12px; background: #000; }
.ch-clear { margin-top: 18px; }

.ch-about .ch-points { padding-left: 1.1em; }
.ch-about .ch-points li { margin-bottom: 8px; }
.ch-credit { font-size: 0.93rem; color: var(--sb-slate); border-top: 1px solid var(--line); padding-top: 12px; }
.ch-credit a { display: inline-block; padding: 12px 0; margin: -12px 0; }

@media (max-width: 980px) {
  .ch-layout { grid-template-columns: 1fr; }
  /* C7: editor first, compact preview after it */
  .ch-stage { position: static; padding-top: 4px; }
  .ch-screen[data-aspect="9:16"] { width: min(100%, calc(34vh * 0.5625)); }
  .ch-screen[data-aspect="4:5"] { width: min(100%, calc(34vh * 0.8)); }
  .ch-screen[data-aspect="1:1"] { width: min(100%, 34vh); }
  .ch-screen[data-aspect="16:9"] { width: min(100%, calc(34vh * 1.7778)); }
  .ch-transport { margin-top: 8px; }
  .ch-scene-now { margin: 4px 0 0; }
}
@media (max-width: 620px) {
  .ch-hero-grid { grid-template-columns: 1fr; }
  .ch-hero-mark { display: none; }
  .ch-tpls { grid-template-columns: 1fr; }
  .ch-panel { padding: 14px 12px 18px; }
  /* C6: all five steps visible as numbered tabs; only the active one shows its label */
  .ch-steps { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; overflow: visible; }
  .ch-steps button { padding: 0 10px; font-size: 0.85rem; min-width: 44px; }
  .ch-steps button .lbl { display: none; }
  .ch-steps button[aria-selected="true"] .lbl { display: inline; }
  /* C13: stack scene fields full width */
  .ch-scene .row { grid-template-columns: 1fr; }
  .ch-scene { grid-template-columns: 18px 1fr; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-hero-mark img, .ch-pane, .ch-shots li, .ch-bin li, .ch-result, .ch-rec .dot, .ch-cam-pill .dot { animation: none; }
  .ch-screen, .ch-tpl, .ch-scene, .ch-steps button { transition: none; }
}
.ch-ai { border: 1px dashed rgba(139, 123, 255, 0.55); border-radius: 16px; padding: 4px 14px 10px; margin: 0 0 16px; background: rgba(109, 91, 255, 0.06); }
.ch-ai .ch-sub { margin-top: 10px; }
.ch-ai-prompt, #ch-ai-out { width: 100%; background: rgba(0, 0, 0, 0.25); color: var(--sb-white); border: 1px solid rgba(246, 247, 251, 0.18); border-radius: 12px; padding: 10px 12px; min-height: 44px; font: inherit; }
#ch-ai-out { resize: vertical; line-height: 1.5; }
.ch-beta { display: inline-block; background: var(--sb-saffron); color: var(--sb-midnight); font-weight: 700; padding: 0 8px; border-radius: 999px; margin-right: 6px; }

/* L2 */
#ch-split { white-space: nowrap; }
/* Sound, brand kit, end card, trim, checks */
.ch-field input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--sb-saffron); }
.ch-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--sb-cloud); cursor: pointer; margin: 4px 0 8px; }
.ch-check input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--sb-saffron); }
.ch-live { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 59, 48, 0.16); border: 1px solid rgba(255, 59, 48, 0.65); color: #fff; font: 700 0.85rem var(--sb-font-head); padding: 4px 10px; border-radius: 999px; }
.ch-live .dot { width: 10px; height: 10px; border-radius: 50%; background: #FF3B30; animation: ch-pulse 1.1s ease-in-out infinite; }
/* L5: 'Camera on' visible inside the camera panel at every width */
.ch-cam-live { position: absolute; top: 10px; right: 10px; background: rgba(11, 16, 51, 0.85); }
.ch-trim { padding: 0 8px 6px; font-size: 0.78rem; color: var(--ink-soft); }
.ch-trim summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--sb-cyan); font-weight: 600; }
.ch-trim label { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 4px 0; }
.ch-trim input { width: 76px; min-height: 44px; background: rgba(0, 0, 0, 0.3); color: var(--sb-white); border: 1px solid rgba(246, 247, 251, 0.2); border-radius: 8px; padding: 4px 6px; font: inherit; }
.ch-endnote { margin: 8px 0 0; color: var(--sb-white); font-weight: 600; }
.ch-checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.ch-checks li { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 0.92rem; line-height: 1.45; }
.ch-checks .ch-check-warn { border-left: 3px solid var(--sb-saffron); }
.ch-checks .ch-check-tip { border-left: 3px solid var(--sb-cyan); }
.ch-checks .ch-check-tip .ch-tag { background: var(--sb-cyan); }
.ch-checks .ch-check-ok { border-left: 3px solid #3ddc97; }
.ch-checks .ch-check-ok .ch-tag { background: #3ddc97; }
@media (prefers-reduced-motion: reduce) { .ch-live .dot { animation: none; } }
/* M-1: phones get one clean column; the action buttons share one even grid */
@media (max-width: 620px) {
  .ch-scene .row { grid-template-columns: minmax(0, 1fr); }
  .ch-scene .acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
  .ch-scene .acts button { padding: 0 6px; }
}
/* M-5: a red REC badge in the scene being recorded, a red Stop, and the live pill pinned in view on phones */
.ch-scene-rec { margin: 8px 0 0; width: fit-content; scroll-margin: 24px 0 120px; }
.ch-scene .acts button.ch-stop { background: #FF3B30; border-color: #FF3B30; color: #fff; }
/* R-1: live strip in the sticky header on phones/tablets; it takes its own 44px, so nothing sits under it */
.ch-live-strip { display: none; }
@media (max-width: 980px) {
  .ch-live-strip:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; white-space: nowrap; background: #3a0d12; border-top: 1px solid rgba(255, 59, 48, 0.7); color: #fff; font: 700 0.95rem var(--sb-font-head); }
  .ch-live-strip .dot { width: 10px; height: 10px; border-radius: 50%; background: #FF3B30; animation: ch-pulse 1.1s ease-in-out infinite; }
  .ch-strip-stop { height: 44px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 0; background: #FF3B30; color: #fff; font: 700 0.95rem var(--sb-font-head); white-space: nowrap; cursor: pointer; }
  html.ch-live-on { --header-h: 116px; scroll-padding-top: calc(var(--header-h) + 8px); }
  html.ch-live-on .site-header .bar { min-height: 72px; }
  #ch-cam-pill { display: none !important; }
}
@media (max-width: 980px) and (prefers-reduced-motion: reduce) { .ch-live-strip .dot { animation: none; } }
