/* Vital SEO — SEO Keyword Mapping Generator
   Tool-specific styling only. No shared component overrides. */

#tool-seo-keyword-mapping-generator {
  min-width: 0;
}

#keywordMappingForm {
  display: grid;
  gap: 14px;
}

#keywordMappingForm label {
  display: block;
  margin-bottom: 5px;
}

#keywordMappingForm input,
#keywordMappingForm select,
#keywordMappingForm textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #a8c6dc;
  border-radius: 10px;
  background: #fff;
  color: #183b59;
  font: inherit;
}

#keywordMappingForm textarea {
  min-height: 155px;
  resize: vertical;
}

#keywordMappingForm input:focus-visible,
#keywordMappingForm select:focus-visible,
#keywordMappingForm textarea:focus-visible,
#keywordMappingResult input:focus-visible {
  outline: 3px solid #69bdf4;
  outline-offset: 2px;
}

#keywordMappingForm [hidden],
#keywordMappingResult[hidden] {
  display: none !important;
}

#keywordMappingResult {
  margin-top: 26px;
  min-width: 0;
}

.keyword-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.keyword-map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-map-toolbar-actions button {
  min-height: 42px;
}

.keyword-map-summary {
  margin: 0 0 14px;
  color: #365d7d;
}

.keyword-map-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #bfd6e8;
  border-radius: 12px;
  background: #fff;
  overscroll-behavior-inline: contain;
}

.keyword-map-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.keyword-map-table th,
.keyword-map-table td {
  min-width: 145px;
  padding: 10px 12px;
  border-right: 1px solid #e0ebf3;
  border-bottom: 1px solid #e0ebf3;
  text-align: left;
  vertical-align: middle;
}

.keyword-map-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e7f3fc;
  color: #153f65;
  font-weight: 700;
  white-space: nowrap;
}

.keyword-map-table th:first-child,
.keyword-map-table td:first-child {
  position: sticky;
  left: 0;
  min-width: 270px;
  max-width: 330px;
  z-index: 1;
  background: #f4f9fd;
}

.keyword-map-table th:first-child {
  z-index: 3;
  background: #d8ebfa;
}

.keyword-map-table tbody tr:hover td {
  background-color: #f0f8ff;
}

.keyword-map-table td a {
  overflow-wrap: anywhere;
}

.keyword-map-table td.keyword-map-level {
  color: #215f92;
  font-weight: 650;
}

.keyword-map-table td input,
.keyword-map-table td select {
  width: 100%;
  min-width: 135px;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid #c7dbe9;
  border-radius: 7px;
  background: #fff;
  color: #183b59;
  font: inherit;
}

.keyword-map-message {
  padding: 12px 14px;
  border: 1px solid #c4ddef;
  border-radius: 9px;
  background: #f0f8fe;
  color: #234e70;
}

.keyword-map-message[role="alert"] {
  border-color: #dba7a7;
}

[data-theme="dark"] #keywordMappingForm input,
[data-theme="dark"] #keywordMappingForm select,
[data-theme="dark"] #keywordMappingForm textarea,
[data-theme="dark"] .keyword-map-table td input,
[data-theme="dark"] .keyword-map-table td select {
  background: #152e46;
  border-color: #466b88;
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-scroll {
  background: #12283e;
  border-color: #42637d;
}

[data-theme="dark"] .keyword-map-table th {
  background: #234a69;
  color: #f2f8ff;
}

[data-theme="dark"] .keyword-map-table td {
  border-color: #34536c;
  color: #e8f3fc;
}

[data-theme="dark"] .keyword-map-table td:first-child {
  background: #1c3b55;
}

[data-theme="dark"] .keyword-map-table th:first-child {
  background: #2a5575;
}

[data-theme="dark"] .keyword-map-table tbody tr:hover td {
  background: #294b66;
}

[data-theme="dark"] .keyword-map-table td.keyword-map-level {
  color: #9ad7ff;
}

[data-theme="dark"] .keyword-map-summary {
  color: #b8d5ea;
}

[data-theme="dark"] .keyword-map-message {
  background: #1c3d58;
  border-color: #426f90;
  color: #e6f5ff;
}

@media (max-width: 700px) {
  #keywordMappingForm {
    gap: 12px;
  }

  .keyword-map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .keyword-map-toolbar-actions {
    width: 100%;
  }

  .keyword-map-toolbar-actions button {
    flex: 1 1 130px;
  }

  .keyword-map-table th:first-child,
  .keyword-map-table td:first-child {
    min-width: 190px;
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tool-seo-keyword-mapping-generator *,
  #tool-seo-keyword-mapping-generator *::before,
  #tool-seo-keyword-mapping-generator *::after {
    scroll-behavior: auto;
  }
}


