.repeated-phrases-shell,
.repeated-phrases-shell *,
.repeated-phrases-shell *::before,
.repeated-phrases-shell *::after {
  box-sizing: border-box;
}

.repeated-phrases-shell {
  display: grid;
  gap: 24px;
  overflow-x: clip;
}

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

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

.repeated-phrases-panel,
.repeated-phrases-side-panel,
.repeated-phrases-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);
}

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

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

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

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

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

.repeated-phrases-heading h2,
.repeated-phrases-side-panel h2 {
  font-size: 20px;
}

.repeated-phrases-card h3,
.repeated-phrases-subhead h3,
.repeated-phrases-empty h3 {
  font-size: 16px;
}

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

.repeated-phrases-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;
}

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

.repeated-phrases-field span,
.repeated-phrases-check span,
.repeated-phrases-unlock span {
  color: #263331;
  font-size: 13px;
  font-weight: 850;
}

.repeated-phrases-field textarea,
.repeated-phrases-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%;
}

.repeated-phrases-field textarea {
  min-height: 300px;
  resize: vertical;
}

.repeated-phrases-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.repeated-phrases-check {
  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;
}

.repeated-phrases-check input {
  accent-color: #244f7f;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.repeated-phrases-field textarea:focus-visible,
.repeated-phrases-unlock input:focus-visible,
.repeated-phrases-check input:focus-visible,
.repeated-phrases-button:focus-visible,
.repeated-phrases-buy:focus-visible {
  outline: 2px solid #244f7f;
  outline-offset: 2px;
}

.repeated-phrases-actions,
.repeated-phrases-export-actions,
.repeated-phrases-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repeated-phrases-button,
.repeated-phrases-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;
}

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

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

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

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

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

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

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

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

.repeated-phrases-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;
}

.repeated-phrases-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;
}

.repeated-phrases-preview strong {
  color: #17201f;
  font-weight: 850;
}

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

.repeated-phrases-preview li:last-child {
  border-bottom: 0;
}

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

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

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

  .repeated-phrases-panel,
  .repeated-phrases-side-panel,
  .repeated-phrases-card {
    padding: 16px;
  }

  .repeated-phrases-heading,
  .repeated-phrases-subhead {
    display: grid;
  }

  .repeated-phrases-field textarea {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .repeated-phrases-actions .repeated-phrases-button,
  .repeated-phrases-export-actions .repeated-phrases-button,
  .repeated-phrases-buy,
  .repeated-phrases-unlock-row .repeated-phrases-button {
    width: 100%;
  }
}
