* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f5f5f5;
  color: #1e1e2f;
}

a {
  color: #4f46e5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: #1e1e2f;
  color: white;
}

.logo {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.header-nav,
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
}

.usage-chip,
.account-email {
  font-size: 13px;
  color: #d1d5db;
}

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.split-view {
  display: flex;
  flex: 1;
  min-height: 0;
}

.panel {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid #ccc;
}

#prompt-input {
  flex: 1;
  min-height: 160px;
  padding: 12px;
  font-size: 15px;
  resize: none;
}

#model-select,
#api-key-input,
.compare-column select {
  padding: 8px 10px;
  font-size: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: #4f46e5;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #4338ca;
}

button.ghost-btn {
  background: transparent;
  border: 1px solid #6b7280;
  color: white;
}

button.ghost-btn:hover {
  background: #374151;
}

#output-display {
  margin-top: 12px;
  white-space: pre-wrap;
}

.version-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #555;
}

.version-nav button {
  padding: 4px 10px;
  background: #e5e5e5;
  color: #333;
}

.version-nav button:hover {
  background: #d5d5d5;
}

.version-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.compare-panel {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid #ccc;
}

.compare-grid {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.compare-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.compare-output {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  background: #fafafa;
  min-height: 100px;
}

.landing {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 8px 0 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.lede {
  font-size: 18px;
  line-height: 1.5;
  color: #374151;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.text-link {
  font-size: 14px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.features article,
.price-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.features h2,
.price-card h3 {
  margin-top: 0;
}

.pricing {
  margin-top: 64px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.price {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
}

.price span {
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
}

.price-card ul {
  padding-left: 18px;
  color: #374151;
  margin-bottom: 20px;
}

.price-card.featured {
  border-color: #4f46e5;
}

.site-footer {
  padding: 24px;
  text-align: center;
  font-size: 14px;
}

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.modal {
  background: white;
  width: min(420px, 100%);
  border-radius: 10px;
  padding: 24px;
}

.modal h2 {
  margin-top: 0;
}

.modal label {
  display: block;
  font-size: 13px;
  margin: 12px 0 4px;
}

.modal input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-error {
  color: #b91c1c;
  font-size: 13px;
  min-height: 1.2em;
}

.modal-switch {
  margin-top: 12px;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* Announcement bar */
.offer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #4f46e5;
  color: white;
  font-size: 14px;
  text-align: center;
}

.offer-bar a {
  color: white;
  font-weight: 600;
}

.offer-bar button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}

.hero-note {
  margin-top: 18px;
  font-size: 13px;
  color: #6b7280;
}

/* Billing banner (app) */
.billing-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fde68a;
  font-size: 14px;
}

.billing-banner .ghost-btn {
  color: #78350f;
  border-color: #d97706;
}

.billing-banner .ghost-btn:hover {
  background: #fde68a;
}

/* Presets */
.section-lede {
  color: #6b7280;
  font-size: 15px;
  margin: 4px 0 0;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.preset-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.preset-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f46e5;
  font-weight: 600;
  margin: 0 0 8px;
}

.preset-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.preset-card p {
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 14px;
  flex: 1;
}

.preset-link {
  font-size: 14px;
  font-weight: 600;
}

/* Testimonials */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.quote-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  margin: 0;
}

.quote-card p {
  margin: 0 0 14px;
  line-height: 1.55;
  color: #1e1e2f;
}

.quote-card footer {
  font-size: 13px;
  color: #6b7280;
}

.testimonials,
.faq {
  margin-top: 64px;
}

/* FAQ */
.faq details {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}

.faq details p {
  margin: 10px 0 0;
  color: #374151;
  line-height: 1.55;
}

/* Pay modal */
.pay-note {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin: 4px 0 12px;
}

.pay-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
  flex-wrap: wrap;
}

.pay-line span {
  color: #6b7280;
  min-width: 70px;
}

.pay-line strong {
  min-width: 70px;
}

.upi-code {
  font-family: ui-monospace, monospace;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
  flex: 1;
  min-width: 140px;
  font-size: 13px;
  word-break: break-all;
}

.copy-btn {
  background: transparent;
  border: 1px solid #6b7280;
  color: #1e1e2f;
  font-size: 12px;
  padding: 5px 10px;
}

.pay-close {
  width: 100%;
  margin-top: 8px;
}

/* Admin */
.admin-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.admin-token-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.admin-token-row input {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.admin-table th {
  background: #1e1e2f;
  color: white;
  font-weight: 600;
}

.admin-table code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.order-pending {
  color: #b45309;
  font-weight: 600;
}

.order-paid {
  color: #047857;
  font-weight: 600;
}

.approve-btn {
  background: #047857;
  font-size: 13px;
  padding: 7px 12px;
}

.approve-btn:hover {
  background: #065f46;
}

.approve-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.footer-sep {
  color: #9ca3af;
  margin: 0 4px;
}

/* Share modal */
.share-modal {
  width: min(520px, 100%);
}

.share-privacy-row {
  font-size: 14px;
  margin: 12px 0;
}

.share-privacy-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.share-privacy-row input {
  width: auto;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  padding: 8px 10px;
}

/* Share page */
.share-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.share-status {
  color: #6b7280;
}

.share-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
}

.share-meta,
.share-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.model-badge {
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}

.private-badge {
  background: #fef3c7;
  color: #92400e;
}

.share-owner,
.share-date,
.share-views {
  font-size: 13px;
  color: #6b7280;
}

.share-section {
  padding: 18px;
}

.share-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 0 0 8px;
}

.share-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  max-height: 420px;
  overflow: auto;
}

.share-block.output-block {
  background: #f5fff6;
  border-color: #e3f4e4;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  border-top: 1px solid #f0f0f0;
}

.share-actions .hero-actions {
  margin-top: 0;
}

.share-madewith {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.share-locked {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
}

.share-locked h1 {
  margin: 0 0 8px;
}

.share-locked p {
  color: #374151;
}

@media (max-width: 800px) {
  .split-view,
  .compare-grid,
  .features,
  .pricing-grid,
  .preset-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .input-panel {
    border-right: none;
    border-bottom: 1px solid #ccc;
  }
}
