:root {
      --bg: #0e1624;
      --panel: #141f31;
      --paper: #1b2940;
      --ink: #eef4ff;
      --muted: #9fb0c8;
      --line: #314158;
      --accent: #2dd4bf;
      --accent-2: #60a5fa;
      --good: #34d399;
      --warn: #f59e0b;
      --bad: #f87171;
      --button-text: #06131f;
      --focus: rgba(45, 212, 191, .28);
    }
    body.light {
      --bg: #f4f7fb;
      --panel: #ffffff;
      --paper: #ffffff;
      --ink: #172033;
      --muted: #607086;
      --line: #d9e0ea;
      --accent: #247b7b;
      --accent-2: #1f3a5f;
      --good: #2f855a;
      --warn: #d97706;
      --bad: #b91c1c;
      --button-text: #ffffff;
      --focus: rgba(36, 123, 123, .22);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: Arial, Helvetica, sans-serif;
      color: var(--ink);
      background: var(--bg);
      line-height: 1.45;
    }
    header {
      padding: 22px 24px;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
    }
    .top {
      max-width: 940px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .top-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .legal-nav {
      display: inline-flex;
      gap: 10px;
      align-items: center;
      font-size: 12px;
      font-weight: 700;
    }
    .legal-nav a {
      color: var(--accent);
      text-decoration: none;
    }
    .legal-nav a:hover {
      text-decoration: underline;
    }
    .legal-bar {
      position: fixed;
      right: 12px;
      bottom: 12px;
      z-index: 20;
      display: inline-flex;
      gap: 10px;
      align-items: center;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: 0 8px 24px rgba(0,0,0,.24);
      font-size: 12px;
      font-weight: 700;
    }
    .legal-bar a {
      color: var(--accent);
      text-decoration: none;
    }
    .legal-bar a:hover {
      text-decoration: underline;
    }
    .resource-nav {
      max-width: 940px;
      margin: 12px auto 0;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 12px;
      font-weight: 700;
    }
    .resource-nav a {
      color: var(--accent);
      text-decoration: none;
    }
    .resource-nav a:hover {
      text-decoration: underline;
    }
    .lang-switch {
      display: inline-flex;
      gap: 4px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255,255,255,.025);
    }
    .lang-switch button {
      min-height: 32px;
      padding: 6px 9px;
      border-color: transparent;
      background: transparent;
      color: var(--muted);
    }
    .lang-switch button.active {
      border-color: var(--accent);
      color: var(--button-text);
      background: var(--accent);
    }
    h1 {
      margin: 0;
      font-size: 26px;
      letter-spacing: 0;
    }
    .sub {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 14px;
    }
    .page-shell {
      max-width: 1360px;
      margin: 0 auto;
      padding: 20px;
      display: grid;
      grid-template-columns: minmax(120px, 160px) minmax(0, 940px) minmax(120px, 160px);
      gap: 20px;
      align-items: start;
    }
    main {
      min-width: 0;
      display: grid;
      gap: 16px;
      grid-column: 2;
    }
    .grid {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
      gap: 16px;
    }
    .panel, .stats {
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }
    .panel h2 {
      margin: 0;
      padding: 12px 14px;
      font-size: 15px;
      color: var(--ink);
      border-bottom: 1px solid var(--line);
    }
    .body {
      padding: 14px;
      display: grid;
      gap: 12px;
    }
    .upload-zone {
      min-height: 190px;
      border: 2px dashed var(--line);
      border-radius: 8px;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 18px;
      background: rgba(96, 165, 250, .06);
    }
    .upload-zone.dragover {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px var(--focus);
    }
    .upload-zone strong {
      display: block;
      font-size: 18px;
      margin-bottom: 6px;
    }
    .upload-zone span {
      color: var(--muted);
      font-size: 13px;
    }
    .file-pick-row {
      margin-top: 12px;
    }
    .manual-ad .adsbygoogle {
      display: block;
    }
    button, label.file-button {
      border: 1px solid var(--accent);
      background: var(--accent);
      color: var(--button-text);
      min-height: 38px;
      padding: 8px 12px;
      border-radius: 6px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    button.secondary, label.file-button.secondary {
      background: transparent;
      color: var(--accent);
    }
    button:disabled {
      opacity: .45;
      cursor: not-allowed;
    }
    input[type="file"] {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }
    textarea {
      width: 100%;
      min-height: 160px;
      resize: vertical;
      border: 1px solid var(--line);
      border-radius: 8px;
      outline: none;
      padding: 12px;
      font-family: Consolas, "Courier New", monospace;
      font-size: 13px;
      color: var(--ink);
      background: var(--panel);
    }
    textarea:focus, select:focus, input:focus {
      box-shadow: 0 0 0 3px var(--focus);
      border-color: var(--accent);
    }
    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }
    .field {
      display: grid;
      gap: 5px;
    }
    .field label, .check label {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    select {
      width: 100%;
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--panel);
      color: var(--ink);
      padding: 7px 8px;
    }
    .checks {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .check {
      display: flex;
      gap: 8px;
      align-items: center;
      min-height: 34px;
      padding: 7px 8px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: rgba(255,255,255,.02);
    }
    .check input { margin: 0; }
    details {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }
    summary {
      cursor: pointer;
      padding: 10px 12px;
      color: var(--accent);
      font-weight: 700;
    }
    .stats {
      display: grid;
      grid-template-columns: repeat(5, minmax(120px, 1fr));
    }
    .stat {
      padding: 12px;
      border-right: 1px solid var(--line);
    }
    .stat:last-child { border-right: 0; }
    .stat b {
      display: block;
      font-size: 22px;
      color: var(--ink);
    }
    .stat span {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .table-wrap {
      overflow: auto;
      max-height: 520px;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 860px;
      font-size: 13px;
    }
    th, td {
      border-bottom: 1px solid var(--line);
      padding: 8px 10px;
      text-align: left;
      white-space: nowrap;
      max-width: 260px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    th {
      position: sticky;
      top: 0;
      background: var(--accent-2);
      color: white;
      z-index: 1;
    }
    .status {
      min-height: 22px;
      color: var(--muted);
      font-size: 13px;
    }
    .status.error { color: var(--bad); font-weight: 700; }
    .status.good { color: var(--good); font-weight: 700; }
    .pill {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(45, 212, 191, .12);
      color: var(--accent);
      font-size: 12px;
      font-weight: 700;
    }
    .small {
      color: var(--muted);
      font-size: 12px;
    }
    .manual-ad {
      display: none;
      width: 100%;
      min-height: 280px;
      overflow: hidden;
    }
    .manual-ad.is-ready {
      display: block;
    }
    .manual-ad.side {
      position: sticky;
      top: 16px;
      min-height: 600px;
    }
    .manual-ad[data-ad-placement="left"] {
      grid-column: 1;
    }
    .manual-ad[data-ad-placement="right"] {
      grid-column: 3;
    }
    .manual-ad.mobile {
      min-height: 120px;
    }
    .manual-ad.mobile.is-ready {
      display: none;
    }
    .manual-ad.bottom {
      min-height: 120px;
      margin: 8px 0 4px;
    }
    .sr-note {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
    }
    .seo-content {
      display: grid;
      gap: 18px;
      padding: 12px 0 2px;
    }
    .seo-section {
      border-top: 1px solid var(--line);
      padding-top: 18px;
    }
    .seo-section h2 {
      margin: 0 0 8px;
      font-size: 21px;
      line-height: 1.25;
    }
    .seo-section h3 {
      margin: 0 0 6px;
      font-size: 16px;
      line-height: 1.3;
    }
    .seo-section p {
      max-width: 900px;
      margin: 0 0 10px;
      color: var(--muted);
    }
    .seo-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .seo-item {
      min-height: 122px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255,255,255,.025);
    }
    .seo-list, .steps {
      margin: 0;
      padding-left: 20px;
      color: var(--muted);
    }
    .seo-list li, .steps li {
      margin: 5px 0;
    }
    .sample-cleanup {
      width: 100%;
      max-width: 820px;
      min-width: 0;
      margin-top: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      font-size: 13px;
    }
    .sample-cleanup caption {
      padding: 10px 12px;
      color: var(--muted);
      text-align: left;
      border-bottom: 1px solid var(--line);
      background: rgba(255,255,255,.025);
    }
    .sample-cleanup th,
    .sample-cleanup td {
      max-width: none;
      white-space: normal;
      vertical-align: top;
    }
    .faq-block {
      display: grid;
      gap: 8px;
      max-width: 900px;
    }
    .faq-block details {
      background: rgba(255,255,255,.025);
    }
    .faq-block p {
      padding: 0 12px 12px;
    }
    footer {
      max-width: 1180px;
      margin: 0 auto;
      padding: 0 20px 26px;
      color: var(--muted);
      font-size: 12px;
      text-align: center;
    }
    footer a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 700;
    }
    footer a:hover {
      text-decoration: underline;
    }
    @media (max-width: 860px) {
      .top, .grid { grid-template-columns: 1fr; display: grid; }
      .top-actions { justify-content: start; }
      .page-shell { max-width: 940px; grid-template-columns: minmax(0, 1fr); }
      .page-shell { padding-left: 12px; padding-right: 12px; }
      main { grid-column: 1; }
      .manual-ad.side { display: none; }
      .manual-ad.mobile.is-ready { display: block; }
      .stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
      .checks { grid-template-columns: 1fr; }
      .seo-grid { grid-template-columns: 1fr; }
      header { padding-left: 12px; padding-right: 12px; }
    }
