/* ============================================================
   DWD "I got a dark web alert" wizard
   Uses dwd-glass theme tokens (light + dark) with fallbacks.
   ============================================================ */
.dwd-aw {
  --aw-teal: var(--teal, #00D4AA);
  --aw-fill: var(--teal-fill, #00D4AA);
  --aw-fill-end: var(--teal-fill-end, #00B894);
  --aw-on-fill: var(--on-teal, #000);
  --aw-red: var(--red, #FF4757);
  --aw-amber: var(--amber, #FFAB00);
  --aw-purple: var(--purple-text, #B388FF);
  --aw-text: var(--text, #E8E8F0);
  --aw-dim: var(--text-dim, #8888A0);
  --aw-muted: var(--text-muted, #7C7C96);
  --aw-glass: var(--glass, rgba(255,255,255,0.04));
  --aw-border: var(--glass-border, rgba(255,255,255,0.08));
  --aw-tint: var(--tint-2, rgba(255,255,255,0.05));
  --aw-shadow: var(--card-shadow, none);
  --aw-font: var(--font, system-ui, sans-serif);
  --aw-mono: var(--mono, ui-monospace, monospace);
  margin: 32px 0 48px; font-family: var(--aw-font); color: var(--aw-text); line-height: 1.6;
}
div.dwd-aw p { margin: 0; color: inherit; }
div.dwd-aw ul, div.dwd-aw ol { margin: 0; padding: 0; list-style: none; }
div.dwd-aw li { margin: 0; }
div.dwd-aw li::marker { content: none; }
.dwd-aw .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.dwd-aw [hidden] { display: none !important; }

/* App card */
.dwd-aw-app {
  background: var(--aw-glass); border: 1px solid var(--aw-border); border-radius: 20px;
  padding: 32px; box-shadow: var(--aw-shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  scroll-margin-top: 88px;
}

/* Step dots */
.dwd-aw-progress { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px !important; }
.dwd-aw-progress li {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12.5px/1 var(--aw-font); color: var(--aw-muted);
  padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--aw-border);
}
.dwd-aw-progress li span {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 700 11px/1 var(--aw-mono); background: var(--aw-tint); color: var(--aw-dim);
}
.dwd-aw-progress li.is-current { color: var(--aw-text); border-color: var(--aw-teal); }
.dwd-aw-progress li.is-current span, .dwd-aw-progress li.is-done span { background: var(--aw-fill); color: var(--aw-on-fill); }
.dwd-aw-progress li.is-done { color: var(--aw-dim); }

.dwd-aw .dwd-aw-q { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -.6px; line-height: 1.2; margin: 0 0 6px; padding: 0; border: 0; outline: none; }
.dwd-aw .dwd-aw-sub { color: var(--aw-dim); font-size: 15px; margin-bottom: 22px; }

/* Step 1 tiles */
.dwd-aw-tiles { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dwd-aw-tile {
  position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--aw-border); background: var(--aw-tint);
  transition: border-color .15s, background .15s, transform .15s;
}
.dwd-aw-tile:hover { border-color: rgba(0,212,170,.35); transform: translateY(-1px); }
.dwd-aw-tile input { position: absolute; opacity: 0; pointer-events: none; }
.dwd-aw-tile-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--aw-teal); background: rgba(0,212,170,.1); }
.dwd-aw-tile-text { display: flex; flex-direction: column; min-width: 0; }
.dwd-aw-tile-text strong { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.dwd-aw-tile-text small { font-size: 12.5px; color: var(--aw-muted); line-height: 1.35; }
.dwd-aw-tile-check { margin-left: auto; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--aw-border); display: flex; align-items: center; justify-content: center; color: transparent; transition: all .15s; }
.dwd-aw-tile:has(input:checked) { border-color: var(--aw-teal); background: rgba(0,212,170,.08); }
.dwd-aw-tile:has(input:checked) .dwd-aw-tile-check { background: var(--aw-fill); border-color: var(--aw-fill); color: var(--aw-on-fill); }
.dwd-aw-tile:has(input:focus-visible) { outline: 2px solid var(--aw-teal); outline-offset: 2px; }
.dwd-aw .dwd-aw-error { color: var(--aw-red); font-size: 14px; margin-top: 14px; }

/* Step 2 regions */
.dwd-aw-regions { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dwd-aw-region { position: relative; cursor: pointer; }
.dwd-aw-region input { position: absolute; opacity: 0; pointer-events: none; }
.dwd-aw-region span { display: block; text-align: center; padding: 14px 10px; border-radius: 12px; border: 1px solid var(--aw-border); background: var(--aw-tint); font-weight: 700; font-size: 14.5px; transition: border-color .15s, background .15s; }
.dwd-aw-region input:checked + span { border-color: var(--aw-teal); background: rgba(0,212,170,.08); color: var(--aw-teal); }
.dwd-aw-region input:focus-visible + span { outline: 2px solid var(--aw-teal); outline-offset: 2px; }

/* Buttons */
.dwd-aw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.dwd-aw-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 700 14px/1 var(--aw-font); color: var(--aw-text);
  padding: 13px 20px; border-radius: 12px; border: 1px solid var(--aw-border); background: var(--aw-glass);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dwd-aw-btn:hover { border-color: var(--border-strong, rgba(255,255,255,.2)); transform: translateY(-1px); }
.dwd-aw-btn:focus-visible { outline: 2px solid var(--aw-teal); outline-offset: 2px; }
.dwd-aw-btn--primary { border: 0; background: linear-gradient(135deg, var(--aw-fill), var(--aw-fill-end)); color: var(--aw-on-fill); }
.dwd-aw-btn--primary:hover { box-shadow: 0 8px 24px rgba(0,212,170,.25); }
.dwd-aw-btn--quiet { background: transparent; color: var(--aw-muted); }
.dwd-aw .dwd-aw-note { font-size: 12.5px; color: var(--aw-muted); margin-top: 14px; }

/* Step 3 result */
.dwd-aw-result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 8px; }
.dwd-aw-result-head .dwd-aw-sub { margin-bottom: 0; }
.dwd-aw-meter { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.dwd-aw-meter-text { font: 600 12.5px/1 var(--aw-mono); color: var(--aw-dim); text-align: right; }
.dwd-aw-meter-bar { height: 6px; border-radius: 6px; background: var(--aw-tint); overflow: hidden; }
.dwd-aw-meter-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aw-fill), var(--aw-fill-end)); transition: width .3s ease; }

.dwd-aw-group { margin-top: 26px; --g: var(--aw-teal); }
.dwd-aw-group--now { --g: var(--aw-red); }
.dwd-aw-group--today { --g: var(--aw-amber); }
.dwd-aw-group--week { --g: var(--aw-teal); }
.dwd-aw-group--ongoing { --g: var(--aw-purple); }
.dwd-aw-group--misused { --g: var(--aw-red); }
.dwd-aw-group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--aw-border); }
.dwd-aw .dwd-aw-group-title { display: flex; align-items: center; gap: 8px; font: 800 13px/1 var(--aw-mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--g); margin: 0; padding: 0; border: 0; }
.dwd-aw .dwd-aw-group-title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); }
.dwd-aw-group-hint { font-size: 13px; color: var(--aw-muted); }
.dwd-aw-group--misused { margin-top: 32px; padding: 6px 18px 14px; border: 1px dashed rgba(255,71,87,.35); border-radius: 14px; }

.dwd-aw-items { display: grid; gap: 4px; }
.dwd-aw-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 10px; border-radius: 12px; transition: background .15s, opacity .2s; }
.dwd-aw-item:hover { background: var(--aw-tint); }
.dwd-aw-item input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 2px 0 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--aw-border); background: var(--aw-glass);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.dwd-aw-item input::after { content: ''; width: 10px; height: 6px; border: 2.5px solid var(--aw-on-fill); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.dwd-aw-item input:checked { background: var(--aw-fill); border-color: var(--aw-fill); }
.dwd-aw-item input:checked::after { opacity: 1; }
.dwd-aw-item input:focus-visible { outline: 2px solid var(--aw-teal); outline-offset: 2px; }
.dwd-aw-item-body { min-width: 0; }
.dwd-aw-item-label { display: block; cursor: pointer; }
.dwd-aw-item-title { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.dwd-aw-item-detail { display: block; font-size: 14px; color: var(--aw-dim); line-height: 1.6; margin-top: 2px; }
.dwd-aw-item.is-done .dwd-aw-item-title { text-decoration: line-through; text-decoration-color: var(--aw-muted); color: var(--aw-muted); }
.dwd-aw-item.is-done .dwd-aw-item-detail, .dwd-aw-item.is-done .dwd-aw-item-links { opacity: .55; }
.dwd-aw-item-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
div.dwd-aw .dwd-aw-item-links a {
  font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--aw-border); color: var(--aw-teal); background: var(--aw-glass);
}
div.dwd-aw .dwd-aw-item-links a:hover { border-color: var(--aw-teal); }
div.dwd-aw .dwd-aw-item-links a.is-external::after { content: ' ↗'; }
div.dwd-aw .dwd-aw-item-links a.is-guide::before { content: '📖 '; }
.dwd-aw-actions--result { border-top: 1px solid var(--aw-border); padding-top: 20px; }

/* No-JS + reference list */
.dwd-aw .dwd-aw-noscript { padding: 14px 18px; border-radius: 12px; border: 1px solid var(--aw-border); background: var(--aw-glass); color: var(--aw-dim); margin-bottom: 16px; }
.dwd-aw-ref { margin-top: 40px; }
.dwd-aw.is-enhanced .dwd-aw-ref { margin-top: 48px; }
.dwd-aw-ref > h2 { margin-bottom: 4px; }
.dwd-aw .dwd-aw-ref-sub { color: var(--aw-muted); font-size: 13px; margin-bottom: 14px; }
.dwd-aw-ref-item { border: 1px solid var(--aw-border); border-radius: 12px; background: var(--aw-glass); margin-bottom: 8px; }
.dwd-aw-ref-item > summary { cursor: pointer; padding: 14px 18px; font-size: 15px; color: var(--aw-text); list-style: none; display: flex; align-items: center; gap: 10px; }
.dwd-aw-ref-item > summary::-webkit-details-marker { display: none; }
.dwd-aw-ref-item > summary::before { content: '▸'; color: var(--aw-teal); transition: transform .2s; }
.dwd-aw-ref-item[open] > summary::before { transform: rotate(90deg); }
.dwd-aw-ref-item h3 { font: 700 12px/1.2 var(--aw-mono) !important; letter-spacing: 1px; text-transform: uppercase; color: var(--aw-muted); margin: 14px 18px 6px !important; padding: 0 !important; border: 0 !important; }
.dwd-aw-ref-item ul { padding: 0 18px 12px !important; }
.dwd-aw-ref-item li { font-size: 14.5px; color: var(--aw-dim); line-height: 1.6; padding: 6px 0; border-bottom: 1px solid var(--aw-border); }
.dwd-aw-ref-item li:last-child { border-bottom: 0; }
.dwd-aw-ref-item li strong { color: var(--aw-text); }
.dwd-aw-tag { font: 700 10px/1 var(--aw-mono); padding: 3px 6px; border-radius: 5px; background: var(--aw-tint); color: var(--aw-muted); vertical-align: 2px; }
.dwd-aw-ref-links { display: block; margin-top: 4px; }
.dwd-aw-ref-links a { margin-right: 10px; font-size: 13px; }

@media (max-width: 860px) {
  .dwd-aw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dwd-aw-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dwd-aw-app { padding: 22px 16px; border-radius: 16px; }
  .dwd-aw-tiles { grid-template-columns: 1fr; }
  .dwd-aw-progress li { font-size: 0; gap: 0; padding: 4px; }
  .dwd-aw-progress li span { font-size: 11px; }
  .dwd-aw-meter { min-width: 0; width: 100%; }
  .dwd-aw-meter-text { text-align: left; }
  .dwd-aw-btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dwd-aw * { transition: none !important; }
}

/* Print just the checklist */
@media print {
  html.dwd-aw-printing body * { visibility: hidden !important; }
  html.dwd-aw-printing .dwd-aw [data-aw-step="3"], html.dwd-aw-printing .dwd-aw [data-aw-step="3"] * { visibility: visible !important; }
  html.dwd-aw-printing .dwd-aw [data-aw-step="3"] { position: absolute; left: 0; top: 0; width: 100%; color: #000; }
  html.dwd-aw-printing .dwd-aw-actions, html.dwd-aw-printing .dwd-aw-note, html.dwd-aw-printing .dwd-aw-meter-bar { display: none !important; }
  html.dwd-aw-printing .dwd-aw-item-detail, html.dwd-aw-printing .dwd-aw-group-hint { color: #333 !important; }
  html.dwd-aw-printing .dwd-aw-item input { border-color: #000 !important; }
  html.dwd-aw-printing .dwd-aw-item-links a::after { content: ' (' attr(href) ')' !important; color: #555; }
}
