/* Web app shell. Loads after components.css and re-points its tokens at the
   webandseo.dev palette, then lays out the page around the tool. */

:root {
  --bg: #05060a;
  --panel: #0d0f12;
  --panel-2: #141821;
  --border: #1c1f24;
  --text: #f7f8f8;
  --muted: #8a9099;
  --green: #00d084;
  --red: #e64c66;
  --blue: #4f8ff7;

  --radius: 10px;
  --radius-card: 14px;
  --space: 8px;
  --wrap: 1120px;
  /* Manrope is the site font; on the standalone build it simply falls back */
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #00a86a;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: calc(var(--space) * 3);
}

/* ---------- Page chrome ---------- */

.site-head {
  border-bottom: 1px solid var(--border);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--space) * 2);
  padding-block: calc(var(--space) * 2.5);
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-head nav {
  display: flex;
  gap: calc(var(--space) * 2);
  font-size: 0.875rem;
}

.hero {
  padding-block: calc(var(--space) * 6) calc(var(--space) * 4);
}

h1 {
  margin: 0 0 calc(var(--space) * 2);
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* ---------- URL form ---------- */

.url-form {
  display: flex;
  gap: var(--space);
  margin-top: calc(var(--space) * 4);
  max-width: 760px;
}

.url-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#url-input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9375rem;
}

#url-input::placeholder {
  color: #5c636d;
}

#url-input:focus {
  border-color: var(--green);
  outline: none;
}

.btn {
  flex-shrink: 0;
  background: var(--green);
  color: #05060a;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.btn:hover {
  background: #00a86a;
  border-color: #00a86a;
}

.form-error {
  max-width: 760px;
  margin-top: calc(var(--space) * 1.5);
  color: var(--red);
  font-size: 0.9375rem;
}

/* ---------- Tool ---------- */

.app {
  margin-top: calc(var(--space) * 5);
  padding: calc(var(--space) * 3);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

/* the panels sit on the app surface, one shade up from the popup's */
.app .card,
.app .col,
.app #status,
.app #market-select {
  background: var(--panel-2);
}

#market-title {
  font-size: 1.0625rem;
}

#market-meta {
  font-size: 0.8125rem;
}

#status {
  margin-bottom: calc(var(--space) * 1.5);
}

.card-pl {
  font-size: 1.625rem;
}

.row {
  font-size: 0.8125rem;
  padding: 7px 12px;
}

.col-head,
.row-head {
  padding-inline: 12px;
}

.rows {
  overflow: visible;
}

/* ---------- Static sections ---------- */

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--space) * 3);
  padding-block: calc(var(--space) * 7);
}

.notes h2 {
  margin: 0 0 var(--space);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.notes p {
  margin: 0 0 var(--space);
  color: var(--muted);
  font-size: 0.9375rem;
}

.bookmarklet-link {
  display: inline-block;
  margin-block: var(--space);
  padding: 8px 16px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
}

.site-foot {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-foot .wrap {
  padding-block: calc(var(--space) * 3) calc(var(--space) * 6);
}

.site-foot p {
  margin: 0 0 var(--space);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 800px) {
  .url-form {
    flex-direction: column;
  }

  #summary,
  #columns {
    grid-template-columns: 1fr;
  }

  .app {
    padding: calc(var(--space) * 2);
  }
}

@media (max-width: 420px) {
  .row {
    grid-template-columns: 14px 18px minmax(0, 1fr) 46px 50px 46px;
    gap: 4px;
    padding-inline: 8px;
    font-size: 0.75rem;
  }

  .col-head,
  .row-head {
    padding-inline: 8px;
  }
}
