/* AI copy writer (copy-writer/). Builds on base.css, landing.css and tools.css.
   Brief on the left (about a third), results on the right; stacked on phones. */

.cw-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

.cw-brief {
  display: grid;
  gap: 14px;
}

.cw-brief h2 {
  margin: 0;
  font-size: 18px;
}

.cw-brief textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  font: 15px/1.45 var(--font-sans);
  color: var(--ink);
  resize: vertical;
}

.cw-brief .tool-field input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.cw-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.cw-emoji {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  font-size: 14px;
}

.cw-brief .tool-note {
  margin: 0;
}

.cw-brief .btn-primary {
  justify-self: start;
}

.cw-brief .btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Results */
.cw-results {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.cw-empty {
  padding: 28px 24px;
  border: 1.5px dashed var(--hairline);
  border-radius: 8px;
  color: var(--ink-soft);
}

.cw-empty h2 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--ink);
}

.cw-empty p {
  max-width: 52ch;
  margin: 0;
}

.cw-working {
  margin: 0;
}

.cw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cw-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
}

.cw-tab {
  padding: 6px 16px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  font: 500 14px var(--font-sans);
  color: var(--ink-soft);
  cursor: pointer;
}

.cw-tab[aria-selected="true"] {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.cw-single {
  margin: 0;
  font-size: 18px;
}

.cw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cw-card {
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper);
}

.cw-card.is-working {
  opacity: 0.55;
}

.cw-placeholder {
  height: 220px;
  background: linear-gradient(90deg, var(--paper) 0%, var(--artboard) 50%, var(--paper) 100%);
  background-size: 200% 100%;
  animation: cw-shimmer 1.4s linear infinite;
}

@keyframes cw-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-placeholder {
    animation: none;
  }
}

.cw-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cw-card-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
}

.cw-number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-tint);
  font-size: 13px;
  color: var(--brand-strong);
}

.cw-rewrite select,
.cw-button-row select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  font: 14px var(--font-sans);
  color: var(--ink);
}

.cw-field {
  margin-top: 12px;
}

.cw-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cw-field-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cw-field-tools .btn-small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.cw-field-note {
  margin: 4px 0 0;
  font-size: 13px;
}

.cw-label {
  font-size: 13px;
  color: var(--ink-soft);
}

.cw-count {
  font-size: 12px;
  color: var(--ink-soft);
}

.cw-count.is-over {
  font-weight: 600;
  color: var(--caution);
}

/* The copy itself, at real reading size */
.cw-text {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--artboard);
  font: 15px/1.5 var(--font-sans);
  color: var(--ink);
  resize: none;
}

.cw-text:hover {
  border-color: var(--hairline);
}

.cw-text:focus {
  border-color: var(--brand);
  outline: none;
  background: var(--paper);
}

.cw-text-headline {
  font-weight: 600;
}

.cw-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 860px) {
  .cw-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw-results {
    margin-top: 0;
  }
}
