/* Digest para IA. Everything is scoped to #digest-root; colours come from the app's variables. */
#digest-root .dg{display:grid;gap:16px;min-width:0;color:var(--ink,#ffb000);font:15px/1.5 var(--sans,system-ui,sans-serif)}
#digest-root .dg h4{margin:0 0 6px;font:800 13px var(--mono,monospace);letter-spacing:.06em;text-transform:uppercase;color:#ffb000}
#digest-root .dg p{margin:0}
#digest-root .dg-hint{color:var(--muted,#b87a00);font-size:13px}
#digest-root .dg-ok{padding:10px 12px;border:2px solid #ffb000;border-radius:10px;background:#140d00;color:#ffb000;font-size:14px}
#digest-root .dg-bar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 18px}
#digest-root .dg-field{display:grid;gap:6px;min-width:0}
#digest-root .dg-field label{font:700 12px var(--mono,monospace);color:#ffb000}
#digest-root .dg select,#digest-root .dg input[type=text]{min-height:44px;padding:8px 10px;border:2px solid var(--line,#805800);border-radius:10px;background:#0a0600;color:inherit;font:14px var(--mono,monospace);min-width:0;max-width:100%}
#digest-root .dg-exclude input[type=text]{width:100%}
#digest-root .dg-check{display:flex;align-items:center;gap:8px;min-height:44px;font:700 14px var(--sans,system-ui,sans-serif);cursor:pointer}
#digest-root .dg-check input{width:20px;height:20px;accent-color:var(--purple,#ffb000)}
#digest-root .dg-actions{display:flex;flex-wrap:wrap;gap:10px;margin-left:auto}
#digest-root .dg-btn,#digest-root .dg-mini{border:2px solid var(--line,#805800);border-radius:10px;background:var(--paper,#0a0600);color:var(--ink,#ffb000);font:800 14px var(--sans,system-ui,sans-serif);cursor:pointer}
#digest-root .dg-btn{min-height:44px;padding:8px 16px;box-shadow:4px 4px 0 var(--line,#805800)}
#digest-root .dg-btn.dg-primary{background:var(--purple,#ffb000);color:#0a0600}
#digest-root .dg-btn:hover:not(:disabled){transform:translate(-1px,-1px);box-shadow:5px 5px 0 var(--line,#805800)}
#digest-root .dg-btn:active:not(:disabled){transform:translate(3px,3px);box-shadow:1px 1px 0 var(--line,#805800)}
#digest-root .dg-btn:disabled{opacity:.5;cursor:not-allowed;box-shadow:none}
#digest-root .dg-mini{min-height:32px;padding:2px 10px;font-size:12px}
#digest-root .dg-mini:hover{background:var(--panel,#0a0600)}
#digest-root .dg select:focus-visible,#digest-root .dg input:focus-visible,#digest-root .dg button:focus-visible,#digest-root .dg textarea:focus-visible{outline:3px solid #ffd060;outline-offset:2px}
#digest-root .dg-status{min-height:20px;font:700 13px var(--mono,monospace);color:#ffb000}
#digest-root .dg-status.dg-error{color:#ff5533}
#digest-root .dg-cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#digest-root .dg-card{display:grid;align-content:start;gap:2px;padding:12px 14px;border:2px solid var(--line,#805800);border-radius:12px;background:var(--paper,#0a0600);min-width:0}
#digest-root .dg-card strong{font:800 26px/1.1 var(--mono,monospace);overflow-wrap:anywhere}
#digest-root .dg-card span{font-size:12px;color:var(--muted,#b87a00)}
#digest-root .dg-card .dg-k{font:800 11px var(--mono,monospace);letter-spacing:.06em;text-transform:uppercase;color:#ffb000}
#digest-root .dg-fit ul{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:4px}
#digest-root .dg-fit li{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline;font-size:13px}
#digest-root .dg-fit li b{font-family:var(--mono,monospace)}
#digest-root .dg-fit li span{color:var(--ink,#ffb000);font-size:13px}
#digest-root .dg-fit-yes span{color:#ffb000}
#digest-root .dg-fit-no span{color:#ff5533;font-weight:700}
#digest-root .dg-empty-state{padding:14px 16px;border:2px dashed #140d00;border-radius:12px;color:var(--muted,#b87a00)}
#digest-root .dg-sec{display:grid;gap:8px;min-width:0}
#digest-root .dg-sec:empty{display:none}
#digest-root .dg-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
#digest-root .dg-chip{display:flex;align-items:center;gap:8px;max-width:100%;min-width:0;padding:4px 6px 4px 10px;border:2px solid var(--line,#805800);border-radius:999px;background:#0a0600}
#digest-root .dg-chip-off{border-style:dashed;background:var(--panel,#0a0600)}
#digest-root .dg-chip-path{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:44ch;min-height:28px;padding:0;border:0;background:none;color:inherit;font:12px var(--mono,monospace);text-align:left;cursor:pointer}
#digest-root .dg-chip-path,#digest-root .dg-chip-path:hover,#digest-root .dg-chip-path:active{box-shadow:none;transform:none;border-radius:999px;background:none}
#digest-root .dg-chip-path:hover .dg-chip-name{text-decoration:underline}
#digest-root .dg-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
#digest-root .dg-state{flex:none;font-weight:800;color:#ffb000}
#digest-root .dg-chip-off .dg-chip-name{text-decoration:line-through;color:var(--muted,#b87a00)}
#digest-root .dg-chip-off:hover .dg-chip-name{text-decoration:line-through underline}
#digest-root .dg-chip-off .dg-state{color:#ff5533}
#digest-root .dg-warn{padding:6px 10px;border:2px solid #ffd060;border-radius:10px;background:#1a1200;color:#ffd060;font-size:13px}
#digest-root .dg-warn:empty{display:none}
#digest-root .dg-warn code{font:12px var(--mono,monospace);overflow-wrap:anywhere}
#digest-root .dg-empty-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#digest-root .dg-skipped li .dg-mini{margin-top:6px}
#digest-root .dg h4:focus-visible{outline:3px solid #ffd060;outline-offset:2px}
#digest-root .dg-chip-n{font:700 12px var(--mono,monospace);color:#ffb000;white-space:nowrap}
#digest-root .dg-empty{color:var(--muted,#b87a00);font-size:14px}
#digest-root .dg-skipped{list-style:none;margin:0;padding:0;display:grid;gap:8px}
#digest-root .dg-skipped li{padding:10px 12px;border:2px solid #140d00;border-radius:10px;background:#0a0600;min-width:0}
#digest-root .dg-skipped li p{margin-top:2px;font-size:13px;color:var(--muted,#b87a00)}
#digest-root .dg-skipped .dg-ex code{font:12px var(--mono,monospace);overflow-wrap:anywhere;color:var(--ink,#ffb000)}
#digest-root .dg-preview{width:100%;min-height:260px;max-height:60vh;resize:vertical;padding:12px;border:2px solid var(--line,#805800);border-radius:12px;background:#ffb000;color:#0a0600;font:12px/1.5 var(--mono,monospace);white-space:pre;overflow:auto;tab-size:2}
@media(max-width:900px){#digest-root .dg-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){
  #digest-root .dg-bar{align-items:stretch}
  #digest-root .dg-field,#digest-root .dg select{width:100%}
  #digest-root .dg-actions{margin-left:0;width:100%}
  #digest-root .dg-actions .dg-btn{flex:1 1 140px}
  #digest-root .dg-cards{grid-template-columns:1fr}
  #digest-root .dg-chip-path{max-width:22ch;min-height:32px}
  #digest-root .dg-preview{min-height:200px}
}
@media(prefers-reduced-motion:reduce){#digest-root .dg-btn{transition:none}#digest-root .dg-btn:hover:not(:disabled),#digest-root .dg-btn:active:not(:disabled){transform:none}}
