/* Direction: Indian education advertising — royal purple chrome, yellow and green accents, rounded display type */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #faf7ff;
  --surface: #ffffff;
  --surface-2: #f1eafd;
  --border: #e0d6f3;
  --border-strong: #b3aeba;
  --ink: #1d1136;
  --muted: #5d5277;
  --accent: #5b21b6;
  --accent-hover: #4d1c9b;
  --accent-ink: #ffffff;
  --accent-text: #5b21b6;
  --accent-strong: #5b21b6;
  --accent-soft: #eee6fc;
  --accent-border: #b297de;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dfe9e8;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f2e3e1;
  --warning-strong: #a64c08;
  --danger: #c81e1e;
  --danger-ink: #ffffff;
  --danger-soft: #f4dde4;
  --danger-strong: #b81c1c;
  --chart-1: #5b21b6;
  --chart-2: #bb0c74;
  --chart-3: #763b0c;
  --chart-4: #656a0a;
  --chart-5: #0a5a49;
  --chart-6: #146f96;

  --font-display: "Baloo 2", "Poppins", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.01em;
  --radius-card: 18px;
  --radius-btn: 12px;
  --radius-input: 10px;
  --x-p-purple: #5b21b6;
  --x-p-deep: #2e1065;
  --x-p-yellow: #ffc72c;
  --x-p-green: #15803d;
  --x-p-red: #d62828;
  --x-p-white: #ffffff;
  --x-p-ink: #1d1136;
  --x-p-lav: #f3ecff;
  --x-p-cream: #fff7e0;
  --x-p-grey: #6b6480;
  --x-on-photo: #ffffff;
  --x-stage: #2a1a4d;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Poppins", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="dark"] {
  --canvas: #090312;
  --surface: #221c2a;
  --surface-2: #15101e;
  --border: #2b2633;
  --border-strong: #534f59;
  --ink: #faf7ff;
  --muted: #9a95a0;
  --accent: #5b21b6;
  --accent-hover: #7442c1;
  --accent-ink: #ffffff;
  --accent-text: #9b79d3;
  --accent-strong: #926dcf;
  --accent-soft: #1b0a36;
  --accent-border: #2e115c;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #0c1f1b;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #2f1510;
  --warning-strong: #c57a40;
  --danger: #c81e1e;
  --danger-ink: #ffffff;
  --danger-soft: #330915;
  --danger-strong: #d75e5e;
  --chart-1: #7b4ddf;
  --chart-2: #e54498;
  --chart-3: #c36107;
  --chart-4: #898e00;
  --chart-5: #1f957a;
  --chart-6: #0e96ca;
}

/* Poster Maker: canvas, handles, editor panel. Tokens only. */
.thumb { overflow: hidden; }
.thumb:not(.absolute) { position: relative; }
.thumb .poster { pointer-events: none; }
.poster { position: absolute; left: 0; top: 0; overflow: hidden; transform-origin: 0 0; }
.stage-bg { background: var(--x-stage); }
.band-list { border-top: 1px solid color-mix(in srgb, var(--x-on-photo) 25%, transparent); }
.band-list > li { border-bottom: 1px solid color-mix(in srgb, var(--x-on-photo) 25%, transparent); }

.hero-back { transform: rotate(5deg); }
.hero-front { transform: rotate(-4deg); transition: transform 0.25s ease; }
.hero-stack:hover .hero-front { transform: rotate(-2deg) translateY(-4px); }
@keyframes rise { from { translate: 0 22px; } to { translate: 0 0; } }
.hero-front, .hero-back { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
html.reduced-motion .hero-front, html.reduced-motion .hero-back { animation: none; transition: none; }
.strip { scrollbar-width: thin; }

.fmt-pick[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }

.preview-host { width: min(94vw, 1100px); height: calc(100dvh - 190px); min-height: 320px; overflow: visible; }
.preview-host .poster { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); }
.dl-host { width: 100%; height: min(70vh, 760px); }

/* editor canvas */
#canvas-wrap { display: flex; padding: 24px; overscroll-behavior: contain; }
.stage-box { position: relative; flex: none; margin: auto; }
#stage { box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5); touch-action: none; }
#stage .pe { cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
#stage .pe[data-lock="1"] { pointer-events: none; }
#stage .pe:hover { outline: 1px dashed var(--accent-text); outline-offset: 0; }
#stage .pt.editing { user-select: text; -webkit-user-select: text; cursor: text; outline: 2px solid var(--accent); outline-offset: 4px; background: color-mix(in srgb, var(--x-p-white) 60%, transparent); }

.sel { position: absolute; pointer-events: none; outline: 2px solid var(--accent); box-shadow: 0 0 0 1px var(--x-p-white); z-index: 5; }
.sel .h { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--x-p-white); border: 2px solid var(--accent); pointer-events: auto; touch-action: none; }
.sel .h[data-h="tl"] { left: 0; top: 0; cursor: nwse-resize; }
.sel .h[data-h="tr"] { left: 100%; top: 0; cursor: nesw-resize; }
.sel .h[data-h="bl"] { left: 0; top: 100%; cursor: nesw-resize; }
.sel .h[data-h="br"] { left: 100%; top: 100%; cursor: nwse-resize; }
.sel .h.rot { left: 50%; top: -30px; cursor: grab; background: var(--accent); border-color: var(--x-p-white); }
.sel .h.rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 22px; margin-left: -1px; background: var(--accent); }
@media (pointer: coarse) { .sel .h { width: 24px; height: 24px; margin: -12px 0 0 -12px; } .sel .h.rot { top: -38px; } }

/* panel */
.ptab { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ptab:hover { background: var(--surface-2); color: var(--ink); }
.ptab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.ptab:focus-visible, .tile:focus-visible, .seg-b:focus-visible, .mini:focus-visible, .layer:focus-visible, .sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sec { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sec:first-child { margin-top: 0; }
.hint { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.pgrid { display: grid; gap: 8px; }
.pgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pgrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; text-align: center; }
.tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.tile:active { transform: scale(0.97); }
.tile .deva { font-size: 20px; line-height: 1; }
.colorrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.colorrow input[type="color"], input[type="color"][data-role-fill] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border-strong, var(--border)); border-radius: 8px; background: none; cursor: pointer; }
.sw { width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--border-strong, var(--border)); }
.sw:hover { transform: scale(1.12); }
.sw.wide { width: 100%; height: 38px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg-b { display: grid; place-items: center; width: 38px; height: 34px; background: var(--surface); color: var(--ink); }
.seg-b.solo { border: 1px solid var(--border); border-radius: 10px; }
.seg-b:hover { background: var(--accent-soft); }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 500; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
#panel-body .field { margin-top: 10px; }
#panel-body .input, #panel-body .select { min-height: 38px; }
#panel-body textarea.input { resize: vertical; }
.lib { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.lib-img { aspect-ratio: 4 / 3; border-radius: 10px; background-size: cover; background-position: center; background-color: var(--surface-2); border: 1px solid var(--border); }
.lib-act { display: flex; gap: 4px; }
.mini { flex: 1; padding: 5px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; }
.mini:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.layers { display: flex; flex-direction: column; gap: 4px; }
.layers li { display: flex; align-items: center; gap: 4px; }
.layer { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; text-align: left; color: var(--ink); }
.layer:hover { background: var(--surface-2); }
.layer.on { border-color: var(--accent); background: var(--accent-soft); }
