#pwg ─────
     Every selector starts with #pwg. Nothing leaks to the host page.
     No Tailwind, no global resets, no preflight. WordPress / Elementor
     theme styles (container borders, headings, etc.) remain untouched. */

  #pwg, #pwg *, #pwg *::before, #pwg *::after { box-sizing: border-box; }
  #pwg, #pwg button, #pwg input, #pwg p, #pwg h2, #pwg span, #pwg div, #pwg a, #pwg label {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  /* Internal reset — only applies INSIDE the widget */
  #pwg div, #pwg p, #pwg h2, #pwg span { margin: 0; padding: 0; }
  #pwg button { margin: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
  #pwg input { margin: 0; font: inherit; color: inherit; }
  #pwg svg { display: inline-block; vertical-align: middle; }

  /* Container */
  #pwg {
    width: 100%; max-width: 56rem; margin: 0 auto;
    padding: 8px 4px;
    font-size: 14px; line-height: 1.5; color: #1f2937;
  }
  @media (min-width: 640px) { #pwg { padding: 8px; } }
  @media (min-width: 768px) { #pwg { padding: 8px 16px; } }

  /* Mobile breakout — pull widget outside parent column padding */
  @media (max-width: 767px) {
    #pwg { margin-left: -25px; margin-right: -25px; width: calc(100% + 50px); max-width: none; }
  }

  /* Subtitle */
  #pwg .pwg-subtitle { text-align: center; font-size: 14px; color: #4b5563; font-weight: 500; margin-bottom: 16px; }
  @media (min-width: 768px) { #pwg .pwg-subtitle { font-size: 16px; } }

  /* Card */
  #pwg .pwg-card-wrap { width: 100%; }
  #pwg .pwg-card-bg {
    border-radius: 12px;
    border: 1px solid #93c5fd; /* blue-300 mobile */
    padding: 20px 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #eef2ff 100%);
    box-shadow: 0 4px 20px -8px rgba(59,130,246,.18), 0 1px 3px rgba(0,0,0,.04);
    position: relative; overflow: hidden;
  }
  @media (min-width: 768px) {
    #pwg .pwg-card-bg { border-radius: 16px; padding: 28px; border-color: #bfdbfe; /* blue-200 desktop */ }
  }

  /* Top-edge scan-progress bar */
  #pwg .pwg-card-bg::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 50%, #2563eb 100%);
    transform-origin: left center; transform: scaleX(0); opacity: 0;
    pointer-events: none; z-index: 2;
    box-shadow: 0 0 12px rgba(37,99,235,.5);
  }
  #pwg .pwg-card-bg.pwg-wave-red::before {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 50%, #ef4444 100%);
    box-shadow: 0 0 12px rgba(239,68,68,.5);
  }
  #pwg .pwg-card-bg.pwg-wave-go::before {
    animation: pwgLoadBar 1.4s cubic-bezier(.45,.05,.4,1) forwards;
  }
  @keyframes pwgLoadBar {
    0%   { transform: scaleX(0); opacity: 0; }
    8%   { opacity: 1; }
    78%  { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
  }

  /* Output block */
  #pwg .pwg-out-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
  }
  #pwg .pwg-label {
    font-size: 11px; color: #6b7280; text-transform: uppercase;
    letter-spacing: .06em; font-weight: 800;
  }
  #pwg .pwg-out-row {
    display: flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #dbeafe; border-radius: 12px;
    padding: 12px 8px 12px 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.03);
  }
  #pwg .pwg-out {
    flex: 1; min-width: 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 19px; font-weight: 700; line-height: 1.4;
    color: #1f2937; letter-spacing: .01em;
    word-break: break-all; overflow-wrap: anywhere;
  }
  @media (min-width: 768px) { #pwg .pwg-out { font-size: 24px; } }
  #pwg .pwg-out.pwg-out-bad { color: #ef4444; font-size: 15px; font-weight: 600; font-family: 'Inter', system-ui, sans-serif; }
  #pwg .pwg-out.pwg-out-sm { font-size: 14px; }
  @media (min-width: 768px) { #pwg .pwg-out.pwg-out-sm { font-size: 18px; } }
  #pwg .pwg-icon-btn { color: #9ca3af; transition: all .15s; padding: 8px; border-radius: 10px; flex-shrink: 0; }
  #pwg .pwg-icon-btn:hover { color: #2563eb; background: rgba(59,130,246,.08); }
  #pwg .pwg-icon-btn:active { transform: scale(.94); }
  #pwg .pwg-icon-btn svg { width: 20px; height: 20px; }
  #pwg .pwg-copied { color: #059669; }
  #pwg .pwg-regen.pwg-spinning svg { animation: pwgSpin .5s cubic-bezier(.4,0,.2,1); }
  @keyframes pwgSpin { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }

  /* Message rows */
  #pwg .pwg-msg-row { min-height: 20px; padding: 0 4px; margin: 10px 0 0; text-align: center; }
  #pwg .pwg-err { font-size: 13px; color: #ef4444; font-weight: 600; line-height: 1.45; }
  #pwg .pwg-warn {
    display: flex; gap: 8px; align-items: flex-start;
    background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
    border-radius: 10px; padding: 10px 12px; margin-top: 12px;
    font-size: 12.5px; font-weight: 600; line-height: 1.45; text-align: left;
  }
  #pwg .pwg-warn svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
  #pwg .pwg-hidden { display: none !important; }

  /* Length control */
  #pwg .pwg-len-row { margin-top: 4px; }
  #pwg .pwg-len-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  #pwg .pwg-len-num {
    width: 76px; padding: 8px 10px; border-radius: 8px;
    border: 2px solid #d1d5db; background: #fff; color: #1f2937;
    font-size: 15px; font-weight: 700; text-align: center;
    font-variant-numeric: tabular-nums; transition: all .15s;
  }
  #pwg .pwg-len-num:focus { outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.18); border-color: #3b82f6; }
  #pwg .pwg-range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 9999px;
    background: #dbeafe; outline: none; display: block; cursor: pointer;
  }
  #pwg .pwg-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; border-radius: 50%;
    background: #2563eb; border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(37,99,235,.45); cursor: pointer;
  }
  #pwg .pwg-range::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #2563eb; border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(37,99,235,.45); cursor: pointer;
  }
  #pwg .pwg-range::-moz-range-track { height: 6px; border-radius: 9999px; background: #dbeafe; }
  #pwg .pwg-range:focus-visible { box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
  #pwg .pwg-len-scale {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #9ca3af; font-weight: 600; margin-top: 6px;
  }

  /* Option pills */
  #pwg .pwg-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  #pwg .pwg-pill {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 13px; border-radius: 9999px;
    border: 1.5px solid #d1d5db; background: #fff;
    font-size: 13px; font-weight: 600; color: #4b5563;
    cursor: pointer; transition: all .15s; user-select: none; -webkit-user-select: none;
  }
  #pwg .pwg-pill:hover { border-color: #93c5fd; color: #2563eb; background: #f8fafc; }
  #pwg .pwg-pill input {
    position: absolute; opacity: 0; width: 1px; height: 1px;
    margin: 0; padding: 0; border: 0; pointer-events: none;
  }
  #pwg .pwg-pill input:focus-visible + .pwg-tick { box-shadow: 0 0 0 3px rgba(59,130,246,.3); }
  #pwg .pwg-tick {
    width: 17px; height: 17px; border-radius: 5px; flex-shrink: 0;
    border: 1.5px solid #d1d5db; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .15s;
  }
  #pwg .pwg-tick svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity .15s; }
  #pwg .pwg-pill input:checked + .pwg-tick { background: #2563eb; border-color: #2563eb; }
  #pwg .pwg-pill input:checked + .pwg-tick svg { opacity: 1; }
  #pwg .pwg-pill input:disabled + .pwg-tick { background: #f3f4f6; border-color: #e5e7eb; }
  #pwg .pwg-pill:has(input:checked) { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }
  #pwg .pwg-pill:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(59,130,246,.22); }

  /* Panel */
  #pwg .pwg-panel {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    margin-top: 16px; overflow: hidden;
  }
  #pwg .pwg-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
  }
  #pwg .pwg-panel-title {
    font-size: 12px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: #374151;
  }
  #pwg .pwg-chip {
    font-size: 11px; font-weight: 700; color: #6b7280;
    background: #eef2f7; border-radius: 9999px; padding: 3px 9px;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  #pwg .pwg-panel-body { padding: 16px 14px; }
  @media (min-width: 768px) { #pwg .pwg-panel-body { padding: 18px; } }
  #pwg .pwg-opts { margin-top: 16px; }
  #pwg .pwg-opts:first-child { margin-top: 0; }
  #pwg .pwg-label-gap { margin-bottom: 8px; }
  #pwg .pwg-foot {
    font-size: 12.5px; color: #6b7280; text-align: center;
    margin-top: 16px; line-height: 1.6; max-width: 42rem;
    margin-left: auto; margin-right: auto; font-weight: 500;
  }

  /* Score section */
  #pwg .pwg-score-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid #dbeafe; }
  #pwg .pwg-score-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
  }
  #pwg .pwg-score-title, #pwg .pwg-status-lbl {
    font-size: 13px; font-weight: 700; color: #1f2937;
    text-transform: uppercase; letter-spacing: .05em;
  }
  #pwg .pwg-status-wrap { display: flex; align-items: center; gap: 8px; }
  #pwg .pwg-status {
    padding: 4px 12px; border-radius: 9999px;
    font-size: 12px; font-weight: 700;
    border: 1px solid transparent;
  }
  #pwg .pwg-status-clean   { background: #d1fae5; color: #059669; border-color: #a7f3d0; }
  #pwg .pwg-status-blue    { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
  #pwg .pwg-status-med     { background: #fef3c7; color: #d97706; border-color: #fde68a; }
  #pwg .pwg-status-high    { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
  #pwg .pwg-status-empty   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
  #pwg .pwg-score-display { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
  #pwg .pwg-score-num { font-size: 2.25rem; font-weight: 800; line-height: 1; color: #d1d5db; font-variant-numeric: tabular-nums; }
  #pwg .pwg-score-max { font-size: 14px; color: #9ca3af; margin-bottom: 4px; font-weight: 500; }
  #pwg .pwg-score-lbl { margin-left: auto; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
  #pwg .pwg-bar-track {
    height: 8px; background: #fff; border-radius: 9999px;
    overflow: hidden; border: 1px solid #dbeafe;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
  }
  #pwg .pwg-bar { height: 100%; border-radius: 9999px; width: 0%; background: #e5e7eb; transition: width .8s cubic-bezier(.4,0,.2,1); }
  #pwg .pwg-note { font-size: 13px; color: #6b7280; margin-top: 10px; font-weight: 500; line-height: 1.55; }
  #pwg .pwg-note strong { color: #374151; font-weight: 700; }
  #pwg .pwg-score-flash { animation: pwgScoreFlash .9s ease-out; }
  @keyframes pwgScoreFlash {
    0%   { transform: scale(.85); filter: brightness(1.4); text-shadow: 0 0 0 currentColor; }
    35%  { transform: scale(1.08); filter: brightness(1.2); text-shadow: 0 0 18px currentColor; }
    100% { transform: scale(1);    filter: brightness(1);   text-shadow: 0 0 0 currentColor; }
  }

  /* Loading state */
  #pwg .is-loading { color: #9ca3af !important; font-style: italic; font-weight: 400 !important; }