body[data-page="geo-content-optimizer"] {
  background: #f8fafc;
  color: #0f172a;
}

body[data-page="geo-content-optimizer"] button,
body[data-page="geo-content-optimizer"] input,
body[data-page="geo-content-optimizer"] select,
body[data-page="geo-content-optimizer"] textarea {
  font: inherit;
}

body[data-page="geo-content-optimizer"] button {
  -webkit-tap-highlight-color: transparent;
}

body[data-page="geo-content-optimizer"] button:focus-visible,
body[data-page="geo-content-optimizer"] input:focus-visible,
body[data-page="geo-content-optimizer"] select:focus-visible,
body[data-page="geo-content-optimizer"] textarea:focus-visible,
body[data-page="geo-content-optimizer"] [contenteditable="true"]:focus-visible,
body[data-page="geo-content-optimizer"] summary:focus-visible {
  outline: 3px solid rgba(60, 63, 222, 0.2);
  outline-offset: 2px;
}

body[data-page="geo-content-optimizer"] svg {
  display: block;
}

.tool-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 2rem 48px;
  background: linear-gradient(135deg, #20249f 0%, #3c3fde 55%, #5b5ff2 100%);
  text-align: center;
}

.tool-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.tool-hero-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.tool-hero .breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
}

.tool-hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.tool-hero .breadcrumb a:hover {
  color: #ffffff;
}

.tool-hero h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.tool-hero h1 em {
  color: #b8baff;
  font-style: normal;
}

.tool-hero p {
  max-width: 580px;
  margin: 0 auto 23px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 500;
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.geo-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 2rem 42px;
}

.article-setup {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 20px 22px;
  border: 1.5px solid #dbe3ed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.query-field label,
.section-eyebrow {
  display: block;
  margin: 0 0 7px;
  color: #3c3fde;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.query-input-wrap {
  position: relative;
  max-width: 690px;
}

.query-input-wrap svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.query-input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 15px 0 42px;
  border: 1.5px solid #dbe3ed;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.86rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.query-input-wrap input::placeholder {
  color: #94a3b8;
}

.query-input-wrap input:focus {
  border-color: #3c3fde;
  box-shadow: 0 0 0 3px rgba(60, 63, 222, 0.1);
  outline: none;
}

.query-field p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.5;
}

.setup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.document-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: #64748b;
  font-size: 0.72rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a36a;
  box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.1);
}

.status-dot.saving {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.btn-primary,
.btn-secondary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border: 1px solid #3c3fde;
  background: #3c3fde;
  color: #ffffff;
}

.btn-primary:hover {
  border-color: #2a2db8;
  background: #2a2db8;
}

.btn-secondary {
  border: 1.5px solid #dbe3ed;
  background: #ffffff;
  color: #334155;
}

.btn-secondary:hover {
  border-color: #b9c4d2;
  background: #f8fafc;
}

.btn-primary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-wrap {
  position: relative;
}

.export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: 205px;
  padding: 6px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.export-menu button {
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  text-align: left;
  font-size: 0.76rem;
  cursor: pointer;
}

.export-menu button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.hidden-editor-settings {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.geo-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.editor-card,
.analysis-panel {
  border: 1.5px solid #dbe3ed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.editor-card {
  min-width: 0;
  overflow: visible;
}

.editor-card-header,
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e5eaf1;
}

.editor-card-header h2,
.analysis-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.editor-card-header .section-eyebrow,
.analysis-header .section-eyebrow,
.section-title-row .section-eyebrow,
.readability-hero .section-eyebrow {
  margin-bottom: 4px;
  font-size: 0.61rem;
}

.highlight-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #dbe3ed;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.highlight-toggle span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.highlight-toggle.active {
  border-color: #c6c8fb;
  background: #f0f0fe;
  color: #2a2db8;
}

.highlight-toggle.active span {
  background: #3c3fde;
}

.editor-canvas {
  position: relative;
  padding: 30px 34px 42px;
}

