/* Bear Halftone Studio · estilos
   Misma paleta y tipografía que el resto de las apps Bear (Bear Tee Builder, Bear Graphic Editor, Bear Video Editor).
   Violeta = marca y acciones. Magenta = algo está ocurriendo (forma activa, zona de datos). Todo bajo #bhs-app para no heredar estilos del tema. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter-latin-400-normal.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter-latin-500-normal.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter-latin-600-normal.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/inter-latin-700-normal.woff") format("woff"); }

#bhs-app {
	--bhs-bg: #0a1230;
	--bhs-surface: #101a3e;
	--bhs-line: #27325f;
	--bhs-text: #eef0fa;
	--bhs-muted: #a9b0c8;
	--bhs-primary: #6366f1;
	--bhs-signal: #ff00b0;
	--bhs-danger: #ff5a5f;
	--bhs-raise: color-mix(in srgb, var(--bhs-surface) 84%, white);
	--bhs-sunk: color-mix(in srgb, var(--bhs-bg) 70%, black);
	--bhs-primary-ink: color-mix(in srgb, var(--bhs-primary) 55%, white);
	--bhs-h: 100vh;
	--bhs-h: 100dvh;
	--bhs-font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	position: relative;
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: none;
	height: var(--bhs-h);
	min-height: 600px;
	margin: 0;
	padding: 0;
	background: var(--bhs-bg);
	color: var(--bhs-text);
	font: 400 14px/1.45 var(--bhs-font);
	border: 1px solid var(--bhs-line);
	border-radius: 8px;
	overflow: hidden;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
#bhs-app.is-fs { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh !important; max-height: none; border: 0; border-radius: 0; }
html.bhs-lock, html.bhs-lock body { overflow: hidden !important; }

#bhs-app *, #bhs-app *::before, #bhs-app *::after { box-sizing: border-box; }
#bhs-app h1, #bhs-app h2, #bhs-app h3, #bhs-app p, #bhs-app ul, #bhs-app li { margin: 0; padding: 0; }
#bhs-app h1, #bhs-app h2, #bhs-app h3, #bhs-app p { font-family: inherit; font-weight: inherit; line-height: 1.3; letter-spacing: 0; color: inherit; }
#bhs-app ul { list-style: none; }
#bhs-app button, #bhs-app input, #bhs-app select, #bhs-app textarea {
	font: inherit; color: inherit; letter-spacing: 0; text-shadow: none; text-decoration: none;
	margin: 0; border: 0; border-radius: 0; box-shadow: none; background: none; min-height: 0; height: auto; width: auto; max-width: 100%;
	-webkit-appearance: none; appearance: none; outline: none; line-height: 1.3;
}
#bhs-app button { cursor: pointer; padding: 0; }
#bhs-app button:disabled { cursor: not-allowed; }
#bhs-app a { color: var(--bhs-primary-ink); text-decoration: none; }
#bhs-app [hidden] { display: none !important; }
#bhs-app :focus-visible { outline: 2px solid var(--bhs-signal); outline-offset: 2px; }
#bhs-app i.fas { line-height: 1; }
#bhs-app img { max-width: none; border: 0; }
#bhs-app .bhs-boot { padding: 40px; text-align: center; color: var(--bhs-muted); }
#bhs-app .bhs-muted { color: var(--bhs-muted); }
#bhs-app .bhs-hint { font-size: 12px; color: var(--bhs-muted); }
#bhs-app .bhs-hint i { margin-right: 6px; }
#bhs-app .bhs-link { color: var(--bhs-primary-ink); font-size: 12px; background: none; }
#bhs-app .bhs-link:hover { text-decoration: underline; }
#bhs-app .bhs-only-narrow { display: none !important; }

/* ---------- Estructura ---------- */
#bhs-app .bhs-app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
#bhs-app .bhs-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bhs-sunk); border-bottom: 1px solid var(--bhs-line); min-width: 0; }
#bhs-app .bhs-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; white-space: nowrap; margin-right: 4px; }
#bhs-app .bhs-brand i { color: var(--bhs-primary-ink); font-size: 17px; }
#bhs-app .bhs-top-sp { flex: 1; }
#bhs-app .bhs-main { position: relative; display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 0; }
#bhs-app .bhs-panel { background: var(--bhs-surface); border-right: 1px solid var(--bhs-line); overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--bhs-line) transparent; }
#bhs-app .bhs-sec { padding: 14px 16px; border-top: 1px solid var(--bhs-line); display: grid; gap: 10px; }
#bhs-app .bhs-sec:first-child { border-top-color: transparent; }
#bhs-app .bhs-sec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
#bhs-app .bhs-sec-title i { color: var(--bhs-primary-ink); width: 16px; text-align: center; }

