:root {
  --bg: #f4f3f0;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --surface-3: #efeee9;
  --line: #e6e4de;
  --line-2: #d9d7cf;
  --text: #1c1b19;
  --text-2: #5f5d57;
  --muted: #9a978f;
  --accent: #ff6a3d;
  --accent-ink: #ffffff;
  --accent-soft: #fff0ea;
  --focus: #2f6bff;
  --ok: #1fa463;
  --danger: #e5484d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 12, .06);
  --shadow: 0 1px 2px rgba(20, 18, 12, .05), 0 8px 24px -8px rgba(20, 18, 12, .14);
  --shadow-lg: 0 24px 64px -16px rgba(20, 18, 12, .35);
  --dot: #dad8d1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1d1d1b; --surface-2: #242422; --surface-3: #2c2c29;
    --line: #2f2f2c; --line-2: #3b3b37; --text: #f1efe9; --text-2: #b9b6ad; --muted: #85827a;
    --accent-soft: #3a2219; --dot: #2c2c29;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.4 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { flex: none; display: block; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 216px 296px minmax(0, 1fr) 316px; height: 100vh; }
#app[data-view="texts"] { grid-template-columns: 216px minmax(0, 1fr); }
#app[data-view="texts"] .panel, #app[data-view="texts"] .inspector { display: none; }
#app[data-view="templates"] { grid-template-columns: 216px 340px minmax(0, 1fr) 316px; }
#app.no-inspector { grid-template-columns: 216px 296px minmax(0, 1fr) 0; }
#app.no-inspector .inspector { display: none; }

/* ---------- sidebar ---------- */
.sidebar { background: var(--surface-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 6px 12px; font-weight: 700; letter-spacing: -.01em; font-size: 14px; }
.brand .logo { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(140deg, #ff8a5b, #ff4f6d); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand .logo i { width: 8px; height: 13px; border-radius: 2.5px; background: #fff; display: block; }
.brand small { font-weight: 500; color: var(--muted); font-size: 11px; margin-left: auto; }
.project-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; box-shadow: var(--shadow-sm); }
.project-card:hover { border-color: var(--line-2); }
.project-card .pc-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; flex: none; }
.project-card .pc-icon img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-card b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.project-card span { color: var(--muted); font-size: 11.5px; }
.project-card .ico { margin-left: auto; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.nav button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); border: 0; background: none; text-align: left; color: var(--text-2); font-weight: 500; }
.nav button:hover { background: var(--surface-3); color: var(--text); }
.nav button[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.nav button[aria-current="true"] .ico { color: var(--accent); }
.nav .kbd { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.side-foot p { margin: 0; color: var(--muted); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.save-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: block; }
.save-state.pending i { background: #e8a400; }

/* ---------- botones / controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 550; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 85%, var(--accent)); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.btn-group .btn { border: 0; border-radius: 0; box-shadow: none; }
.btn-group .btn + .btn { border-left: 1px solid var(--line); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; border-radius: 7px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 .5px var(--line-2); }

.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-height: 32px; }
.field > label, .field > .lbl { color: var(--text-2); }
.field.col { grid-template-columns: 1fr; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: 0; }
.hint code, .hint kbd { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 1px 4px; border-radius: 4px; color: var(--text-2); }

select, .input, textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; height: 30px; padding: 0 8px; outline: none; transition: border-color .12s, box-shadow .12s; }
select { padding-right: 24px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239a978f' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; max-width: 170px; }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; width: 100%; min-height: 38px; }
select:focus, .input:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.input.w100 { width: 100%; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--text) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 1px 3px rgba(0,0,0,.25); margin-top: -6px; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--text); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); }
.range { display: grid; grid-template-columns: 78px 1fr 40px; align-items: center; gap: 8px; }
.range label { color: var(--text-2); }
.range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; }

.color { display: flex; align-items: center; gap: 8px; }
.color input[type="color"] { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.color .hex { font: 11.5px ui-monospace, Menlo, monospace; color: var(--muted); width: 62px; text-transform: uppercase; }

.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(14px); }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); padding: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- panel / inspector ---------- */
.panel, .inspector { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.inspector { border-right: 0; border-left: 1px solid var(--line); }
.p-head { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.p-head h2 { font-size: 14px; margin: 0; letter-spacing: -.01em; }
.p-head .sub { color: var(--muted); font-size: 12px; }
.sec { padding: 14px 16px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.sec-h h3 { margin: 0; font-size: 12.5px; font-weight: 650; }
.sec-h .end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.scope { white-space: nowrap; flex: none; border: 0; background: none; font-size: 11.5px; color: var(--muted); padding: 2px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
.scope:hover { background: var(--surface-3); color: var(--text); }
.scope.custom { color: var(--accent); background: var(--accent-soft); }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opt { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px; display: grid; place-items: center; gap: 4px; color: var(--text-2); font-size: 11px; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--line-2); background: var(--surface); }
.opt[aria-pressed="true"] { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 8%, var(--surface)); color: var(--text); box-shadow: 0 0 0 1px var(--focus); }
.opt svg.pos { width: 34px; height: 50px; border-radius: 5px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.opt[aria-pressed="true"] svg.pos { background: #fff; }
.opt .tilt-ico { width: 20px; height: 32px; border-radius: 4px; background: var(--line-2); border: 1.5px solid var(--muted); position: relative; transform-style: preserve-3d; }
.opt .tilt-ico::after { content: ""; position: absolute; top: 3px; left: 50%; width: 6px; height: 2px; border-radius: 2px; background: var(--muted); transform: translateX(-50%); }
.opt[aria-pressed="true"] .tilt-ico { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 25%, var(--surface)); }
.tilt-wrap { perspective: 70px; height: 40px; display: grid; place-items: center; }
.frame-opt { padding: 10px 6px 8px; }
.frame-opt .fr { width: 26px; height: 42px; border-radius: 6px; }

.shot-box { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; }
.shot-thumb { width: 74px; height: 120px; border-radius: 10px; background: var(--surface-3); overflow: hidden; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line-2); cursor: pointer; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot-thumb.has { border-style: solid; }
.picker { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-3); cursor: crosshair; border: 1px solid var(--line); max-height: 260px; display: flex; justify-content: center; }
.picker img { max-width: 100%; max-height: 258px; display: block; user-select: none; -webkit-user-drag: none; }
.picker .pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--focus), 0 3px 8px rgba(0,0,0,.35); pointer-events: none; }
.picker-wrap { position: relative; display: inline-block; }
.lang-pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.empty-insp { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty-insp .big { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; }

/* plantillas */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; }
.tpl { border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--surface-2); display: grid; gap: 6px; text-align: left; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.tpl:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tpl canvas { width: 100%; border-radius: 9px; display: block; aspect-ratio: 1320/2868; background: var(--surface-3); }
.tpl span { font-weight: 600; font-size: 12px; padding: 0 2px; }
.tpl .del { position: absolute; top: 12px; right: 12px; opacity: 0; }
.tpl:hover .del { opacity: 1; }

/* ---------- stage ---------- */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 18px 18px; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(12px); z-index: 3; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.toolbar .spacer { flex: 1; }
.stage-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.strip { display: flex; gap: 28px; padding: 30px 36px 40px; align-items: flex-start; min-width: max-content; }
.card { display: flex; flex-direction: column; gap: 8px; position: relative; }
.card-head { display: flex; align-items: center; gap: 6px; height: 24px; cursor: grab; user-select: none; }
.card-head .num { font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); letter-spacing: .02em; }
.card-head .more { margin-left: auto; opacity: 0; transition: opacity .12s; }
.card:hover .card-head .more, .card.sel .card-head .more { opacity: 1; }
.card-canvas { position: relative; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 30px -12px rgba(0,0,0,.25); outline: 2px solid transparent; outline-offset: 5px; transition: outline-color .12s; border-radius: 4px; }
.card-canvas canvas { display: block; border-radius: 4px; touch-action: none; }
.card.sel .card-canvas { outline-color: var(--focus); }
.card.drop-target .card-canvas { outline: 2px dashed var(--accent); }
.card.drag-before::before, .card.drag-after::after { content: ""; position: absolute; top: 30px; bottom: 0; width: 3px; border-radius: 3px; background: var(--focus); }
.card.drag-before::before { left: -16px; }
.card.drag-after::after { right: -16px; }
.card.dragging { opacity: .4; }
.card .badge { position: absolute; left: 8px; bottom: 8px; font-size: 10.5px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 7px; border-radius: 99px; backdrop-filter: blur(6px); pointer-events: none; }
.add-card { border: 1.5px dashed var(--line-2); border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: color-mix(in srgb, var(--surface) 50%, transparent); margin-top: 32px; transition: border-color .12s, color .12s, background .12s; text-align: center; gap: 6px; padding: 10px; }
.add-card:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.stage-footer { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.stage-footer .pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 12px; box-shadow: var(--shadow-sm); }
.stage-footer .pill select { border: 0; box-shadow: none; background-color: transparent; height: 26px; font-weight: 550; }
.zoom-ctl { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; box-shadow: var(--shadow-sm); }
.zoom-ctl span { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); }
.zoom-ctl .btn { border-radius: 99px; }

/* estado vacío */
.empty { height: 100%; display: grid; place-items: center; padding: 30px; }
.empty-box { width: min(560px, 100%); border: 2px dashed var(--line-2); border-radius: 22px; padding: 44px 32px; text-align: center; background: color-mix(in srgb, var(--surface) 70%, transparent); display: grid; gap: 14px; justify-items: center; transition: border-color .15s, background .15s; }
.empty-box.over { border-color: var(--accent); background: var(--accent-soft); }
.empty-box h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.empty-box p { margin: 0; color: var(--text-2); max-width: 400px; }
.empty-phones { display: flex; gap: 10px; margin-bottom: 6px; }
.empty-phones i { width: 38px; height: 72px; border-radius: 10px; border: 3px solid var(--text); background: linear-gradient(160deg, #ffd8c7, #ff8a5b); display: block; transform: rotate(-8deg); }
.empty-phones i:nth-child(2) { transform: translateY(-6px); background: linear-gradient(160deg, #d6e4ff, #6c8cff); }
.empty-phones i:nth-child(3) { transform: rotate(8deg); background: linear-gradient(160deg, #d9f5e6, #3fbf86); }
.steps { display: flex; gap: 18px; margin-top: 8px; color: var(--muted); font-size: 12px; flex-wrap: wrap; justify-content: center; }
.steps b { color: var(--text); font-weight: 600; }

/* vista de textos */
.texts { padding: 20px 24px 40px; }
.texts-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.texts-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.ttable { border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ttable th, .ttable td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 10px; vertical-align: top; text-align: left; }
.ttable th:last-child, .ttable td:last-child { border-right: 0; }
.ttable tr:last-child td { border-bottom: 0; }
.ttable th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; z-index: 1; min-width: 280px; }
.ttable th:first-child, .ttable td:first-child { min-width: 70px; width: 70px; position: sticky; left: 0; background: var(--surface-2); z-index: 2; }
.ttable td:first-child img { width: 48px; border-radius: 6px; display: block; }
.ttable td:first-child .n { font: 600 12px ui-monospace, Menlo, monospace; color: var(--muted); margin-bottom: 6px; }
.ttable textarea { min-height: 34px; margin-bottom: 6px; font-size: 12.5px; }
.ttable textarea.t { font-weight: 600; }
.ttable textarea.empty-tr { border-style: dashed; background: var(--surface-2); }
.th-lang { display: flex; align-items: center; gap: 6px; }
.th-lang .base { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 99px; }
.th-lang .end { margin-left: auto; display: flex; gap: 2px; }

/* ---------- popovers, modales, toasts ---------- */
.menu { position: fixed; z-index: 100; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; animation: pop .12s ease-out; }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 10px; border-radius: 7px; text-align: left; white-space: nowrap; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button.danger { color: var(--danger); }
.menu button .k { margin-left: auto; color: var(--muted); font-size: 11.5px; padding-left: 20px; }
.menu button .ck { width: 14px; color: var(--focus); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .mlabel { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(20, 18, 12, .32); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .18s ease-out; }
.modal.wide { width: min(760px, 100%); }
.modal-h { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 10px; }
.modal-h h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.modal-h p { margin: 4px 0 0; color: var(--text-2); }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 12px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.modal-f .left { margin-right: auto; color: var(--muted); font-size: 12px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); }
.check:hover { border-color: var(--line-2); }
.check input { accent-color: var(--focus); width: 15px; height: 15px; margin: 0; }
.check small { display: block; color: var(--muted); font-size: 11px; }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--focus) 45%, var(--line)); background: color-mix(in srgb, var(--focus) 6%, var(--surface)); }
.group-title { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 -4px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff4f6d); border-radius: 99px; transition: width .15s; }
.search { width: 100%; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1c1b19; color: #fff; padding: 9px 14px; border-radius: 11px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .15s; display: flex; gap: 8px; align-items: center; max-width: 520px; }
.toast.err { background: var(--danger); }
.drop-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); backdrop-filter: blur(2px); pointer-events: none; }
.drop-overlay > div { background: var(--surface); padding: 26px 34px; border-radius: 20px; box-shadow: var(--shadow-lg); display: grid; gap: 4px; text-align: center; border: 2px dashed var(--accent); }
.drop-overlay b { font-size: 16px; }
.drop-overlay span { color: var(--muted); }
body.dragging-files .drop-overlay { display: grid; }
body.dragging-files.over-card .drop-overlay { display: none; }

.kbd-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; }
.kbd-list kbd { font: 11.5px ui-monospace, Menlo, monospace; background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }

@media (max-width: 1180px) {
  #app { grid-template-columns: 60px 280px minmax(0, 1fr) 300px; }
  #app[data-view="templates"] { grid-template-columns: 60px 300px minmax(0, 1fr) 300px; }
  #app[data-view="texts"] { grid-template-columns: 60px minmax(0, 1fr); }
  .sidebar .brand span, .sidebar .brand small, .project-card div, .project-card > .ico, .nav button span, .nav .kbd, .nav-label, .side-foot { display: none; }
  .project-card { padding: 6px; justify-content: center; }
  .nav button { justify-content: center; }
}

/* indicador de IA conectada */
.ai-badge { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #6d3fe0; border: 1px solid color-mix(in srgb, #8b5cf6 30%, transparent); margin-bottom: 6px; }
.ai-badge.reconnecting { color: var(--muted); background: var(--surface-3); border-color: var(--line); }
.ai-badge.busy .ico { animation: aispin 1.2s linear infinite; }
@keyframes aispin { to { transform: rotate(360deg); } }
@media (prefers-color-scheme: dark) { .ai-badge { color: #c4b5fd; } }
.ai-badge { width: 100%; cursor: pointer; text-align: left; }
.ai-badge.connecting, .ai-badge.offline { color: var(--muted); background: var(--surface-3); border-color: var(--line); }
.ai-cta { justify-content: flex-start; color: #6d3fe0; }
.codebox { position: relative; }
.codebox pre { margin: 0; padding: 10px 12px; padding-right: 84px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 10px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
.codebox .btn { position: absolute; top: 6px; right: 6px; }
.ai-state { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.ai-state.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--text); }
.ai-state.warn { background: color-mix(in srgb, #e8a400 14%, var(--surface)); color: var(--text); }
.ai-state code { font: 11.5px ui-monospace, Menlo, monospace; }
.ai-badge.permission, .ai-badge.blocked { color: #8a5a00; background: color-mix(in srgb, #e8a400 16%, var(--surface)); border-color: color-mix(in srgb, #e8a400 40%, transparent); }
