/* Look and feel modeled on the Church's Gospel Library reading pages: white page,
   near-black text, serif reading text, plain sans interface, teal links, a light
   gray contents panel. No Church logos, names or marks are used. */
:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --panel: #f7f8f8;
  --selected: #e0e2e2;
  --ink: #212225;
  --muted: #53575b;
  --line: #e0e2e2;
  --accent: #157493;
  --accent-ink: #ffffff;
  --accent-soft: #e6f1f4;
  --mark: rgba(255, 214, 0, 0.42);
  --ok: #2c7a4b;
  --warn: #b3262a;
  --serif: Palatino, 'Palatino Linotype', 'Noto Serif', Georgia, serif;
  --sans: Roboto, Arial, 'Noto Sans', sans-serif;
  --radius: 4px;
}
/* Dark colors: follow the device unless the reader picks Light or Dark in the header. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #1b1c1e;
    --paper: #1b1c1e;
    --panel: #232427;
    --selected: #34363a;
    --ink: #e8e9ea;
    --muted: #a6a9ad;
    --line: #3a3c3f;
    --accent: #5fb4d0;
    --accent-ink: #10181b;
    --accent-soft: #1d3440;
    --mark: rgba(255, 214, 0, 0.3);
    --ok: #7fc5a2;
    --warn: #f0a08e;
  }
}
:root[data-theme='dark'] {
  --bg: #1b1c1e;
  --paper: #1b1c1e;
  --panel: #232427;
  --selected: #34363a;
  --ink: #e8e9ea;
  --muted: #a6a9ad;
  --line: #3a3c3f;
  --accent: #5fb4d0;
  --accent-ink: #10181b;
  --accent-soft: #1d3440;
  --mark: rgba(255, 214, 0, 0.3);
  --ok: #7fc5a2;
  --warn: #f0a08e;
}
:root[data-theme='dark'] {
  color-scheme: dark;
}
:root[data-theme='light'] {
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 var(--sans);
}
a {
  color: var(--accent);
}
[tabindex='-1']:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  background: var(--paper);
  padding: 8px 12px;
  z-index: 9;
}
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
}
h1 {
  font-size: clamp(32px, 6vw, 42px);
  margin: 32px 0 16px;
}
h2 {
  font-size: 26px;
  margin: 32px 0 12px;
}
h3 {
  font-size: 21px;
}
.lede {
  color: var(--ink);
  font-size: 19px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}
.choices {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.choice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.choice:hover {
  background: var(--panel);
}
.choice .icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.choice strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-size: 18px;
}
.choice span {
  color: var(--muted);
  font-size: 15px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 16px 0 6px;
}
input[type='text'],
input[type='password'],
input[type='email'],
input[type='search'],
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
textarea {
  min-height: 320px;
  font-family: var(--serif);
  line-height: 1.7;
}
.pw {
  position: relative;
}
.pw button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
}
button.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius);
  padding: 12px 24px;
  font: 600 16px var(--sans);
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}
button.primary[disabled] {
  opacity: 0.55;
  cursor: default;
}
button.link {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 8px 0;
}
button.small {
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px 12px;
  font: 500 14px var(--sans);
  cursor: pointer;
}
button.small:hover {
  background: var(--accent-soft);
}
.actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.note {
  font-size: 14px;
  color: var(--muted);
}
.trust {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--muted);
}
.trust li {
  display: flex;
  gap: 10px;
}
.trust li::before {
  content: '✓';
  color: var(--ok);
  font-weight: 700;
}
.error {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 14px;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  color: var(--muted);
}
.steps li.done {
  color: var(--ink);
}
.steps li.done::before {
  content: '✓';
  color: var(--ok);
  font-weight: 700;
  width: 18px;
}
.steps li.now::before {
  content: '';
  width: 14px;
  height: 14px;
  margin: 0 2px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .steps li.now::before {
    animation: none;
  }
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 560px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
.lock {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
#gen-progress {
  width: 100%;
  height: 10px;
  margin-top: 16px;
  accent-color: var(--accent);
}
[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  header.site {
    padding: 0 16px;
  }
}

/* ---------- account (public/account.js) ---------- */
.account-btn {
  margin-left: auto;
}
/* Account menu (signed in) */
.account-menu {
  position: relative;
  margin-left: auto;
}
.account-menu .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 220px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
}
.account-menu .menu a,
.account-menu .menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu .menu a:hover,
.account-menu .menu button:hover,
.account-menu .menu a:focus-visible,
.account-menu .menu button:focus-visible {
  background: var(--panel);
  outline: none;
}
.account-menu .menu [role='menuitemradio'] {
  padding-left: 36px;
  position: relative;
}
.account-menu .menu [aria-checked='true']::before {
  content: '✓';
  position: absolute;
  left: 16px;
}
.account-menu .menu-label {
  padding: 8px 16px 2px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.account-menu .menu [role='separator'] {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}
dialog.account {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
dialog.account::backdrop {
  background: rgb(0 0 0 / 0.45);
}
dialog.account h2 {
  margin-top: 0;
}
dialog.account form {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
dialog.account input {
  width: 100%;
}
dialog.account details {
  margin: 8px 0 16px;
}
.account-oauth {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.account-note,
.account-msg {
  color: var(--muted);
  font-size: 0.9em;
}

.notice {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 12px 16px;
}
.account-delete {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.account-delete summary {
  cursor: pointer;
  color: var(--muted);
}
button.danger {
  background: #b3261e;
  color: #fff;
  border-color: #b3261e;
}