/* Keyword mapping workspace popup */
.keyword-map-launch {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #bfd6e8;
  border-radius: 12px;
  background: #f2f8fd;
}

.keyword-map-launch[hidden],
.keyword-map-overlay[hidden] {
  display: none !important;
}

.keyword-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 26, 43, .72);
  box-sizing: border-box;
}

.keyword-map-dialog {
  display: flex;
  flex-direction: column;
  width: min(1500px, 96vw);
  height: min(850px, 90dvh);
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  color: #183b59;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .3);
}

.keyword-map-dialog.is-fullscreen {
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
}

.keyword-map-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid #d7e5f0;
  flex-shrink: 0;
}

.keyword-map-dialog-header h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.keyword-map-dialog-header p {
  margin: 0;
  font-size: 14px;
}

.keyword-map-dialog-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.keyword-map-dialog-controls button {
  padding: 10px 14px;
  border: 1px solid #a8c6dc;
  border-radius: 10px;
  background: #e7f3fc;
  color: #153f65;
  font: inherit;
  cursor: pointer;
}

.keyword-map-dialog-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
}

.keyword-map-dialog-content #keywordMappingResult {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.keyword-map-dialog-content .keyword-map-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.keyword-map-modal-open {
  overflow: hidden;
}

[data-theme="dark"] .keyword-map-dialog {
  background: #10283e;
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-dialog-header {
  border-color: #42637d;
}

[data-theme="dark"] .keyword-map-dialog-controls button {
  background: #234a69;
  border-color: #466b88;
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-launch {
  background: #1c3d58;
  border-color: #426f90;
}

@media (max-width: 700px) {
  .keyword-map-overlay {
    padding: 0;
  }

  .keyword-map-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .keyword-map-dialog-header {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .keyword-map-dialog-content {
    padding: 10px;
  }
}


/* Keyword mapping search volume columns */
.keyword-map-table th:nth-child(2n + 9),
.keyword-map-table td.keyword-map-sv {
  min-width: 78px;
  width: 78px;
  max-width: 78px;
  padding: 8px 7px;
  background: #e2f0fb;
  text-align: center;
}

.keyword-map-table th:nth-child(2n + 9) {
  background: #cfe5f6;
  color: #153f65;
}

.keyword-map-table td.keyword-map-sv input {
  width: 100%;
  min-width: 0;
  padding: 7px 5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.keyword-map-table tbody tr:hover td.keyword-map-sv {
  background: #d3e9f9;
}

[data-theme="dark"] .keyword-map-table th:nth-child(2n + 9) {
  background: #315c7b;
  color: #f2f8ff;
}

[data-theme="dark"] .keyword-map-table td.keyword-map-sv {
  background: #244660;
}

[data-theme="dark"] .keyword-map-table tbody tr:hover td.keyword-map-sv {
  background: #305875;
}
\n
/* Keyword mapping automatic generation status */
#keywordMappingForm + .keyword-map-message {
  margin: 14px 0 0;
}

#keywordMappingForm + .keyword-map-message[hidden] {
  display: none !important;
}

#keywordMappingSubmit {
  display: none !important;
}


/* Keyword mapping full-screen workspace refinement */

/* Remove the overlay padding when the workspace is expanded. */
.keyword-map-overlay:has(.keyword-map-dialog.is-fullscreen) {
  padding: 0;
}

/* Occupy the entire available browser viewport. */
.keyword-map-dialog.is-fullscreen {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Keep the spreadsheet flexible inside the workspace. */
.keyword-map-dialog.is-fullscreen .keyword-map-dialog-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 18px 18px;
}

.keyword-map-dialog.is-fullscreen #keywordMappingResult {
  flex: 1 1 auto;
  min-height: 0;
}

.keyword-map-dialog.is-fullscreen .keyword-map-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Restore the page-ordering control appearance. */
.keyword-map-order-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #183b59;
}

.keyword-map-order-select {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #bfd6e8;
  border-radius: 10px;
  background: #fff;
  color: #183b59;
  font: inherit;
  cursor: pointer;
}

