:root {
  color-scheme: light;
  --canvas: #f5f4ee;
  --surface: #ffffff;
  --surface-soft: #fafaf6;
  --ink: #10212b;
  --ink-soft: #42535c;
  --muted: #748188;
  --line: #dde1dc;
  --line-strong: #cbd2cb;
  --navy: #102a33;
  --navy-soft: #173943;
  --green: #1fc878;
  --green-dark: #0a8750;
  --green-soft: #ddf8e9;
  --amber: #e6a23c;
  --amber-soft: #fff3d9;
  --red: #c94747;
  --red-soft: #ffebeb;
  --shadow-sm: 0 1px 2px rgba(16, 33, 43, 0.04), 0 5px 16px rgba(16, 33, 43, 0.035);
  --shadow-lg: 0 20px 60px rgba(16, 33, 43, 0.09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shell: 1240px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(31, 200, 120, 0.07), transparent 25rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(203, 210, 203, 0.78);
  background: rgba(250, 250, 246, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 7px 18px rgba(16, 42, 51, 0.17);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: var(--green);
}

.brand-mark::before {
  width: 18px;
  height: 4px;
  transform: rotate(45deg);
}

.brand-mark::after {
  width: 4px;
  height: 18px;
  transform: rotate(45deg);
}

.brand-mark span::before {
  width: 6px;
  height: 2px;
  top: -8px;
  left: 8px;
}

.brand-mark span::after {
  width: 2px;
  height: 6px;
  top: -10px;
  left: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-key-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.header-key-button:hover,
.header-key-button:focus-visible {
  border-color: #a6cfb5;
  color: var(--green-dark);
}

.header-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.discovery-section {
  padding-block: 28px 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

.search-panel {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(16, 42, 51, 0.12);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green) 0 25%, rgba(31, 200, 120, 0.18) 25%);
  content: "";
}

.search-fields {
  display: grid;
  grid-template-columns:
    minmax(280px, 1fr)
    minmax(160px, 190px)
    minmax(130px, 150px);
  gap: 14px;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input {
  padding: 0 15px 0 43px;
}

.proxy-fields .field input {
  padding: 0 14px;
}

.field select {
  padding: 0 36px 0 14px;
}

.field input::placeholder {
  color: #8c989d;
}

.field input.is-invalid {
  border-color: #c94b45;
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(201, 75, 69, 0.1);
}

.field-error {
  margin: 7px 3px 0;
  color: #a63d38;
  font-size: 0.75rem;
  font-weight: 700;
}

.field input:focus,
.field select:focus {
  border-color: var(--green-dark);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 200, 120, 0.12);
}

.query-control {
  position: relative;
}

.query-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 17px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-55%);
  pointer-events: none;
}

.query-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.proxy-settings,
.follower-settings {
  min-width: 0;
  margin: 15px 0 0;
  border: 1px solid #e3e7e2;
  border-radius: 14px;
  padding: 11px 13px 13px;
  background: rgba(247, 248, 245, 0.76);
}

.proxy-settings legend,
.follower-settings legend {
  padding: 0 7px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.015em;
}

