/* SquareJuice help center. One radius (4px), no pills, mobile first. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #4a4a48;
  --muted: #6e6e6a;
  --line: #e3e1da;
  --accent: #1f5f3f;
  --accent-ink: #163f2b;
  --code-bg: #f1efe8;
  --radius: 4px;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --measure: 68ch;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--accent-ink);
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.skip {
  position: absolute;
  left: 16px;
  top: -40px;
  background: var(--surface);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.skip:focus {
  top: 8px;
  z-index: 10;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand .muted {
  color: var(--muted);
  font-weight: 400;
  margin-left: -6px;
}
.mark {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: var(--radius);
  display: inline-block;
}
.top-link {
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.top-link:hover {
  text-decoration: underline;
}

/* Shell: nav + content */
.shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 56px;
}

.pages ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pages li a {
  display: block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
}
.pages li.current a {
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.pages li a:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.content {
  min-width: 0;
  max-width: var(--measure);
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  overflow-wrap: anywhere;
}
h1 {
  font-size: 2rem;
  margin-top: 4px;
}
h2 {
  font-size: 1.375rem;
  margin-top: 2em;
  padding-top: 0.75em;
  border-top: 1px solid var(--line);
}
h3 {
  font-size: 1.0625rem;
  margin-top: 1.5em;
}
p,
ul,
ol {
  margin: 0 0 1em;
}
li {
  margin-bottom: 0.35em;
}
ul,
ol {
  padding-left: 1.4em;
}
.lede {
  color: var(--ink-2);
  font-size: 1.125rem;
}
.aside {
  color: var(--ink-2);
  border-left: 3px solid var(--line);
  padding-left: 14px;
}
strong {
  font-weight: 600;
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

/* Table of contents */
.toc {
  margin: 0 0 1.5em;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9375rem;
}
.toc p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
}
.toc li {
  margin: 0 0 4px;
}
.toc a {
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.9375rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 600;
  color: var(--ink-2);
  background: var(--code-bg);
}
tbody tr:last-child td {
  border-bottom: 0;
}

/* Index cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.cards a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.cards a:hover {
  border-color: var(--accent);
}
.cards strong {
  display: block;
  margin-bottom: 2px;
}
.cards span {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: 0.875rem;
}
.foot p {
  margin: 0;
}

/* Wider screens */
@media (min-width: 760px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    padding-top: 40px;
  }
  .pages {
    position: sticky;
    top: 24px;
    align-self: start;
  }
  .pages ul {
    flex-direction: column;
    gap: 2px;
  }
  .pages li a {
    border: 0;
    background: none;
    padding: 6px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .pages li.current a {
    border-left-color: var(--accent);
    background: var(--surface);
  }
  .pages li a:hover {
    background: var(--surface);
  }
  h1 {
    font-size: 2.375rem;
  }
  .toc ul {
    columns: 2;
    column-gap: 24px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