.title-input {
  width: 100%;
  min-height: 52px;
  padding: 0 0 20px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
  resize: none;
  overflow: hidden;
}

.title-input::placeholder {
  color: #a6b1bf;
}

.title-input:focus {
  outline: none;
}

.toolbar {
  position: sticky;
  top: 76px;
  z-index: 25;
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 25px;
  padding: 6px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.97);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(10px);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tool-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.tool-button:hover,
.tool-button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.09);
}

.tool-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-tool {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.84rem;
}

.format-select {
  width: 108px;
  height: 30px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
}

.format-select:hover {
  background: #ffffff;
}

.tool-separator {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: #dbe3ed;
}

.editor {
  min-height: 700px;
  color: #26354a;
  font-family: 'Poppins', sans-serif;
  font-size: 0.96rem;
  line-height: 1.82;
  overflow-wrap: anywhere;
  caret-color: #3c3fde;
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.editor:focus {
  outline: none;
}

.editor > :first-child {
  margin-top: 0;
}

.editor p {
  margin: 0 0 1.25em;
}

.editor h2,
.editor h3 {
  color: #0f172a;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.025em;
  scroll-margin-top: 135px;
}

.editor h2 {
  margin: 1.65em 0 0.62em;
  font-size: 1.47rem;
  line-height: 1.3;
}

.editor h3 {
  margin: 1.45em 0 0.52em;
  font-size: 1.12rem;
  line-height: 1.35;
}

.editor ul,
.editor ol {
  margin: 0 0 1.25em;
  padding-left: 1.45em;
}

.editor li {
  margin: 0.38em 0;
}

.editor a {
  color: #3c3fde;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.editor blockquote {
  margin: 1.45em 0;
  padding: 14px 18px;
  border-left: 3px solid #3c3fde;
  border-radius: 0 9px 9px 0;
  background: #f7f7ff;
  color: #475569;
}

::highlight(readability-medium) {
  background: #fff2ad;
  color: inherit;
}

::highlight(readability-hard) {
  background: #ffc9cf;
  color: inherit;
}

.selection-toolbar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, calc(-100% - 10px));
}

.selection-toolbar[hidden] {
  display: none;
}

.selection-toolbar.is-below {
  transform: translate(-50%, 10px);
}

.selection-toolbar button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.selection-toolbar button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.selection-toolbar svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selection-toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.editor-statusbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #e5eaf1;
  background: #fbfcfe;
}

.status-metrics,
.highlight-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: #64748b;
  font-size: 0.68rem;
}

.status-metrics strong {
  color: #334155;
  font-weight: 600;
}

.highlight-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-swatch.medium {
  background: #ffe681;
}

.legend-swatch.hard {
  background: #ffadb7;
}

.analysis-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.analysis-panel::-webkit-scrollbar {
  width: 7px;
}

.analysis-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.analysis-header {
  margin-bottom: 15px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #f1f5f9;
}

.tab {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: #ffffff;
  color: #3c3fde;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.09);
}

.tab-panel {
  padding-top: 15px;
}

.tab-panel[hidden] {
  display: none;
}

.score-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid #dfe0fb;
  border-radius: 12px;
  background: #f7f7ff;
}

.score-ring {
  --score: 0;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#3c3fde calc(var(--score) * 1%), #e2e5ef 0);
  position: relative;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #ffffff;
}

