:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1a1f29;
  --muted: #6b7280;
  --accent: #2f6bff;
  --accent-dark: #1f4fd0;
  --border: #e3e7ee;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; border-radius: 6px; flex-shrink: 0; }
.brand-text span { color: var(--accent); }
.site-nav a { margin-left: 1rem; text-decoration: none; color: var(--muted); font-weight: 600; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-external { color: var(--accent); }

/* Layout */
.container { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.breadcrumb { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.hero { text-align: center; margin: 1rem 0 2rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* Widget */
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone.dragover { border-color: var(--accent); background: #eef3ff; }
.hint { color: var(--muted); margin: 0.75rem 0 0; }

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.cta:hover { background: var(--accent-dark); }
.convert-btn { width: 100%; margin-top: 1rem; }

.file-info { margin-top: 1rem; color: var(--muted); text-align: center; word-break: break-all; }
.file-info .file-count { font-weight: 700; color: var(--ink); margin-bottom: 0.4rem; }
.file-info .file-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; max-height: 8rem; overflow-y: auto; text-align: left; }
.file-info .file-list li { padding: 0.15rem 0; }

.format-cue { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.badge { background: #eef3ff; color: var(--accent); font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 8px; font-size: 0.85rem; }
.badge.muted { background: #f0f2f6; color: var(--muted); }
.badge.out { background: #e8f7ee; color: var(--ok); }
.arrow { color: var(--muted); font-weight: 700; }

.options { margin-top: 1.25rem; }
.options summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.quality-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.quality-row input[type=range] { flex: 1; }

.status { text-align: center; margin: 1rem 0 0; min-height: 1.25rem; }
.status.error { color: var(--err); }
.status.busy { color: var(--accent); }

.result { text-align: center; margin-top: 1.25rem; }
.result-heading { font-weight: 700; font-size: 1.1rem; margin: 0 0 0.25rem; }
.result-sub { color: var(--muted); margin: 0 0 1rem; }
.result .download { background: var(--ok); }
.result .download:hover { background: #128a3e; }
.link-btn { display: block; margin: 0.75rem auto 0; background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* Result actions: Download + Save side by side (stack on mobile) */
.result-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.result-actions .cta { flex: 1 1 200px; margin: 0; }

/* Save to Google Drive (optional storage action) */
.drive-btn { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.drive-btn:hover { background: #eef3ff; }
.drive-btn:disabled { opacity: 0.6; cursor: default; }
/* Final "saved" state — stays bright/positive, not greyed out. */
.drive-btn.saved { background: var(--ok); color: #fff; border-color: var(--ok); opacity: 1; cursor: default; }

/* "already connected" reassurance above the actions */
.drive-connected { color: var(--ok); font-size: 0.85rem; font-weight: 600; margin: 0 0 0.6rem; }

.drive-status { margin: 0.7rem 0 0; min-height: 1.1rem; font-size: 0.9rem; color: var(--muted); }
.drive-status.error { color: var(--err); }
.drive-status.busy { color: var(--accent); }
.drive-status.ok { color: var(--ok); font-weight: 600; }
.drive-status a { color: var(--accent); }
.drive-status .drive-open { display: inline-block; padding: 0.4rem 1rem; border: 1px solid var(--ok); border-radius: 8px; color: var(--ok); text-decoration: none; font-weight: 600; }
.drive-status .drive-open:hover { background: #e8f7ee; }

/* Info / hub */
.info { margin-top: 2.5rem; }
.info h2 { font-size: 1.25rem; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .1s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card h2, .tool-card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.tool-card p { margin: 0; color: var(--muted); }

/* Native file input (no-JS baseline; JS hides it) */
.dropzone input[type=file] { display: block; margin: 0 auto; max-width: 100%; }

/* Coming-soon tool cards */
.tool-card.soon { opacity: 0.7; cursor: default; }
.tool-card.soon:hover { transform: none; border-color: var(--border); }
.soon-badge { display: inline-block; background: #f0f2f6; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.2rem 0.5rem; border-radius: 6px; margin-bottom: 0.5rem; }
.tool-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }

/* Related tools + ecosystem */
.related { margin-top: 2.5rem; }
.related h2 { font-size: 1.25rem; }
.ecosystem { margin-top: 2.5rem; background: linear-gradient(135deg, #eef3ff, #f5f7fa); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; text-align: center; }
.ecosystem h2 { margin: 0 0 0.5rem; }
.ecosystem p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.25rem; }
.ecosystem-actions { display: flex; gap: 1rem; justify-content: center; align-items: center; flex-wrap: wrap; }

/* Footer */
.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem; }
.footer-links { margin-bottom: 0.75rem; }
.footer-links a { color: var(--muted); text-decoration: none; margin: 0 0.6rem; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }
.site-footer a { color: var(--accent); }

/* Legal pages (privacy, terms) — comfortable long-form reading. */
.legal { text-align: left; }
.legal h1 { font-size: 1.8rem; margin: 0 0 0.25rem; }
.legal h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.legal p { margin: 0 0 1rem; }
.legal ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.legal li { margin: 0.35rem 0; }
.legal code { background: #eef3ff; color: var(--accent-dark); padding: 0.1rem 0.35rem; border-radius: 5px; font-size: 0.9em; }
.legal a { color: var(--accent); }

/* Roadmap hint under the tool grid (replaces greyed-out "coming soon" cards). */
.tools-more { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 1.25rem 0 0; }

/* Trust microcopy under the Google Drive action — reassures on scope. */
.drive-note { color: var(--muted); font-size: 0.8rem; line-height: 1.4; margin: 0.6rem auto 0; max-width: 42ch; }

/* Visible keyboard focus for all interactive elements (accessibility). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 520px) {
  .hero h1 { font-size: 1.6rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .cta { width: 100%; }
}

/* --- Flagship product card (hub) ------------------------------------------
   One visually dominant entry point. Uses the same tokens as .tool-card so the
   hub still reads as one system; the difference is scale and the accent border,
   not a new visual language. */
.flagship { margin-top: 1.5rem; }
.flagship-card {
  display: block;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 16px rgba(47, 107, 255, 0.08);
  transition: transform .1s, box-shadow .15s;
}
.flagship-card:hover { transform: translateY(-2px); box-shadow: 0 4px 22px rgba(47, 107, 255, 0.16); }
.flagship-eyebrow {
  display: inline-block; background: #eef3ff; color: var(--accent);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem; border-radius: 6px; margin-bottom: 0.6rem;
}
.flagship-card h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.flagship-lead { margin: 0 0 0.9rem; color: var(--muted); font-size: 1.02rem; }
.flagship-points { margin: 0 0 1.1rem; padding-left: 1.1rem; color: var(--muted); }
.flagship-points li { margin: 0.25rem 0; }
.flagship-cta { display: inline-block; color: var(--accent); font-weight: 700; }

/* --- Utility converters (hub) --- */
.utilities { margin-top: 2.5rem; }
.utilities-heading { font-size: 1.15rem; margin: 0 0 0.3rem; }
.utilities-sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.utilities .tool-grid { margin-top: 1rem; }

/* --- Cross-link from a converter page to the flagship --- */
.upsell {
  margin-top: 2.5rem; padding: 1.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.upsell h2 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.upsell p { margin: 0 0 0.7rem; color: var(--muted); }
.upsell .cta.secondary {
  display: inline-block; margin: 0.3rem 0 0;
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
}
.upsell .cta.secondary:hover { background: #eef3ff; }

@media (max-width: 640px) {
  .flagship-card { padding: 1.25rem; }
  .flagship-card h2 { font-size: 1.3rem; }
}
