:root {
  --ink: #13201f;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(21, 47, 44, 0.12);
  --wash: #f5f8f7;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --gold: #d69e2e;
  --rose: #d85b69;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(15, 118, 110, 0.18), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(216, 91, 105, 0.15), transparent 28%),
    linear-gradient(135deg, #f8fbfa 0%, #eef6f4 45%, #fff8ec 100%);
  color: var(--ink);
  letter-spacing: 0;
}

.app-nav {
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-inner,
.nav-actions {
  display: flex;
  align-items: center;
}

.nav-inner {
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  color: var(--ink);
}

.brand-mark::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

.nav-actions {
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-pricing {
  color: #0f5f8f;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.14);
}

.nav-pricing:hover {
  color: #164e63;
  background: rgba(14, 116, 144, 0.22);
}

.nav-user {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.hero {
  min-height: calc(100vh - 57px);
  display: flex;
  align-items: center;
  padding: 4.5rem 0;
  position: relative;
}

.editor-preview,
.auth-panel,
.workspace-panel,
.home-rewriter,
.pricing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(19, 32, 31, 0.12);
  backdrop-filter: blur(18px);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-stats div {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(19, 32, 31, 0.08);
}

.hero-stats strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
}

.hero-stats span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.editor-preview {
  padding: 1.5rem;
}

.preview-line {
  height: 16px;
  background: #e6eaf0;
  border-radius: 999px;
  margin-bottom: 12px;
}

.preview-line.short {
  width: 58%;
}

.preview-output {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #eaf7f5;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
}

.preview-output span {
  color: var(--accent);
  font-weight: 700;
}

.preview-output p {
  margin: 0.5rem 0 0;
}

.home-rewriter {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.home-rewriter::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose));
}

.rewriter-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: var(--accent-strong);
  background: #eaf7f5;
  font-size: 0.82rem;
  font-weight: 800;
}

.rewriter-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.signed-in-line {
  color: var(--muted);
  font-size: 0.92rem;
}

.style-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow: visible;
  padding: 0.15rem 0;
}

.style-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px transparent;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.style-chip span {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(214, 158, 46, 0.16);
  color: #8a5b09;
  font-size: 0.72rem;
  font-weight: 800;
}

.style-chip.locked {
  color: #98a2b3;
  border-color: rgba(152, 162, 179, 0.32);
  background: rgba(234, 236, 240, 0.72);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.style-chip.locked span {
  color: #667085;
  background: rgba(152, 162, 179, 0.18);
}

.style-chip:hover,
.style-radio:checked + .style-chip {
  border-color: var(--accent);
  background: #eaf7f5;
  color: #115e59;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.style-chip:hover {
  border-color: var(--accent);
  color: #115e59;
}

.style-chip.locked:hover {
  color: #98a2b3;
  border-color: rgba(152, 162, 179, 0.32);
  background: rgba(234, 236, 240, 0.72);
  box-shadow: none;
}

.style-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.editor-pane {
  height: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(21, 47, 44, 0.1);
  border-radius: 8px;
}

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

.editor-meta .form-label {
  margin-bottom: 0;
}

.editor-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.char-counter {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-clear-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  color: #b42318;
  background: rgba(254, 228, 226, 0.72);
  line-height: 1;
}

.btn-clear-icon:hover {
  color: #7a271a;
  border-color: rgba(180, 35, 24, 0.36);
  background: rgba(254, 228, 226, 0.95);
}

.output-pane {
  background: linear-gradient(180deg, rgba(234, 247, 245, 0.8), rgba(255, 255, 255, 0.72));
}

.rewrite-box {
  min-height: 230px;
  resize: vertical;
  line-height: 1.6;
  border-color: rgba(21, 47, 44, 0.14);
  background: rgba(255, 255, 255, 0.86);
}

.rewrite-box.rewritten {
  background: rgba(251, 252, 253, 0.9);
}

.auth-section,
.pricing-section {
  min-height: calc(100vh - 57px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 2rem;
}

.app-shell {
  padding: 3rem 0;
}

.workspace-panel {
  padding: 1.25rem;
}

.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-summary span,
.admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
}

.admin-summary strong {
  margin-right: 0.3rem;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(19, 32, 31, 0.12);
  backdrop-filter: blur(18px);
}

.admin-table {
  min-width: 720px;
}

.admin-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.result-panel {
  min-height: 100%;
}

.result-text {
  white-space: pre-wrap;
  line-height: 1.65;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.pricing-card.featured {
  border-color: rgba(15, 118, 110, 0.35);
}

.pricing-card > * {
  position: relative;
  z-index: 1;
}

.pricing-card .btn,
.pricing-card form {
  margin-top: auto;
}

.pricing-card form .btn {
  margin-top: 0;
}

.pricing-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(214, 158, 46, 0.16));
  border-bottom-left-radius: 100%;
  pointer-events: none;
}

.price-line {
  font-size: 3rem;
  font-weight: 800;
  margin: 1.5rem 0;
}

.price-line span {
  font-size: 1rem;
  color: var(--muted);
}

.pricing-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.pricing-points span {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.pricing-list {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.narrow {
  max-width: 720px;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #115e59;
  --bs-btn-hover-border-color: #115e59;
}

.btn,
.form-control,
.form-select {
  border-radius: 8px;
}

.btn {
  font-weight: 700;
}

.btn-rewrite {
  width: min(100%, 460px);
  min-height: 42px;
  padding: 0.45rem 2rem;
  font-size: 1rem;
}

.rewrite-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.rewrite-spinner {
  display: none;
  margin-left: 0.5rem;
}

.btn-rewrite.is-loading .rewrite-spinner {
  display: inline-block;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.16);
}

@media (max-width: 991.98px) {
  .hero {
    align-items: flex-start;
    padding: 3rem 0;
  }

  .hero-stats {
    max-width: 420px;
  }

  .pricing-section {
    place-items: stretch;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .nav-inner {
    align-items: flex-start;
  }

  .brand-mark {
    padding-top: 0.25rem;
  }

  .nav-actions {
    max-width: 270px;
  }

  .nav-user {
    white-space: normal;
  }

  .hero {
    padding: 2rem 0;
  }

  .hero .display-4 {
    font-size: 2.35rem;
  }

  .home-rewriter,
  .auth-panel,
  .workspace-panel,
  .pricing-card {
    padding: 1rem;
  }

  .rewriter-topline {
    display: block;
  }

  .status-pill {
    margin-top: 0.75rem;
  }

  .rewrite-box {
    min-height: 180px;
  }

  .price-line {
    font-size: 2.5rem;
  }

  .btn-rewrite,
  .rewrite-actions {
    width: 100%;
  }

  .editor-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
