/* Mutega Email Security Report v2 — (c) Mutega AB */
:root {
      --ink: #0d1117;
      --ink-2: #1c2333;
      --ink-3: #2d3748;
      --surface: #f8f9fb;
      --surface-2: #eef0f4;
      --border: #e2e5eb;
      --accent: #1a56db;
      --accent-light: #eff4ff;
      --good: #0e7a4a;
      --good-bg: #ecfdf5;
      --good-border: #a7f3d0;
      --warn: #b45309;
      --warn-bg: #fffbeb;
      --warn-border: #fde68a;
      --bad: #b91c1c;
      --bad-bg: #fef2f2;
      --bad-border: #fecaca;
      --opt: #64748b;
      --opt-bg: #f8fafc;
      --opt-border: #e2e8f0;
    }

    *, *::before, *::after { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--surface);
      color: var(--ink);
      margin: 0;
      line-height: 1.6;
    }

    code, pre, .mono {
      font-family: 'DM Mono', monospace;
    }

    /* ── Layout ── */
    .page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

    /* ── Header ── */
    .site-header {
      background: var(--ink);
      border-bottom: 1px solid var(--ink-2);
      padding: 0 20px;
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .site-header-inner {
      max-width: 1100px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 56px;
      gap: 16px;
    }
    .site-header a { color: #e2e8f0; text-decoration: none; }
    .site-title {
      font-size: 13px;
      font-weight: 500;
      color: #94a3b8;
      letter-spacing: .02em;
      white-space: nowrap;
    }
    .header-pills { display: flex; gap: 6px; flex-wrap: wrap; }
    .header-pill {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .06em;
      text-transform: uppercase;
      padding: 3px 8px;
      border-radius: 100px;
      background: #1e2d45;
      color: #7dd3fc;
      border: 1px solid #2a3f5f;
      font-family: 'DM Mono', monospace;
    }

    /* ── Cards ── */
    .card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 24px;
      box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
    }
    .card-sm { padding: 16px 20px; }

    /* ── Inputs ── */
    .input-wrap { position: relative; }
    .input-prefix {
      position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
      color: #94a3b8; font-family: 'DM Mono', monospace; font-size: 14px;
      pointer-events: none; user-select: none;
    }
    input[type="text"] {
      font-family: 'DM Sans', sans-serif;
      font-size: 14px;
      width: 100%;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      background: #fff;
      color: var(--ink);
      outline: none;
      transition: border-color .15s, box-shadow .15s;
    }
    input[type="text"]:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(26,86,219,.12);
    }
    #domain { padding-left: 28px; }
    label.field-label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: .04em;
      text-transform: uppercase;
      color: #64748b;
      margin-bottom: 6px;
    }
    .field-hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }
    .field-hint code { font-family: 'DM Mono', monospace; font-size: 11px; background: #f1f5f9; padding: 1px 4px; border-radius: 4px; }

    /* ── Buttons ── */
    .btn {
      display: inline-flex; align-items: center; gap: 6px;
      font-family: 'DM Sans', sans-serif;
      font-size: 13px; font-weight: 500;
      padding: 9px 16px;
      border-radius: 10px;
      border: 1.5px solid transparent;
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
      text-decoration: none;
    }
    .btn-primary {
      background: var(--ink);
      color: #fff;
      border-color: var(--ink);
    }
    .btn-primary:hover { background: #1c2333; }
    .btn-primary:disabled { opacity: .4; cursor: not-allowed; }
    .btn-primary.running {
      background: var(--accent);
      border-color: var(--accent);
      animation: pulse-btn 1.4s ease-in-out infinite;
    }
    @keyframes pulse-btn {
      0%, 100% { box-shadow: 0 0 0 0 rgba(26,86,219,.4); }
      50% { box-shadow: 0 0 0 6px rgba(26,86,219,0); }
    }
    .btn-outline {
      background: #fff;
      color: var(--ink-3);
      border-color: var(--border);
    }
    .btn-outline:hover { background: var(--surface); border-color: #cbd5e1; }
    .btn-outline:disabled { opacity: .4; cursor: not-allowed; }
    .btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

    /* ── Progress / Status ── */
    .scan-progress {
      margin-top: 16px;
      overflow: hidden;
      max-height: 0;
      transition: max-height .4s ease, opacity .3s ease;
      opacity: 0;
    }
    .scan-progress.visible { max-height: 200px; opacity: 1; }
    .progress-bar-track {
      height: 3px;
      background: var(--surface-2);
      border-radius: 2px;
      overflow: hidden;
      margin-bottom: 10px;
    }
    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent), #60a5fa);
      border-radius: 2px;
      transition: width .4s ease;
      width: 0%;
    }
    .progress-steps {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .progress-step {
      display: inline-flex; align-items: center; gap: 5px;
      font-size: 11px; font-weight: 500;
      padding: 3px 10px;
      border-radius: 100px;
      border: 1px solid var(--border);
      background: #fff;
      color: #94a3b8;
      transition: all .2s;
      font-family: 'DM Mono', monospace;
    }
    .progress-step.active {
      border-color: #93c5fd;
      background: #eff6ff;
      color: var(--accent);
    }
    .progress-step.done {
      border-color: var(--good-border);
      background: var(--good-bg);
      color: var(--good);
    }
    .progress-step .step-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: currentColor;
      flex-shrink: 0;
    }
    .progress-step.active .step-dot {
      animation: blink 1s ease-in-out infinite;
    }
    @keyframes blink { 0%,100%{opacity:1;} 50%{opacity:.3;} }

    .status-msg {
      display: flex; align-items: center; gap: 8px;
      font-size: 13px; color: #475569;
      padding: 8px 12px;
      border-radius: 8px;
      background: var(--surface);
    }
    .status-msg.error { color: var(--bad); background: var(--bad-bg); }
    .status-msg.success { color: var(--good); background: var(--good-bg); }

    /* ── Score Ring ── */
    .score-ring-wrap {
      display: flex; align-items: center; gap: 28px;
      flex-wrap: wrap;
    }
    .score-ring-svg { flex-shrink: 0; }
    .score-ring-track { fill: none; stroke: #e2e8f0; stroke-width: 8; }
    .score-ring-fill {
      fill: none;
      stroke-width: 8;
      stroke-linecap: round;
      transform: rotate(-90deg);
      transform-origin: center;
      transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1), stroke .5s ease;
    }
    .score-ring-text { font-family: 'DM Mono', monospace; font-weight: 500; }
    .score-meta { flex: 1; min-width: 200px; }
    .score-value { font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
    .score-hint-badge {
      display: inline-block;
      font-size: 11px; font-weight: 600;
      letter-spacing: .06em;
      text-transform: uppercase;
      padding: 3px 10px;
      border-radius: 100px;
      margin-top: 6px;
    }

    /* ── Summary Cards ── */
    #summary {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }
    .sum-card {
      background: #fff;
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      cursor: pointer;
      transition: all .18s;
      position: relative;
      overflow: hidden;
    }
    .sum-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0;
      width: 100%; height: 3px;
      border-radius: 14px 14px 0 0;
      opacity: 0;
      transition: opacity .2s;
    }
    .sum-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
    .sum-card:hover::before { opacity: 1; }
    .sum-card.good::before { background: linear-gradient(90deg, #10b981, #34d399); }
    .sum-card.warn::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
    .sum-card.bad::before { background: linear-gradient(90deg, #ef4444, #f87171); }
    .sum-card.opt::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
    .sum-card-icon {
      width: 32px; height: 32px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 10px;
      flex-shrink: 0;
    }
    .sum-card-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
    .sum-card-detail { font-size: 11px; color: #94a3b8; font-family: 'DM Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sum-card-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 10px; font-weight: 600;
      letter-spacing: .04em;
      padding: 3px 8px;
      border-radius: 100px;
      border: 1px solid;
      margin-top: 8px;
    }
    .sum-card-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

    /* ── Skeleton loader ── */
    .skeleton {
      background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      border-radius: 6px;
    }
    @keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

    /* ── Finding Cards ── */
    .finding-card {
      border: 1.5px solid var(--border);
      border-radius: 14px;
      background: #fff;
      overflow: hidden;
      scroll-margin-top: 80px;
    }
    .finding-card-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px;
      cursor: pointer;
      user-select: none;
      gap: 12px;
    }
    .finding-card-header:hover { background: var(--surface); }
    .finding-card-title {
      display: flex; align-items: center; gap: 10px;
      font-size: 14px; font-weight: 600;
    }
    .finding-card-icon {
      width: 28px; height: 28px; border-radius: 7px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .finding-card-body {
      padding: 0 20px;
      max-height: 0;
      overflow: hidden;
      transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .25s;
    }
    .finding-card-body.open {
      max-height: 2000px;
      padding: 0 20px 20px;
      border-top: 1px solid var(--border);
    }
    .finding-card-chevron {
      transition: transform .25s;
      color: #94a3b8;
      flex-shrink: 0;
    }
    .finding-card-chevron.open { transform: rotate(180deg); }

    /* ── Pre / Code ── */
    pre {
      font-family: 'DM Mono', monospace;
      font-size: 12px;
      white-space: pre-wrap;
      word-break: break-word;
      background: #0d1117;
      color: #e2e8f0;
      border-radius: 10px;
      padding: 14px 16px;
      overflow-x: auto;
      margin: 0;
      line-height: 1.6;
    }

    /* ── Badges / Pills ── */
    .badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 11px; font-weight: 600;
      letter-spacing: .04em;
      padding: 3px 9px;
      border-radius: 100px;
      border: 1px solid;
    }
    .badge-good { color: var(--good); background: var(--good-bg); border-color: var(--good-border); }
    .badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
    .badge-bad  { color: var(--bad);  background: var(--bad-bg);  border-color: var(--bad-border); }
    .badge-opt  { color: var(--opt);  background: var(--opt-bg);  border-color: var(--opt-border); }

    .pill {
      display: inline-flex; align-items: center;
      font-size: 11px; font-family: 'DM Mono', monospace;
      padding: 3px 9px;
      border-radius: 100px;
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--ink-3);
    }

    /* ── Tables ── */
    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .data-table th {
      text-align: left;
      font-size: 11px; font-weight: 600;
      text-transform: uppercase; letter-spacing: .05em;
      color: #64748b;
      padding: 10px 14px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
    }
    .data-table td {
      padding: 10px 14px;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: top;
    }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table tr:hover td { background: #fafbfc; }
    .sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; }
    .sticky-col-head { background: var(--surface) !important; z-index: 3; }

    /* ── Recommendations ── */
    .rec-list { list-style: none; padding: 0; margin: 0; space-y: 6px; }
    .rec-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 10px 14px;
      border-radius: 10px;
      border: 1px solid;
      margin-bottom: 8px;
      font-size: 13px;
    }
    .rec-item.high { border-color: var(--bad-border); background: var(--bad-bg); color: #7f1d1d; }
    .rec-item.med  { border-color: var(--warn-border); background: var(--warn-bg); color: #78350f; }
    .rec-item.low  { border-color: var(--opt-border); background: var(--opt-bg); color: #334155; }
    .rec-icon { flex-shrink: 0; margin-top: 1px; }

    /* ── Scores table ── */
    .score-row { border-top: 1px solid var(--border); }
    .score-row td { padding: 9px 12px; font-size: 13px; }
    .score-bar { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; width: 80px; }
    .score-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

    /* ── Info accordion ── */
    .info-acc {
      border: 1.5px solid var(--border);
      border-radius: 12px;
      background: #fff;
      overflow: hidden;
      margin-bottom: 8px;
    }
    .info-acc summary {
      padding: 14px 18px;
      cursor: pointer;
      list-style: none;
      font-size: 13px; font-weight: 600; color: var(--ink-3);
      display: flex; align-items: center; justify-content: space-between;
    }
    .info-acc summary:hover { background: var(--surface); }
    .info-acc summary::after {
      content: '▾';
      font-size: 11px;
      color: #94a3b8;
      transition: transform .2s;
    }
    .info-acc[open] summary::after { transform: rotate(180deg); }
    .info-acc-body { padding: 0 18px 16px; font-size: 13px; color: #475569; border-top: 1px solid var(--border); }
    .info-acc-body { padding-top: 12px; }

    /* ── CTA ── */
    .cta-card {
      border-radius: 18px;
      padding: 28px 32px;
      background: linear-gradient(135deg, #0d1117 0%, #1e3a5f 100%);
      color: #fff;
      text-align: center;
      position: relative;
      overflow: hidden;
    }
    .cta-card::before {
      content: '';
      position: absolute;
      width: 300px; height: 300px;
      border-radius: 50%;
      background: rgba(59,130,246,.15);
      top: -100px; right: -80px;
      pointer-events: none;
    }
    .cta-score {
      font-size: 48px; font-weight: 800;
      letter-spacing: -.03em;
      line-height: 1;
      background: linear-gradient(90deg, #60a5fa, #93c5fd);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    /* ── Tooltip ── */
    .tip { position: relative; display: inline-flex; }
    .tip .tip-bubble {
      position: absolute;
      left: 50%; transform: translateX(-50%);
      bottom: calc(100% + 8px);
      width: min(360px, 90vw);
      display: none;
      z-index: 200;
      pointer-events: none;
    }
    .tip:hover .tip-bubble, .tip:focus-within .tip-bubble { display: block; }
    .tip-inner {
      background: var(--ink);
      color: #e2e8f0;
      font-size: 12px;
      padding: 10px 14px;
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,.3);
      line-height: 1.5;
    }
    .tip-btn {
      width: 18px; height: 18px;
      border-radius: 50%;
      border: 1.5px solid #cbd5e1;
      background: #fff;
      color: #64748b;
      font-size: 10px;
      font-family: 'DM Mono', monospace;
      cursor: default;
      display: inline-flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }

    /* ── Source links ── */
    .source-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
    .source-link {
      font-size: 11px;
      padding: 3px 10px;
      border-radius: 100px;
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--accent);
      text-decoration: none;
      transition: background .15s;
    }
    .source-link:hover { background: var(--accent-light); }

    /* ── Manual verify ── */
    .verify-btn {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 12px; font-weight: 500;
      padding: 7px 14px;
      border-radius: 8px;
      border: 1.5px solid var(--warn-border);
      background: var(--warn-bg);
      color: var(--warn);
      cursor: pointer;
      transition: all .15s;
      font-family: 'DM Sans', sans-serif;
    }
    .verify-btn:hover { background: #fef3c7; }
    .verified-badge {
      display: inline-flex; align-items: center; gap: 5px;
      font-size: 12px; font-weight: 500;
      padding: 6px 12px;
      border-radius: 8px;
      background: var(--good-bg);
      border: 1px solid var(--good-border);
      color: var(--good);
    }

    /* ── Flash animation ── */
    @keyframes flash-ring {
      from { box-shadow: 0 0 0 0 rgba(26,86,219,.5); }
      to   { box-shadow: 0 0 0 14px rgba(26,86,219,0); }
    }
    .highlight { animation: flash-ring 1s ease-out; }

    /* ── Raw results ── */
    #raw { max-height: 60vh; }

    /* ── Back to top ── */
    #backToTop {
      position: fixed; bottom: 24px; right: 24px;
      display: none;
      align-items: center; gap: 6px;
      background: var(--ink);
      color: #fff;
      border: none;
      border-radius: 100px;
      padding: 10px 18px;
      font-size: 13px; font-weight: 500;
      font-family: 'DM Sans', sans-serif;
      cursor: pointer;
      box-shadow: 0 4px 20px rgba(0,0,0,.2);
      transition: all .2s;
      z-index: 500;
    }
    #backToTop:hover { background: #1c2333; transform: translateY(-2px); }
    #backToTop.visible { display: flex; }

    /* ── Print ── */
    @media print {
      .no-print { display: none !important; }
      body { background: #fff !important; }
      .card, .finding-card { box-shadow: none !important; }
      .finding-card-body { max-height: none !important; display: block !important; padding: 0 20px 20px !important; border-top: 1px solid #e2e5eb; }
    }

    /* ── Mobile ── */
    @media (max-width: 640px) {
      .page-wrap { padding: 0 12px 40px; }
      #summary { grid-template-columns: 1fr 1fr; }
      .score-ring-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
      .site-header-inner { height: 48px; }
      .header-pills { display: none; }
      .controls-grid { grid-template-columns: 1fr !important; }
      .controls-grid > div:last-child { padding-top: 0 !important; }
    }

    /* ── Section spacing ── */
    .section { margin-top: 24px; }
    .section-title {
      font-size: 15px; font-weight: 700;
      color: var(--ink); margin: 0 0 14px;
      display: flex; align-items: center; gap: 8px;
    }
    .section-title-label {
      font-size: 11px; font-weight: 500;
      color: #94a3b8; margin-left: auto;
    }

    /* ── Impact grid ── */
    .impact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .impact-tile {
      background: #fff;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 16px;
      text-align: center;
    }
    .impact-tile-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
    .impact-tile-val { font-size: 22px; font-weight: 700; font-family: 'DM Mono', monospace; margin: 4px 0 2px; }
    .impact-tile-pct { font-size: 12px; color: #94a3b8; }
    @media (max-width: 480px) { .impact-grid { grid-template-columns: 1fr 1fr; } }

    /* ── DNS table ── */
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1.5px solid var(--border); }
    .dns-table { min-width: 800px; }

    /* ── Empty state ── */
    .empty-state {
      padding: 48px 24px;
      text-align: center;
      color: #94a3b8;
    }
    .empty-state-icon { font-size: 40px; margin-bottom: 12px; }
    .empty-state-text { font-size: 14px; }

/* ── Added in code-separation build (replaces Tailwind CDN) ── */
.hidden { display: none !important; }
img { max-width: 100%; height: auto; }
.site-logo { display: block; width: 10rem; height: auto; max-width: 100%; }
@media (min-width: 640px) { .site-logo { width: 180px; } }
.cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 24px; border-radius: 10px;
  background: #1d4ed8; color: #fff; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: background .15s;
}
.cta-btn:hover { background: #1e40af; }

/* ── Suite navigation (dark header) ── */
.suite-nav { display: flex; gap: 4px; align-items: center; }
.suite-tab {
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px;
  color: #94a3b8; text-decoration: none; border: 1px solid transparent;
  white-space: nowrap;
}
a.suite-tab:hover { color: #e2e8f0; border-color: #2a3f5f; }
.suite-tab.active { background: #1e2d45; color: #7dd3fc; border-color: #2a3f5f; }
@media (max-width: 720px) { .suite-nav { display: none; } }
