:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.5;
  color: #1a1a2e;
  background: #f4f6fb;
  --site-max-width: 1200px;
  --site-padding-x: 15px;
  --field-bg: #fff;
  --field-border: #d5dce8;
  --field-border-hover: #b8c5d9;
  --field-border-focus: #6366f1;
  --field-radius: 10px;
  --field-shadow-focus: 0 0 0 3px rgba(99, 102, 241, 0.14);
  --field-padding: 11px 14px;
  --label-color: #334155;
  --label-size: 13px;
  --app-card-radius: 16px;
  --app-accent: #6366f1;
  --app-accent-dark: #4f46e5;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

#root {
  min-height: 100vh;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-shell > .landing-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.site-container {
  width: 100%;
  max-width: var(--site-max-width);
  margin-inline: auto;
  padding-inline: var(--site-padding-x);
  box-sizing: border-box;
}

/* Page shells share site-container — keep 1200px cap even if a page class sets max-width */
.main.site-container,
.site-container.project-detail,
.site-container.dashboard-page,
.site-container.billing-page,
.site-container.billing-stub,
.admin-main.site-container,
.site-container.blog-page,
.site-container.blog-layout,
.site-container.author-layout,
.help-layout.site-container {
  max-width: var(--site-max-width);
}

a { color: #3b5bdb; }

.auth-brand, .dash-brand {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #6366f1;
  text-decoration: none;
}

.dash-brand { font-size: 22px; margin-bottom: 0; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--site-padding-x);
}

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

.card {
  background: #fff;
  border-radius: var(--app-card-radius);
  padding: 24px 28px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 8px 28px rgba(15, 23, 42, 0.06);
  border: 1px solid #e8ecf3;
  width: 100%;
}

.auth-page .card {
  width: min(100%, 440px);
  padding: 28px 32px;
}

.card h1, .card h2 { margin-top: 0; }

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: var(--label-size);
  font-weight: 600;
  color: var(--label-color);
  letter-spacing: 0.01em;
}

input, textarea, button, select {
  font: inherit;
}

input:not([type='checkbox']):not([type='radio']),
textarea,
select {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  padding: var(--field-padding);
  background-color: var(--field-bg);
  color: #0f172a;
  font-size: 15px;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

input:not([type='checkbox']):not([type='radio']):hover,
textarea:hover,
select:hover {
  border-color: var(--field-border-hover);
}

input:not([type='checkbox']):not([type='radio']):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--field-border-focus);
  box-shadow: var(--field-shadow-focus);
}

input:not([type='checkbox']):not([type='radio']):disabled,
textarea:disabled,
select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f8fafc;
}

input:not([type='checkbox']):not([type='radio'])::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  border: 1px solid var(--field-border) !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  transition: background-color 99999s ease-out 0s;
}

