.toc-generator-shell,
.toc-generator-shell *,
.toc-generator-shell *::before,
.toc-generator-shell *::after {
  box-sizing: border-box;
}

.toc-generator-shell {
  display: grid;
  gap: 24px;
  overflow-x: clip;
}

.toc-generator-page .section-inner {
  max-width: min(var(--max), 100%);
}

.toc-generator-workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
}

.toc-generator-panel,
.toc-generator-side-panel,
.toc-generator-card {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 31, 0.07);
}

.toc-generator-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.toc-generator-side {
  align-content: start;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.toc-generator-side-panel,
.toc-generator-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.toc-generator-heading,
.toc-generator-subhead {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.toc-generator-heading h2,
.toc-generator-side-panel h2,
.toc-generator-card h3,
.toc-generator-subhead h3,
.toc-generator-empty h3 {
  color: #17201f;
  line-height: 1.3;
  margin: 0;
}

.toc-generator-heading h2,
.toc-generator-side-panel h2 {
  font-size: 20px;
}

.toc-generator-card h3,
.toc-generator-subhead h3,
.toc-generator-empty h3 {
  font-size: 16px;
}

.toc-generator-heading p,
.toc-generator-side-panel p,
.toc-generator-card p,
.toc-generator-empty p,
.toc-generator-help,
.toc-generator-list li {
  color: #5f6c68;
  line-height: 1.6;
  margin: 0;
}

.toc-generator-chip {
  align-items: center;
  background: #e9f2ff;
  border: 1px solid rgba(43, 91, 143, 0.18);
  border-radius: 8px;
  color: #244f7f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.toc-generator-field,
.toc-generator-unlock {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.toc-generator-field span,
.toc-generator-option span,
.toc-generator-unlock span {
  color: #263331;
  font-size: 13px;
  font-weight: 850;
}

.toc-generator-field textarea,
.toc-generator-unlock input {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  color: #17201f;
  font: inherit;
  min-width: 0;
  padding: 10px 12px;
  width: 100%;
}

.toc-generator-field textarea {
  min-height: 300px;
  resize: vertical;
}

.toc-generator-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toc-generator-option {
  align-items: center;
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.1);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
}

.toc-generator-option input {
  accent-color: #244f7f;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.toc-generator-field textarea:focus-visible,
.toc-generator-unlock input:focus-visible,
.toc-generator-option input:focus-visible,
.toc-generator-button:focus-visible,
.toc-generator-buy:focus-visible {
  outline: 2px solid #244f7f;
  outline-offset: 2px;
}

.toc-generator-actions,
.toc-generator-export-actions,
.toc-generator-unlock-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toc-generator-button,
.toc-generator-buy {
  align-items: center;
  background: #17201f;
  border: 1px solid #17201f;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.toc-generator-button.is-secondary,
.toc-generator-buy.is-secondary {
  background: #ffffff;
  color: #17201f;
}

.toc-generator-button:disabled {
  background: #edf2ef;
  border-color: #d5ded9;
  color: #7a8581;
  cursor: not-allowed;
}

.toc-generator-status {
  align-items: center;
  color: #5f6c68;
  display: inline-flex;
  line-height: 1.5;
  min-height: 42px;
}

.toc-generator-alert {
  background: #fff4e6;
  border: 1px solid rgba(181, 91, 11, 0.22);
  border-radius: 8px;
  color: #7a3f08;
  line-height: 1.6;
  padding: 12px 14px;
}

.toc-generator-results {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toc-generator-metric {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
}

.toc-generator-metric span {
  color: #5f6c68;
  font-size: 12px;
  font-weight: 800;
}

.toc-generator-metric strong {
  color: #17201f;
  font-size: 24px;
  line-height: 1.15;
}

.toc-generator-preview {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 0;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 0;
}

.toc-generator-preview li {
  border-bottom: 1px solid rgba(23, 32, 31, 0.08);
  color: #263331;
  display: grid;
  gap: 4px;
  line-height: 1.55;
  margin-left: 38px;
  overflow-wrap: anywhere;
  padding: 10px 12px 10px 4px;
}

.toc-generator-preview strong {
  color: #17201f;
  font-weight: 850;
}

.toc-generator-preview code {
  color: #263331;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.toc-generator-preview li > span {
  color: #5f6c68;
  font-size: 12px;
  font-weight: 800;
}

.toc-generator-preview li:last-child {
  border-bottom: 0;
}

.toc-generator-empty {
  background: #f8faf8;
  border: 1px dashed #aebbb5;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.toc-generator-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .toc-generator-workbench,
  .toc-generator-results {
    grid-template-columns: 1fr;
  }

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

  .toc-generator-panel,
  .toc-generator-side-panel,
  .toc-generator-card {
    padding: 16px;
  }

  .toc-generator-heading,
  .toc-generator-subhead {
    display: grid;
  }

  .toc-generator-field textarea {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .toc-generator-options {
    grid-template-columns: 1fr;
  }

  .toc-generator-options,
  .toc-generator-actions .toc-generator-button,
  .toc-generator-export-actions .toc-generator-button,
  .toc-generator-buy,
  .toc-generator-unlock-row .toc-generator-button {
    width: 100%;
  }
}
