:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --radius: 12px;
}
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.narrow { max-width: 440px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

h1, h2, h3 { margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  border: none; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }

.brand { font-weight: 800; font-size: 22px; color: var(--primary); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { padding: 8px 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border); background: var(--card); font-weight: 600; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  background: var(--card);
}
.list-item .content { flex: 1; min-width: 0; word-break: break-word; }
.list-item pre { margin: 0; white-space: pre-wrap; font-family: inherit; }

.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 12px 0; }
.notice.error { background: #fee2e2; color: #991b1b; }
.notice.success { background: #dcfce7; color: #166534; }
[data-theme="dark"] .notice.error { background: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .notice.success { background: #14532d; color: #bbf7d0; }

.bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--primary); background: rgba(37,99,235,.06); }

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 34px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin-top: 24px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.toggle { cursor: pointer; user-select: none; }

/* clickable brand */
a.brand { text-decoration: none; }
a.brand:hover { text-decoration: none; opacity: .85; }

/* feature showcase rows (image beside copy) */
.showcase { display: grid; gap: 44px; margin-top: 40px; }
.showcase-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
}
/* min-width:0 stops the wide screenshots from forcing the grid track
   wider than the viewport (the cause of the mobile right-overflow). */
.showcase-media, .showcase-copy { min-width: 0; }
.showcase-media img {
  width: 100%; max-width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
}
/* Screenshots swap with the theme: the light-mode screenshots are shown while
   the site is in DARK theme, and the dark-mode screenshots while in LIGHT theme. */
.showcase-media .shot-for-dark { display: none; }
[data-theme="dark"] .showcase-media .shot-for-light { display: none; }
[data-theme="dark"] .showcase-media .shot-for-dark { display: block; }
.showcase-copy .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 6px;
}
.showcase-copy h3 { font-size: 24px; margin-bottom: 8px; }
.showcase-row.alt .showcase-media { order: -1; }  /* image on the left */

@media (max-width: 760px) {
  .showcase-row, .showcase-row.alt { grid-template-columns: 1fr; gap: 16px; }
  .showcase-row.alt .showcase-media { order: 0; }  /* keep copy first on mobile */
  .hero h1 { font-size: 28px; }
}

/* contact action buttons — equal size on desktop and mobile */
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.contact-actions .btn.lg {
  flex: 0 1 240px; width: 240px; max-width: 240px;
  padding: 14px 22px; font-size: 16px; border-radius: 999px;
}
.btn.lg svg { width: 20px; height: 20px; flex: none; }
.btn.whatsapp { background: #22c55e; }
.btn.whatsapp:hover { background: #16a34a; }
@media (max-width: 520px) {
  .contact-actions { flex-direction: column; align-items: stretch; }
  .contact-actions .btn.lg { width: 100%; max-width: none; flex: 1 1 auto; }
}

/* topbar center: "Already have an account? Sign in" — centered on desktop */
.topbar-center { flex: 1; text-align: center; font-size: 14px; color: var(--muted); }
.topbar-center a { font-weight: 600; }

/* app.html brand: greeting can stack under the title on mobile.
   On desktop the .brand-block holds only the visible brand (greeting stays on
   the right via #hello), so desktop looks exactly as before. */
.brand-block { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-block .only-mobile { font-size: 12px; }
.only-mobile { display: none; }

@media (max-width: 560px) {
  .hide-mobile { display: none; }
  /* On mobile drop the centering and tuck "Sign in" to the right, just
     before the light/dark toggle. */
  .topbar-center { flex: 0 0 auto; margin-left: auto; margin-right: 4px; text-align: right; font-size: 14px; }
  /* app.html: show the greeting under the brand, hide the right-side copy,
     and tighten the control row so the icons sit evenly. */
  .only-mobile { display: block; }
  .hide-on-mobile { display: none; }
  .topbar { padding: 10px 12px; }
  .topbar .row { gap: 8px; }
}