[data-theme="dark"] .keyword-map-order-label {
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-order-select {
  background: #193a54;
  border-color: #426b89;
  color: #edf7ff;
}

@media (max-width: 700px) {
  .keyword-map-dialog.is-fullscreen .keyword-map-dialog-content {
    padding: 10px;
  }

  .keyword-map-order-label {
    flex-wrap: wrap;
  }
}


/* Keyword Mapping Generator — mobile CSV-only workspace.
   The underlying spreadsheet data remains intact for CSV export
   and desktop editing. */

.keyword-map-mobile-note {
  display: none;
}

@media (max-width: 700px) {
  #keywordMappingFullscreen,
  .keyword-map-order-label,
  .keyword-map-scroll,
  #keywordMappingResult > .keyword-map-message {
    display: none !important;
  }

  .keyword-map-mobile-note {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid #bfd6e8;
    border-radius: 12px;
    background: #edf6fd;
    color: #183b59;
  }

  .keyword-map-mobile-note strong {
    display: block;
    margin-bottom: 8px;
  }

  .keyword-map-mobile-note p {
    margin: 0;
    line-height: 1.6;
  }

  .keyword-map-toolbar {
    align-items: stretch;
  }

  .keyword-map-toolbar-actions {
    width: 100%;
  }

  .keyword-map-toolbar-actions button {
    width: 100%;
  }

  .keyword-map-dialog-content {
    overflow-y: auto;
  }

  .keyword-map-dialog-content .keyword-map-scroll {
    display: none !important;
  }
}

@media (max-width: 700px) {
  [data-theme="dark"] .keyword-map-mobile-note {
    background: #193a54;
    border-color: #426b89;
    color: #edf7ff;
  }
}


/* Vital SEO — Keyword Mapping fixed-centre desktop watermark.
   Positioned independently of the scrollable spreadsheet. */

.keyword-map-dialog-content .keyword-map-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.keyword-map-dialog-content .keyword-map-viewport > .keyword-map-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.keyword-map-watermark {
  display: none;
}

@media (min-width: 701px) {
  .keyword-map-dialog-content .keyword-map-watermark {
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    max-width: 90%;
    color: #45698e;
    opacity: 0.08;
    font-family: Inter, sans-serif;
    font-size: clamp(18px, 3.5vw, 48px);
    font-weight: 700;
    letter-spacing: 0.025em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
  }

  [data-theme="dark"] .keyword-map-dialog-content
  .keyword-map-watermark {
    color: #c4ddf5;
    opacity: 0.10;
  }
}

@media (max-width: 700px) {
  .keyword-map-dialog-content .keyword-map-viewport {
    display: none;
  }
}

/* Keyword mapping guidance accordions */
#tool-seo-keyword-mapping-generator .keyword-map-guidance {
  margin: 18px 0 22px;
  padding: 15px 18px;
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background: #f8fbff;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance > summary {
  cursor: pointer;
  font-weight: 700;
  color: #183d72;
  line-height: 1.5;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance[open] > summary {
  margin-bottom: 14px;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance-content {
  line-height: 1.65;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance-content li {
  margin: 8px 0;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance-content p {
  margin: 0 0 12px;
}

#tool-seo-keyword-mapping-generator .keyword-map-guidance-content p:last-child {
  margin-bottom: 0;
}

html[data-theme="dark"] #tool-seo-keyword-mapping-generator .keyword-map-guidance {
  background: #172638;
  border-color: #3b536b;
  color: #c8d2df;
}

html[data-theme="dark"] #tool-seo-keyword-mapping-generator .keyword-map-guidance > summary {
  color: #dcecff;
}

html[data-theme="dark"] #tool-seo-keyword-mapping-generator .keyword-map-guidance-content,
html[data-theme="dark"] #tool-seo-keyword-mapping-generator .keyword-map-guidance-content li,
html[data-theme="dark"] #tool-seo-keyword-mapping-generator .keyword-map-guidance-content p {
  color: #c8d2df;
}


/* Keyword Mapping Generator — desktop-only Excel export */
@media (max-width: 700px) {
  .keyword-map-excel-button {
    display: none !important;
  }
}


/* Vital SEO — Keyword Mapping saved-progress controls */

.keyword-map-saved-progress {
  box-sizing: border-box;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #bfd6e8;
  border-radius: 12px;
  background: #f2f8fd;
  color: #234e70;
}

