/* ============================================================
   GeminiError.com — v2 design
   Clean, compact, card-based troubleshooting layout.
   ============================================================ */

:root {
  --ink: #101828;
  --body: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e6e9f0;
  --line-strong: #d5dae3;
  --bg: #ffffff;
  --soft: #f7f8fb;
  --soft-2: #f2f4f8;
  --accent: #2563eb;
  --accent-ink: #1e40af;
  --accent-soft: #ebf1fe;
  --violet: #7c3aed;
  --green: #0d9464;
  --green-soft: #e8f7f0;
  --amber: #f5b940;
  --amber-soft: #fff7e5;
  --amber-ink: #6b4d05;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .07);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .10);
  --container: 1140px;
  --gutter: 20px;
  --pad: max(var(--gutter), calc((100% - var(--container)) / 2));
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
section { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------------- Header ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 0 var(--pad);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 50% 3px 50% 3px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
}
.topbar nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--body);
}
.topbar nav a { padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); background: var(--soft-2); }
.topbar nav a.active { color: var(--accent); background: var(--accent-soft); }

/* ---------------- Buttons ---------------- */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.primary:hover { background: var(--accent-ink); }
.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.secondary:hover { border-color: var(--faint); background: var(--soft); }
.primary:active, .secondary:active { transform: translateY(1px); }

/* ---------------- Section scaffolding ---------------- */
main > section { padding: 64px var(--pad); }
.section-head { max-width: 780px; margin: 0 auto 36px; text-align: center; }
.section-head.sub { margin-top: 48px; margin-bottom: 24px; }
.section-head.sub h2 { font-size: 22px; }
.section-head p:not(.eyebrow) {
  max-width: 700px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 17px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 48px;
  padding-top: 72px !important;
  padding-bottom: 72px !important;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--accent-soft) 0%, rgba(235, 241, 254, 0) 60%),
    radial-gradient(700px 380px at 95% 0%, #f3ecfe 0%, rgba(243, 236, 254, 0) 55%),
    var(--bg);
}
.hero-copy { max-width: 640px; }
.hero .lead { margin-top: 18px; color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.disclaimer { margin-top: 22px; max-width: 560px; color: var(--faint); font-size: 13px; line-height: 1.55; }
.safety-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.safety-card > span {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.safety-card ul { margin: 0; padding: 0; list-style: none; }
.safety-card li {
  position: relative;
  margin: 10px 0;
  padding-left: 28px;
  color: var(--body);
  font-size: 15px;
  font-weight: 600;
}
.safety-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.2 2.2L8 1' fill='none' stroke='%230d9464' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

/* ---------------- Diagnose cards ---------------- */
.workflow-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.workflow-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.workflow-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.workflow-grid h3 { font-size: 16.5px; }
.workflow-grid p { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* ---------------- Error table ---------------- */
.errors { background: var(--soft); }
.table-wrap {
  max-width: var(--container);
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.error-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.error-table th, .error-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.error-table thead th {
  position: sticky;
  top: 0;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.error-table tbody tr:last-child td { border-bottom: 0; }
.error-table tbody tr:hover { background: #fafbfd; }
.error-table strong { color: var(--ink); font-size: 14.5px; }
.error-table td { color: var(--muted); }
.error-table a { color: var(--accent); font-weight: 600; }
.error-table a:hover { text-decoration: underline; }

/* ---------------- Fix paths ---------------- */
.fix-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fix-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.fix-grid h3 {
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.fix-grid ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.fix-grid li {
  position: relative;
  counter-increment: step;
  margin: 12px 0;
  padding-left: 36px;
  color: var(--muted);
  font-size: 14px;
}
.fix-grid li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}

/* ---------------- Status / tool cards ---------------- */
.status { background: var(--bg); }
.alternatives { background: var(--soft); }
.tool-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tool-grid a {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tool-grid a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-grid strong { display: block; color: var(--ink); font-size: 17px; font-weight: 800; }
.tool-grid span {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tool-grid p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.tool-grid .highlight { background: linear-gradient(160deg, #fffdf5, var(--amber-soft)); border-color: #ecd08c; }
.tool-grid .highlight:hover { border-color: var(--amber); }

/* ---------------- Developer checklist ---------------- */
.developers { background: var(--bg); padding-top: 0 !important; }
.dev-card {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 44px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, #fff 55%, var(--accent-soft));
  box-shadow: var(--shadow-md);
}
.dev-card h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 2px; }
.dev-card p:not(.eyebrow) { margin-top: 14px; color: var(--muted); font-size: 16px; }
.check-list { margin: 0; padding: 22px 24px; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.check-list li {
  position: relative;
  margin: 9px 0;
  padding-left: 28px;
  color: var(--body);
  font-size: 14px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7' viewBox='0 0 9 7'%3E%3Cpath d='M1 3.5l2.2 2.2L8 1' fill='none' stroke='%230d9464' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

/* ---------------- Guides network ---------------- */
.guides { background: var(--soft); }
.mini-link-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.mini-link-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-link-grid a {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mini-link-grid a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mini-link-grid strong { color: var(--ink); font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.mini-link-grid p { margin-top: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mini-link-grid .dest {
  margin-top: auto;
  padding-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.mini-link-grid .dest::after { content: " →"; }

.net-links {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.net-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--body);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, color .15s ease;
}
.net-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- FAQ ---------------- */
.faq { background: var(--bg); }
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
details[open] { border-color: var(--line-strong); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transition: transform .15s ease;
}
details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
details p { padding: 0 20px 18px; color: var(--muted); font-size: 14.5px; }

/* ---------------- Footer ---------------- */
.footer {
  padding: 32px var(--pad);
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}
.footer p { max-width: 860px; margin: 0 auto; }
.footer a { color: var(--muted); font-weight: 600; }
.footer a:hover { color: var(--accent); }

/* ---------------- Mobile nav ---------------- */
.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.mobile-nav-open .mobile-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-open .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
.mobile-nav-open .mobile-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .topbar nav { font-size: 13px; gap: 0; }
  .topbar nav a { padding: 7px 8px; }
  .workflow-grid, .mini-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-link-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hero, .dev-card { grid-template-columns: 1fr; gap: 32px; }
  .hero-copy { max-width: 100%; }
  .fix-grid, .tool-grid, .mini-link-grid.three { grid-template-columns: 1fr; }
  .fix-grid { max-width: 640px; }

  /* Card-style rows for the error table on small screens */
  .table-wrap { border: 0; background: none; box-shadow: none; overflow: visible; }
  .error-table, .error-table tbody, .error-table tr, .error-table td { display: block; width: 100%; }
  .error-table thead { display: none; }
  .error-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .error-table td { border-bottom: 1px solid var(--line); }
  .error-table tr td:last-child { border-bottom: 0; }
  .error-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
}

@media (max-width: 860px) {
  .topbar { gap: 12px; }
  .topbar nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: var(--gutter);
    right: var(--gutter);
    z-index: 120;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-lg);
  }
  .topbar.mobile-nav-open nav { display: flex; }
  .topbar nav a { min-height: 44px; display: flex; align-items: center; white-space: normal; }
  .mobile-nav-toggle { display: inline-flex; margin-left: auto; }
}

@media (max-width: 640px) {
  main > section { padding-top: 48px; padding-bottom: 48px; }
  .hero { padding-top: 48px !important; padding-bottom: 48px !important; }
  .primary, .secondary { width: 100%; }
  .workflow-grid, .mini-link-grid { grid-template-columns: 1fr; }
  .dev-card { padding: 24px; }
  .safety-card { padding: 20px; }
}