.score-ring[data-level="strong"] {
  background: conic-gradient(#16875f calc(var(--score) * 1%), #e2e5ef 0);
}

.score-ring[data-level="developing"] {
  background: conic-gradient(#d97706 calc(var(--score) * 1%), #e2e5ef 0);
}

.score-ring[data-level="weak"] {
  background: conic-gradient(#dc3545 calc(var(--score) * 1%), #e2e5ef 0);
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.score-ring-inner strong {
  color: #0f172a;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  line-height: 1;
}

.score-ring-inner span {
  color: #94a3b8;
  font-size: 0.58rem;
}

.score-copy .score-label {
  color: #3c3fde;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-copy h3 {
  margin: 3px 0 5px;
  color: #0f172a;
  font-size: 0.96rem;
  line-height: 1.25;
}

.score-copy p {
  margin: 0;
  color: #64748b;
  font-size: 0.69rem;
  line-height: 1.55;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 9px;
}

.mini-metric {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
  text-align: center;
}

.mini-metric span {
  display: block;
  min-height: 26px;
  color: #64748b;
  font-size: 0.56rem;
  line-height: 1.3;
}

.mini-metric strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 0.73rem;
}

.analysis-section {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid #e5eaf1;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.section-title-row h3 {
  margin: 0;
  color: #0f172a;
  font-size: 0.83rem;
  line-height: 1.35;
}

.mini-counter {
  min-width: 29px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
}

.blueprint-list,
.recommendation-list,
.clarity-list,
.outline-list {
  display: grid;
  gap: 7px;
}

.blueprint-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
}

.blueprint-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
}

.blueprint-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.blueprint-item.complete .blueprint-icon {
  background: #eaf8f2;
  color: #16875f;
}

.blueprint-item.partial .blueprint-icon {
  background: #fff6df;
  color: #b65f00;
}

.blueprint-copy {
  min-width: 0;
}

.blueprint-copy strong {
  display: block;
  color: #26354a;
  font-size: 0.69rem;
  line-height: 1.3;
}

.blueprint-copy span {
  display: block;
  margin-top: 2px;
  color: #7b899d;
  font-size: 0.57rem;
  line-height: 1.35;
}

.blueprint-points {
  color: #7b899d;
  font-size: 0.58rem;
  font-weight: 600;
}

.recommendation-card {
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
}

.recommendation-card.high {
  border-left: 3px solid #dc3545;
}

.recommendation-card.medium {
  border-left: 3px solid #d97706;
}

.recommendation-top {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.recommendation-number {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0f0fe;
  color: #3c3fde;
  font-size: 0.6rem;
  font-weight: 700;
}

.recommendation-title {
  min-width: 0;
  color: #26354a;
  font-size: 0.69rem;
  font-weight: 700;
}

.impact-pill {
  padding: 3px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.53rem;
  font-weight: 600;
  white-space: nowrap;
}

.recommendation-card p {
  margin: 7px 0 0 28px;
  color: #64748b;
  font-size: 0.61rem;
  line-height: 1.5;
}

.recommendation-actions {
  margin: 8px 0 0 28px;
}

.inline-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #3c3fde;
  font-size: 0.61rem;
  font-weight: 700;
  cursor: pointer;
}

.inline-action:hover {
  color: #2a2db8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.success-state,
.empty-state {
  padding: 12px;
  border: 1px solid #d8e9e1;
  border-radius: 9px;
  background: #f0faf6;
  color: #39715c;
  font-size: 0.66rem;
  line-height: 1.55;
}

.empty-state {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.copy-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
}

.copy-button:hover {
  background: #f8fafc;
  color: #3c3fde;
}

.copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.answer-preview {
  max-height: 150px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.66rem;
  line-height: 1.65;
}

.score-disclaimer {
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #dfe0fb;
  border-radius: 9px;
  background: #f7f7ff;
  color: #64748b;
  font-size: 0.6rem;
  line-height: 1.55;
}

.score-disclaimer strong {
  color: #334155;
}

.readability-hero {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.readability-badge {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #3c3fde;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.readability-hero h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 0.86rem;
}

.readability-hero p {
  margin: 0;
  color: #64748b;
  font-size: 0.62rem;
  line-height: 1.5;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 9px;
}

.stat-card {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
}

.stat-card span {
  display: block;
  color: #64748b;
  font-size: 0.57rem;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 0.78rem;
}

.distribution-list {
  display: grid;
  gap: 10px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 48px 1fr 22px;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.62rem;
}

.distribution-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.distribution-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #16875f;
}

.distribution-row:nth-child(2) .distribution-track i {
  background: #e4b33d;
}

.distribution-row:nth-child(3) .distribution-track i {
  background: #dc3545;
}

.distribution-row strong {
  color: #334155;
  text-align: right;
  font-size: 0.62rem;
}

.clarity-item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #ffffff;
}

.clarity-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff6df;
  color: #b65f00;
}

