@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Base styles and shared buttons. Requires tokens.css loaded first. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-page-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
 * Underlines: the one rule every link and hover underline uses. Real
 * text-decoration only (never borders, shadows, or gradients under text), so
 * skip-ink can break the line around descenders. Links underline on hover;
 * .link-inline is underlined at rest. Whole-row links (.row-link) underline
 * only their primary line (.row-link-primary, the name), never the row.
 */
a, .link-inline, .row-link-primary {
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  text-decoration-skip-ink: auto;
}
a { color: var(--color-brand); text-decoration-line: none; }
a:hover { color: var(--color-brand-hover); text-decoration-line: underline; }
.link-inline { text-decoration-line: underline; }
a.row-link:hover { text-decoration-line: none; }
a.row-link:hover .row-link-primary { text-decoration-line: underline; }
/* The primary line usually clips for its ellipsis (overflow: hidden): room below the
   baseline for the offset underline, given back by the margin so nothing moves. */
.row-link-primary { padding-bottom: var(--space-4); margin-bottom: calc(-1 * var(--space-4)); }

/* Read by screen readers, not shown (live readouts, extra labels). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: var(--radius-sm);
  border: 3px solid var(--color-page-bg);
}

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
  font: inherit;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  height: var(--control-h-md); /* size md; .btn-sm is the only other size */
  padding: 0 var(--control-pad-x-md);
}
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Primary: ink fill, brand blue on hover */
.btn-primary {
  background: var(--color-ink);
  color: var(--color-text-inverse);
  border-color: var(--color-ink);
}
.btn-primary:hover:not(:disabled) { background: var(--color-brand); border-color: var(--color-brand); }

/* Secondary: white with border */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-strong);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-bg-control); }

/* Tertiary: quieter than secondary — grey fill, no border, secondary text */
.btn-tertiary {
  background: var(--color-btn-tertiary-bg);
  color: var(--color-btn-tertiary-text);
  border-color: transparent;
}
.btn-tertiary:hover:not(:disabled):not(.is-unavailable) { background: var(--color-btn-tertiary-bg-hover); }

/* Danger: white with red border and text */
.btn-danger {
  background: var(--color-surface);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}
.btn-danger:hover:not(:disabled) { background: var(--color-danger-bg); }

/* Chip: pill-shaped quick action / filter */
.btn-chip {
  background: var(--color-bg-control);
  color: var(--color-text-strong);
  border-color: var(--color-border);
  border-radius: var(--radius-pill);
  height: var(--chip-h); /* a chip-shaped button: chip size */
  padding: 0 var(--chip-pad-x);
  font-size: 12.5px;
}
.btn-chip:hover:not(:disabled) { background: var(--color-bg-control-hover); }
.btn-chip.is-accent {
  background: var(--color-blue-tint-bg);
  color: var(--color-blue-tint-text);
  border-color: var(--color-blue-tint-border);
}
.btn-chip.is-accent:hover:not(:disabled) { background: var(--color-blue-tint-bg-hover); }

/* Mini: the quiet look for compact actions in cards and rows (a tone, not a size: pair it with .btn-sm) */
.btn-mini {
  background: var(--color-bg-control);
  color: var(--color-text-strong);
  border-color: var(--color-border);
}
.btn-mini:hover:not(:disabled) { background: var(--color-bg-control-hover); }
