:root {
  --mk-primary: #2563eb;
  --mk-primary-dark: #1d4ed8;
  --mk-accent: #3b82f6;
  --mk-text: #111827;
  --mk-muted: #6b7280;
  --mk-border: #e5e7eb;
  --mk-bg: #ffffff;
  --mk-bg-soft: #f7f8fc;
  --mk-danger: #dc2626;
  --mk-radius: 16px;
  --mk-radius-sm: 10px;
  --mk-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --mk-shadow-hover: 0 4px 10px rgba(17, 24, 39, 0.06), 0 16px 36px rgba(17, 24, 39, 0.10);
}

.mk-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
.mk-narrow { max-width: 860px; }

/* ---------- Hero ---------- */
.mk-hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  color: #ffffff;
  padding: 64px 0 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mk-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.mk-title {
  font-size: 44px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: #ffffff;
}
.mk-intro {
  max-width: 680px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Tool layout ---------- */
.mk-tool {
  background: var(--mk-bg-soft);
  padding: 0 0 56px;
}
.mk-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: -56px;
  position: relative;
  z-index: 1;
}
.mk-panel {
  background: var(--mk-bg);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: 28px;
  box-shadow: var(--mk-shadow);
  color: var(--mk-text);
  box-sizing: border-box;
  min-width: 0;
}
.mk-form-panel { position: sticky; top: 20px; }
.mk-results-panel { min-height: 460px; }

.mk-panel-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

/* ---------- Form ---------- */
.mk-field { margin-bottom: 16px; }
.mk-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--mk-text);
}
.mk-muted { color: var(--mk-muted); font-weight: 400; }
.mk-req { color: var(--mk-danger); }

.mk-field input,
.mk-field select,
.mk-field textarea,
#mk-filter {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius-sm);
  background: #fbfbfe;
  color: var(--mk-text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.mk-field textarea { resize: vertical; min-height: 64px; }
.mk-field input:hover,
.mk-field select:hover,
.mk-field textarea:hover { border-color: #c7c9e2; }
.mk-field input:focus,
.mk-field select:focus,
.mk-field textarea:focus,
#mk-filter:focus {
  outline: none;
  border-color: var(--mk-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.mk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mk-row .mk-field { min-width: 0; }

.mk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---------- Buttons ---------- */
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.mk-btn:hover { transform: translateY(-1px); }
.mk-btn:active { transform: translateY(0); }
.mk-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.mk-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}
.mk-btn-primary:hover { box-shadow: 0 10px 22px rgba(79, 70, 229, 0.34); }

.mk-btn-ghost {
  background: #ffffff;
  color: var(--mk-text);
  border-color: var(--mk-border);
}
.mk-btn-ghost:hover { border-color: #c7c9e2; color: var(--mk-primary); }

.mk-btn-small {
  padding: 7px 14px;
  font-size: 13px;
  background: #eef0ff;
  color: var(--mk-primary);
  border-color: #dfe2ff;
}
.mk-btn-small:hover { background: #e0e3ff; }

.mk-error {
  color: var(--mk-danger);
  font-size: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: var(--mk-radius-sm);
  margin: 14px 0 0;
}
.mk-error[hidden] { display: none; }

/* ---------- Tips ---------- */
.mk-tips {
  margin-top: 24px;
  padding: 18px;
  background: var(--mk-bg-soft);
  border-radius: var(--mk-radius-sm);
}
.mk-tips h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.mk-tips ul {
  margin: 0;
  padding-left: 18px;
  color: var(--mk-muted);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- Results ---------- */
.mk-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.mk-results-head .mk-panel-title { margin-bottom: 0; }
.mk-results-head .mk-btn-small[hidden] { display: none; }

.mk-empty {
  text-align: center;
  color: var(--mk-muted);
  font-size: 15px;
  line-height: 1.7;
  padding: 56px 16px;
  border: 2px dashed var(--mk-border);
  border-radius: var(--mk-radius);
}
.mk-empty[hidden] { display: none; }

.mk-loading {
  padding: 48px 8px;
  text-align: center;
  color: var(--mk-muted);
  font-size: 15px;
}
.mk-loading[hidden] { display: none; }
.mk-loading::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid #e0e3ff;
  border-top-color: var(--mk-primary);
  border-radius: 50%;
  animation: mk-spin 0.8s linear infinite;
}
@keyframes mk-spin { to { transform: rotate(360deg); } }

#mk-result[hidden] { display: none; }

.mk-out-block { margin-bottom: 22px; }
.mk-out-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mk-muted);
  margin-bottom: 10px;
}

.mk-subjects { margin: 0; padding: 0; list-style: none; }
.mk-subject-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius-sm);
  margin-bottom: 8px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}
