:root {
  color-scheme: light;
  --ink: #16243a;
  --muted: #627189;
  --line: #d8e1ed;
  --surface: #ffffff;
  --page: #f3f6fb;
  --primary: #3379f6;
  --primary-dark: #1f56bc;
  --platform-accent: #2771ef;
  --normal: #12a33a;
  --normal-soft: #e9f8ed;
  --abnormal: #f22935;
  --abnormal-soft: #fff0f0;
  --unknown: #8191aa;
  --unknown-soft: #f0f2f5;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  background: var(--page);
  color: var(--ink);
}

button, textarea { font: inherit; }

.page-shell {
  width: min(1440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 38px;
}

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 122px;
  padding: 22px 26px;
  border-radius: 18px;
  background: linear-gradient(118deg, #214e9e 0%, #346af1 58%, #159bd0 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(32, 79, 166, 0.2);
}

.hero-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 6px;
  color: #b8ffed;
  font-size: 12px;
  font-weight: 800;
}
.eyebrow span { margin-right: 5px; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -0.025em; }
.subtitle { margin: 7px 0 0; color: rgba(255, 255, 255, 0.92); font-size: 14px; }

.hero-controls { display: grid; justify-items: end; gap: 9px; min-width: 0; }
.hero-control-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.feedback-shortcuts { display: inline-flex; align-items: center; gap: 6px; }
.hero-feedback-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background: rgba(8, 45, 106, 0.28);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.hero-feedback-button:hover { background: rgba(8, 45, 106, 0.48); }
.hero-nav-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 10px 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 13px rgba(7, 36, 89, 0.18);
  color: #243b5e;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  animation: hero-nav-float 1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.hero-nav-card:hover {
  animation-play-state: paused;
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 7px 17px rgba(7, 36, 89, 0.24);
}
.hero-nav-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30% auto -30% -45%;
  width: 32%;
  background: linear-gradient(100deg, transparent, rgba(77, 184, 255, 0.24), transparent);
  transform: skewX(-18deg);
  animation: hero-nav-shine 3.4s ease-in-out infinite;
}
.hero-nav-card:focus-visible {
  outline: 3px solid rgba(184, 255, 237, 0.72);
  outline-offset: 2px;
}
.hero-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f65e6, #16a6d9);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  animation: hero-nav-icon-pulse 2s ease-in-out infinite;
}
.hero-nav-copy { display: grid; gap: 1px; line-height: 1; }
.hero-nav-copy strong { font-size: 11px; font-weight: 900; }
.hero-nav-copy small { color: #e54848; font-size: 8px; font-weight: 900; }
.hero-nav-divider {
  align-self: stretch;
  width: 1px;
  margin: 1px 2px;
  background: linear-gradient(transparent, #d5e1f0 22%, #d5e1f0 78%, transparent);
}
.hero-nav-features {
  display: grid;
  gap: 2px;
  min-width: 184px;
  text-align: left;
}
.hero-nav-feature-label {
  color: #2468d8;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}
.hero-nav-feature-copy {
  display: grid;
  color: #405878;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}
.hero-nav-arrow {
  color: #2d74e8;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  animation: hero-nav-arrow-nudge 1s ease-in-out infinite;
}
@keyframes hero-nav-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes hero-nav-icon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 101, 230, 0.16); }
  50% { box-shadow: 0 0 0 4px rgba(31, 101, 230, 0.08); }
}
@keyframes hero-nav-shine {
  0%, 58% { left: -45%; opacity: 0; }
  68% { opacity: 1; }
  90%, 100% { left: 120%; opacity: 0; }
}
@keyframes hero-nav-arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-nav-card,
  .hero-nav-card::after,
  .hero-nav-icon,
  .hero-nav-arrow { animation: none; }
}
.language-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(8, 45, 106, 0.34);
}
.language-option {
  min-height: 30px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.language-option:hover { color: #fff; }
.language-option.is-active { background: #fff; color: #2057b7; box-shadow: 0 3px 9px rgba(7, 36, 89, 0.18); }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 63, 136, 0.38);
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  line-height: 1.5;
}
.privacy-note strong { color: #b8ffed; }
.privacy-icon { color: #68f3cf; }

.platform-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 16px 0 24px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(43, 65, 100, 0.06);
  scrollbar-width: thin;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #4d5d72;
  white-space: nowrap;
  cursor: pointer;
}
.platform-tab small {
  padding: 2px 5px;
  border-radius: 99px;
  background: #eef2f7;
  color: #8a96a7;
  font-size: 10px;
}
.platform-tab:disabled { cursor: not-allowed; opacity: 0.72; }
.platform-tab:hover:not(:disabled):not(.is-active) { background: #f4f7fb; color: #253b5a; }
.platform-tab.is-active {
  background: var(--platform-accent);
  color: #fff;
  box-shadow: 0 5px 13px rgba(45, 119, 245, 0.3);
}

.platform-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  background: #eef2f7;
  color: #26364c;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
.is-active .platform-icon { background: rgba(255, 255, 255, 0.2); color: #fff; }
.icon-facebook { color: #1877f2; }
.icon-instagram { color: #d6249f; }
.icon-threads { color: #111; }
.icon-tiktok { color: #0f172a; }
.icon-telegram { color: #229ed9; }

.workspace-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(45, 62, 88, 0.07);
}

.section-heading,
.platform-heading,
.result-title,
.toolbar,
.split-actions {
  display: flex;
  align-items: center;
}

.section-heading { justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.platform-heading { gap: 9px; }
.platform-heading .platform-icon { background: var(--platform-accent); color: #fff; }
.section-heading h2, .result-title h2 { margin: 0; font-size: 17px; }
.section-heading p { max-width: 900px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.line-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf3fc;
  color: #45607f;
}
.line-counter strong { color: #1d57bd; font-size: 18px; }
.line-counter.over-limit, .line-counter.over-limit strong { color: #c51e2b; background: #ffeded; }

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea:focus { border-color: #5d8ee5; box-shadow: 0 0 0 3px rgba(65, 124, 226, 0.13); }
.account-input { min-height: 170px; padding: 13px 15px; }
.input-help { margin: 7px 0 0; color: #53657d; font-size: 13px; }
.query-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #34465e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.query-mode-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--platform-accent); }

.toolbar { gap: 10px; margin-top: 16px; }
.button {
  min-height: 40px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform 100ms ease, opacity 100ms ease, background 100ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(51, 121, 246, 0.2); }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); }
.button-secondary { border-color: #cbd5e1; color: #526174; }

.progress-wrap {
  display: grid;
  grid-template-columns: minmax(120px, 260px) auto;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #e6ebf2; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2e74e8, #59a2fa); transition: width 180ms ease; }
.notice { min-height: 22px; margin: 10px 0 -4px; color: #46617e; font-size: 13px; }
.notice.error { color: #c51e2b; }
.notice.success { color: #087c28; }
.copy-toast { position: fixed; z-index: 1200; top: max(18px, env(safe-area-inset-top)); left: 50%; width: min(620px, calc(100% - 28px)); margin: 0; padding: 14px 18px; transform: translateX(-50%); border: 1px solid; border-radius: 13px; box-shadow: 0 18px 50px rgba(13,31,61,.22); font-size: 14px; font-weight: 800; line-height: 1.6; text-align: center; pointer-events: none; }
.copy-toast.is-success { color: #087c28; border-color: #86efac; background: #f0fdf4; }
.copy-toast.is-error { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }

.feedback-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.feedback-dialog::backdrop { background: rgba(15, 23, 42, .58); }
.feedback-dialog-card { padding: 24px; border-radius: 18px; background: #fff; }
.feedback-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.feedback-dialog-heading h2 { margin: 0; }
.feedback-dialog-description { margin: 14px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.feedback-dialog label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.feedback-dialog textarea { min-height: 160px; padding: 12px 13px; }
.feedback-meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 8px; }
.feedback-security-note { margin: 0; color: #b45309; font-size: 12px; line-height: 1.55; }
#feedback-counter { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.feedback-message { min-height: 22px; margin: 10px 0 0; font-size: 13px; }
.feedback-message.is-success { color: #087c28; }
.feedback-message.is-error { color: #b91c1c; }
.feedback-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }

.platform-detail {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #cde8f5;
  border-radius: 10px;
  background: #f1faff;
  color: #315a70;
  font-size: 13px;
  line-height: 1.55;
}

.service-error-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 26px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 28px 80px rgba(13, 31, 61, 0.3);
}
.service-error-dialog::backdrop { background: rgba(20, 32, 52, 0.52); backdrop-filter: blur(2px); }
.service-error-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: #fff0f1;
  color: #d52332;
  font-size: 30px;
  font-weight: 900;
}
.service-error-dialog h2 { margin: 0; font-size: 21px; }
.service-error-dialog p { margin: 12px 0 20px; color: #5f6f84; line-height: 1.65; }
.service-error-dialog button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #d52332;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 18px;
}

.gmail-results-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.gmail-results-grid[hidden] { display: none; }

.result-card { padding: 18px; border: 1px solid transparent; border-radius: 16px; }
.result-normal { background: var(--normal-soft); border-color: #d4efdb; }
.result-abnormal { background: var(--abnormal-soft); border-color: #f8d9dc; }
.result-verification { background: #fffbea; border-color: #f7dda0; }
.result-disabled { background: #fff0f0; border-color: #f8d9dc; }
.result-not-registered { background: #fff2ef; border-color: #f7d7cf; }
.result-unknown { background: var(--unknown-soft); border-color: #e2e6eb; }
.result-title { gap: 7px; margin-bottom: 9px; }
.result-normal .result-title { color: var(--normal); }
.result-abnormal .result-title { color: var(--abnormal); }
.result-verification .result-title { color: #d6a400; }
.result-disabled .result-title { color: #ef2b34; }
.result-not-registered .result-title { color: #ff3b30; }
.result-unknown .result-title { color: var(--unknown); }
.count-badge {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 99px;
  background: currentColor;
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  text-align: center;
}
.result-normal .count-badge { background: var(--normal); }
.result-abnormal .count-badge { background: var(--abnormal); }
.result-verification .count-badge { background: #d6a400; }
.result-disabled .count-badge { background: #ef2b34; }
.result-not-registered .count-badge { background: #ff3b30; }
.result-unknown .count-badge { background: var(--unknown); }
.result-card textarea { min-height: 190px; padding: 11px; background: #fff; }
.button-copy { width: 100%; min-height: 36px; margin-top: 9px; padding: 6px 12px; border-color: currentColor; font-weight: 600; }
.result-normal .button-copy { color: var(--normal); }
.result-abnormal .button-copy { color: var(--abnormal); }
.result-verification .button-copy { color: #b88b00; }
.result-disabled .button-copy { color: #ef2b34; }
.result-not-registered .button-copy { color: #ff3b30; }
.result-unknown .button-copy { color: var(--unknown); }
.split-actions { gap: 0; }
.split-actions .button { flex: 1; }
.button-retry { min-height: 36px; margin-top: 9px; padding: 6px 12px; border-color: #3577ff; color: #2468ef; }

.rules-card {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 11px;
  background: #f7f9fc;
  color: #65748a;
  font-size: 13px;
  line-height: 1.5;
}
.rules-card strong { flex: 0 0 auto; color: #2f4057; }

.copy-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 17px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(13, 31, 61, 0.3);
}
.copy-dialog::backdrop { background: rgba(20, 32, 52, 0.48); backdrop-filter: blur(2px); }
.copy-dialog form { padding: 22px; }
.copy-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.copy-dialog h2 { margin: 2px 0 0; font-size: 20px; }
.dialog-eyebrow { margin: 0; color: #3978e8; font-size: 12px; font-weight: 800; }
.dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #f0f3f7;
  color: #526174;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.copy-dialog-description { margin: 13px 0 15px; color: var(--muted); font-size: 13px; }
.copy-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.copy-choice {
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfe;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.copy-choice:hover { border-color: #73a0f2; background: #f1f6ff; }
.copy-choice strong, .copy-choice span { display: block; }
.copy-choice strong { margin-bottom: 7px; font-size: 14px; }
.copy-choice span { color: var(--muted); font-size: 12px; line-height: 1.45; }

[hidden] { display: none !important; }

.visibility-results { margin-top: 18px; }
.visibility-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.visibility-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.visibility-filter {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d6deea;
  border-radius: 999px;
  background: #fff;
  color: #526174;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.visibility-filter:hover { border-color: #91a9cb; background: #f6f9fe; }
.visibility-filter.is-active {
  border-color: var(--platform-accent);
  background: var(--platform-accent);
  color: #fff;
}
.visibility-filter span {
  display: inline-block;
  min-width: 18px;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(98, 113, 137, 0.13);
  text-align: center;
}
.visibility-filter.is-active span { background: rgba(255, 255, 255, 0.2); }
.visibility-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.visibility-actions .button { min-height: 36px; padding: 6px 12px; }
.visibility-actions .button-retry { margin-top: 0; }
.visibility-shown-count { color: var(--muted); font-size: 12px; white-space: nowrap; }

.visibility-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #ccd6e4;
  border-radius: 11px;
  background: #fff;
}
.visibility-table {
  width: 100%;
  min-width: 460px;
  border-spacing: 0;
  color: #25364e;
  table-layout: fixed;
}
.visibility-table th,
.visibility-table td {
  height: 43px;
  padding: 8px 13px;
  border-right: 1px solid #e2e7ef;
  border-bottom: 1px solid #e2e7ef;
  text-align: center;
}
.visibility-table th:first-child,
.visibility-table td:first-child { width: 56%; text-align: left; }
.visibility-table th:nth-child(2),
.visibility-table th:nth-child(3) { width: 22%; }
.visibility-table th:last-child,
.visibility-table td:last-child { border-right: 0; }
.visibility-table tbody tr:last-child td { border-bottom: 0; }
.visibility-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #e9eef5;
  color: #34465e;
  font-size: 13px;
}
.visibility-table thead th:first-child { left: 0; z-index: 4; }
.visibility-table tbody tr:nth-child(odd) { background: #fff; }
.visibility-table tbody tr:nth-child(even) { background: #f3f5f8; }
.visibility-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}
.visibility-table tbody tr:nth-child(even) td:first-child { background: #f3f5f8; }
.visibility-username {
  overflow: hidden;
  color: #162f58;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visibility-status {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
}
.visibility-visible { background: #e7f8ec; }
.visibility-not-visible { background: #fff0f0; }
.visibility-unknown { background: #eef1f5; }
.visibility-empty-row td {
  position: static !important;
  height: 110px;
  background: #fff !important;
  color: var(--muted);
  text-align: center !important;
}

.warning-dialog {
  position: relative;
  width: min(500px, calc(100% - 28px));
  padding: 26px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(13, 31, 61, 0.32);
}
.warning-dialog::backdrop { background: rgba(20, 32, 52, 0.58); backdrop-filter: blur(3px); }
.warning-dialog-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 14px;
  background: #fff4d8;
  color: #b66b00;
  font-size: 28px;
  font-weight: 900;
}
.warning-dialog h2 { margin: 3px 0 13px; font-size: 22px; }
.warning-dialog-copy {
  padding: 13px 15px;
  border: 1px solid #f0dfb7;
  border-radius: 11px;
  background: #fffaf0;
  color: #536175;
  font-size: 13px;
  line-height: 1.7;
}
.warning-dialog-copy p { margin: 0; }
.warning-dialog-copy p + p { margin-top: 8px; }
.warning-dialog-copy strong { color: #16243a; }
.warning-dialog-confirm {
  width: 100%;
  min-height: 44px;
  margin-top: 17px;
  border: 0;
  border-radius: 10px;
  background: var(--platform-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
.warning-dialog-confirm:disabled { background: #aeb8c7; cursor: not-allowed; }
.warning-dialog .warning-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}
.advanced-search-warning-dialog { width: min(560px, calc(100% - 28px)); }
.advanced-search-warning-copy strong { color: #15233a; }
.advanced-search-ack {
  display: grid;
  gap: 7px;
  margin-top: 17px;
  color: #24344d;
  font-size: 13px;
  font-weight: 800;
}
.advanced-search-ack input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cdd8e8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.advanced-search-ack input:focus {
  border-color: var(--platform-accent);
  box-shadow: 0 0 0 3px rgba(65, 124, 226, 0.13);
  outline: none;
}
.advanced-search-ack-help { margin: 7px 0 0; color: #7a8799; font-size: 12px; }
.advanced-search-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 17px; }
.advanced-search-actions .button,
.advanced-search-actions .warning-dialog-confirm { width: 100%; margin-top: 0; }
.gmail-mode-selector {
  display: flex;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}
.gmail-mode-selector legend { margin-bottom: 8px; color: #31415a; font-size: 13px; font-weight: 800; }
.gmail-mode-selector label {
  display: flex;
  min-width: 210px;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid #d6dfed;
  border-radius: 11px;
  background: #f8faff;
  cursor: pointer;
}
.gmail-mode-selector input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--platform-accent); }
.gmail-mode-selector span { display: grid; gap: 2px; }
.gmail-mode-selector strong { color: #172b4d; font-size: 13px; }
.gmail-mode-selector small { color: #708097; font-size: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .tool-hero { align-items: flex-start; }
  .privacy-note { max-width: 420px; }
  .results-grid { gap: 14px; }
  .gmail-results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 16px, 1440px); padding: 8px 0 26px; }
  .tool-hero { display: block; min-height: 0; padding: 16px 17px; border-radius: 15px; }
  h1 { font-size: 25px; }
  .subtitle, .privacy-note { display: none; }
  .hero-controls { justify-items: start; margin-top: 12px; }
  .hero-control-row { justify-content: flex-start; }
  .feedback-shortcuts { display: contents; }
  .language-switch { order: 1; }
  .hero-feedback-button { order: 2; }
  .hero-nav-card { order: 3; flex-basis: 100%; }
  .feedback-dialog-card { padding: 20px 16px; }
  .feedback-meta-row { display: block; }
  #feedback-counter { display: block; margin-top: 6px; text-align: right; }
  .feedback-dialog-actions { flex-direction: column-reverse; }
  .feedback-dialog-actions .button { width: 100%; }
  .language-option { min-height: 28px; padding: 4px 10px; }
  .platform-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0 14px;
    padding: 7px;
    overflow: visible;
    border-radius: 12px;
    scrollbar-width: auto;
  }
  .platform-tab { width: 100%; min-width: 0; min-height: 48px; gap: 5px; padding: 8px; font-size: 13px; }
  .platform-tab .platform-icon { width: 20px; height: 20px; flex-basis: 20px; font-size: 12px; }
  .platform-tab span:last-child { min-width: 0; white-space: normal; line-height: 1.25; text-align: left; }
  .platform-tab small { display: none; }
  .workspace-card { padding: 16px; border-radius: 14px; }
  .section-heading { align-items: flex-start; gap: 10px; }
  .section-heading p { font-size: 13px; }
  .line-counter { padding: 6px 9px; }
  .account-input { min-height: 155px; }
  .toolbar { flex-wrap: wrap; }
  .progress-wrap { grid-template-columns: 1fr auto; width: 100%; min-width: 0; margin: 4px 0 0; }
  .button-primary, .button-secondary { flex: 1; }
  .results-grid { grid-template-columns: 1fr; gap: 13px; }
  .gmail-results-grid { grid-template-columns: 1fr; gap: 13px; }
  .result-card textarea { min-height: 140px; }
  .visibility-controls { align-items: stretch; flex-direction: column; }
  .visibility-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visibility-filter { min-width: 0; text-align: left; }
  .visibility-actions { flex-wrap: wrap; }
  .visibility-shown-count { width: 100%; }
  .visibility-actions .button { flex: 1; white-space: nowrap; }
  .visibility-table { min-width: 420px; }
  .visibility-table th, .visibility-table td { padding: 7px 10px; }
  .gmail-mode-selector { display: grid; }
  .gmail-mode-selector label { min-width: 0; }
  .warning-dialog { padding: 21px; }
  .rules-card { flex-direction: column; gap: 5px; }
}

@media (max-width: 420px) {
  .tool-hero { padding: 14px 15px; }
  .hero-nav-card { width: 100%; }
  .hero-nav-features { min-width: 0; flex: 1; }
  .workspace-card { padding: 13px; }
  .section-heading { display: grid; grid-template-columns: 1fr auto; }
  .section-heading p { grid-column: 1 / -1; }
  .result-card { padding: 14px; }
  .copy-dialog form { padding: 18px; }
  .copy-choice-grid { grid-template-columns: 1fr; }
  .copy-choice { min-height: 78px; }
}

@media (hover: none) and (pointer: coarse) and (min-width: 761px) and (max-width: 1180px) {
  .subtitle, .privacy-note { display: none; }
  .tool-hero { min-height: 0; padding: 17px 20px; }
  .platform-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    scrollbar-width: auto;
  }
  .platform-tab { width: 100%; min-width: 0; justify-content: flex-start; }
}
