/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-2: #f7f7f8;
  --bg-3: #efefef;
  --border: #e5e5e5;
  --text: #0d0d0d;
  --text-2: #4e4e57;
  --text-3: #8e8ea0;
  --accent: #10a37f;
  --accent-dark: #0d8f6e;
  --danger: #d00e17;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 60px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-link {
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }
.btn-reset { background: none; border: none; padding: 0; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover:not(:disabled) { background: #1a1a1a; }

.btn-secondary {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-3); }

.btn-play {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
}
.btn-play:hover:not(:disabled) { background: var(--accent-dark); }

.btn-detail {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}
.btn-detail:hover:not(:disabled) { background: var(--bg-3); }

.speed-dropdown {
  position: relative;
}
.btn-speed {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  min-height: calc(0.9rem * 1.4 + 2 * 0.55rem);
}
.btn-speed:hover:not(:disabled) { background: var(--bg-3); }
.btn-speed svg { overflow: visible; }
.speed-menu[hidden] { display: none; }
.speed-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 100;
  min-width: 5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.speed-option {
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  text-align: left;
}
.speed-option:hover { background: var(--bg-2); }
.speed-option.is-active { font-weight: 600; color: var(--accent); }

.btn-nav {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
}
.btn-nav:hover:not(:disabled) { background: var(--bg-3); }

.btn-full { width: 100%; justify-content: center; padding: 0.7rem 1rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* ── Spinner ───────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--text-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 13px; height: 13px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm-dark {
  border-color: var(--border);
  border-top-color: var(--text-2);
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-ready { background: #d1fae5; color: #065f46; }
.badge-loading { background: #fef3c7; color: #92400e; }
.badge-error { background: #fee2e2; color: #991b1b; }

/* ── Flash messages ────────────────────────────────────────────────────── */
.messages-bar { padding: 0.75rem 1.5rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.flash-error, .flash-warning { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-success, .flash-info { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fade-in 0.15s ease;
}
.modal-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  animation: slide-up 0.18s ease;
}
.modal-icon { font-size: 2.25rem; margin-bottom: 1rem; }
.modal-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.6rem; }
.modal-body { color: var(--text-2); font-size: 0.9rem; margin: 0 0 1.5rem; line-height: 1.6; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes slide-up { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.hero-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-3);
}

/* ── Dropzone ──────────────────────────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-2);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: #f0fdf9;
}
.dropzone-icon { color: var(--text-3); margin-bottom: 0.25rem; }
.dropzone-label { font-size: 0.95rem; color: var(--text-2); }
.dropzone-browse { color: var(--accent); font-weight: 500; }
.dropzone-hint { font-size: 0.8rem; color: var(--text-3); }
.dropzone-progress {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  color: var(--text-2);
}

/* ── Uploads section ───────────────────────────────────────────────────── */
.uploads-section {
  padding: 2rem 1.5rem 4rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.uploads-inner { max-width: 1100px; margin: 0 auto; }
.uploads-header { margin-bottom: 1.5rem; }
.uploads-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.uploads-subtitle { font-size: 0.875rem; color: var(--text-3); }
.uploads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.upload-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.upload-card:hover {
  border-color: var(--text-3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.upload-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.upload-card-icon {
  flex-shrink: 0;
  color: var(--text-3);
  margin-top: 1px;
}
.upload-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.upload-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.upload-card-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Demo section ──────────────────────────────────────────────────────── */
.demo-section {
  padding: 2rem 1.5rem 4rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.demo-inner { max-width: 1100px; margin: 0 auto; }
.demo-label {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}
.demo-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.demo-subtitle {
  font-size: 0.875rem;
  color: var(--text-3);
  margin-bottom: 1.75rem;
}

/* ── Embedded viewer (demo) ────────────────────────────────────────────── */
.viewer-embed {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.viewer-embed-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 480px;
}
@media (max-width: 780px) {
  .viewer-embed-main { grid-template-columns: 1fr; }
}
.pdf-panel-embed {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 420px;
}
.notes-panel-embed {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Features ──────────────────────────────────────────────────────────── */
.features-section { padding: 4rem 1.5rem; }
.features-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.feature { text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature p { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }

/* ── CTA ───────────────────────────────────────────────────────────────── */
.cta-section {
  padding: 4rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta-inner { max-width: 480px; margin: 0 auto; }
.cta-inner h2 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.cta-inner p { color: var(--text-2); margin-bottom: 1.5rem; }

/* ── Full viewer page ──────────────────────────────────────────────────── */
.viewer-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  overflow: hidden;
}
.viewer-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.back-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-2);
  white-space: nowrap;
}
.back-link:hover { color: var(--text); }
.viewer-doc-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-status { flex-shrink: 0; }

.upgrade-banner {
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  padding: 0.55rem 1.5rem;
  font-size: 0.8rem;
  color: #92400e;
  flex-shrink: 0;
}

.viewer-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 400px;
  overflow: hidden;
}
@media (max-width: 860px) {
  .viewer-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .notes-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: 55vh;
  }
  .notes-panel.is-collapsed {
    max-height: none;
    overflow: visible;
  }
  .notes-panel.is-collapsed .notes-meta,
  .notes-panel.is-collapsed .notes-body { display: none; }
  .notes-panel.is-collapsed .notes-actions { overflow: visible; }
  .notes-collapse-toggle { display: inline-flex; }
  .audio-hint { display: none; }
  .nav-hint { display: none; }
}

.pdf-panel {
  background: #e8e8e8;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.pdf-canvas-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.pdf-loading {
  position: absolute; inset: 0;
  background: rgba(232,232,232,0.7);
  display: flex; align-items: center; justify-content: center;
}
.pdf-canvas { display: block; box-shadow: 0 4px 24px rgba(0,0,0,0.12); border-radius: 4px; }

/* ── Notes panel (shared) ──────────────────────────────────────────────── */
.notes-panel {
  border-left: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.notes-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.notes-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.page-counter {
  font-size: 0.8rem;
  color: var(--text-3);
}
.notes-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}
.notes-loading, .notes-error {
  font-size: 0.9rem;
  color: var(--text-3);
  font-style: italic;
}
.notes-error { color: var(--danger); }

/* Rendered markdown inside notes */
.notes-md > *:first-child { margin-top: 0; }
.notes-md > *:last-child { margin-bottom: 0; }
.notes-md p { margin: 0 0 0.9em; }
.notes-md h1, .notes-md h2, .notes-md h3, .notes-md h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
}
.notes-md h1 { font-size: 1.35rem; }
.notes-md h2 { font-size: 1.2rem; }
.notes-md h3 { font-size: 1.05rem; }
.notes-md h4 { font-size: 0.95rem; color: var(--text-2, var(--text)); }
.notes-md ul, .notes-md ol { margin: 0 0 0.9em; padding-left: 1.4em; }
.notes-md li { margin: 0.25em 0; }
.notes-md li > p { margin: 0 0 0.3em; }
.notes-md strong { font-weight: 600; }
.notes-md em { font-style: italic; }
.notes-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg, rgba(0,0,0,0.05));
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border, transparent);
}
.notes-md pre {
  background: var(--bg, rgba(0,0,0,0.05));
  border: 1px solid var(--border, transparent);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0 0 0.9em;
}
.notes-md pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.9em;
}
.notes-md blockquote {
  margin: 0 0 0.9em;
  padding: 0.25em 0 0.25em 1em;
  border-left: 3px solid var(--border);
  color: var(--text-3);
}
.notes-md a { color: var(--accent, inherit); }
.notes-md hr { border: 0; border-top: 1px solid var(--border); margin: 1.25em 0; }
.notes-md table {
  border-collapse: collapse;
  margin: 0 0 0.9em;
  font-size: 0.95em;
}
.notes-md th, .notes-md td {
  border: 1px solid var(--border);
  padding: 0.4em 0.6em;
  text-align: left;
}
.notes-md .katex-display {
  margin: 0.9em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.notes-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.audio-hint { font-size: 0.75rem; color: var(--text-3); }

.notes-collapse-toggle {
  display: none;
  margin-left: auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
}
.notes-collapse-toggle:hover { color: var(--text); }
.notes-panel.is-collapsed .notes-collapse-toggle { transform: rotate(180deg); }
@media (max-width: 860px) {
  .notes-collapse-toggle { display: inline-flex; }
}

/* ── Viewer nav bar ────────────────────────────────────────────────────── */
.viewer-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.nav-center { text-align: center; flex: 1; }
.nav-hint { font-size: 0.75rem; color: var(--text-3); }

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg-2);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem 2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
  text-align: center;
}
.auth-brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}
.social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-social:active { transform: translateY(1px); }
.social-icon { width: 18px; height: 18px; display: block; flex-shrink: 0; margin-top: -1px; }
.btn-apple .social-icon { margin-top: -2px; }
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--border);
}
.btn-google:hover { background: var(--bg-2); }
.btn-apple {
  background: #000;
  color: #fff;
  border: 1px solid #000;
}
.btn-apple:hover { background: #1a1a1a; }
.auth-terms {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.5;
}

/* ── Form controls ─────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label { font-size: 0.8rem; font-weight: 500; color: var(--text-2); }
.form-optional { font-weight: 400; color: var(--text-3); }
.form-group input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--text-2); }
.form-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}
.field-error { font-size: 0.78rem; color: var(--danger); }

/* ── Billing page ──────────────────────────────────────────────────────── */
.billing-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--bg-2);
}
.billing-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}
.billing-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.plan-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.plan-pro { border-color: var(--accent); background: #f0fdf9; }
.plan-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.plan-name { font-weight: 600; }
.plan-badge { font-size: 0.75rem; background: #d1fae5; color: #065f46; padding: 0.2rem 0.5rem; border-radius: 99px; }
.plan-limit { font-size: 0.9rem; color: var(--text-2); }
.plan-renews { margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-3); }
.upgrade-section { margin-top: 1.5rem; }
.upgrade-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.upgrade-features { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.upgrade-features li { font-size: 0.9rem; color: var(--text-2); padding-left: 1.25rem; position: relative; }
.upgrade-features li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.plan-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.75rem; }
.plan-option { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; background: var(--bg-2); }
.plan-option h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.plan-price { font-size: 1.5rem; font-weight: 600; margin: 0; }
.plan-price span { font-size: 0.85rem; font-weight: 400; color: var(--text-3); margin-left: 0.15rem; }
.plan-option .upgrade-btn { margin-top: auto; }
@media (max-width: 560px) { .plan-options { grid-template-columns: 1fr; } }
