:root {
  /* Grises neutros, en la línea de los editores profesionales (Lightroom), con valores propios.
     La foto se ve sobre un gris oscuro neutro para no alterar la percepción del color. */
  --bg: #1a1a1a;          /* alrededor de la foto */
  --panel: #262626;       /* paneles */
  --panel2: #323232;      /* controles */
  --line: #3e3e3e;
  --text: #d6d6d6;
  --muted: #8f8f8f;
  --accent: #e8e8e8;      /* selección y deslizadores: gris claro neutro */
  --accent-ink: #1a1a1a;
  --brand: #d6f05c;       /* verde lima de la marca: solo logo y botón de descarga */
  --brand-ink: #161513;
  --radius: 6px;
  --track: #5a5a5a; --thumb: #bdbdbd; --thumb-hi: #f2f2f2; --chip-on: #4a4a4a; --chip-on-ink: #fff;
  --hist-bg: #1c1c1c; --well: #111; --strong: #f2f2f2; --hover: #444; --line2: #666; --tint: #ffffff08;
  --warn-bg: #2f2d1c; --warn-line: #5a5530; --warn-ink: #f3e9a8; --tip-bg: #f2f2f2; --tip-ink: #161513;
  color-scheme: dark;
}
/* Modo claro: grises claros neutros (la foto se sigue viendo sobre gris, sin colores que alteren la percepción) */
:root[data-theme="light"] {
  --bg: #e2e2e2; --panel: #f4f4f4; --panel2: #ffffff; --line: #d2d2d2; --text: #1f1f1f; --muted: #6a6a6a;
  --accent: #262626; --accent-ink: #ffffff;
  --track: #bdbdbd; --thumb: #555; --thumb-hi: #111; --chip-on: #262626; --chip-on-ink: #fff;
  --hist-bg: #2a2a2a; --well: #ececec; --strong: #1a1a1a; --hover: #ececec; --line2: #a8a8a8; --tint: #0000000a;
  --warn-bg: #fff5d1; --warn-line: #e3cf85; --warn-ink: #5e4d0a; --tip-bg: #1f1f1f; --tip-ink: #f4f4f4;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.proto { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 4px 12px; background: #3b3620; color: #f3e9a8; font-size: 12px; }
.proto label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 6px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; letter-spacing: .5px; flex: none; }
.name { font-size: 17px; font-weight: 800; letter-spacing: 3px; white-space: nowrap; }
.gate-name { font-size: 20px; font-weight: 800; letter-spacing: 4px; margin-top: 10px; }
.name .by, .gate-name .by { font-family: "Bodoni 72", "Didot", Georgia, serif; font-weight: 400; font-style: italic; letter-spacing: 0; font-size: 14px; color: var(--muted); }
.tag { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; align-items: center; }
select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }

.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: var(--radius); padding: 7px 14px;
  cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.ghost.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

.layout { flex: 1; display: grid; grid-template-columns: 1fr var(--panel-w, 340px); min-height: 0; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; min-height: 0; overflow: hidden; }
#view { display: block; max-width: 100%; max-height: 100%; touch-action: none; box-shadow: 0 2px 18px #000a; }
#view.crop { cursor: grab; outline: 1px dashed #fff6; outline-offset: -1px; }
#view.split { cursor: ew-resize; }
.stagebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.note { color: var(--warn-ink); font-size: 12px; }
.busy { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); background: #000c; border: 1px solid var(--line);
  padding: 8px 14px; border-radius: var(--radius); font-size: 12.5px; z-index: 2; }
.busy::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid var(--muted);
  border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop { text-align: center; max-width: 420px; padding: 40px 24px; border: 1.5px dashed var(--line); border-radius: 16px; }
.drop.over { border-color: var(--accent); background: var(--tint); }
.drop-icon { font-size: 40px; color: var(--muted); }
.drop h2 { font-family: "Bodoni 72", Didot, Georgia, serif; font-weight: 400; font-size: 28px; margin: 8px 0; }
.drop p { color: var(--muted); }

.panel { position: relative; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 11px 2px; text-transform: uppercase; font-size: 11px; letter-spacing: .5px !important; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; letter-spacing: .3px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabpane { padding: 14px 16px 24px; overflow-y: auto; flex: 1; }

.slider { margin: 10px 0 14px; }
.slider .lab { display: flex; justify-content: space-between; font-size: 13px; }
.slider output { color: var(--muted); font-variant-numeric: tabular-nums; }
.slider .help { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 4px 0 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--track); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 2px; background: var(--track); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: var(--thumb); border: 0; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--thumb); border: 0; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { background: var(--thumb-hi); }
input[type=range]:focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; }
.amount { position: sticky; top: -14px; background: var(--panel); padding: 6px 0 8px; z-index: 1; margin-top: 0; }

