/* Layout: panel de controles a la izquierda, mesa de impresión con hojas a la derecha; apila en móvil */
.t2p {
  --bg: #eef0f2;
  --panel: #ffffff;
  --ink: #1d2430;
  --muted: #5d6675;
  --line: #d5dae1;
  --accent: #1f4fa8;
  --accent-ink: #ffffff;
  --paper: #ffffff;
  --paper-ink: #111111;
  --tray: #e2e6eb;
  --ok: #1d7a4a;
  --err: #b4312a;
  --font-ui: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t2p:not(.t2p-light) {
    --bg: #14181e; --panel: #1c2129; --ink: #e6e9ee; --muted: #9aa3b1; --line: #2e3540;
    --accent: #7ea2ec; --accent-ink: #0f1622; --tray: #0f1217; --ok: #5cc48d; --err: #ef7a72;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .t2p:not(.t2p-light) {
  --bg: #14181e; --panel: #1c2129; --ink: #e6e9ee; --muted: #9aa3b1; --line: #2e3540;
  --accent: #7ea2ec; --accent-ink: #0f1622; --tray: #0f1217; --ok: #5cc48d; --err: #ef7a72;
  color-scheme: dark;
}
.t2p *, .t2p *::before, .t2p *::after { box-sizing: border-box; }

.t2p-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; padding: 20px 16px; max-width: 1400px; margin: 0 auto; }
@media (max-width: 820px) { .t2p-wrap { grid-template-columns: minmax(0, 1fr); } }

.t2p-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.t2p-brand { display: flex; flex-direction: column; gap: 4px; }
.t2p-brand h1 { font-size: 1.45rem; line-height: 1.15; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.t2p-brand p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

.t2p-drop {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px; background: var(--panel);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.t2p-drop:hover, .t2p-drop.is-over { border-color: var(--accent); }
.t2p-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.t2p-drop strong { font-size: 0.98rem; }
.t2p-drop span { color: var(--muted); font-size: 0.84rem; }
.t2p-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.t2p-file { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink); word-break: break-all; }

.t2p-group { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 12px; }
.t2p-group h2 { margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.t2p-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t2p-field { display: grid; gap: 4px; min-width: 0; }
.t2p-field label { font-size: 0.8rem; color: var(--muted); }
.t2p-field select, .t2p-field input {
  font: inherit; font-size: 0.88rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; min-width: 0;
}
.t2p-field select:focus-visible, .t2p-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.t2p-check { display: flex; gap: 8px; align-items: center; font-size: 0.86rem; }

.t2p-btn {
  font: inherit; font-weight: 600; font-size: 0.95rem; border: 0; border-radius: 8px; padding: 11px 14px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; width: 100%;
}
.t2p-btn:disabled { opacity: .5; cursor: not-allowed; }
.t2p-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.t2p-status { font-size: 0.84rem; color: var(--muted); min-height: 1.2em; }
.t2p-status.ok { color: var(--ok); }
.t2p-status.err { color: var(--err); }

.t2p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-variant-numeric: tabular-nums; }
.t2p-stats div { display: grid; gap: 2px; }
.t2p-stats dt { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.t2p-stats dd { margin: 0; font-family: var(--font-mono); font-size: 0.86rem; }

.t2p-legend { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin: 0; padding-left: 1.1em; }
.t2p-legend code { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink); }

.t2p-tray { background: var(--tray); border-radius: 12px; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; overflow: hidden; }
.t2p-traybar { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.t2p-sample { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: var(--panel); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; }

.t2p-sheet {
  container-type: inline-size; position: relative; width: 100%; max-width: 980px;
  background: var(--paper); color: var(--paper-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.08);
}
.t2p-sheet.portrait { max-width: 640px; }
.t2p-sheet-no { position: absolute; right: 8px; bottom: 6px; font-size: 10px; color: #8a909a; font-family: var(--font-ui); }
.t2p-line { position: absolute; left: 0; white-space: pre; font-family: "Courier New", Courier, monospace; line-height: 1; }
.t2p-line b { font-weight: 700; }
.t2p-line i { font-style: italic; }
.t2p-line u { text-decoration: underline; }