.proxy-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.follower-fields {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.follower-fields .field input {
  padding: 0 14px;
}

.proxy-fields .field label {
  margin-top: 0;
}

.proxy-fields .field input,
.proxy-fields .field select {
  min-height: 44px;
  background: var(--surface);
}

.label-optional {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.field-help {
  margin: 5px 3px 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.field input:disabled,
.field select:disabled {
  cursor: not-allowed;
  background: #ecefec;
  color: #899398;
}

.search-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eceeea;
}

.search-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.search-note-stack {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid rgba(16, 42, 51, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 38px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-card .eyebrow {
  margin-bottom: 8px;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-help {
  margin: 12px auto 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-form {
  text-align: left;
}

.auth-field input {
  padding: 0 14px;
}

.auth-error {
  margin-bottom: 0;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
}

.auth-status {
  min-height: 1.3em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.auth-storage-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.button-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 17px;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.filter-button:focus-visible,
.example-chip:focus-visible,
.icon-button:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(31, 200, 120, 0.34);
  outline-offset: 3px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.button-primary {
  min-width: 158px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 7px 18px rgba(16, 42, 51, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--navy-soft);
  box-shadow: 0 10px 24px rgba(16, 42, 51, 0.2);
}

.button-spark {
  color: var(--green);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.button-warning {
  border-color: #e7c989;
  background: #fffaf0;
  color: #815717;
}

.button-danger {
  border-color: #ecc3c3;
  background: #fff8f8;
  color: #9a3838;
}

.button-warning:hover:not(:disabled) {
  border-color: #d9ad55;
  background: var(--amber-soft);
}

.button-danger:hover:not(:disabled) {
  border-color: #df9f9f;
  background: var(--red-soft);
}

.button-export {
  min-height: 38px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-compact {
  min-width: 0;
  min-height: 34px;
  padding-inline: 11px;
  font-size: 0.72rem;
}

.download-icon {
  position: relative;
  width: 13px;
  height: 13px;
  border-bottom: 2px solid currentColor;
}

.download-icon::before {
  position: absolute;
  top: 0;
  left: 5px;
  width: 2px;
  height: 8px;
  background: currentColor;
  content: "";
}

.download-icon::after {
  position: absolute;
  top: 4px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.run-queue-section {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.run-queue-header {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid #e6e9e4;
}

.run-queue-heading {
  min-width: 0;
}

.run-queue-heading .eyebrow {
  margin-bottom: 3px;
  font-size: 0.62rem;
}

.run-queue-title-row,
.run-queue-header-actions,
.run-queue-actions {
  display: flex;
  align-items: center;
}

.run-queue-title-row {
  gap: 9px;
}

.run-queue-title-row h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.run-queue-heading > p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.run-queue-header-actions,
.run-queue-actions {
  gap: 7px;
}

.run-queue-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.run-queue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.run-queue-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(160px, 0.8fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  padding: 12px 18px;
  border-bottom: 1px solid #eceeea;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.run-queue-item[data-selected="true"] {
  background: linear-gradient(90deg, var(--green-soft), rgba(221, 248, 233, 0.22));
  box-shadow: inset 3px 0 var(--green);
}

.run-queue-identity,
.run-queue-progress {
  min-width: 0;
}

.run-queue-query {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.run-queue-meta,
.run-queue-progress-copy,
.run-queue-time {
  color: var(--muted);
  font-size: 0.68rem;
}

.run-queue-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-queue-time {
  display: block;
  margin-top: 3px;
}

.run-queue-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.run-queue-progress progress {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e5e8e3;
  appearance: none;
}

.run-queue-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5e8e3;
}

.run-queue-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}

.run-queue-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}

.run-state-badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf0ee;
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 780;
  white-space: nowrap;
}

.run-state-badge[data-state="running"],
.run-state-badge[data-state="done"] {
  background: var(--green-soft);
  color: #12673f;
}

.run-state-badge[data-state="queued"],
.run-state-badge[data-state="resuming"] {
  background: #e8eff2;
  color: #335765;
}

.run-state-badge[data-state="paused"],
.run-state-badge[data-state="exhausted_partial"] {
  background: var(--amber-soft);
  color: #815717;
}

.run-state-badge[data-state="error"] {
  background: var(--red-soft);
  color: #8e3232;
}

.run-state-badge[data-state="stopped"],
.run-state-badge[data-state="cancelled"] {
  background: #f2f0ee;
  color: #6f625a;
}

.run-queue-item-button[data-action="view"][aria-current="true"] {
  border-color: #9eddb8;
  background: var(--green-soft);
  color: #12673f;
}

.run-queue-message {
  margin: 12px 18px 0;
  padding: 9px 11px;
  border: 1px solid #efd59f;
  border-radius: 9px;
  background: var(--amber-soft);
  color: #815717;
  font-size: 0.72rem;
}

.run-queue-empty {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.run-queue-empty strong {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.run-queue-empty span {
  margin-top: 2px;
  font-size: 0.7rem;
}

.run-queue-more {
  display: flex;
  justify-content: center;
  padding: 10px 18px;
  border-top: 1px solid #eceeea;
}

.run-overview {
  margin-bottom: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
}

.run-status-row,
.run-status-copy {
  display: flex;
  align-items: center;
}

.run-status-row {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.run-status-copy {
  gap: 12px;
}

.run-status-copy p {
  margin: 0;
}

#run-status-title {
  font-size: 0.88rem;
  font-weight: 750;
}

.run-status-detail {
  margin-top: 1px !important;
  color: var(--muted);
  font-size: 0.74rem;
}

.run-indicator {
  position: relative;
  display: block;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a8b0b2;
}

.run-indicator[data-state="running"],
.run-indicator[data-state="complete"] {
  background: var(--green);
}

.run-indicator[data-state="running"]::after {
  position: absolute;
  inset: -5px;
  border: 1px solid var(--green);
  border-radius: 50%;
  content: "";
  animation: ping 1.5s ease-out infinite;
}

.run-indicator[data-state="error"] {
  background: var(--red);
}

.run-indicator[data-state="cancelled"],
.run-indicator[data-state="paused"] {
  background: var(--amber);
}

.run-indicator[data-state="partial"] {
  background: var(--amber);
}

.progress-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8e3;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transition: width 260ms ease;
}

.progress-track.is-indeterminate .progress-bar {
  width: 34% !important;
  animation: indeterminate 1.25s ease-in-out infinite;
}

.progress-track[data-state="partial"] .progress-bar,
.progress-track[data-state="paused"] .progress-bar {
  background: var(--amber);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  position: relative;
  display: grid;
  min-height: 134px;
  grid-template-columns: 39px 1fr;
  align-content: start;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card-accent {
  border-color: #bde9ce;
  background: linear-gradient(145deg, #effcf4, #fff);
}

.stat-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 11px;
  background: #edf0ee;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 850;
}

.stat-icon-emails {
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 1rem;
}

.stat-icon-bandwidth {
  background: #e8eff2;
  color: #335765;
  font-size: 1rem;
}

.stat-value-bandwidth {
  font-size: 1.55rem;
}

.stat-label {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stat-value {
  margin: 0;
  font-size: 1.82rem;
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  grid-column: 1 / -1;
  align-self: end;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.live-logs {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
}

.live-logs-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px 2px;
}

.live-logs-heading .eyebrow {
  margin-bottom: 4px;
}

.live-logs-heading h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.live-logs-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.live-logs-heading-actions > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
}

.live-logs-heading-actions .button {
  flex: none;
}

.log-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.log-panel-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(221, 225, 220, 0.86);
}

.log-panel-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.log-panel-identity h3 {
  margin-bottom: 2px;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

.log-panel-identity p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.log-channel-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

[data-log-channel="profile"] .log-channel-dot {
  background: #59a6bf;
  box-shadow: 0 0 0 4px #e3f0f4;
}

.log-count-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef1ee;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}

.log-viewport {
  max-height: 232px;
  overflow: auto;
  background: #10242c;
  color: #d9e5e8;
  scrollbar-color: #47606a #10242c;
}

.log-viewport:focus-visible {
  outline: 3px solid rgba(31, 200, 120, 0.42);
  outline-offset: -3px;
}

.log-list {
  min-height: 58px;
  margin: 0;
  padding: 5px 0;
  list-style: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  line-height: 1.55;
}

.log-entry {
  display: grid;
  grid-template-columns: 70px minmax(118px, 158px) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(218, 229, 232, 0.07);
}

.log-entry:last-child {
  border-bottom: 0;
}

.log-time {
  color: #78909a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-event {
  overflow: hidden;
  color: #75dba7;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.log-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.log-entry[data-tone="warning"] .log-event {
  color: #f0bd68;
}

.log-entry[data-tone="error"] .log-event {
  color: #ff8f8f;
}

.log-entry[data-tone="contact"] .log-event {
  color: #43e89a;
}

.log-entry[data-tone="success"] .log-event {
  color: #9be2bd;
}

.log-empty {
  padding: 18px 16px;
  color: #78909a;
  font-style: italic;
}

.results-section {
  min-height: 390px;
  margin-bottom: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.results-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid #e6e9e4;
}

.results-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.results-title-row h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.count-badge {
  display: inline-grid;
  min-width: 25px;
  min-height: 23px;
  place-items: center;
  border-radius: 999px;
  padding-inline: 7px;
  background: #eef1ee;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.results-actions,
.filter-group {
  display: flex;
  align-items: center;
}

.results-actions {
  gap: 12px;
}

.filter-group {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.filter-button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.filter-button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(16, 33, 43, 0.1);
}

.message-banner {
  margin: 16px 20px 0;
  padding: 12px 14px;
  border: 1px solid #efcaca;
  border-radius: 11px;
  background: var(--red-soft);
  color: #8e3232;
  font-size: 0.8rem;
}

.message-banner strong {
  margin-right: 5px;
}

.message-banner[data-kind="success"] {
  border-color: #bde9ce;
  background: var(--green-soft);
  color: #12673f;
}

.message-banner[data-kind="warning"] {
  border-color: #efd59f;
  background: var(--amber-soft);
  color: #815717;
}

.empty-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  padding: 50px 20px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  width: 92px;
  height: 76px;
  place-items: center;
  margin-bottom: 18px;
}

.empty-ring {
  position: absolute;
  border: 1px solid #cdd8d1;
  border-radius: 50%;
}

.empty-ring-one {
  width: 84px;
  height: 43px;
  transform: rotate(24deg);
}

.empty-ring-two {
  width: 84px;
  height: 43px;
  transform: rotate(-24deg);
}

.empty-core {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: var(--green);
  box-shadow: 0 7px 18px rgba(16, 42, 51, 0.18);
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.empty-state > p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.example-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.example-chip {
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.7rem;
  transition: border-color 140ms ease, background 140ms ease;
}

.example-chip:hover {
  border-color: #a6cfb5;
  background: var(--green-soft);
}

.loading-state {
  padding: 13px 20px 20px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 46px 1.1fr 0.8fr 0.45fr;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid #edf0ec;
}

.skeleton {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ece8;
}

.skeleton::after {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  content: "";
  animation: skeleton 1.35s ease-in-out infinite;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.skeleton-medium {
  max-width: 220px;
}

.skeleton-short {
  max-width: 100px;
}

.results-table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table th {
  padding: 11px 16px;
  border-bottom: 1px solid #e6e9e4;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-align: left;
  text-transform: uppercase;
}

.results-table th:nth-child(1) {
  width: 19%;
}

.results-table th:nth-child(2) {
  width: 11%;
}

.results-table th:nth-child(3) {
  width: 13%;
}

.results-table th:nth-child(4) {
  width: 24%;
}

.results-table th:nth-child(5) {
  width: 24%;
}

.results-table th:nth-child(6) {
  width: 9%;
}

.results-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #edf0ec;
  vertical-align: top;
  font-size: 0.76rem;
}

.results-table tbody tr {
  transition: background 140ms ease;
}

.results-table tbody tr:hover {
  background: #fcfdfa;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.profile-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-identity {
  min-width: 0;
}

.profile-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle:hover {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.follower-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.follower-value {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follower-label,
.follower-empty {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
}

.region-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.bio-location {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  border: 1px solid #cfe5d7;
  border-radius: 999px;
  padding: 2px 7px;
  overflow: hidden;
  background: #f2faf5;
  color: var(--green-dark);
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bio-location::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.region-source,
.region-empty {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
}

.bio-copy {
  display: -webkit-box;
  max-width: 390px;
  overflow: hidden;
  margin: 0 0 7px;
  color: var(--ink-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.bio-empty {
  color: #9aa4a7;
  font-style: italic;
}

.link-list,
.email-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.link-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
}

.link-chip::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.link-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-chip:hover span {
  text-decoration: underline;
}

.more-chip {
  color: var(--muted);
  font-size: 0.64rem;
}

.email-item {
  width: 100%;
}

.email-copy {
  min-width: 0;
}

.email-address-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.email-link {
  display: inline-block;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-link:hover {
  color: var(--green-dark);
}

.source-label {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #a6cfb5;
  color: var(--green-dark);
}

.copy-icon {
  position: relative;
  width: 12px;
  height: 12px;
  color: currentColor;
}

.copy-icon::before,
.copy-icon::after {
  position: absolute;
  width: 7px;
  height: 8px;
  border: 1.4px solid currentColor;
  border-radius: 2px;
  content: "";
}

.copy-icon::before {
  top: 0;
  right: 0;
}

.copy-icon::after {
  bottom: 0;
  left: 0;
  background: #fff;
}

.icon-button.is-copied {
  border-color: #99d9b0;
  background: #edfaf2;
  color: var(--green-dark);
}

.icon-button.is-copied .copy-icon::before {
  top: 0;
  left: 3px;
  width: 5px;
  height: 9px;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  transform: rotate(45deg);
}

.icon-button.is-copied .copy-icon::after {
  display: none;
}

.no-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a969a;
  font-size: 0.7rem;
}

.no-contact::before {
  width: 6px;
  height: 6px;
  border: 1px solid #aeb7b9;
  border-radius: 50%;
  content: "";
}

.row-action {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
}

.row-action:hover {
  border-color: #a6cfb5;
  color: var(--green-dark);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 4px 34px;
  color: var(--muted);
  font-size: 0.68rem;
}

.site-footer p {
  margin: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes ping {
  from {
    opacity: 0.65;
    transform: scale(0.7);
  }
  to {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes indeterminate {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(330%);
  }
}

@keyframes skeleton {
  from {
    transform: translateX(-160%);
  }
  to {
    transform: translateX(260%);
  }
}

@media (max-width: 960px) {
  .search-fields {
    grid-template-columns: minmax(220px, 1.25fr) repeat(2, minmax(110px, 0.55fr));
  }

  .proxy-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-queue-item {
    grid-template-columns: minmax(190px, 1.2fr) minmax(140px, 0.8fr) auto;
  }

  .run-queue-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-actions {
    width: 100%;
    justify-content: space-between;
  }

  .results-table {
    min-width: 1000px;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(calc(100% - 24px), var(--shell));
  }

  .header-inner {
    min-height: 67px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-key-button {
    padding-inline: 9px;
  }

  .header-meta {
    font-size: 0;
  }

  .header-meta::after {
    content: "Live";
    font-size: 0.74rem;
  }

  .discovery-section {
    padding-block: 20px 18px;
  }

  .search-panel {
    padding: 17px;
    border-radius: 18px;
  }

  .search-fields {
    grid-template-columns: 1fr 1fr;
  }

  .field-query {
    grid-column: 1 / -1;
  }

  .field-target-count {
    grid-column: 1 / -1;
  }

  .proxy-fields {
    grid-template-columns: 1fr;
  }

  .search-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-note-stack {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .button-group {
    width: 100%;
  }

  .button-group .button {
    flex: 1;
  }

  .run-queue-header {
    align-items: flex-start;
  }

  .run-queue-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .run-queue-progress {
    grid-column: 1;
  }

  .run-state-badge {
    grid-column: 2;
    grid-row: 1;
  }

  .run-queue-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
  }

  .run-status-detail {
    max-width: 250px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 124px;
    padding: 15px;
  }

  .live-logs-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .live-logs-heading-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .live-logs-heading-actions > p {
    text-align: left;
  }

  .log-panel-header {
    align-items: flex-start;
  }

  .log-entry {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 3px 10px;
    padding-inline: 13px;
  }

  .log-message {
    grid-column: 1 / -1;
  }

  .results-section {
    border-radius: 18px;
  }

  .results-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .filter-button {
    flex: 1;
  }

  .button-export {
    width: 100%;
  }

  .results-table-wrap {
    overflow: visible;
  }

  .results-table,
  .results-table tbody,
  .results-table tr,
  .results-table td {
    display: block;
    width: 100%;
  }

  .results-table {
    min-width: 0;
  }

  .results-table thead {
    display: none;
  }

  .results-table tbody {
    padding: 0 14px 14px;
  }

  .results-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-top: 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .results-table td {
    padding: 0;
    border: 0;
  }

  .results-table td:nth-child(1) {
    grid-column: 1;
  }

  .results-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding-left: 8px;
    text-align: right;
  }

  .results-table td:nth-child(3),
  .results-table td:nth-child(4),
  .results-table td:nth-child(5) {
    grid-column: 1 / -1;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #edf0ec;
  }

  .results-table td:nth-child(6) {
    grid-column: 1 / -1;
    margin-top: 12px;
  }

  .profile-avatar {
    width: 35px;
    height: 35px;
  }

  .bio-copy {
    max-width: none;
  }

  .email-list {
    max-width: 370px;
  }

  .row-action {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .auth-gate {
    padding: 16px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .brand-copy span {
    display: none;
  }

  .search-fields {
    grid-template-columns: 1fr;
  }

  .field-query {
    grid-column: auto;
  }

  .field-target-count {
    grid-column: auto;
  }

  .run-queue-header {
    align-items: stretch;
    flex-direction: column;
  }

  .run-queue-header-actions {
    width: 100%;
  }

  .run-queue-header-actions .button {
    flex: 1;
  }

  .run-queue-item {
    grid-template-columns: 1fr;
  }

  .run-queue-progress,
  .run-state-badge,
  .run-queue-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .run-state-badge {
    justify-self: start;
  }

  .run-queue-actions {
    width: 100%;
  }

  .run-queue-actions .button {
    flex: 1;
  }

  .follower-fields {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 110px;
  }

  .live-logs-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .live-logs-heading-actions .button {
    width: 100%;
  }

  .results-header {
    padding: 16px;
  }

  .run-status-detail {
    max-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