.pack h4 { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pre { position: relative; background: var(--panel2); border: 2px solid transparent; border-radius: 4px; padding: 0;
  cursor: pointer; overflow: hidden; text-align: left; }
.pre.on { border-color: var(--accent); }
.pre .th { aspect-ratio: 1; background: var(--line) center/cover no-repeat; }
.pre .nm { display: block; padding: 4px 6px 5px; font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre .badge { position: absolute; top: 5px; left: 5px; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--brand); color: var(--brand-ink); }
.pre .lock { position: absolute; inset: 0 0 auto 0; aspect-ratio: 1; display: grid; place-items: center; background: #0007; font-size: 20px; }

.more { background: none; border: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; margin: 4px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.hint { color: var(--muted); font-size: 12px; }
.lab.small { font-size: 13px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { border: 1px solid var(--line); background: var(--panel2); border-radius: var(--radius); padding: 5px 12px; cursor: pointer; font-size: 13px; }
.chips button.on { border-color: var(--accent); color: var(--chip-on-ink); background: var(--chip-on); }
.course { display: block; margin-top: 20px; color: var(--muted); font-size: 12px; text-decoration: none; border-top: 1px solid var(--line); padding-top: 12px; }
.course:hover { color: var(--brand); }

.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 380px; display: grid; gap: 10px; }
.modal h3 { margin: 0; font-family: "Bodoni 72", Didot, Georgia, serif; font-weight: 400; font-size: 22px; }
.modal p { margin: 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 999px; z-index: 30; }

/* histograma */
.histo { position: relative; margin: 10px 12px 2px; height: 74px; background: var(--hist-bg); border: 1px solid var(--line); border-radius: 4px; }
.histo canvas { width: 100%; height: 100%; display: block; }
.clip { position: absolute; top: 4px; width: 0; height: 0; border: 6px solid transparent; opacity: .35; }
.clip.lo { left: 4px; border-top-color: #9a9a9a; border-left-color: #9a9a9a; }
.clip.hi { right: 4px; border-top-color: #9a9a9a; border-right-color: #9a9a9a; }
.clip.on { opacity: 1; }
.clip.lo.on { border-top-color: #6aa0ff; border-left-color: #6aa0ff; }
.clip.hi.on { border-top-color: #ff6a5a; border-right-color: #ff6a5a; }

/* pincel */
#view.brush { cursor: none; }
.brushcur { position: absolute; pointer-events: none; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #0008, inset 0 0 0 1px #0006; z-index: 3; }
.brushcur::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #0008; }
.brushcur.erase { border-style: dashed; }
.chips.modes button { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.light { background: #ff7a5a; } .dot.dark { background: #4f86ff; } .dot.erase { background: transparent; border: 1.5px dashed var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; cursor: pointer; font-size: 13px; }

/* comparar presets */
.cmpwrap { flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.cmpwrap .hint { text-align: center; margin: 0; }
.cmpgrid { flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cmpgrid.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cmpgrid.n2 { grid-template-rows: 1fr; }
.cmpgrid .cell { position: relative; min-height: 0; padding: 0; border: 2px solid transparent; border-radius: 4px; background: var(--well); cursor: pointer; overflow: hidden; }
.cmpgrid .cell.on { border-color: var(--accent); }
.cmpgrid .cell:hover { border-color: var(--muted); }
.cmpgrid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cmpgrid .lbl { position: absolute; left: 8px; bottom: 8px; background: #000b; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.pre.cmp { border-color: var(--brand); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .stage { padding: 10px; min-height: 0; }
  .panel { border-left: 0; border-top: 1px solid var(--line); height: 46dvh; }
  .tag { display: none; }
  .histo { display: none; }
  .top { padding: 8px 12px; }
  .actions .ghost#openBtn { display: none; }
  .stagebar { gap: 6px; margin-top: 8px; }
  .stagebar .note { flex-basis: 100%; text-align: center; font-size: 11px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  .actions { gap: 6px; }
  #lang { max-width: 72px; padding: 7px 4px; }
  #installBtn { padding: 5px 8px; font-size: 12px; }
  .brand { flex: none; }
  .brand > div:not(.logo) { display: none; }
  .proto { gap: 8px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .name { font-size: 16px; }
  .btn { padding: 7px 12px; }
}

/* marco de recorte libre */
.croplayer { position: absolute; overflow: hidden; touch-action: none; z-index: 3; }
.cropbox { position: absolute; box-sizing: border-box; border: 1px solid #fff; box-shadow: 0 0 0 9999px #000a; cursor: move; }
.cropbox b { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(#fff5,#fff5) 33.33% 0/1px 100% no-repeat, linear-gradient(#fff5,#fff5) 66.66% 0/1px 100% no-repeat,
              linear-gradient(#fff5,#fff5) 0 33.33%/100% 1px no-repeat, linear-gradient(#fff5,#fff5) 0 66.66%/100% 1px no-repeat; }
.cropbox i { position: absolute; width: 18px; height: 18px; border: 0 solid #fff; z-index: 1; }
.cropbox i[data-h="tl"] { left: -3px; top: -3px; border-width: 3px 0 0 3px; cursor: nwse-resize; }
.cropbox i[data-h="tr"] { right: -3px; top: -3px; border-width: 3px 3px 0 0; cursor: nesw-resize; }
.cropbox i[data-h="bl"] { left: -3px; bottom: -3px; border-width: 0 0 3px 3px; cursor: nesw-resize; }
.cropbox i[data-h="br"] { right: -3px; bottom: -3px; border-width: 0 3px 3px 0; cursor: nwse-resize; }
@media (pointer: coarse) { .cropbox i { width: 28px; height: 28px; } }

/* tienda y entrada */
.proto a { color: #f3e9a8; }
.user { color: var(--muted); font-size: 12px; white-space: nowrap; }
.linkbtn { background: none; border: 0; color: var(--text); text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }
.packhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; }
.packhead h4 { margin: 0; }
.owned { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.btn.buy { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.pre .lock { aspect-ratio: auto; inset: 4px 4px auto auto; width: 22px; height: 22px; border-radius: 4px; font-size: 12px; background: #000a; }
.buybanner { flex-basis: 100%; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); font-size: 12.5px; color: var(--warn-ink); text-align: center; margin-top: 2px; }
.gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; padding: 16px; z-index: 20; }
.gate .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; width: 100%; max-width: 380px; display: grid; gap: 12px; text-align: center; }
.gate .logo { margin: 0 auto; }
.gate h3 { margin: 0; font-family: "Bodoni 72", Didot, Georgia, serif; font-weight: 400; font-size: 24px; }
.gate form, .gate #gateSent, .gate #gateNoBuy { display: grid; gap: 10px; }
.gate input { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; color: var(--text); }
.gate p { margin: 0; }
.gate #gateCodeForm { display: grid; gap: 10px; }
.gate input.code { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; padding: 12px 10px; }
.gate a { color: var(--text); }
@media (max-width: 820px) { .user { display: none; } }

.proto { position: relative; z-index: 30; }

/* herramientas, historial, recetas, exportación y lote */
.tools { display: inline-flex; gap: 4px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.icon { background: none; border: 0; color: var(--text); width: 32px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1; }
.icon:hover:not(:disabled) { background: var(--panel2); }
.icon:disabled { opacity: .3; cursor: default; }
.icon.on { background: var(--accent); color: var(--accent-ink); }
.icon.big { width: 44px; height: 38px; display: inline-grid; place-items: center; color: var(--strong); background: var(--panel2); border: 1px solid var(--line); }
.icon.big:hover:not(:disabled) { background: var(--hover); border-color: var(--line2); }
.icon.big:disabled { opacity: .3; }
#zoomBtn { font-size: 11px; font-weight: 600; width: 36px; }
.tools .sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
#view.zoomed { cursor: grab; }
.tabs button { font-size: 10.5px !important; }
.histlist { display: grid; gap: 2px; margin-top: 8px; }
.hist { display: flex; justify-content: space-between; gap: 8px; background: none; border: 0; border-left: 2px solid transparent; color: var(--text); text-align: left; padding: 7px 10px; cursor: pointer; border-radius: 0 4px 4px 0; font-size: 12.5px; }
.hist:hover { background: var(--panel2); }
.hist.on { border-left-color: var(--accent); background: var(--panel2); font-weight: 600; }
.hist.future { color: var(--muted); }
.hist small { color: var(--muted); }
.btn.wide { width: 100%; margin: 4px 0 2px; }
.pre.recipe { cursor: pointer; }
.pre .del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #000b; color: #fff; cursor: pointer; font-size: 13px; line-height: 1; display: none; }
.pre.recipe:hover .del, .pre.recipe:focus-within .del { display: block; }
@media (pointer: coarse) { .pre .del { display: block; } }
.modal .card form, .modal form.card { display: grid; gap: 10px; }
.modal input, .modal select { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; color: var(--text); width: 100%; }
.field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); text-align: left; }
.strip { width: 100%; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.striphead { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.striphead .btn { margin-left: auto; }
.striplist { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sth { flex: none; width: var(--strip-th, 64px); height: var(--strip-th, 64px); border-radius: 4px; border: 2px solid transparent; background: var(--panel2) center/cover no-repeat; cursor: pointer; position: relative; color: var(--muted); font-size: 10px; }
.sth.on { border-color: var(--accent); }
.sth.edited::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
@media (max-width: 820px) { .tools .icon { width: 30px; } .tools .icon.big { width: 42px; height: 38px; } }
@media (max-width: 820px) {
  .sth { width: var(--strip-th-m, 44px); height: var(--strip-th-m, 44px); }
  .striphead { margin-bottom: 4px; }
  .striphead .btn { padding: 4px 8px; font-size: 12px; }
  .stagebar { gap: 4px; }
}

/* etiquetas al pasar el ratón y pistas de la primera vez */
.tip { position: fixed; z-index: 30; max-width: 240px; background: var(--tip-bg); color: var(--tip-ink); padding: 6px 10px; border-radius: 6px;
  font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 16px #0006; }
.hintbox { position: fixed; z-index: 31; max-width: 280px; background: var(--brand); color: var(--brand-ink); padding: 11px 13px 10px; border-radius: 10px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 8px 28px #0008; animation: hintIn .18s ease-out; }
.hintbox::before { content: ''; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; background: var(--brand); transform: translateX(-50%) rotate(45deg); }
.hintbox.below::before { top: -5px; } .hintbox.above::before { bottom: -5px; }
.hintbox button { display: block; margin: 8px 0 0 auto; background: var(--brand-ink); color: var(--brand); border: 0; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
@keyframes hintIn { from { opacity: 0; transform: translateY(4px); } }
.round { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; }
#installBtn .ico { display: none; }
@media (max-width: 600px) {
  #installBtn .txt { display: none; } #installBtn .ico { display: inline; }
  #installBtn { width: 32px; padding: 0; }
  .round { width: 30px; height: 30px; }
  #lang { max-width: 64px; }
}
:root[data-theme="light"] .i-sun, :root:not([data-theme="light"]) .i-moon { display: none; }

/* temperatura y tinte con su color, cuentagotas, colores y grano */
.slider[data-k="temp"] input::-webkit-slider-runnable-track, .slider[data-k="kelvin"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, #4f86d8, #9a9a9a, #e3a04a); }
.slider[data-k="tint"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, #5aa65a, #9a9a9a, #c25bb5); }
.slider[data-k^="cs"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, #8a8a8a, var(--c)); }
.slider[data-k^="cl"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, #1b1b1b, var(--c), #f4f4f4); }
.slider[data-k="temp"] input::-moz-range-track, .slider[data-k="kelvin"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, #4f86d8, #9a9a9a, #e3a04a); }
.slider[data-k="tint"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, #5aa65a, #9a9a9a, #c25bb5); }
.slider[data-k^="cs"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, #8a8a8a, var(--c)); }
.slider[data-k^="cl"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, #1b1b1b, var(--c), #f4f4f4); }
.slider[data-k="temp"] input::-webkit-slider-thumb, .slider[data-k="kelvin"] input::-webkit-slider-thumb, .slider[data-k="tint"] input::-webkit-slider-thumb,
.slider[data-k^="cs"] input::-webkit-slider-thumb, .slider[data-k^="cl"] input::-webkit-slider-thumb { margin-top: -4px; }
.wbrow { display: grid; gap: 4px; margin: -4px 0 10px; }
.wbrow .btn { justify-self: start; display: inline-flex; align-items: center; gap: 7px; }
.wbrow .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.help { color: var(--muted); font-size: 11.5px; margin: 1px 0 0; }
#view.picking { cursor: crosshair; }
.section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.sechead { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 500; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.sw { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid transparent; outline: 2px solid transparent; cursor: pointer; padding: 0; }
.sw.on { outline-color: var(--text); outline-offset: 2px; }
.sw.mod::after { content: ''; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); border: 2px solid var(--panel); }
.mixname { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; font-size: 13px; }
.dotc { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* botones que en el móvil se quedan solo con el icono */
.iconable { display: inline-flex; align-items: center; gap: 6px; }
.iconable .ico { display: none; }
@media (max-width: 820px) {
  .stage { padding: 6px 6px 4px; }
  .panel { height: 42dvh; transition: height .2s ease; }
  .panel.collapsed { height: auto; }
  .panel.collapsed .tabpane, .panel.collapsed .histo { display: none !important; }
  .stagebar { gap: 4px; margin-top: 6px; }
  .stagebar .tools .icon.big { width: 38px; height: 34px; }
  .iconable { width: 38px; height: 36px; padding: 0; justify-content: center; }
  .iconable .ico { display: block; } .iconable .txt { display: none; }
  .tabs button.on { position: relative; }
  .tabs button.on::after { content: '▾'; margin-left: 3px; font-size: 9px; opacity: .6; }
  .panel.collapsed .tabs button.on::after { content: '▴'; }
}

/* zoom visible: − / porcentaje / + */
.zoombox { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel2); overflow: hidden; }
.zoombox .zbtn { width: 34px; height: 36px; font-size: 20px; font-weight: 600; color: var(--strong); border-radius: 0; }
.zoomlbl { min-width: 64px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--strong);
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0 8px; }
.zoomlbl.on { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 820px) { .zoombox .zbtn { width: 30px; } .zoomlbl { min-width: 54px; padding: 0 4px; } }
/* móvil en vertical: panel algo más bajo para que la foto respire */
@media (max-width: 820px) and (orientation: portrait) { .panel { height: var(--panel-h, 38dvh); } }
/* ventana estrecha pero apaisada (tableta tumbada, ventana baja): panel a la derecha, la foto aprovecha toda la altura */
@media (max-width: 820px) and (orientation: landscape) {
  .layout { grid-template-columns: 1fr var(--panel-w, 290px); grid-template-rows: none; }
  .panel { height: auto; border-top: 0; border-left: 1px solid var(--line); }
  .panel.collapsed .tabpane { display: block !important; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .tabs button { font-size: 9.5px; letter-spacing: 0 !important; padding: 10px 1px; }
  .tabs button.on::after { content: none; }
}

/* estrellas */
.rate { display: inline-flex; }
.rate button { background: none; border: 0; padding: 2px 1px; font-size: 18px; line-height: 1; color: var(--line2); cursor: pointer; }
.rate button.on { color: #f2c94c; }
.rate:hover button { color: #f2c94c; } .rate button:hover ~ button { color: var(--line2); }
#rateFilter { padding: 4px 6px; font-size: 12px; }
.sth .stars { position: absolute; left: 2px; bottom: 2px; font-size: 9px; letter-spacing: -1px; color: #f2c94c; background: #000a; border-radius: 3px; padding: 0 3px; line-height: 13px; }
@media (max-width: 820px) { .rate button { font-size: 16px; } .striphead { flex-wrap: wrap; } }

/* modo sencillo / pro */
body[data-mode="simple"] [data-pro] { display: none !important; }
body[data-mode="pro"] .simpleonly { display: none; }
.modebtn { font-weight: 800; letter-spacing: 1.5px; font-size: 11.5px; padding: 6px 10px; }
.btn.ghost.modebtn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
/* aviso de quemados: el histograma se puede tocar */
.histo { cursor: pointer; }
.histo.clipon { outline: 2px solid var(--brand); outline-offset: 1px; }
/* guías de Instagram dentro del marco de recorte */
.igguide { position: absolute; inset: 0; pointer-events: none; }
.igguide .grid34 { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); border-left: 1.5px dashed #ffffffb0; border-right: 1.5px dashed #ffffffb0; }
.igguide span { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: #fff; background: #000a; padding: 2px 7px; border-radius: 999px; }
.igguide .grid34 span { top: 6px; }
.igguide .safe { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #0007 0 6px, #0004 6px 12px); }
.igguide .safe.top { top: 0; height: 14%; } .igguide .safe.bot { bottom: 0; height: 20%; }
.igguide .safe span { top: 50%; transform: translate(-50%, -50%); }
/* formatos en la descarga */
.fmtbox { display: grid; gap: 6px; }
.fmtrow { display: flex; gap: 10px; flex-wrap: wrap; }
.fmt { display: grid; gap: 4px; width: 96px; font-size: 11px; color: var(--muted); text-align: center; }
.fmtimg { position: relative; width: 96px; overflow: hidden; border-radius: 4px; background: var(--well); }
.fmtimg img { width: 100%; height: 100%; object-fit: fill; display: block; opacity: .55; }
.fbox { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 999px #0006; cursor: grab; touch-action: none; background: transparent; }
.fbox.story::before, .fbox.story::after { content: ''; position: absolute; left: 0; right: 0; background: #0005; }
.fbox.story::before { top: 0; height: 14%; } .fbox.story::after { bottom: 0; height: 20%; }
.modal .card { max-height: calc(100dvh - 32px); overflow-y: auto; }
.pre .dest { position: absolute; top: 4px; left: 4px; font-size: 11px; background: #000a; color: #fff; border-radius: 4px; padding: 0 4px; }
/* cabecera del móvil: que quepan todos los botones */
@media (max-width: 600px) {
  .top { padding: 8px 8px; gap: 6px; }
  .actions { gap: 4px; }
  .round { width: 28px; height: 28px; }
  #installBtn { width: 30px; }
  .btn.modebtn { padding: 5px 6px; font-size: 10.5px; letter-spacing: 1px; }
  #lang { max-width: 56px; }
  #dlBtn { padding: 7px 9px; font-size: 12.5px; }
}

/* aviso de foto quemada: una píldora pequeña y discreta; el consejo sale al pasar el ratón */
.clipwarn { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: #000b; color: #f2f2f2; border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 12px; backdrop-filter: blur(6px); animation: hintIn .2s ease-out; }
.clipwarn .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ff6a5a; }
.clipwarn .lnk { background: none; border: 0; color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 2px; }
.clipwarn .x { background: none; border: 0; color: #bbb; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 4px; }

/* copiar / pegar */
.row.tight { margin-top: 8px; gap: 6px; }
/* curva de tonos */
.curve { width: 100%; aspect-ratio: 1.3; display: block; margin: 8px 0; background: var(--well); border: 1px solid var(--line); border-radius: 4px; touch-action: none; cursor: crosshair; }
/* quitar manchas */
.dot.spot { background: transparent; border: 2px solid var(--text); }
.spothelp { display: none; }
#brushModes:has(button[data-m="spot"].on) ~ .spothelp { display: block; }
.spotlayer { position: absolute; z-index: 3; cursor: none; touch-action: none; }
.spotlayer svg { overflow: visible; }
.spotlayer .spot line { stroke: #fff9; stroke-width: 1; stroke-dasharray: 3 3; }
.spotlayer circle { fill: transparent; stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 0 1px #000); cursor: move; }
.spotlayer circle.s { stroke-dasharray: 4 3; stroke: #ffffffc0; }
.spotlayer .spot.sel circle.t { stroke: var(--brand); stroke-width: 2.5; }
.spotlayer .spot.sel circle.s { stroke: var(--brand); }
/* menú de ayuda */
.helpwrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #0007; padding: 5px; display: grid; }
.menu button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.menu button:hover { background: var(--panel2); }
textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px; resize: vertical; color: var(--text); font: inherit; }

/* Mis fotos */
.modal.lib { place-items: stretch; padding: 24px; }
.libbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 48px); width: min(1100px, 100%); margin: 0 auto; }
.libhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.libhead h3 { flex: 1; margin: 0; font-family: "Bodoni 72", Didot, Georgia, serif; font-weight: 400; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libactions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0; }
.libgrid { flex: 1; overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-content: start; }
.libempty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px 10px; font-size: 14px; }
.libnote { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.folder { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: visible; cursor: pointer; }
.folder:hover { border-color: var(--muted); }
.fcover { aspect-ratio: 4/3; border-radius: 10px 10px 0 0; background: var(--well) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.fmeta { padding: 8px 10px 10px; display: grid; gap: 2px; }
.fmeta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; }
.fmeta small { color: var(--muted); font-size: 11.5px; }
.fmenu { position: absolute; right: 4px; bottom: 10px; background: none; border: 0; color: var(--text); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.fmenu:hover { background: var(--hover); }
.folder .menu { right: 0; top: auto; bottom: 40px; }
.menu .danger { color: #ff7b6b; }
.lphoto { position: relative; cursor: pointer; display: grid; gap: 4px; }
.lthumb { aspect-ratio: 1; border-radius: 6px; background: var(--well) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 2px solid transparent; }
.lphoto:hover .lthumb { border-color: var(--muted); }
.lphoto small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lphoto .stars { position: absolute; left: 5px; top: 5px; font-size: 10px; color: #f2c94c; background: #000a; border-radius: 3px; padding: 0 4px; }
.lphoto .edited { position: absolute; right: 6px; top: calc(100% - 30px); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.premove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #000b; color: #fff; cursor: pointer; display: none; }
.lphoto:hover .premove { display: block; }
@media (pointer: coarse) { .premove { display: block; } }
@media (max-width: 600px) { .modal.lib { padding: 0; } .libbox { max-height: 100dvh; height: 100dvh; border-radius: 0; } .libgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; } .libhead h3 { font-size: 20px; } }

/* textos legales */
.legalcard { max-width: 680px !important; width: 100%; }
.legalbody { overflow-y: auto; max-height: 60dvh; font-size: 13.5px; line-height: 1.55; padding-right: 6px; }
.legalbody h4 { margin: 16px 0 4px; font-size: 14px; }
.legalbody p, .legalbody ul { margin: 0 0 8px; }
.legalbody ul { padding-left: 20px; }
mark.todo { background: #f2c94c33; color: inherit; border: 1px dashed #f2c94c; border-radius: 4px; padding: 0 4px; }
.legalline { font-size: 11.5px; margin-top: 6px; }
.legalline a { color: var(--muted); }

/* degradados */
.dot.glin { background: linear-gradient(180deg, var(--text), transparent); border-radius: 2px; }
.dot.grad { background: radial-gradient(circle, var(--text) 30%, transparent 75%); }
.gradbox { display: none; }
[data-pane="brush"][data-tool="linear"] .gradbox, [data-pane="brush"][data-tool="radial"] .gradbox { display: block; }
[data-pane="brush"][data-tool="linear"] #brushSliders, [data-pane="brush"][data-tool="radial"] #brushSliders,
[data-pane="brush"][data-tool="linear"] #brushSliders ~ .check, [data-pane="brush"][data-tool="radial"] #brushSliders ~ .check,
[data-pane="brush"][data-tool="linear"] #brushSliders ~ .row, [data-pane="brush"][data-tool="radial"] #brushSliders ~ .row,
[data-pane="brush"][data-tool="spot"] #brushSliders ~ .check, [data-pane="brush"][data-tool="spot"] #brushSliders ~ .row { display: none; }
.gradlayer { position: absolute; z-index: 3; touch-action: none; cursor: crosshair; overflow: hidden; }
.gradlayer svg { overflow: visible; }
.gradlayer .l { stroke: #ffffffb0; stroke-width: 1.2; filter: drop-shadow(0 0 1px #000); }
.gradlayer .l.mid { stroke-dasharray: 5 4; }
.gradlayer .body { fill: transparent; stroke: #ffffffc0; stroke-width: 1.5; filter: drop-shadow(0 0 1px #000); cursor: move; }
.gradlayer .inner { fill: none; stroke: #ffffff60; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.gradlayer .h { fill: #fff; stroke: #000a; stroke-width: 1; cursor: grab; }
.gradlayer .grad.sel .h { fill: var(--brand); }
.gradlayer .grad.sel .l, .gradlayer .grad.sel .body { stroke: var(--brand); }

/* sin herramienta activa: no se pinta ni se ven guías, pero los efectos siguen aplicados */
.notool { display: none; background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
[data-pane="brush"][data-tool="none"] .notool { display: block; }
[data-pane="brush"][data-tool="none"] #brushSliders, [data-pane="brush"][data-tool="none"] #brushSliders ~ .check { display: none; }
.launch { margin: 2px 0 0; font-size: 12.5px; color: var(--text); background: var(--panel2); border-left: 3px solid var(--brand); border-radius: 6px; padding: 7px 10px; text-align: left; }
.launch s { color: var(--muted); }

/* tamaños ajustables arrastrando (como los paneles de Lightroom) */
.resizer { position: absolute; z-index: 6; touch-action: none; }
.resizer.v { left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; }
.resizer.v::after { content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.resizer.v:hover::after, .resizer.v.on::after { background: var(--brand); }
.resizer.h { left: 0; right: 0; top: -6px; height: 14px; cursor: row-resize; display: none; }
.resizer.h::after { content: ''; position: absolute; left: 50%; top: 4px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--line2); }
.striphead { user-select: none; -webkit-user-select: none; }
.striphead .grip { width: 24px; height: 24px; border-radius: 4px; cursor: ns-resize; color: var(--muted); display: inline-grid; place-items: center; touch-action: none; font-size: 12px; letter-spacing: -2px; }
@media (max-width: 820px) and (orientation: portrait) {
  .resizer.v { display: none; }
  .resizer.h { display: block; }
  .panel { transition: none; }
}

/* borde superior de la tira: asa grande y visible para cambiar el tamaño de las miniaturas */
.strip { position: relative; }
.striphandle { position: absolute; left: 0; right: 0; top: -9px; height: 16px; cursor: ns-resize; touch-action: none; z-index: 2; }
.striphandle::after { content: ''; position: absolute; left: 50%; top: 6px; width: 48px; height: 4px; margin-left: -24px; border-radius: 3px; background: var(--line2); transition: background .15s, width .15s; }
.striphandle:hover::after, .striphandle.on::after { background: var(--brand); width: 72px; margin-left: -36px; }
.striphead .grip { color: var(--text); opacity: .7; }
.striphead .grip:hover { opacity: 1; background: var(--panel2); }

/* con la barra espaciadora pulsada (zoom), las guías dejan pasar el arrastre para mover la foto */
body.panning .spotlayer, body.panning .gradlayer { pointer-events: none; }
/* tablet o ventana estrecha: el nombre se acorta para que nunca se pise con los botones */
@media (max-width: 820px) {
  .brand { min-width: 0; flex-shrink: 1; }
  .name .by { display: none; }
  .actions { flex-shrink: 0; }
}

/* móvil: que la página no se mueva ni rebote; solo se mueven la foto, los controles y las listas */
html, body { overscroll-behavior: none; }
body { touch-action: manipulation; }          /* sin zoom por doble toque en la página */
.tabpane, .libgrid, .legalbody, .modal .card { overscroll-behavior: contain; }
@media (max-width: 820px) {
  html, body { overflow: hidden; }
  body { position: fixed; inset: 0; }
  .stage { touch-action: none; }               /* arrastrar por la zona de la foto no mueve la página */
  .striplist { touch-action: pan-x; }          /* la tira de miniaturas sí se desliza de lado */
  .tabpane { touch-action: pan-y; }            /* el panel solo se desplaza arriba y abajo */
  input, select, textarea { font-size: 16px; } /* evita que el iPhone haga zoom al escribir */
}

/* ================================================================
   ESTRUCTURA DE APP EN EL MÓVIL (vertical)
   arriba: barra mínima · centro: la foto · abajo: bandeja de la herramienta + barra de pestañas con iconos
   ================================================================ */
.tabs .ti, #openBtn .ico, #dlBtn .ico, #helpBtn .dots, .mobileonly { display: none; }
#openBtn, #dlBtn { display: inline-flex; align-items: center; gap: 6px; }
.menulang { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 13px; }
@media (max-width: 820px) and (orientation: portrait) {
  .proto { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr) !important; }
  .panel, .tabpane, #presetList { min-width: 0; max-width: 100vw; }
  /* barra superior: logo · abrir · carpetas · ⋯ · descargar */
  .top { padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand > div:not(.logo) { display: none; }
  #modeBtn, #lang, #installBtn { display: none !important; }
  .actions { gap: 6px; }
  .actions .ghost#openBtn { display: inline-flex !important; width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
  #openBtn .ico { display: block; } #openBtn .txt { display: none; }
  #helpBtn .q { display: none; } #helpBtn .dots { display: inline; font-size: 18px; line-height: 1; }
  .round, #libBtn, #helpBtn { width: 36px !important; height: 36px !important; }
  #dlBtn { padding: 8px 14px; border-radius: 999px; }
  #dlBtn .ico { display: block; }
  .mobileonly { display: block; } .menulang.mobileonly { display: flex; }
  .menu { min-width: 250px; }
  /* la foto ocupa todo el espacio libre */
  .stage { padding: 4px 6px 2px; }
  /* panel = bandeja de la herramienta + pestañas abajo */
  .panel { height: auto !important; border-top: 1px solid var(--line); }
  .panel .histo { display: none !important; }
  .tabs { order: 9; border-bottom: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); }
  .tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; font-size: 10px !important; letter-spacing: 0 !important;
    text-transform: none; border-bottom: 0; border-top: 2px solid transparent; }
  .tabs button.on { color: var(--brand); border-top-color: transparent; }
  .tabs button.on::after { content: none !important; }
  .tabs .ti { display: block; }
  .tabpane { flex: none; height: var(--panel-h, 30dvh); padding: 10px 14px 12px; }
  .menu { position: fixed; right: 10px; left: auto; top: calc(52px + env(safe-area-inset-top)); max-width: calc(100vw - 20px); }
  .panel.collapsed .tabpane { display: none !important; }
  .resizer.h { top: -7px; }
  /* presets: una fila que se desliza de lado, como en las apps de fotos */
  #presetList { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; padding-bottom: 6px; scrollbar-width: none; }
  #presetList::-webkit-scrollbar { display: none; }
  #presetList .pack { flex: none; display: flex; flex-direction: column; }
  #presetList .pack h4 { margin: 4px 0 6px; font-size: 10.5px; white-space: nowrap; }
  #presetList .packhead { display: flex; gap: 8px; align-items: center; }
  #presetList .grid { display: flex; gap: 8px; }
  #presetList .pre { width: 78px; flex: none; }
  [data-pane="presets"] .amount { position: static; padding: 0 0 4px; }
  [data-pane="presets"] .amount .help { display: none; }
  #saveRecipeBtn { display: none; }
  [data-pane="presets"] .row.tight { margin: 2px 0 8px; }
  .course { display: none; }
}
.drop .madeby { color: var(--text); font-family: "Bodoni 72", Didot, Georgia, serif; font-style: italic; font-size: 15px; margin: 4px 0 14px; }
.clipwarn[data-kind="lo"] .dot { background: #6aa0ff; }
.clipwarn[data-kind="q"] .dot { background: #f2c94c; }

/* cortinilla antes/después: tirador y etiquetas */
.splitui { position: absolute; z-index: 3; pointer-events: none; --x: 50%; overflow: hidden; }
.splitui .lbl { position: absolute; top: 12px; padding: 5px 10px; border-radius: 999px; background: #000a; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; backdrop-filter: blur(6px); transition: opacity .15s; }
.splitui .lbl.l { left: 12px; } .splitui .lbl.r { right: 12px; }
.splitui .lbl.off { opacity: 0; }
.splitui .knob { position: absolute; left: var(--x); top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 2px 12px #0009; }
/* lupa del cuentagotas */
.loupe { position: absolute; z-index: 6; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; pointer-events: none; border: 3px solid #fff; box-shadow: 0 4px 18px #000a, 0 0 0 1px #0006; background: #000; }
.loupe canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.loupe i { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border: 2px solid #fff; box-shadow: 0 0 0 1px #000a, inset 0 0 0 1px #000a; }
/* antes/después para Instagram en el diálogo de descarga */
.basec { display: grid; gap: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
.basec .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.modal .check input[type=checkbox] { width: auto; flex: none; padding: 0; margin: 0; }
.modal .check { align-items: flex-start; } .modal .check input[type=checkbox] { margin-top: 2px; }
.clipwarn .snd { background: none; border: 0; color: #bbb; cursor: pointer; padding: 0 2px; display: grid; place-items: center; }
.clipwarn .snd:hover, .clipwarn .x:hover { color: #fff; }
.clipwarn .snd .off { display: none; }
.clipwarn .snd.muted .on { display: none; } .clipwarn .snd.muted .off { display: inline; }

/* pantalla de entrada: la llama se dibuja y aparece el nombre */
.splash { position: fixed; inset: 0; z-index: 10000; background: #121110; display: grid; place-items: center; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash .sp-in { display: grid; justify-items: center; gap: 6px; }
.splash .sp-flame { stroke: #d6f05c; }
.splash .sp-flame path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: spDraw 1s cubic-bezier(.6,0,.3,1) forwards, spGlow 1.6s ease .9s forwards; }
.splash .sp-word { font-weight: 700; letter-spacing: 10px; font-size: 30px; color: #f2f2f2; margin: 10px 0 0 10px; opacity: 0; transform: translateY(6px); animation: spUp .6s ease .55s forwards; }
.splash .sp-by { font-family: "Bodoni 72", Didot, Georgia, serif; font-style: italic; color: #a8a8a8; font-size: 15px; opacity: 0; animation: spUp .6s ease .8s forwards; }
@keyframes spDraw { to { stroke-dashoffset: 0; } }
@keyframes spGlow { 40% { fill: #d6f05c33; } to { fill: #d6f05c22; } }
@keyframes spUp { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash .sp-flame path { stroke-dashoffset: 0; animation: none; } .splash .sp-word, .splash .sp-by { animation: none; opacity: 1; transform: none; } }
/* icono de la pantalla de inicio */
.drop-icon { color: var(--brand); display: grid; place-items: center; }
.drop-icon svg { filter: drop-shadow(0 0 14px #d6f05c40); }
/* fundido al cambiar de preset */
.fadecv { position: absolute; z-index: 2; pointer-events: none; opacity: 1; }
.fadecv.go { transition: opacity .32s ease; opacity: 0; }
/* panel de atajos (solo en ordenador) */
@media (pointer: coarse), (max-width: 820px) { .desktoponly { display: none !important; } }
.card.keys { max-width: 520px; }
.keylist { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: center; margin: 6px 0 14px; font-size: 13px; }
.keylist .k { display: flex; gap: 4px; justify-content: flex-end; }
.keylist kbd { font: 600 12px/1 system-ui, -apple-system, sans-serif; min-width: 24px; text-align: center; padding: 5px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text); }
.keylist .d { color: var(--muted); }

/* pantallas anchas: presets a la izquierda, ajustes a la derecha (como en Lightroom) */
body.leftp .layout { grid-template-columns: var(--lp-w, 290px) minmax(0, 1fr) var(--panel-w, 340px); }
.lpanel { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lphead { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text); font-weight: 600; }
.lpbody { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.lpbody .tabpane { display: block; }
body.leftp .tabs button[data-tab="presets"] { display: none; }
.lpopen { position: absolute; left: 10px; top: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12px; cursor: pointer; }
.lpopen:hover { border-color: var(--line2); }

/* botón sol / luna: en oscuro se ve el sol (pasar a claro) y en claro la luna */
.themebtn .moon { display: none; }
:root[data-theme="light"] .themebtn .sun { display: none; } :root[data-theme="light"] .themebtn .moon { display: inline; }
@media (max-width: 820px) { .themebtn { display: none; } }
.lpanel { position: relative; }
.resizer.v.lp { left: auto; right: -5px; }
.lpanel .grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }

/* guías de composición */
.guidelayer { position: absolute; z-index: 2; pointer-events: none; overflow: visible; }
.guidelayer path, .guidelayer line, .guidelayer circle { fill: none; stroke: #fff; stroke-opacity: .9; stroke-width: 1.4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1.5px #000); }
.guidelayer .soft { stroke-opacity: .45; }
.gwrap { position: relative; display: inline-flex; }
#guideBtn.on { background: var(--brand); color: #161513; }
.gmenu { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 30; width: 300px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px #0008; padding: 6px; display: grid; gap: 2px; }
.gmenu button.g { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; color: var(--text); }
.gmenu button.g:hover { background: var(--tint, #ffffff10); }
.gmenu button.g.on { background: var(--panel2); outline: 1px solid var(--line2); }
.gmenu button.g svg { grid-row: span 2; width: 34px; height: 26px; border: 1px solid var(--line2); border-radius: 4px; color: var(--muted); }
.gmenu button.g.on svg { color: var(--brand); border-color: var(--brand); }
.gmenu .n { font-size: 13px; font-weight: 600; }
.gmenu .d { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.gmenu .grot { margin: 4px 6px 2px; }
@media (max-width: 820px) { .gmenu { position: fixed; left: 12px; right: 12px; transform: none; width: auto; bottom: calc(var(--panel-h, 30dvh) + 120px); } }
/* Luz de los degradados: de oscuro a claro, con una marca en el centro (0 = sin cambio) */
.slider[data-k="gExp"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, transparent calc(50% - 1px), var(--muted) calc(50% - 1px), var(--muted) calc(50% + 1px), transparent calc(50% + 1px)) center / 100% 12px no-repeat, linear-gradient(90deg, #0b0b0b, #8a8a8a, #f4f4f4); }
.slider[data-k="gExp"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, #0b0b0b, #8a8a8a, #f4f4f4); }

/* botones Automático y B&N encima de los controles básicos */
.autorow { display: flex; gap: 6px; margin: 2px 0 8px; }
.autorow .btn { flex: 1; justify-content: center; }
#bwBtn.on { background: var(--brand); color: #161513; border-color: var(--brand); }
.slider[data-k^="ch"] input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--cp), var(--c), var(--cn)); }
.slider[data-k^="ch"] input::-moz-range-track { height: 4px; background: linear-gradient(90deg, var(--cp), var(--c), var(--cn)); }
.lenscheck { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0 0; cursor: pointer; }
.lenscheck input { width: auto; margin: 0; }