.mk-subject-row:hover {
  border-color: #c7c9e2;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}
.mk-subject-text {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mk-preview {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--mk-muted);
  overflow-wrap: anywhere;
}

.mk-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.75;
  padding: 20px;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius-sm);
  background: var(--mk-bg-soft);
  color: var(--mk-text);
}

/* ---------- Sections ---------- */
.mk-section { padding: 72px 0; color: var(--mk-text); }
.mk-alt { background: var(--mk-bg-soft); }

.mk-h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-align: center;
}
.mk-h2-left { text-align: left; margin-top: 44px; }
.mk-prose .mk-h2:first-child { text-align: left; }

.mk-prose p {
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
  margin: 0 0 16px;
}

/* SEO example cards */
.mk-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 8px;
}
.mk-card {
  background: var(--mk-bg);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: 24px;
  box-shadow: var(--mk-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mk-card:hover { transform: translateY(-3px); box-shadow: var(--mk-shadow-hover); }
.mk-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.mk-card p { font-size: 15px; line-height: 1.7; color: var(--mk-muted); margin: 0 0 12px; }
.mk-example {
  font-size: 14px !important;
  color: var(--mk-text) !important;
  background: #f3f4ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 !important;
}

.mk-checklist {
  padding-left: 0;
  list-style: none;
  margin: 0 0 16px;
}
.mk-checklist li {
  position: relative;
  padding: 8px 0 8px 32px;
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  border-bottom: 1px solid var(--mk-border);
}
.mk-checklist li:last-child { border-bottom: 0; }
.mk-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef0ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* Benefits */
.mk-benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.mk-benefit {
  background: var(--mk-bg);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: 24px;
  box-shadow: var(--mk-shadow);
}
.mk-benefit h3 { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.mk-benefit p { font-size: 14px; color: var(--mk-muted); margin: 0; line-height: 1.7; }

/* FAQ */
.mk-faq { display: flex; flex-direction: column; gap: 12px; }
.mk-faq-item {
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius-sm);
  background: var(--mk-bg);
  overflow: hidden;
  box-shadow: var(--mk-shadow);
}
.mk-faq-q {
  width: 100%;
  text-align: left;
  padding: 18px 52px 18px 20px;
  background: none;
  border: 0;
  color: var(--mk-text);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  position: relative;
}
.mk-faq-q::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: #eef0ff;
  color: var(--mk-primary);
  font-size: 18px;
  font-weight: 600;
}
.mk-faq-q.active::after { content: '\2212'; }
.mk-faq-a {
  display: none;
  padding: 0 20px 18px;
  font-size: 15px;
  color: var(--mk-muted);
  line-height: 1.75;
}
.mk-faq-a.open { display: block; }

/* ---------- Ad slots (placed between sections only) ---------- */
.mk-ad {
  max-width: 1140px;
  margin: 8px auto 24px;
  padding: 0 16px;
  box-sizing: border-box;
  text-align: center;
}
.mk-ad-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mk-muted);
  margin-bottom: 6px;
}
.mk-ad-inner {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .mk-workspace { grid-template-columns: 1fr; margin-top: -40px; }
  .mk-form-panel { position: static; }
  .mk-benefits { grid-template-columns: repeat(2, 1fr); }
  .mk-cards { grid-template-columns: 1fr; }
  .mk-title { font-size: 36px; }
  .mk-section { padding: 56px 0; }
}

@media (max-width: 575px) {
  .mk-container { padding: 0 16px; }
  .mk-hero { padding: 44px 0 80px; }
  .mk-title { font-size: 30px; }
  .mk-intro { font-size: 16px; }
  .mk-panel { padding: 20px; }
  .mk-row { grid-template-columns: 1fr; }
  .mk-benefits { grid-template-columns: 1fr; }
  .mk-h2 { font-size: 24px; }
  .mk-prose p { font-size: 15px; }
  .mk-subject-row { flex-wrap: wrap; }
  .mk-subject-row .mk-copy { flex: 0 0 auto; }
  .mk-actions .mk-btn { flex: 1 1 100%; }
}