button {
  border: none;
  border-radius: var(--field-radius);
  padding: 11px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: #fff;
  color: #334155;
  border: 1px solid var(--field-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

button.secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: var(--field-border-hover);
  filter: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.error { color: #c92a2a; }
.muted { color: #6c757d; font-size: 14px; }
.bonus { color: #2b8a3e; font-weight: 600; }

.layout {
  min-height: 100vh;
}

.header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 20px;
  position: relative;
}

.header-brand {
  min-width: 0;
}

.header-tagline {
  margin: 2px 0 0;
}

.header h1 { margin: 0; font-size: 22px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.header-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  background: #edf2ff;
  color: #364fc7;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.main {
  padding-block: 28px 40px;
  display: grid;
  gap: 20px;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  margin-top: 4px;
}

.grid-form label {
  margin-bottom: 14px;
}

.grid-form .full { grid-column: 1 / -1; }

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field input {
  padding-right: 44px;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.password-field__toggle:hover {
  color: #334155;
  background: #f1f5f9;
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--field-border-focus);
  outline-offset: 1px;
}

.password-field__icon {
  display: block;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.field-hint--ok {
  color: #15803d;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.project-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-list li:hover {
  border-color: #d5dce8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.project-list li > div {
  display: grid;
  gap: 4px;
}

.project-detail-header {
  margin-bottom: 16px;
}

.project-detail-header h1 {
  margin: 0 0 4px;
}

.billing-page h1 {
  margin: 0 0 4px;
}

.billing-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.billing-packages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.billing-package {
  position: relative;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.billing-package-popular {
  border-color: #6366f1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.billing-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.billing-price {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.billing-tokens {
  margin: 0;
  font-size: 14px;
  color: #364fc7;
  font-weight: 600;
}

.billing-hint {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.billing-stub-details {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 10px;
}

.billing-stub-details li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.billing-stub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.badge-link {
  text-decoration: none;
  color: inherit;
}

.billing-dash-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.billing-dash-card h2 {
  margin: 0 0 4px;
}

@media (max-width: 1024px) {
  .billing-packages { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .billing-packages { grid-template-columns: 1fr; }
}

.legal-page {
  min-height: 100vh;
  background: #f6f8fc;
}

.legal-header {
  background: #070b14;
  color: #fff;
}

.legal-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 18px;
}

.legal-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.legal-back {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}

.legal-back:hover { color: #fff; }

.legal-content {
  width: 100%;
  margin: 32px 0;
  padding: 32px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.08);
  box-sizing: border-box;
}

.legal-date {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 14px;
}

.legal-content h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.legal-intro {
  margin: 0 0 28px;
  color: #475569;
  font-size: 17px;
  line-height: 1.65;
}

.legal-section {
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
}

.legal-section + .legal-section { margin-top: 22px; }

.legal-section h2,
.sitemap-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.legal-section p,
.legal-section li {
  color: #334155;
  line-height: 1.65;
}

.legal-section ul {
  margin: 0;
  padding-left: 22px;
}

.sitemap-content {
  display: grid;
  gap: 24px;
}

.sitemap-section {
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
}

.sitemap-links,
.sitemap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sitemap-links a,
.sitemap-tags span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf2ff;
  color: #364fc7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav-link-inline {
  color: #6366f1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-back-top {
  align-self: flex-start;
  margin-bottom: 12px;
  border: none;
  background: transparent;
  color: #6366f1;
  cursor: pointer;
  font: inherit;
  padding: 0;
  box-shadow: none;
  font-weight: 600;
}

.auth-back-top:hover:not(:disabled) {
  filter: none;
  box-shadow: none;
  color: #4f46e5;
}

.auth-shell {
  width: min(100%, 480px);
  display: grid;
}

.impersonation-banner {
  background: #fff3bf;
  color: #5c4b00;
  border-bottom: 1px solid #ffe08a;
}

.impersonation-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 10px;
}

.impersonation-banner button {
  background: #f08c00;
  white-space: nowrap;
  box-shadow: none;
}

.admin-main {
  padding-block: 32px 48px;
}

.admin-page h1 {
  margin: 0 0 8px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.admin-stat-card,
.admin-link-card {
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.admin-stat-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.admin-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-link-card {
  color: #364fc7;
  font-weight: 700;
  text-decoration: none;
}

.admin-table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f8fafc;
  font-size: 13px;
}

.admin-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf2ff;
  color: #364fc7;
  font-size: 11px;
  font-weight: 700;
}

.admin-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 20px;
  padding: 5px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
}

.admin-tabs button {
  background: transparent;
  color: #475569;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: none;
}

.admin-tabs button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.55);
  filter: none;
  box-shadow: none;
}

.admin-tabs button.active {
  background: #fff;
  color: var(--app-accent);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.12);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 4px;
  align-items: center;
}

.admin-actions button {
  min-height: 44px;
}

.admin-actions select {
  width: auto;
  min-width: 180px;
  max-width: 100%;
}

.admin-preview {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf2ff;
  color: #364fc7;
  font-size: 14px;
}

/* Help / documentation */
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  padding: 32px 0 64px;
}

.help-toc {
  position: sticky;
  top: 88px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.help-toc-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.help-toc nav {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}

.help-toc nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
}