.clarity-item.good .clarity-icon {
  background: #eaf8f2;
  color: #16875f;
}

.clarity-item.bad .clarity-icon {
  background: #fff0f1;
  color: #c4323f;
}

.clarity-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clarity-copy strong {
  display: block;
  color: #334155;
  font-size: 0.65rem;
}

.clarity-copy span {
  display: block;
  margin-top: 2px;
  color: #7b899d;
  font-size: 0.55rem;
  line-height: 1.3;
}

.clarity-value {
  color: #64748b;
  font-size: 0.57rem;
  font-weight: 600;
  white-space: nowrap;
}

.outline-item {
  width: 100%;
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.outline-item.level-3 {
  margin-left: 12px;
  width: calc(100% - 12px);
}

.outline-item:hover {
  border-color: #c6c8fb;
  background: #f7f7ff;
}

.outline-level {
  color: #3c3fde;
  font-size: 0.58rem;
  font-weight: 700;
}

.outline-text {
  overflow: hidden;
  color: #334155;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  max-width: 330px;
  padding: 11px 14px;
  border-radius: 9px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25);
  font-size: 0.74rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.faq-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 2rem 64px;
}

.faq-title {
  margin: 0 0 20px;
  color: #0f172a;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.faq-item {
  border-bottom: 1px solid #dbe3ed;
}

