:root {
  --charcoal: #0F1117;
  --charcoal-light: #1A1D27;
  --orange: #E8652D;
  --orange-dark: #D1551F;
  --orange-light: #FFF5F0;
  --grey-100: #F3F4F6;
  --grey-200: #E5E7EB;
  --grey-400: #9CA3AF;
  --grey-500: #6B7280;
  --grey-700: #374151;
  --page: #F3F4F8;
  --success: #10B981;
  --success-light: #ECFDF5;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--charcoal);
  background: var(--page);
}
a { color: var(--orange-dark); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
p { margin: 0 0 0.8rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--grey-100); padding: 0.1em 0.35em; border-radius: 4px; }
pre {
  background: var(--charcoal);
  color: #F9FAFB;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
pre.key { font-size: 1.05rem; letter-spacing: 0.02em; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.topbar { background: var(--charcoal); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; padding: 0.5rem 0; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand span { color: var(--orange); }
.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a { white-space: nowrap; }

/* Off-screen but still read aloud, for labels the layout does not need. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.nav a { color: #D1D5DB; text-decoration: none; }
.nav a:hover { color: #fff; }
.nav .link { color: #D1D5DB; }

main { padding: 2rem 16px; }
.footer { color: var(--grey-500); font-size: 0.85rem; padding: 2rem 16px; }

.hero { padding: 3rem 0 2rem; max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--orange-dark); font-weight: 600; }
.hero h1 { font-size: 2.5rem; }
.lead { font-size: 1.15rem; color: var(--grey-700); }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.step { background: #fff; border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }

.card { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.highlight { border: 2px solid var(--orange); background: var(--orange-light); }
.card.empty { color: var(--grey-500); }
.card.small { font-size: 0.9rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 0.9rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
label small { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  background: #fff;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
textarea { resize: vertical; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--grey-200);
  background: #fff;
  color: var(--charcoal);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--grey-400); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-quiet { border-color: transparent; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--orange-dark); cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--danger); }
.inline { display: inline; }

.search { display: flex; gap: 0.5rem; align-items: center; flex: 1; max-width: 520px; }
.search input { flex: 1; }

.flash { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: var(--success-light); border-color: #A7F3D0; color: #065F46; }
.flash-error { background: var(--danger-light); border-color: #FECACA; color: #991B1B; }

.memories { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.memory { background: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.memory.pinned { border-left: 3px solid var(--orange); }
.memory.superseded { opacity: 0.6; }
.memory.superseded .memory-content { text-decoration: line-through; text-decoration-color: var(--grey-400); }
.memory-actions { margin-left: auto; display: flex; gap: 0.6rem; }
.badge { background: var(--orange); color: #fff; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; font-size: 0.75rem; }
.badge-muted { background: var(--grey-400); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.danger { color: var(--danger); }
.memory-content { margin: 0 0 0.5rem; white-space: pre-wrap; }
.memory-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; font-size: 0.82rem; }
.tag { background: var(--grey-100); color: var(--grey-700); padding: 0.1rem 0.5rem; border-radius: 999px; }
.score { background: var(--orange-light); color: var(--orange-dark); font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; }
.muted { color: var(--grey-500); }
.right { text-align: right; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-500); }
.table tr:last-child td { border-bottom: 0; }
.table tr.revoked td { color: var(--grey-400); }

.table.kv th { width: 40%; text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: var(--charcoal); }
.table.compact th, .table.compact td { padding: 0.45rem 0.6rem; font-size: 0.88rem; }
.inline-label { flex-direction: row; align-items: center; gap: 0.5rem; }
.inline-label input { width: 5rem; }
input[type="number"] { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--grey-200); border-radius: 6px; }

.consent .scopes { margin: 0 0 1.25rem; padding-left: 1.2rem; }
.consent .scopes li { margin-bottom: 0.3rem; }
.consent .actions { margin-top: 0; }

/* Memory banks: the switcher in the top bar and the choice on a consent form. */
.bank-switch { display: flex; align-items: center; }
.bank-switch select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--charcoal-mid, #2D3142);
  background: var(--charcoal-light, #1A1D27);
  color: #fff;
  max-width: 11rem;
}
.bank-choice {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.bank-choice select {
  display: block;
  margin-top: 0.3rem;
  font: inherit;
  padding: 0.5rem;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line, #d7dae2);
  background: #fff;
}
