* {
  box-sizing: border-box;
}

.page {
  width: min(1100px, 100%);
  margin: auto;
  display: flex;
  justify-content: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.editor {
  background: #f2f2f2;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: none;
  border: 1px solid rgba(125, 102, 76, 0.18);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.editor__header h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0 0 8px;
}

.subtext {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.panel {
  display: grid;
  gap: 16px;
  background: var(--bg);
  border-radius: 20px;
  border: 1px solid rgba(125, 102, 76, 0.12);
  padding: 16px;
}

.panel--output {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.field__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.field__link {
  font-size: 0.75rem;
}

.field textarea {
  border-radius: 18px;
  border: 1px solid rgba(125, 102, 76, 0.2);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: "Poppins", sans-serif;
  height: 180px;
  max-height: 180px;
  overflow-y: auto;
  resize: none;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  cursor: text;
}

.panel--output .field {
  height: 100%;
  flex: 1;
  grid-template-rows: auto 1fr auto;
}

.panel--output textarea {
  height: 100%;
  max-height: none;
}

.field textarea:focus {
  outline: 2px solid rgba(157, 124, 227, 0.35);
  border-color: rgba(157, 124, 227, 0.6);
}

.field textarea::placeholder {
  color: var(--muted);
}

.field__meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

.field__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.field__note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.field__note.is-hidden {
  visibility: hidden;
}

.control-group {
  display: grid;
  gap: 10px;
}

.control-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.mode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool {
  border: none;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  box-shadow: 0 6px 14px rgba(29, 27, 22, 0.12);
}

.tool:hover {
  transform: translateY(-1px);
}

.tool--active {
  background: var(--cta-secondary-bg);
  color: var(--cta-secondary-ink);
}

.cta.is-disabled {
  opacity: 0.6;
}

.tool--mini {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.mode-notes {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.mode-notes p {
  display: none;
  margin: 0;
}

.mode-notes p.is-active {
  display: block;
}

.mode-notes strong {
  color: var(--accent-deep);
  font-weight: 600;
}

.slider {
  display: grid;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.slider__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}

.slider__value {
  font-weight: 600;
}

.slider input[type="range"] {
  width: 100%;
  accent-color: #000;
}

.control-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.tone-grid {
  display: grid;
  gap: 8px;
}

.tone-group {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tone-label {
  font-weight: 600;
  color: var(--accent-deep);
}

.tone-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field__actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.field__actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.field__actions--right {
  justify-content: flex-end;
}


.toolbar__note {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--accent-deep);
  min-height: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.status--visible {
  opacity: 1;
}

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

  .panel--output {
    height: auto;
  }

  .panel--output .field {
    height: auto;
    grid-template-rows: auto;
  }

  .panel--output textarea {
    height: 180px;
    max-height: 180px;
  }
}

@media (max-width: 600px) {
  .editor {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .editor {
    animation: floatIn 0.6s ease forwards;
    transform: translateY(12px);
    opacity: 0;
  }

  @keyframes floatIn {
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