.help-toc nav a:hover,
.help-toc nav a.active {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.help-toc-cta {
  display: grid;
  gap: 8px;
}

.help-toc-app {
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

.help-content {
  padding: 32px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.help-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.help-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.help-header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
}

.help-lead {
  margin: 0;
  color: #64748b;
  font-size: 17px;
  line-height: 1.6;
}

.help-section {
  padding: 28px 0;
  border-bottom: 1px solid #e2e8f0;
}

.help-section:last-child { border-bottom: none; }

.help-section h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.help-section p,
.help-section li {
  color: #334155;
  line-height: 1.65;
  font-size: 15px;
}

.help-h3 {
  margin: 20px 0 10px;
  font-size: 16px;
}

.help-steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.help-pipeline {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0;
}

.help-table th,
.help-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.help-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.help-note {
  padding: 12px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border-left: 3px solid #6366f1;
  font-size: 14px !important;
  color: #475569 !important;
}

.help-code {
  padding: 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
}

.help-ok { color: #16a34a; font-weight: 600; }
.help-soon { color: #d97706; font-weight: 600; }

.help-faq {
  display: grid;
  gap: 10px;
}

.help-faq details {
  padding: 14px 18px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.help-faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.help-faq summary::-webkit-details-marker { display: none; }

.help-faq p {
  margin: 10px 0 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .grid-form { grid-template-columns: 1fr; }
}

/* Project connections */
.connection-checklist {
  margin-bottom: 0;
}

.connection-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.connection-steps li {
  display: grid;
  gap: 4px;
  padding: 12px 14px 12px 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  position: relative;
}

.connection-steps li::before {
  content: '○';
  position: absolute;
  left: 14px;
  top: 12px;
  color: #94a3b8;
  font-weight: 700;
}

.connection-steps li.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.connection-steps li.done::before {
  content: '✓';
  color: #059669;
}

.connection-steps li.partial {
  background: #fffbeb;
  border-color: #fde68a;
}

.connection-steps li.partial::before {
  content: '!';
  color: #d97706;
}

.connection-steps li span {
  font-size: 14px;
  color: #64748b;
}

.webmaster-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.webmaster-card h2 {
  margin: 0 0 4px;
}

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}

.status-pill--ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill--warn {
  background: #fef3c7;
  color: #92400e;
}

.webmaster-connect {
  display: grid;
  gap: 16px;
}

.webmaster-oauth-setup {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2, #fafafa);
}

.webmaster-oauth-setup summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.webmaster-oauth-setup summary::-webkit-details-marker {
  display: none;
}

.webmaster-oauth-body {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.webmaster-callback-url {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.webmaster-callback-url:hover {
  background: #f3f6ff;
  border-color: #9ab4ff;
}

.webmaster-callback-url:active {
  background: #e8eeff;
}

.webmaster-copy-done {
  border-color: #2e9e5b;
  color: #1a6b3c;
}

.webmaster-callback-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.webmaster-permissions-block {
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.webmaster-permissions-block .webmaster-guide-list {
  margin-bottom: 8px;
}

.webmaster-callback-block {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.webmaster-callback-label {
  margin: 0 0 8px;
}

.webmaster-callback-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.webmaster-guide-h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}

.webmaster-guide-steps {
  margin-top: 8px;
}

.webmaster-guide-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
}

.webmaster-guide-list li {
  margin-bottom: 6px;
}

.webmaster-guide-note {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: #fff8e6;
  border-radius: 6px;
  font-size: 0.88rem;
  color: #6b5a00;
}

.webmaster-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.webmaster-guide-table th,
.webmaster-guide-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.webmaster-guide-table th {
  background: #fff;
  font-weight: 600;
}

.webmaster-connected label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.webmaster-host-prompt {
  margin: 0 0 8px;
}

.webmaster-host-select {
  margin: 12px 0;
}

.webmaster-host-select label {
  margin: 0 0 8px;
}

.webmaster-hosts-refresh {
  margin-top: 4px;
}

.webmaster-hosts-error {
  color: var(--color-danger, #c0392b);
}

/* Field tooltips */
.field-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  max-width: 100%;
}

.field-label-text {
  line-height: 1.35;
}

.field-tip {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.field-tip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  padding: 0;
  flex-shrink: 0;
}

.field-tip-trigger:hover,
.field-tip-trigger:focus-visible {
  border-color: var(--app-accent, #2563eb);
  color: var(--app-accent, #2563eb);
  background: #eff6ff;
  outline: none;
}

.field-tip-popup {
  position: absolute;
  top: auto;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, calc(100vw - 32px));
  max-width: min(280px, calc(100vw - 32px));
  padding: 10px 12px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
}

.field-tip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.field-tip:hover,
.field-tip:focus-within {
  z-index: 10001;
}

.field-tip:hover .field-tip-popup,
.field-tip:focus-within .field-tip-popup {
  opacity: 1;
  visibility: visible;
}

.field-tip--fixed .field-tip-popup {
  position: fixed;
  bottom: auto;
  transform: none;
}

.field-tip--fixed .field-tip-popup::after {
  display: none;
}

label:has(.field-tip:hover),
label:has(.field-tip:focus-within),
.form-toggle:has(.field-tip:hover),
.form-toggle:has(.field-tip:focus-within),
.autopilot-card:has(.field-tip:hover),
.autopilot-card:has(.field-tip:focus-within) {
  position: relative;
  z-index: 30;
  overflow: visible;
}

@media (max-width: 640px) {
  .field-tip-popup {
    left: auto;
    right: -8px;
    transform: none;
    width: min(280px, calc(100vw - 48px));
  }

  .field-tip-popup::after {
    left: auto;
    right: 14px;
    transform: none;
  }
}
