@font-face {
  font-family: "InDesign Hidden";
  src: url(../fonts/InDesignHidden-Regular.otf) format("opentype");
  font-display: swap;
}

:root {
  --bg: #0c0e11;
  --bg-2: #12151a;
  --panel: #171b21;
  --panel-2: #1d222a;
  --line: #2a3039;
  --line-2: #363d48;
  --text: #eef1f5;
  --text-2: #b4bcc8;
  --text-3: #808a98;
  --accent: #6bb3f5;
  --accent-2: #8dc4f8;
  --accent-ink: #06243f;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 10px;
  --mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, Consolas, monospace;
  --head: "Space Grotesk", "Space Grotesk Fallback", "Inter", "Inter Fallback", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* same page width with or without a scrollbar, so the header never shifts between pages */
html { scrollbar-gutter: stable; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 14, 17, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.tools { display: flex; gap: 4px; margin-left: 8px; }
.tools a { font-size: 14px; color: var(--text-2); padding: 6px 12px; border-radius: 8px; }
.tools a:hover { background: var(--panel); color: var(--text); }
.tools a.on { color: var(--text); background: var(--panel-2); }
.nav-right { margin-left: auto; display: flex; gap: 8px; }
.nav-right .btn { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 15px/1 "Inter", "Inter Fallback", sans-serif;
  padding: 13px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.btn:hover { background: var(--panel); border-color: var(--text-3); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-sm .icon { width: 16px; height: 16px; }

/* ---------- hero ---------- */
/* same top spacing as the landing page, so the 01 // line sits in the same place */
.hero { padding: 80px 0 56px; border-bottom: 1px solid var(--line); }

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.kicker b { color: var(--accent); font-weight: 500; }

h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 700; max-width: 900px; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }

.lead { font-size: 18px; color: var(--text-2); max-width: 640px; margin-top: 18px; }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-top: 32px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--text-3);
  font: 400 17px "Inter", "Inter Fallback", sans-serif;
  cursor: text;
  text-align: left;
}

.search-trigger:hover { border-color: var(--accent); }
.search-trigger .kbd { margin-left: auto; }

.kbd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 2px 7px;
}

.stats { display: flex; gap: 28px; margin-top: 28px; color: var(--text-3); font-size: 14px; }
.stats strong { display: block; font-family: var(--head); font-size: 24px; color: var(--text); font-weight: 600; }
/* touch screens have no keyboard shortcut to show */
@media (hover: none) and (pointer: coarse) { .kbd { display: none; } }
@media (max-width: 768px) {
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .stats > div[hidden] { display: none; }
  /* phones: main buttons and form buttons full width, one under the other (small header-style buttons stay) */
  main .btn:not(.btn-sm), main button[type=submit] { width: 100%; min-height: 46px; justify-content: center; }
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 24px 0;
}