/* ---------- Controles ---------- */
#bhs-app .bhs-input { width: 100%; background: var(--bhs-sunk); border: 1px solid var(--bhs-line); border-radius: 6px; padding: 9px 11px; font-size: 14px; color: var(--bhs-text); transition: border-color .12s; }
#bhs-app .bhs-input:hover { border-color: color-mix(in srgb, var(--bhs-line) 60%, var(--bhs-muted)); }
#bhs-app .bhs-input:focus { border-color: var(--bhs-primary); box-shadow: 0 0 0 1px var(--bhs-primary); }
#bhs-app select.bhs-input { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f8cc0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
#bhs-app .bhs-input option { background: var(--bhs-surface); color: var(--bhs-text); }
#bhs-app .bhs-field { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
#bhs-app .bhs-field > span { color: var(--bhs-muted); }
#bhs-app .bhs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#bhs-app .bhs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; background: var(--bhs-raise); border: 1px solid var(--bhs-line); border-radius: 6px; color: var(--bhs-text); font-size: 13px; font-weight: 500; line-height: 1.2; transition: background .12s, border-color .12s; white-space: nowrap; }
#bhs-app .bhs-btn:hover:not(:disabled) { border-color: var(--bhs-muted); }
#bhs-app .bhs-btn.is-primary { background: var(--bhs-primary); border-color: var(--bhs-primary); color: #fff; }
#bhs-app .bhs-btn.is-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--bhs-primary) 86%, white); border-color: transparent; }
#bhs-app .bhs-btn.is-sm { padding: 6px 10px; font-size: 12px; }
#bhs-app .bhs-btn.is-block { width: 100%; }
#bhs-app .bhs-btn:disabled { opacity: .45; }
#bhs-app .bhs-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--bhs-muted); font-size: 13px; flex: none; }
#bhs-app .bhs-icon-btn:hover:not(:disabled) { color: var(--bhs-text); background: var(--bhs-raise); }
#bhs-app .bhs-icon-btn.is-on { color: #fff; background: var(--bhs-primary); border-color: var(--bhs-primary); }
#bhs-app .bhs-seg { display: flex; border: 1px solid var(--bhs-line); border-radius: 6px; overflow: hidden; background: var(--bhs-sunk); }
#bhs-app .bhs-seg-b { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; background: none; border: 0; color: var(--bhs-muted); font-size: 12px; white-space: nowrap; }
#bhs-app .bhs-seg-b + .bhs-seg-b { border-left: 1px solid var(--bhs-line); }
#bhs-app .bhs-seg-b:hover { color: var(--bhs-text); }
#bhs-app .bhs-seg-b.is-on { background: var(--bhs-primary); color: #fff; }
#bhs-app .bhs-range { width: 100%; height: 18px; background: none; padding: 0; border: 0; cursor: pointer; }
#bhs-app .bhs-range::-webkit-slider-runnable-track { height: 3px; background: var(--bhs-line); border-radius: 2px; }
#bhs-app .bhs-range::-moz-range-track { height: 3px; background: var(--bhs-line); border-radius: 2px; }
#bhs-app .bhs-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--bhs-primary-ink); border: 0; }
#bhs-app .bhs-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bhs-primary-ink); border: 0; }
#bhs-app .bhs-range:hover::-webkit-slider-thumb { background: #fff; }
#bhs-app .bhs-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
#bhs-app .bhs-row-l { color: var(--bhs-muted); display: flex; align-items: center; gap: 6px; }
#bhs-app .bhs-row.is-range { grid-template-columns: 1fr; gap: 4px; }
#bhs-app .bhs-row.is-range .bhs-row-top { display: flex; justify-content: space-between; }
#bhs-app .bhs-num { font-variant-numeric: tabular-nums; color: var(--bhs-muted); font-size: 12px; }
#bhs-app .bhs-toggle { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 13px; cursor: pointer; }
#bhs-app .bhs-switch { position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--bhs-sunk); border: 1px solid var(--bhs-line); flex: none; transition: background .15s, border-color .15s; }
#bhs-app .bhs-switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--bhs-muted); transition: transform .15s, background .15s; }
#bhs-app input:checked + .bhs-switch { background: var(--bhs-primary); border-color: var(--bhs-primary); }
#bhs-app input:checked + .bhs-switch::after { transform: translateX(16px); background: #fff; }
#bhs-app .bhs-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#bhs-app .bhs-swatch-wrap { position: relative; width: 34px; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--bhs-line); flex: none; cursor: pointer; }
#bhs-app .bhs-swatch-wrap input { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; padding: 0; }
#bhs-app .bhs-swatch-fill { position: absolute; inset: 0; background: var(--c, #fff); pointer-events: none; }

/* ---------- Dropzone / imágenes ---------- */
#bhs-app .bhs-drop { display: grid; gap: 6px; justify-items: center; padding: 18px 10px; border: 1.5px dashed var(--bhs-line); border-radius: 8px; background: var(--bhs-sunk); text-align: center; transition: border-color .12s, background .12s; }
#bhs-app .bhs-drop:hover, #bhs-app .bhs-drop.is-drag { border-color: var(--bhs-signal); background: color-mix(in srgb, var(--bhs-signal) 8%, var(--bhs-sunk)); }
#bhs-app .bhs-drop i { font-size: 22px; color: var(--bhs-muted); }
#bhs-app .bhs-drop b { font-size: 13px; font-weight: 600; }
#bhs-app .bhs-drop span { font-size: 11.5px; color: var(--bhs-muted); }
#bhs-app .bhs-drop input { display: none; }
#bhs-app .bhs-file { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--bhs-sunk); border: 1px solid var(--bhs-line); border-radius: 8px; }
#bhs-app .bhs-file-th { width: 42px; height: 42px; border-radius: 6px; background: repeating-conic-gradient(#2a3463 0% 25%, #202a50 0% 50%) 50% / 10px 10px; display: grid; place-items: center; overflow: hidden; flex: none; }
#bhs-app .bhs-file-th img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
#bhs-app .bhs-file-meta { flex: 1; min-width: 0; display: grid; gap: 1px; }
#bhs-app .bhs-file-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bhs-app .bhs-file-dims { font-size: 11px; color: var(--bhs-muted); }