.keyword-map-saved-progress h3 {
  margin: 0 0 12px;
  color: #153f65;
}

.keyword-map-saved-progress p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.keyword-map-saved-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.keyword-map-saved-actions button {
  min-height: 44px;
}

.keyword-map-saved-actions button[hidden] {
  display: none !important;
}

.keyword-map-saved-notice {
  margin: 14px 0 0 !important;
  font-size: 0.94rem;
  color: #365d7d;
}

.keyword-map-save-status {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #365d7d;
}

.keyword-map-save-status[role="alert"] {
  color: #a12b35;
  font-weight: 600;
}

[data-theme="dark"] .keyword-map-saved-progress,
html[data-theme="dark"] .keyword-map-saved-progress {
  background: #1c3d58;
  border-color: #426f90;
  color: #e6f5ff;
}

[data-theme="dark"] .keyword-map-saved-progress h3,
html[data-theme="dark"] .keyword-map-saved-progress h3 {
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-saved-notice,
[data-theme="dark"] .keyword-map-save-status,
html[data-theme="dark"] .keyword-map-saved-notice,
html[data-theme="dark"] .keyword-map-save-status {
  color: #c4dff2;
}

[data-theme="dark"] .keyword-map-save-status[role="alert"],
html[data-theme="dark"] .keyword-map-save-status[role="alert"] {
  color: #ffb6bd;
}

@media (max-width: 700px) {
  .keyword-map-saved-progress {
    padding: 16px;
  }

  .keyword-map-saved-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .keyword-map-saved-actions button {
    width: 100%;
  }

  .keyword-map-save-status {
    width: 100%;
  }
}

/* Vital SEO — Keyword Mapping three-project manager */

.keyword-map-project-manager[hidden] {
  display: none !important;
}

.keyword-map-project-manager {
  margin-top: 20px;
}

.keyword-map-project-manager > label {
  display: block;
  margin-bottom: 8px;
  color: inherit;
}

.keyword-map-project-create-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.keyword-map-project-create-row > input {
  box-sizing: border-box;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #a9c7dc;
  border-radius: 10px;
  background: #fff;
  color: #183d5c;
  font: inherit;
}

.keyword-map-project-create-row > input:focus-visible {
  outline: 3px solid #73b8e8;
  outline-offset: 2px;
}

.keyword-map-project-count {
  margin: 12px 0 !important;
  font-size: 0.94rem;
  font-weight: 600;
}

.keyword-map-project-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.keyword-map-project-actions button {
  min-height: 44px;
}

.keyword-map-project-actions button[hidden] {
  display: none !important;
}

.keyword-map-project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.keyword-map-project-card {
  box-sizing: border-box;
  min-width: 0;
  padding: 20px;
  border: 1px solid #bfd6e8;
  border-radius: 10px;
  background: #fff;
  color: #234e70;
}

.keyword-map-project-card h4 {
  margin: 0 0 6px;
  color: #153f65;
  overflow-wrap: anywhere;
}

.keyword-map-project-card p {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.keyword-map-project-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.keyword-map-project-card-actions button {
  min-height: 44px;
}

.keyword-map-project-card-actions button[hidden] {
  display: none !important;
}

.keyword-map-project-card.is-active {
  border-color: #468bbd;
  box-shadow: 0 0 0 1px #468bbd;
}

[data-theme="dark"] .keyword-map-project-create-row > input,
html[data-theme="dark"] .keyword-map-project-create-row > input {
  background: #16334c;
  border-color: #6087a5;
  color: #f0f8ff;
}

[data-theme="dark"] .keyword-map-project-create-row > input::placeholder,
html[data-theme="dark"] .keyword-map-project-create-row > input::placeholder {
  color: #b9d2e4;
}

[data-theme="dark"] .keyword-map-project-card,
html[data-theme="dark"] .keyword-map-project-card {
  background: #17354e;
  border-color: #426f90;
  color: #e6f5ff;
}

[data-theme="dark"] .keyword-map-project-card h4,
html[data-theme="dark"] .keyword-map-project-card h4 {
  color: #f0f8ff;
}

[data-theme="dark"] .keyword-map-project-card.is-active,
html[data-theme="dark"] .keyword-map-project-card.is-active {
  border-color: #91cfff;
  box-shadow: 0 0 0 1px #91cfff;
}

@media (max-width: 700px) {
  .keyword-map-project-create-row > input {
    max-width: none;
  }

  .keyword-map-project-actions,
  .keyword-map-project-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .keyword-map-project-actions button,
  .keyword-map-project-card-actions button {
    width: 100%;
  }
}


/* Vital SEO — adjustable keyword mapping columns */
/* The colgroup controls widths; cells must not override them. */
@media (min-width: 701px) {
  .keyword-map-table {
    table-layout: fixed;
    min-width: 0;
  }

  .keyword-map-table th,
  .keyword-map-table td,
  .keyword-map-table th:first-child,
  .keyword-map-table td:first-child,
  .keyword-map-table th:nth-child(2n + 9),
  .keyword-map-table td.keyword-map-sv {
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    width: auto;
  }

  .keyword-map-table td input,
  .keyword-map-table td select {
    min-width: 0;
  }

  .keyword-map-table th {
    position: sticky;
  }

  .keyword-map-table th:first-child,
  .keyword-map-table td:first-child {
    left: 0;
  }

  .keyword-map-table td a {
    overflow-wrap: anywhere;
  }
}


/* Vital SEO — spreadsheet column resize handles */
@media (min-width: 701px) {
  .keyword-map-table th {
    position: sticky;
  }

  .keyword-map-column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 12px;
    cursor: col-resize;
    touch-action: none;
    z-index: 5;
  }

  .keyword-map-column-resizer::after {
    content: "";
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 5px;
    width: 2px;
    border-radius: 2px;
    background: #91b7d2;
    opacity: 0.55;
    transition: opacity 150ms ease, background-color 150ms ease;
  }

  .keyword-map-column-resizer:hover::after,
  .keyword-map-column-resizer.is-resizing::after {
    background: #087ac5;
    opacity: 1;
  }

  .keyword-map-column-resizer.is-resizing {
    background: rgba(8, 122, 197, 0.08);
  }

  [data-theme="dark"] .keyword-map-column-resizer::after {
    background: #82abc9;
  }

  [data-theme="dark"] .keyword-map-column-resizer:hover::after,
  [data-theme="dark"] .keyword-map-column-resizer.is-resizing::after {
    background: #7ed0ff;
  }
}

@media (max-width: 700px) {
  .keyword-map-column-resizer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keyword-map-column-resizer::after {
    transition: none;
  }
}


/* Named keyword mapping projects — title, metadata and edit action. */
.keyword-map-project-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.keyword-map-project-title-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.keyword-map-project-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-map-project-meta {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
}

.keyword-map-project-active {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
}

.keyword-map-project-edit {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #a9c7dc;
  border-radius: 8px;
  background: #edf6fd;
  color: #174b73;
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.keyword-map-project-edit:hover {
  background: #dceefa;
}

.keyword-map-project-edit:focus-visible {
  outline: 3px solid #73b8e8;
  outline-offset: 2px;
}

[data-theme="dark"] .keyword-map-project-edit,
html[data-theme="dark"] .keyword-map-project-edit {
  background: #234a69;
  border-color: #6087a5;
  color: #edf7ff;
}

[data-theme="dark"] .keyword-map-project-edit:hover,
html[data-theme="dark"] .keyword-map-project-edit:hover {
  background: #315d7e;
}


/* Keyword Mapping Generator — grouped workspace controls */
.keyword-map-toolbar-groups {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

.keyword-map-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.keyword-map-toolbar-controls button {
  min-height: 42px;
}

@media (max-width: 700px) {
  .keyword-map-toolbar-groups,
  .keyword-map-toolbar-controls,
  .keyword-map-toolbar-actions {
    width: 100%;
  }

  .keyword-map-toolbar-groups {
    align-items: stretch;
    flex-direction: column;
  }

  .keyword-map-toolbar-controls {
    display: none;
  }

  .keyword-map-toolbar-actions {
    justify-content: stretch;
  }
}


@media (max-width: 900px) {
  .keyword-map-project-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .keyword-map-project-create-row {
    flex-direction: column;
    align-items: stretch;
  }

  .keyword-map-project-actions {
    width: 100%;
  }
}


/* Keyword mapping workspace — compact heading and bottom exports. */
.keyword-map-dialog-content .keyword-map-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 5px;
}

.keyword-map-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.keyword-map-heading-row h3 {
  margin: 0;
}

.keyword-map-heading-row .keyword-map-save-button {
  flex: 0 0 auto;
}

.keyword-map-dialog-content .keyword-map-toolbar-groups {
  flex: 0 0 auto;
  gap: 8px;
}

.keyword-map-dialog-content .keyword-map-summary {
  margin: 0 0 7px;
}

.keyword-map-dialog-content .keyword-map-save-status {
  margin: 0;
}

.keyword-map-workspace-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 9px;
  flex-shrink: 0;
}

.keyword-map-workspace-footer .keyword-map-message {
  flex: 1 1 340px;
  min-width: 0;
  margin: 0;
}

.keyword-map-workspace-footer .keyword-map-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.keyword-map-workspace-project-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 2px 0;
  margin: 0 0 3px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.keyword-map-workspace-project-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-map-workspace-project-pencil {
  flex: 0 0 auto;
  color: #3279b2;
}

.keyword-map-workspace-project-name:hover
.keyword-map-workspace-project-label {
  text-decoration: underline;
}

.keyword-map-workspace-project-name:focus-visible {
  outline: 2px solid #3279b2;
  outline-offset: 4px;
  border-radius: 3px;
}

[data-theme="dark"] .keyword-map-workspace-project-pencil {
  color: #8bc9fa;
}

@media (max-width: 700px) {
  .keyword-map-heading-row {
    align-items: stretch;
  }

  .keyword-map-heading-row .keyword-map-save-button {
    width: 100%;
  }

  .keyword-map-workspace-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .keyword-map-workspace-footer .keyword-map-toolbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .keyword-map-workspace-footer
  .keyword-map-toolbar-actions button {
    flex: 1 1 130px;
  }

  .keyword-map-workspace-footer .keyword-map-message {
    flex: 0 0 auto;
  }
}


/* Compact workspace controls — maximise spreadsheet working area. */
.keyword-map-dialog-content .keyword-map-toolbar {
  gap: 5px;
  margin-bottom: 6px;
}

.keyword-map-dialog-content .keyword-map-heading-row {
  align-items: flex-start;
}

.keyword-map-save-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

.keyword-map-save-area .keyword-map-save-status {
  margin: 0;
  text-align: right;
  font-size: 13px;
  line-height: 1.35;
}

.keyword-map-dialog-content .keyword-map-toolbar-groups {
  gap: 4px;
}

.keyword-map-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 7px;
}