.chip {
  font: 500 13px "Inter", "Inter Fallback", sans-serif;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { font-family: var(--mono); font-size: 12px; opacity: 0.8; margin-left: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- pattern cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 72px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.card:hover { border-color: var(--line-2); }

.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 12px; color: var(--text-3); }

.cat {
  background: #1e2b3b;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.cat.sample { background: #3b2a06; color: #facc15; }

.card h3, .card h1 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.card p.desc { color: var(--text-2); font-size: 14px; line-height: 1.6; margin-top: 8px; }

/* thin rule between the description and Find, same as the one above the credit */
.recipe { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.recipe-row + .recipe-row { margin-top: 16px; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 6px; flex-wrap: wrap; }

.field-label { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }

.preview { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
.preview-label { font-size: 11px; font-weight: 500; color: var(--text-3); }
.preview.after .preview-label { color: var(--accent-2); }

/* the example is drawn in the reading font, hidden characters in the InDesign Hidden font */
.example {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: right;
}

.preview.after .example { color: var(--text); }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-right: 10px;
}

.code {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* GREP must show exactly what to type: no "<=" to "≤" style ligatures */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

.code.empty { color: var(--text-3); font-family: "Inter", "Inter Fallback", sans-serif; font-size: 13px; }

.copy {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  justify-content: flex-end;
  padding: 5px 0 5px 8px;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font: 500 12px "Inter", "Inter Fallback", sans-serif;
  cursor: pointer;
}

.copy svg { width: 16px; height: 16px; flex: none; }
.copy:hover { color: var(--text); }
.copy.done { color: var(--ok); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* reserved space: the row is there even when empty, so cards never change height */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; min-height: 22px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { font-style: normal; font-family: "InDesign Hidden", sans-serif; font-size: 18px; line-height: 1; color: #6aa8ec; }

.hc { position: relative; }
.hc::after {
  content: attr(data-g);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -44%);
  font-family: "InDesign Hidden", sans-serif;
  font-size: 1.5em;
  color: #6aa8ec;
  opacity: 0;
  pointer-events: none;
}

.hc.ret::after {
  position: static;
  transform: none;
  font-size: 1em;
  line-height: inherit;
}
.hc.special { background: #22344a; border-radius: 3px; }
.show-hidden .hc::after { opacity: 0.95; }
.ex-i { font-style: italic; }
.ex-sup { font-size: 0.65em; vertical-align: super; line-height: 0; }
.ex-sc { font-variant: all-small-caps; letter-spacing: 0.04em; }
.ex-nb { background: rgba(107, 179, 245, 0.22); border-radius: 3px; }
.ex-st { background: rgba(74, 222, 128, 0.2); color: #b9f5cf; border-radius: 3px; }
.ex-obj { display: inline-block; width: 12px; height: 12px; background: var(--accent); border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.credit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}

.legend + .credit, .recipe + .credit { margin-top: 22px; }
.card .credit { margin-top: 22px; }
.card .report-link { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.card .report-link:hover { color: var(--text-2); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1e2b3b;
  color: var(--accent-2);
  font: 600 11px "Inter", "Inter Fallback", sans-serif;
  flex: none;
  object-fit: cover;
}

.credit .who { color: var(--text); font-weight: 500; }
.credit a { color: var(--text-2); }
.credit a:hover { color: var(--accent); }

.no-results { grid-column: 1 / -1; padding: 48px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 14px; }

/* ---------- contributors / share ---------- */
section.band { padding: 80px 0; border-top: 1px solid var(--line); }

.people { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.person { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--text); }
.person:hover { border-color: var(--accent); color: var(--text); }
.person small { display: block; color: var(--text-3); font-size: 12px; }
.person.empty { border-style: dashed; color: var(--text-2); }
.credits-line { margin-top: 40px; max-width: 760px; font-size: 14px; line-height: 1.7; color: var(--text-3); }
div.person:hover { border-color: var(--line); }

.share {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 48px;
  border: 1px dashed var(--line-2);
  border-radius: 18px;
}

.share ul { list-style: none; margin-top: 18px; }
.share li { color: var(--text-2); margin-bottom: 8px; padding-left: 26px; position: relative; }
.share li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 9px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.share-ctas { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.share-ctas .btn { width: 230px; justify-content: center; }


/* ---------- search palette ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 16px 16px;
  background: rgba(0, 0, 0, 0.6);
}

.palette.open { display: flex; }

.palette-box .pal-all { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--accent); }
.palette-box {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  overflow: hidden;
}

.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: 17px "Inter", "Inter Fallback", sans-serif; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }

.res {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}

.res small { display: block; color: var(--text-3); font-size: 13px; }
.res code { font-family: var(--mono); font-size: 12px; color: var(--text-2); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.res.active { background: var(--panel-2); }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 15px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

.card.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107, 179, 245, 0.2); }

/* ---------- forms (sign in, later profile and submit) ---------- */
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
input[type=email], input[type=text], input[type=url], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font: 16px "Inter", "Inter Fallback", sans-serif;
  padding: 13px 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-msg { font-size: 14px; margin-top: 12px; min-height: 22px; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--ok); }
.auth-box { max-width: 440px; margin: 0 auto; padding: 72px 0 96px; }
.auth-box h1 { font-size: 40px; margin-bottom: 12px; }
.auth-box .lead { color: var(--text-2); margin-bottom: 28px; }
.auth-box .btn { width: 100%; justify-content: center; margin-top: 20px; }
.auth-box .cf-turnstile { margin-top: 20px; min-height: 65px; }
.auth-box .fine { font-size: 13px; color: var(--text-3); margin-top: 20px; }
.auth-sent[hidden], .auth-form[hidden] { display: none; }

/* ---------- profile editor (/grep-library/me) ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; align-items: start; padding: 40px 0 80px; }
.editor h1 { font-size: 40px; margin-bottom: 8px; }
.editor .lead { color: var(--text-2); margin-bottom: 28px; }
.editor .group { margin-bottom: 22px; }
.editor .hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.editor .hint.over { color: var(--bad); }
.editor textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.editor .slug-field { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); }
.editor .slug-field span { padding-left: 14px; color: var(--text-3); font-size: 15px; white-space: nowrap; }
.editor .slug-field input { border: 0; padding-left: 2px; background: transparent; }
.editor .slug-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.editor .slug-field input:focus { outline: 0; }
.editor .link-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; margin-bottom: 8px; }
.editor .link-row .btn { padding: 0 12px; height: 48px; }
.editor .photo-row { display: flex; align-items: center; gap: 16px; }
.editor .photo-row .photo { width: 88px; height: 88px; font-size: 30px; border-radius: 14px; }
.editor .photo-row .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.editor .actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.editor .invalid { outline: 2px solid var(--bad); outline-offset: 1px; }
.editor .preview-pane { position: sticky; top: 84px; }
.editor .preview-pane .profile { grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.editor .preview-pane .photo { width: 120px; height: 120px; font-size: 40px; }
.editor .preview-pane h1 { font-size: 30px; }
.editor .preview-pane .bio { white-space: pre-line; font-size: 15px; }
.welcome { border: 1px solid var(--accent); background: var(--bg-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 24px; color: var(--text-2); font-size: 15px; }
.welcome[hidden], .editor [hidden] { display: none; }

@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; gap: 32px; }
  .editor .preview-pane { position: static; }
}
@media (max-width: 560px) {
  .editor .link-row { grid-template-columns: 1fr auto; }
  .editor .link-row .link-label { grid-column: 1 / -1; }
  .editor .preview-pane .profile { grid-template-columns: 1fr; }
}

/* ---------- share a GREP (/grep-library/submit/) ---------- */
.submit textarea.mono, .submit .mono { font-family: var(--mono); font-size: 15px; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; min-height: 0; }
.submit .preview-pane .card { margin: 0; }
.submit .fine { font-size: 13px; color: var(--text-3); margin: 4px 0 16px; }
/* one line from the library to the script (library hero, GREP pages) */
.lib-script { margin-top: 10px; font-size: 15px; color: var(--text-2); }
.lib-script a { color: var(--accent); }
.pattern-page .lib-script { margin-top: 24px; }

/* ---------- download thanks page (/download/) ---------- */
.dl-page { max-width: 860px; padding-top: 56px; padding-bottom: 72px; }
.dl-page h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }
.dl-file { color: var(--text-2); font-size: 15px; }
.dl-file code { font-family: var(--mono); font-size: 14px; color: var(--text); background: var(--panel-2); border-radius: 5px; padding: 2px 7px; overflow-wrap: anywhere; }
.dl-again { margin-top: 8px; font-size: 14px; color: var(--text-3); }
.dl-again a:not(.btn), .dl-next a { color: var(--accent); }
.dl-again .btn { margin-top: 10px; }
.dl-steps { margin: 32px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.dl-steps li { counter-increment: step; position: relative; padding: 18px 20px 18px 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text-2); line-height: 1.65; }
.dl-steps li::before { content: counter(step); position: absolute; left: 20px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 600 15px/30px var(--head); text-align: center; }
.dl-steps b { color: var(--text); font-weight: 600; }
.dl-next { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dl-next h2 { font-size: 18px; margin-bottom: 6px; }
.dl-next p { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.dl-page .consent { margin-top: 32px; }
@media (max-width: 760px) { .dl-next { grid-template-columns: 1fr; } }

/* ---------- special characters (/grep-library/learn/special-characters/) ---------- */
.sc-page { padding-top: 56px; padding-bottom: 72px; }
.sc-page h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 12px; }
.sc-page .lead { color: var(--text-2); font-size: 17px; line-height: 1.7; max-width: 760px; }
.sc-links { margin: 14px 0 8px; font-size: 14px; color: var(--text-3); }
.sc-links a { color: var(--accent); }
.sc-page h2 { font-size: 24px; margin: 44px 0 12px; }
.sc-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sc-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
.sc-table th, .sc-table td { text-align: left; vertical-align: middle; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.sc-table th { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--bg-2); }
.sc-table tr:last-child td { border-bottom: 0; }
.sc-table td:first-child { color: var(--text); }
.sc-table code { font-family: var(--mono); font-size: 14px; color: var(--text); background: var(--panel-2); border-radius: 5px; padding: 2px 7px; font-variant-ligatures: none; }
.sc-glyph { font-size: 20px; color: var(--text); min-width: 64px; }
.sc-none { font-size: 13px; color: var(--text-3); }
.sc-table tr.sc-part td:last-child { color: #facc15; }
.sc-table tr.sc-no td:last-child { color: var(--text-3); font-style: italic; }
.sc-table tr.sc-hangs td:last-child { color: var(--bad); font-style: normal; }

/* ---------- privacy and terms (/privacy/, /terms/) ---------- */
.legal { max-width: 760px; padding-top: 56px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 12px; }
.legal .lead { color: var(--text-2); font-size: 17px; line-height: 1.7; margin-bottom: 8px; }
.legal h2 { font-size: 26px; margin: 44px 0 12px; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--text-2); font-size: 16px; line-height: 1.75; }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 10px 0 0 22px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); }
.legal code { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--panel-2); border-radius: 5px; padding: 1px 6px; }
/* "By continuing you agree to the Terms and the Privacy Policy." under the forms */
.consent { font-size: 13px; line-height: 1.6; color: var(--text-3); margin: 10px 0 0; }
.consent a { color: var(--text-2); text-decoration: underline; }

/* ---------- ask for a GREP (/grep-library/ask/) ---------- */
.ask fieldset.ask-examples { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.ask .ask-examples legend { margin-bottom: 12px; }
.ask .ask-example { padding: 16px 16px 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.ask .ask-example .group { margin-bottom: 16px; }
.ask .ask-example input { font-size: 17px; }
.ask .ask-example[hidden], .ask #ak-more[hidden] { display: none; }
.ask .cf-turnstile { margin: 4px 0 16px; min-height: 65px; }
.ask .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ask-preview { display: grid; gap: 12px; }
/* hidden characters visible while typing (hidden-field.js): the mirror draws the text, the field on top
   keeps the caret and selection with transparent text */
.hc-wrap { position: relative; }
.hc-mirror { position: absolute; z-index: 0; box-sizing: border-box; overflow: hidden; white-space: pre; color: var(--text); pointer-events: none; }
.hc-mirror.multi { white-space: pre-wrap; overflow-wrap: break-word; }
.hc-wrap .hc-input { position: relative; z-index: 1; background: transparent; color: transparent; caret-color: var(--text); }
.hc-wrap .hc-input::placeholder { color: var(--text-3); }
.hc-wrap .hc-input::selection { background: rgba(107, 179, 245, 0.35); color: transparent; }
.hc.ink { color: transparent; }
.hc-quiet .hc:not(.special):not(.ink)::after { opacity: 0; }
.ask-ex { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: grid; gap: 8px; }
.ask-ex .preview { justify-content: space-between; margin-left: 0; }
.ask-ex .example { text-align: right; }
.warnings { margin-top: 12px; padding: 12px 16px 12px 32px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }
.warnings[hidden] { display: none; }
.warnings li + li { margin-top: 6px; }

/* ---------- your GREPs (/grep-library/me) ---------- */
.my-greps { padding-bottom: 80px; }
.my-greps .section-head { padding-top: 24px; border-top: 1px solid var(--line); }
.mg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.mg-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 16px 18px; }
.mg-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.mg-find { display: block; margin-top: 10px; font-family: var(--mono); font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; font-variant-ligatures: none; }
.mg-item .hint { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.mg-note { margin-top: 10px; color: var(--text-2); font-size: 14px; }
.mg-actions { display: flex; gap: 8px; margin-top: 12px; }
.badge.bad { border-color: var(--bad); color: var(--bad); }
.my-greps .lead[hidden] { display: none; }

/* ---------- review queue (/grep-library/admin) ---------- */
.admin-queue { padding: 40px 24px 80px; }
.admin-queue h1 { font-size: 40px; margin-bottom: 20px; }
.admin-queue [hidden] { display: none; }
.aq-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.aq-tabs button { font: 500 14px "Inter", "Inter Fallback", sans-serif; color: var(--text-2); background: transparent; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.aq-tabs button[aria-selected="true"] { color: var(--text); background: var(--panel-2); border-color: var(--text-3); }
.aq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.aq-item { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.aq-side { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 16px; display: grid; gap: 10px; }
.aq-who { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.aq-side .hint { font-size: 13px; color: var(--text-3); }
.aq-note { min-height: 90px; font-size: 14px; }
.rq-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.fn-box { display: block; }
.fn-table { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 15px; }
.fn-table th, .fn-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.fn-table th { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.fn-table td + td { text-align: right; font-variant-numeric: tabular-nums; }
.rq-body { display: grid; gap: 12px; min-width: 0; }
.rq-desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.aq-trust { justify-self: start; }
@media (max-width: 960px) { .aq-item { grid-template-columns: 1fr; } }

/* ---------- one GREP (/grep-library/p/<id>) ---------- */
.pattern-page { padding-bottom: 80px; }
.pattern-one { max-width: 760px; margin-top: 24px; }
.pattern-more { margin-top: 24px; color: var(--text-3); font-size: 14px; }
.related { max-width: 760px; margin-top: 32px; }
.related h2 { font-family: var(--head); font-size: 18px; line-height: 28px; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.related a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--text-2); font-size: 14px; line-height: 20px; }
.related a:hover { border-color: var(--accent); color: var(--text); }
@media (max-width: 640px) { .related ul { grid-template-columns: 1fr; } }
.card h3 a, .card h1 a { color: inherit; }
.card h3 a:hover, .card h1 a:hover { color: var(--accent-2); }

/* ---------- hidden-character palette (submit form, M4.3) ---------- */
.palette-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 14px; margin: 4px 0 22px; }
.pal-title { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.pal-group + .pal-group { margin-top: 12px; }
.pal-group-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.pal-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text-2); font: 500 12px "Inter", "Inter Fallback", sans-serif; cursor: pointer; }
.pal-btn:hover { border-color: var(--accent); color: var(--text); }
.pal-token { font-family: var(--mono); font-size: 12px; color: var(--accent-2); font-variant-ligatures: none; }

/* ---------- member profile (static page, editor preview, D1 profiles) ---------- */
.crumbs { padding: 28px 0 0; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }

.profile {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: start;
  padding: 36px 0 56px;
  border-bottom: 1px solid var(--line);
}

.photo {
  width: 200px;
  height: 200px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font: 600 64px var(--head);
  color: var(--text);
  object-fit: cover;
}

.profile h1 { font-size: clamp(34px, 4.4vw, 48px); }
.meta { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.meta span + span::before { content: "·"; margin: 0 8px; color: var(--text-3); }

.badges { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  border-radius: 6px;
  padding: 3px 8px;
}
.badge.ok { border-color: rgba(74, 222, 128, 0.4); color: var(--ok); }

.bio { margin-top: 20px; color: var(--text-2); font-size: 17px; max-width: 620px; }

.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

.side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.side .num { font: 600 30px var(--head); }
.side .lbl { color: var(--text-3); font-size: 14px; }
.side .row + .row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.side .report { display: block; margin-top: 18px; font-size: 13px; color: var(--text-3); }
.side .report:hover { color: var(--text-2); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 56px 0 24px; }
.copies { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-left: auto; }

@media (max-width: 960px) {
  .profile { grid-template-columns: 1fr; gap: 24px; }
  .photo { width: 140px; height: 140px; font-size: 44px; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
  /* phones and tablets: the two tools stay reachable as a second row of the header */
  .nav .wrap { flex-wrap: wrap; height: auto; row-gap: 2px; padding-top: 10px; padding-bottom: 6px; }
  .tools { order: 3; flex-basis: 100%; margin-left: -12px; display: flex; }
  .tools a { font-size: 13px; padding: 5px 12px; }
}

@media (max-width: 560px) {
  .nav-right .signin { display: none; }
  /* brand + Share a GREP + Sign in must fit 375 px */
  .nav .wrap { gap: 12px; }
  .nav-right .btn-sm { padding: 0 10px; }
  .nav-right .btn-primary .icon { display: none; }
  .preview { flex-basis: 100%; justify-content: flex-start; margin-left: 0; }
  .example { text-align: left; }
  .credit { flex-wrap: wrap; }
}

