:root {
  --coral: #ff6b35;
  --text: #1a1b1f;
  --bg: #fffaf5;
  --white: #ffffff;
  --muted: #6b7280;
  --error: #dc2626;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.page {
  max-width: 420px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.topbar__info .brand {
  margin-bottom: 0.15rem;
}

.user-email {
  color: var(--muted);
  font-size: 0.875rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.card--wide {
  padding: 0;
  overflow: hidden;
}

.prompts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.prompts-table th,
.prompts-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.prompts-table th {
  background: rgb(255 107 53 / 6%);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.prompts-table__row {
  cursor: pointer;
}

.prompts-table__row:hover,
.prompts-table__row:focus {
  background: rgb(255 107 53 / 6%);
  outline: none;
}

.prompts-table__row:last-child td {
  border-bottom: none;
}

.muted {
  color: var(--muted);
  margin: 0;
  padding: 1.5rem;
}

.btn--ghost {
  margin-top: 0;
  background: transparent;
  color: var(--coral);
  border: 1px solid rgb(255 107 53 / 35%);
}

.btn--back {
  margin-bottom: 1rem;
}

.editor-meta {
  margin: -0.5rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.editor-card,
.history-card {
  padding: 1.25rem;
}

.editor-textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  line-height: 1.55;
  resize: vertical;
}

.editor-textarea:focus {
  outline: 2px solid rgb(255 107 53 / 35%);
  border-color: var(--coral);
}

.placeholders-hint {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgb(255 107 53 / 8%);
  font-size: 0.85rem;
}

.editor-actions {
  margin-top: 1rem;
}

.editor-actions .btn {
  margin-top: 0;
}

.section-title--history {
  margin-top: 2rem;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.history-item__title {
  font-weight: 600;
}

.history-item__meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.history-item__badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgb(22 163 74 / 12%);
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.message--success {
  background: rgb(22 163 74 / 10%);
  color: #15803d;
}

.brand {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--coral);
}

.subtitle {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgb(26 27 31 / 8%);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
}

input[type="email"]:focus {
  outline: 2px solid rgb(255 107 53 / 35%);
  border-color: var(--coral);
}

button,
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: var(--coral);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message--info {
  background: rgb(255 107 53 / 10%);
  color: var(--text);
}

.message--error {
  background: rgb(220 38 38 / 10%);
  color: var(--error);
}

.hidden {
  display: none;
}