.keyword-map-dialog-content .keyword-map-summary-row
.keyword-map-summary {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
}

.keyword-map-summary-row .keyword-map-reset-widths-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 0;
  padding: 2px 0;
  margin: 0 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #246ba3;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transform: none;
}

.keyword-map-summary-row .keyword-map-reset-widths-button:hover {
  background: transparent;
  box-shadow: none;
  color: #164b76;
  transform: none;
}

.keyword-map-summary-row .keyword-map-reset-widths-button:focus-visible {
  outline: 2px solid #3279b2;
  outline-offset: 3px;
}

html[data-theme="dark"]
.keyword-map-summary-row .keyword-map-reset-widths-button {
  color: #91d1ff;
}

@media (max-width: 700px) {
  .keyword-map-save-area {
    width: 100%;
    align-items: stretch;
    margin-left: 0;
  }

  .keyword-map-save-area .keyword-map-save-status {
    text-align: left;
  }

  .keyword-map-summary-row .keyword-map-reset-widths-button {
    display: none;
  }
}


/* Workspace heading — use space beneath the title for page ordering. */
@media (min-width: 701px) {
  .keyword-map-dialog-content .keyword-map-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 5px;
    margin-bottom: 5px;
  }

  .keyword-map-dialog-content .keyword-map-heading-row {
    display: contents;
  }

  .keyword-map-dialog-content .keyword-map-heading-row h3 {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin: 0;
  }

  .keyword-map-dialog-content .keyword-map-save-area {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: start;
    margin-left: 0;
  }

  .keyword-map-dialog-content .keyword-map-toolbar-groups {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }

  .keyword-map-dialog-content .keyword-map-summary-row {
    margin-bottom: 6px;
  }
}