/* ---------- Formas ---------- */
#bhs-app .bhs-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#bhs-app .bhs-shape-b { aspect-ratio: 1; display: grid; place-items: center; background: var(--bhs-sunk); border: 1px solid var(--bhs-line); border-radius: 8px; color: var(--bhs-muted); font-size: 18px; transition: border-color .12s, color .12s; }
#bhs-app .bhs-shape-b:hover { border-color: var(--bhs-muted); color: var(--bhs-text); }
#bhs-app .bhs-shape-b.is-on { border-color: var(--bhs-signal); box-shadow: 0 0 0 1px var(--bhs-signal); color: var(--bhs-text); }
#bhs-app .bhs-shape-b img { max-width: 70%; max-height: 70%; object-fit: contain; }
#bhs-app .bhs-shape-custom { display: flex; align-items: center; gap: 10px; }
#bhs-app .bhs-shape-custom .bhs-shape-b { width: 42px; aspect-ratio: auto; height: 42px; flex: none; }

/* ---------- Escenario / lienzo ---------- */
#bhs-app .bhs-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bhs-bg); position: relative; }
#bhs-app .bhs-tools { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bhs-sunk); border-bottom: 1px solid var(--bhs-line); flex-wrap: wrap; }
#bhs-app .bhs-zoom-label { min-width: 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--bhs-muted); }
#bhs-app .bhs-stage-sp { flex: 1; }
#bhs-app .bhs-canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; background-color: var(--bhs-bg); background-image: radial-gradient(color-mix(in srgb, var(--bhs-text) 9%, transparent) 1.2px, transparent 1.3px); background-size: 22px 22px; }
#bhs-app .bhs-canvas-pad { position: relative; padding: 24px; display: grid; place-items: center; }
#bhs-app .bhs-checker { background-image: repeating-conic-gradient(#d9dce6 0% 25%, #fff 0% 50%); background-size: 16px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
#bhs-app .bhs-canvas-pad canvas { display: block; max-width: none; }
#bhs-app .bhs-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
#bhs-app .bhs-empty-inner { display: grid; gap: 10px; justify-items: center; max-width: 320px; }
#bhs-app .bhs-empty i { font-size: 34px; color: var(--bhs-muted); }
#bhs-app .bhs-status-bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--bhs-sunk); border-top: 1px solid var(--bhs-line); font-size: 12px; color: var(--bhs-muted); min-height: 30px; }
#bhs-app .bhs-progress { flex: 1; max-width: 220px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bhs-line); }
#bhs-app .bhs-progress i { display: block; height: 100%; background: var(--bhs-primary); transition: width .1s linear; width: 0%; }

/* ---------- Avisos ---------- */
#bhs-app .bhs-toasts { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 95; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
#bhs-app .bhs-toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; background: var(--bhs-raise); border: 1px solid var(--bhs-line); border-radius: 6px; font-size: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.4); transition: opacity .25s, transform .25s; pointer-events: auto; }
#bhs-app .bhs-toast i { margin-top: 3px; color: var(--bhs-primary-ink); }
#bhs-app .bhs-toast.is-ok i { color: #35d49a; }
#bhs-app .bhs-toast.is-error { border-color: var(--bhs-danger); }
#bhs-app .bhs-toast.is-error i { color: var(--bhs-danger); }
#bhs-app .bhs-toast.is-out { opacity: 0; transform: translateY(6px); }
#bhs-app .bhs-note { display: flex; gap: 9px; padding: 9px 11px; border-radius: 6px; background: color-mix(in srgb, var(--bhs-signal) 9%, transparent); border: 1px solid color-mix(in srgb, var(--bhs-signal) 38%, transparent); font-size: 12px; }
#bhs-app .bhs-note i { color: var(--bhs-signal); margin-top: 2px; }

/* ---------- Angosto ---------- */
#bhs-app.is-narrow .bhs-main { grid-template-columns: minmax(0, 1fr); }
#bhs-app.is-narrow .bhs-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 100%); z-index: 30; box-shadow: 10px 0 30px rgba(0,0,0,.4); display: none; }
#bhs-app.is-narrow.panel-open .bhs-panel { display: block; }
#bhs-app.is-narrow .bhs-only-narrow { display: inline-flex !important; }
#bhs-app.is-narrow .bhs-brand span { display: none; }

@media (prefers-reduced-motion: reduce) {
	#bhs-app * { transition: none !important; }
}
