/* unitandledger.com. One plain style sheet, no scripts, nothing loaded from other hosts.
   The colors are the add-on's own (COLORS in addon/src/Code.js), so the pages look like the tabs it builds:
   a green banner row with an italic line under it, ruled white rows, yellow cells where you type.
   --muted is darker than the add-on's muted grey so small text keeps a contrast of at least 4.5 to 1. */
:root {
  --primary: #2F5D50;
  --primary-dark: #1F4037;
  --accent: #E07A5F;
  --sand: #F2CC8F;
  --paper: #FAF7F2;
  --ink: #2B2D42;
  --soft: #DDE8E1;
  --line: #D9D4C7;
  --band: #F4F1EA;
  --input: #FFF6DF;
  --muted: #5A5F66;
  --white: #FFFFFF;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

main { flex: 1 0 auto; }
.wrap { width: 100%; max-width: 66rem; margin: 0 auto; padding: 0 1.25rem; }
.nw { white-space: nowrap; }

a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999rem; top: 0; background: var(--white); color: var(--ink); padding: 0.6rem 1rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; z-index: 2; }

/* ---- top bar */
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 2rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.wordmark { font-weight: 700; font-size: 1.125rem; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--ink); text-decoration: underline; }
.top nav, .foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 1rem; }
.top nav a, .foot nav a { padding: 0.3rem 0; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }

/* ---- banner: the same green title row the add-on puts at the top of each tab */
.banner { background: var(--primary); color: var(--white); border-bottom: 6px solid var(--sand); }
.banner .wrap { padding-top: 2.25rem; padding-bottom: 2rem; }
.banner h1 { margin: 0; font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.banner .lede { margin: 0.6rem 0 0; max-width: 40rem; font-style: italic; font-size: 1.125rem; line-height: 1.5; }
.home .banner .wrap { padding-top: 3rem; padding-bottom: 2.75rem; }
.home .banner h1 { font-size: 1.9rem; }
.home .banner .lede { font-size: 1.2rem; }
.install { margin: 1.5rem 0 0; }
.button { display: inline-block; background: var(--sand); color: var(--ink); font-weight: 700; text-decoration: none; padding: 0.75rem 1.25rem; border-radius: 3px; }
.button:hover { background: var(--input); color: var(--ink); }
.banner a:focus-visible { outline-color: var(--white); }

/* ---- page body */
.page { padding-top: 2.25rem; padding-bottom: 1rem; }
.page > p, .page > ul, .page > ol, .page > blockquote, .page > h2, .page > h3,
section > p, section > ul, section > h2, section > h3 { max-width: 40rem; }
h2 { margin: 2.75rem 0 0.75rem; font-size: 1.5rem; line-height: 1.25; color: var(--primary); }
h3 { margin: 2rem 0 0.5rem; font-size: 1.175rem; line-height: 1.3; }
.text .page > h3 { margin-top: 2.25rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.page > :first-child, section > :first-child { margin-top: 0; }
section { margin-top: 3.25rem; }
section.lead-shot { margin-top: 0; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--primary); }
b, strong { font-weight: 700; }
p a, li a, td a { overflow-wrap: anywhere; }
.fine { color: var(--muted); font-size: 0.95rem; }

/* Google's own words, quoted */
blockquote { margin: 0 0 0.75rem; padding: 0.7rem 1rem; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--sand); }
blockquote p { margin: 0; }

/* ---- screenshots */
.shot { margin: 0; }
.shot a { display: block; border: 1px solid var(--line); background: var(--white); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 0.6rem; max-width: 40rem; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.pair { display: grid; grid-template-columns: 1fr; gap: 1.5rem 3rem; align-items: start; }
.pair > div > :first-child { margin-top: 0; }
.pair.shots { margin: 1.75rem 0 1.5rem; }

/* ---- the steps, ruled like rows of a sheet with the row number at the left */
.steps { list-style: none; counter-reset: step; margin: 0 0 1.25rem; padding: 0; max-width: 48rem; background: var(--white); border: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3rem 1fr; margin: 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); display: flex; align-items: center; justify-content: center; background: var(--soft); border-right: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.steps li > span { display: block; padding: 0.85rem 1rem; }

/* ---- the two permissions: Google's words beside plain words */
.ledger { width: 100%; max-width: 56rem; margin: 0 0 1.25rem; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.ledger th { background: var(--primary); color: var(--white); text-align: left; font-weight: 700; padding: 0.6rem 1rem; }
.ledger td { padding: 0.85rem 1rem; vertical-align: top; border-top: 1px solid var(--line); }
.ledger td:first-child { width: 42%; background: var(--input); border-right: 1px solid var(--line); }

/* ---- footer */
.foot { margin-top: 4rem; background: var(--band); border-top: 1px solid var(--line); font-size: 0.95rem; }
.foot .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }
.foot nav { margin-bottom: 1rem; }
.foot p { margin: 0 0 0.3rem; }

/* ---- wider screens */
@media (min-width: 48rem) {
  .banner h1 { font-size: 2.5rem; }
  .home .banner h1 { font-size: 2.75rem; }
  .pair { grid-template-columns: 1fr 1fr; }
  .pair.shots { grid-template-columns: 7fr 5fr; }
}

/* ---- narrow screens: the permission table becomes stacked blocks */
@media (max-width: 40rem) {
  .ledger thead { position: absolute; left: -999rem; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger td:first-child { width: 100%; border-right: 0; }
  .ledger tr + tr td:first-child { border-top: 3px solid var(--primary); }
  .ledger td::before { content: attr(data-label); display: block; margin-bottom: 0.2rem; font-size: 0.95rem; font-weight: 700; }
}

@media print {
  .top nav, .foot nav, .skip { display: none; }
  .banner { background: none; color: var(--ink); border-bottom: 2px solid var(--ink); }
  body { background: none; }
}