/* Vital SEO — Keyword Mapping Generator row ordering controls.
   Controls remain inside the URL column; spreadsheet columns are unchanged. */
@media (min-width: 701px) {
  .keyword-map-url-layout {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
  }

  .keyword-map-url-layout > a {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .keyword-map-row-controls {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
  }

  .keyword-map-row-drag,
  .keyword-map-row-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 23px;
    height: 27px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #49728f;
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    box-shadow: none;
    transform: none;
    transition: background-color 150ms ease, color 150ms ease;
  }

  .keyword-map-row-drag {
    cursor: grab;
    font-size: 19px;
  }

  .keyword-map-row-drag:active {
    cursor: grabbing;
  }

  .keyword-map-row-step {
    cursor: pointer;
  }

  .keyword-map-row-drag:hover,
  .keyword-map-row-step:not(:disabled):hover {
    background: #dceefa;
    color: #164f7d;
    box-shadow: none;
    transform: none;
  }

  .keyword-map-row-drag:focus-visible,
  .keyword-map-row-step:focus-visible {
    outline: 2px solid #267db9;
    outline-offset: 2px;
  }

  .keyword-map-row-step:disabled {
    opacity: 0.25;
    cursor: default;
  }

  .keyword-map-table tr.is-dragging > td {
    opacity: 0.55;
  }

  html[data-theme="dark"] .keyword-map-row-drag,
  html[data-theme="dark"] .keyword-map-row-step {
    color: #b5d9f1;
  }

  html[data-theme="dark"] .keyword-map-row-drag:hover,
  html[data-theme="dark"] .keyword-map-row-step:not(:disabled):hover {
    background: #315875;
    color: #ffffff;
  }

  html[data-theme="dark"] .keyword-map-row-drag:focus-visible,
  html[data-theme="dark"] .keyword-map-row-step:focus-visible {
    outline-color: #9bd6ff;
  }
}

