:root {
  color-scheme: dark;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  background: #101719;
  color: #f4f7f5;
  --panel: #172124;
  --field: #10181b;
  --line: #304044;
  --muted: #afc0c3;
  --accent: #87efc7;
  --mono: "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #121a1d; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { display: inline-flex; gap: 0.65rem; align-items: center; font-size: 1.18rem; font-weight: 700; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 32px; border-radius: 8px; color: #123229; background: var(--accent); font: 800 1rem var(--mono); }
.event, .metadata { color: var(--muted); font: 0.79rem/1.4 var(--mono); }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 26px 0 20px; }
h1 { font-size: clamp(2rem, 4.1vw, 3.25rem); letter-spacing: -0.062em; line-height: 1.04; margin: 0; }
h1 em { color: var(--accent); font-style: normal; }
.intro p { color: var(--muted); margin: 0.55rem 0 0; line-height: 1.5; }
.device-box { flex: 0 1 300px; min-width: 255px; border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem 0.8rem; background: var(--panel); }
.device-line, .device-actions { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.device-actions { justify-content: end; flex-wrap: wrap; margin-top: 0.35rem; }
.status-pill, .tag { font: 0.76rem/1.4 var(--mono); border-radius: 5px; padding: 0.15rem 0.43rem; background: #253437; color: #deebec; overflow-wrap: anywhere; }
.status-pill[data-ready="true"], .tag[data-active="true"] { color: var(--accent); background: #193b35; }
.nano-help summary { color: var(--muted); }
.nano-help[open], .nano-help p { width: 100%; }
.nano-help p { font-size: 0.85rem; overflow-wrap: anywhere; }
button, textarea, input, summary { font: inherit; }
button, summary, .check { cursor: pointer; }
button { color: inherit; }
button:disabled, button[aria-disabled="true"] { cursor: default; opacity: 0.65; }
:focus-visible { outline: 3px solid #a2f8d9; outline-offset: 3px; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--accent); }
.link-button, summary { font-size: 0.875rem; }
.link-button:hover:not(:disabled, [aria-disabled="true"]), summary:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.setup { color: #ffe5b4; background: #30291c; border: 1px solid #645238; border-radius: 8px; margin: 0 0 12px; padding: 0.55rem 0.8rem; font-size: 0.875rem; line-height: 1.4; overflow-wrap: anywhere; }
.setup[data-ready="true"] { color: var(--muted); background: #152125; border-color: var(--line); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem; min-height: 47px; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 1rem; letter-spacing: -0.012em; }
.card-content { padding: 0.75rem 0.9rem; }
.compose, .review { display: flex; flex-direction: column; gap: 0.45rem; height: calc(100% - 47px); }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 0.38rem; margin-bottom: 0.2rem; }
.examples span { color: var(--muted); font-size: 0.875rem; margin-right: 0.15rem; }
.examples button { background: #223033; color: #e5edeb; border: 1px solid #718589; border-radius: 6px; padding: 0.24rem 0.54rem; font-size: 0.875rem; min-height: 30px; }
.examples button:hover { background: #2b4144; }
label { font-size: 0.875rem; font-weight: 600; }
textarea, .preview { width: 100%; border: 1px solid #718589; border-radius: 7px; background: var(--field); color: inherit; padding: 0.6rem 0.7rem; font: 0.83rem/1.5 var(--mono); }
textarea { display: block; resize: vertical; min-height: 3.55rem; }
textarea[aria-invalid="true"] { border-color: #ffae94; }
textarea::placeholder { color: #a3b5b8; opacity: 1; }
.preview { flex: 1; min-height: 164px; max-height: 208px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview.empty { display: grid; place-items: center; color: var(--muted); border-style: dashed; text-align: center; }
.review-label { display: block; font: 700 0.85rem/1.5 system-ui, sans-serif; color: var(--muted); margin-block: 0 0.28rem; }
.review-block + .review-block { border-top: 1px solid var(--line); padding-top: 0.55rem; margin-top: 0.55rem; }
mark { padding: 0.08rem 0.18rem; border-radius: 3px; background: #344a42; color: #c9fee8; box-decoration-break: clone; }
mark[data-type="SECRET"], mark[data-type="CARD"], mark[data-type="IBAN"] { background: #523735; color: #ffd9cb; }
mark[data-type="EMAIL"], mark[data-type="PHONE"], mark[data-type="IP"] { background: #263f57; color: #d3e8ff; }
mark[data-type="CCCD"], mark[data-type="NATIONAL_ID"] { background: #493c29; color: #ffecb9; }
mark[data-source="nano"] { background: #422f5c; color: #f1ddff; }
.source { font: 0.68rem/1.45 system-ui, sans-serif; font-weight: 700; border: 1px solid currentColor; border-radius: 4px; padding: 0 0.2rem; margin-left: 0.28rem; white-space: nowrap; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 400; }
.check input { width: 1rem; height: 1rem; accent-color: var(--accent); margin: 0; }
.message, .hint { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.45; }
.message[data-error="true"] { color: #ffb69f; }
.actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.45rem 0.6rem; margin-top: auto; padding-top: 0.35rem; }
.button { border-radius: 7px; border: 1px solid transparent; padding: 0.45rem 0.74rem; min-height: 38px; font-size: 0.875rem; font-weight: 700; }
.primary { color: #0b2920; background: var(--accent); }
.primary:hover:not(:disabled, [aria-disabled="true"]) { background: #b7ffe5; }
.secondary { color: #dcfdef; background: #194137; border-color: #3b7164; }
.secondary:hover:not(:disabled, [aria-disabled="true"]) { background: #255548; }
.output { margin-top: 14px; }
.payload-details { padding: 0.65rem 0.9rem; }
.payload-details summary { color: var(--muted); }
.sent-note { padding: 0 0.9rem 0.6rem; margin: 0; }
.payload, .answer { white-space: pre-wrap; overflow-wrap: anywhere; font: 0.83rem/1.5 var(--mono); }
.payload { max-height: 250px; overflow: auto; padding: 0.6rem; margin: 0.6rem 0 0; background: var(--field); border-radius: 6px; }
.answer { margin: 0; padding: 0.65rem 0.9rem; max-height: 320px; overflow: auto; }
.answer:focus-visible { outline-offset: -3px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.35rem; padding: 0.8rem 0 1rem; color: var(--muted); font-size: 0.8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 30px); }
  .intro { align-items: stretch; flex-direction: column; padding-top: 20px; }
  .device-box { flex: auto; min-width: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  textarea { font-size: 1rem; }
}
@media (max-width: 370px) {
  .event { font-size: 0.7rem; }
}