.faq-item summary {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 30px 16px 0;
  color: #26354a;
  font-size: 0.86rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 2px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.faq-answer {
  padding: 0 32px 16px 0;
}

.faq-answer p {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.75;
}

@media (max-width: 1020px) {
  .geo-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .article-setup {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .setup-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 880px) {
  .geo-workspace {
    grid-template-columns: 1fr;
  }

  .analysis-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .editor {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .tool-hero {
    padding: 40px 1.25rem 36px;
  }

  .tool-hero h1 {
    font-size: 1.9rem;
  }

  .tool-hero p {
    font-size: 0.86rem;
  }

  .geo-page {
    padding: 36px 1.25rem 34px;
  }

  .article-setup {
    padding: 17px;
  }

  .setup-actions {
    align-items: stretch;
  }

  .document-status {
    width: 100%;
    margin: 0 0 3px;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1 1 auto;
  }

  .editor-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-canvas {
    padding: 24px 20px 34px;
  }

  .toolbar {
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .editor {
    min-height: 500px;
    font-size: 0.91rem;
  }

  .editor-statusbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .mini-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .mini-metric span {
    min-height: 0;
  }

  .mini-metric strong {
    margin-top: 0;
  }

  .faq-section {
    padding: 8px 1.25rem 48px;
  }
}

@media print {
  nav,
  .tool-hero,
  .article-setup,
  .analysis-panel,
  .editor-card-header,
  .toolbar,
  .editor-statusbar,
  .faq-section,
  footer,
  .selection-toolbar,
  .toast {
    display: none !important;
  }

  body[data-page="geo-content-optimizer"] {
    background: #ffffff;
  }

  .geo-page {
    max-width: 760px;
    padding: 0;
  }

  .geo-workspace {
    display: block;
    margin: 0;
  }

  .editor-card {
    border: 0;
    box-shadow: none;
  }

  .editor-canvas {
    padding: 0;
  }

  .editor {
    min-height: 0;
  }
}

/* =========================================================
   FINAL EDITOR STRUCTURE + MOBILE RESPONSIVENESS FIX
   ========================================================= */

body[data-page="geo-content-optimizer"] {
  overflow-x: clip;
}

body[data-page="geo-content-optimizer"] *,
body[data-page="geo-content-optimizer"] *::before,
body[data-page="geo-content-optimizer"] *::after {
  box-sizing: border-box;
}

.geo-page,
.geo-workspace,
.editor-column,
.editor-card,
.editor-card-header,
.editor-header-actions,
.editor-canvas,
.toolbar,
.editor,
.analysis-panel {
  min-width: 0;
  max-width: 100%;
}

.geo-page {
  width: 100%;
}

.geo-workspace {
  margin-top: 0;
}

.editor-card {
  overflow: hidden;
}

.editor-card-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.editor-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 440px;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.editor-header-actions .setup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* Article title / H1 */

.article-title-field {
  margin-bottom: 22px;
  min-width: 0;
}

.title-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #64748b;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.title-label strong {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #c6c8fb;
  border-radius: 999px;
  background: #f0f0fe;
  color: #3c3fde;
  font-size: 0.62rem;
  line-height: 1;
}

.title-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.04em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  caret-color: #3c3fde;
  resize: none;
  overflow: visible;
}

.title-input:empty::before {
  content: attr(data-placeholder);
  color: #a6b1bf;
  pointer-events: none;
}

.title-input:focus {
  outline: none;
}

/* Toolbar */

.toolbar {
  width: 100%;
  max-width: 100%;
}

.toolbar > *,
.tool-group,
.format-select,
.tool-separator {
  flex-shrink: 0;
}

.format-select {
  width: 116px;
}

/* Editor content */

.editor {
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.editor h2,
.editor h3,
.editor h4,
.editor h5,
.editor h6 {
  color: #0f172a;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  scroll-margin-top: 135px;
}

.editor h4 {
  margin: 1.3em 0 0.48em;
  font-size: 1rem;
  line-height: 1.4;
}

.editor h5 {
  margin: 1.2em 0 0.45em;
  font-size: 0.92rem;
  line-height: 1.45;
}

.editor h6 {
  margin: 1.15em 0 0.42em;
  font-size: 0.84rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Tablet and mobile */

@media (max-width: 760px) {
  .geo-page {
    width: 100%;
    padding: 28px 14px 32px;
  }

  .geo-workspace {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-card-header {
    padding: 16px;
  }

  .editor-header-actions {
    width: 100%;
    flex: 1 1 100%;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .editor-header-actions .setup-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .editor-header-actions .document-status {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0 0 2px;
  }

  .editor-header-actions .btn-primary,
  .editor-header-actions .btn-secondary,
  .editor-header-actions .menu-wrap {
    width: 100%;
    min-width: 0;
  }

  .editor-header-actions .btn-primary,
  .editor-header-actions .btn-secondary {
    padding-right: 8px;
    padding-left: 8px;
  }

  .editor-canvas {
    width: 100%;
    padding: 22px 16px 30px;
    overflow: hidden;
  }

  .title-input {
    font-size: clamp(1.55rem, 8vw, 2rem);
  }

  .toolbar {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar::-webkit-scrollbar {
    height: 5px;
  }

  .toolbar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
  }

  .editor {
    min-height: 480px;
    font-size: 0.9rem;
    line-height: 1.72;
  }

  .editor-statusbar {
    width: 100%;
    padding: 12px 16px;
  }

  .status-metrics,
  .highlight-legend {
    width: 100%;
    gap: 10px 12px;
  }

  .analysis-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
  }
}

/* Very small mobile screens */

@media (max-width: 380px) {
  .tool-hero {
    padding-right: 12px;
    padding-left: 12px;
  }

  .geo-page {
    padding-right: 10px;
    padding-left: 10px;
  }

  .editor-card,
  .analysis-panel {
    border-radius: 11px;
  }

  .editor-card-header,
  .editor-canvas,
  .analysis-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .highlight-toggle {
    max-width: 100%;
  }

  .editor-header-actions .setup-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-header-actions .document-status,
  .editor-header-actions .menu-wrap {
    grid-column: 1 / -1;
  }

  .format-select {
    width: 108px;
  }
}