@media (max-width: 700px) {
  .keyword-map-row-controls {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keyword-map-row-drag,
  .keyword-map-row-step {
    transition: none;
  }
}

/* Vital SEO — fullscreen-only keyword mapping zoom controls */
.keyword-map-zoom-controls[hidden] {
  display: none !important;
}

.keyword-map-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.keyword-map-dialog-controls .keyword-map-zoom-controls button {
  min-width: 42px;
  min-height: 42px;
  padding: 7px 11px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.keyword-map-dialog-controls .keyword-map-zoom-controls button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.keyword-map-dialog-controls .keyword-map-zoom-controls button:focus-visible {
  outline: 3px solid #2683ca;
  outline-offset: 2px;
}

/* Zoom the spreadsheet without transforming its scrolling container. */
.keyword-map-dialog.is-fullscreen .keyword-map-table {
  font-size: calc(13px * var(--keyword-map-zoom, 1));
}

.keyword-map-dialog.is-fullscreen .keyword-map-table th,
.keyword-map-dialog.is-fullscreen .keyword-map-table td {
  padding-top: calc(10px * var(--keyword-map-zoom, 1));
  padding-bottom: calc(10px * var(--keyword-map-zoom, 1));
}

.keyword-map-dialog.is-fullscreen .keyword-map-table td input,
.keyword-map-dialog.is-fullscreen .keyword-map-table td select {
  font-size: inherit;
  padding-top: calc(8px * var(--keyword-map-zoom, 1));
  padding-bottom: calc(8px * var(--keyword-map-zoom, 1));
}

@media (max-width: 700px) {
  .keyword-map-zoom-controls {
    display: none !important;
  }
}

/* Vital SEO — keyword mapping HTTP Status column */
.keyword-map-table td.keyword-map-http-status {
  text-align: center;
  vertical-align: middle;
}

.keyword-map-http-status-label {
  display: inline-block;
  min-width: 46px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.keyword-map-http-status-label.is-success {
  color: #17613a;
  background: #e0f4e8;
}

.keyword-map-http-status-label.is-redirect {
  color: #835300;
  background: #fff0ca;
}

.keyword-map-http-status-label.is-error {
  color: #a32430;
  background: #fde6e8;
}

.keyword-map-http-status-label.is-unknown {
  color: #566778;
  background: #edf1f5;
}

[data-theme="dark"] .keyword-map-http-status-label.is-success {
  color: #a3edc0;
  background: #174b35;
}

[data-theme="dark"] .keyword-map-http-status-label.is-redirect {
  color: #ffe19a;
  background: #634719;
}

[data-theme="dark"] .keyword-map-http-status-label.is-error {
  color: #ffb5bb;
  background: #662b34;
}

[data-theme="dark"] .keyword-map-http-status-label.is-unknown {
  color: #d1dce7;
  background: #35485c;
}
