/* Design system: Graphical UI "Untitled" theme. Tokens and component classes.
   Source of truth: GUI.md and gui/ (theme values in gui/themes/untitled.md, component specs in gui/components/untitled/).
   Change tokens here and in DESIGN.md together. */
/* Theme: Graphical UI "Untitled" (registry q93nn51dxf1u). Foundations and light/dark values are copied from gui/themes/untitled.md.
   Layout: one doctrine at a time as a left-to-right spectrum, eras as lanes, tradition as color; a bottom drawer holds each person's sources. */
:root{
  --color-1:#233c56; --color-1-translucent:#233c5666; --color-1-transparent:#233c5633;
  --color-2:#b0c0cc; --color-3:#cec9b8; --color-4:#dbb79c;
  --brand-green:#2f6f5c; /* the green piece of the dilekt. emblem (Josh's logo) */
  --neutral-1:#ffffff; --neutral-2:#faf9f6; --neutral-3:#f2f0e9; --neutral-3-transparent:#f2f0e933; --neutral-4:#e6e3da; --neutral-4-transparent:#e6e3da33;
  --neutral-5:#d2cfc5; --neutral-6:#a5a196; --neutral-7:#666258; --neutral-8:#555249; --neutral-9:#35332e; --neutral-10:#201f1b; --neutral-10-transparent:#201f1b33;
  --success:#247052; --warning:#926318; --warning-transparent:#92631833; --error:#b34846;
  --on-color-1:#faf9f6;
  --option-badge-background:color-mix(in srgb,var(--color-1) 10%,transparent); --option-badge-foreground:#233c56;
  --shadow-s:0px 0.5px 1px 0px #201f1b04,0px 2px 4px 0px #201f1b06;
  --shadow-m:0px 2px 6px 0px #201f1b06,0px 8px 24px 0px #201f1b09;
  --shadow-l:0px 4px 10px 0px #201f1b0b,0px 16px 40px 0px #201f1b10;
  --border-shadow-s:0 0 0 1px var(--neutral-4);
  --font-body:"Sidebar Inter","Inter",sans-serif; --font-data:"Sidebar Inter","Inter",sans-serif;
  --font-display:"GT Super Text","LT Superior Serif",Georgia,serif;
  --space-xxs:4px; --space-xs:8px; --space-s:12px; --space-m:16px; --space-l:24px; --space-xl:32px; --space-xxl:48px;
  --radius-xs:4px; --radius-s:8px; --radius-m:12px; --radius-l:20px; --radius-full:9999px;
  --motion-duration:180ms; --motion-easing:cubic-bezier(0.16,1,0.3,1); --motion-large-duration:320ms; --motion-large-easing:cubic-bezier(0.22,1,0.36,1); --motion-press-distance:1px;
  /* Extension (not in the theme): categorical colors for traditions. The theme supplies only four brand colors. */
  --t-early:#9A6B1F; --t-catholic:#8B3A5A; --t-lutheran:#2F5F8F; --t-reformed:#2F6F5C; --t-anabaptist:#A8553A; --t-arminian:#6A4E9A; --t-modern:#6B7330;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --color-1:#adcbe8; --color-1-translucent:#adcbe866; --color-1-transparent:#adcbe833;
  --color-2:#607d96; --color-3:#b6b19e; --color-4:#cfa488;
  --brand-green:#7dbfa6;
  --neutral-1:#191916; --neutral-2:#20201c; --neutral-3:#292923; --neutral-3-transparent:#29292333; --neutral-4:#37372f; --neutral-4-transparent:#37372f33;
  --neutral-5:#4b4a40; --neutral-6:#77756a; --neutral-7:#aaa79b; --neutral-8:#cbc8bc; --neutral-9:#e6e3d9; --neutral-10:#faf9f4; --neutral-10-transparent:#faf9f433;
  --success:#88cbaa; --warning:#ddbc74; --warning-transparent:#ddbc7433; --error:#ee9991;
  --on-color-1:#20201c; --option-badge-foreground:#adcbe8;
  --shadow-s:0px 0.5px 1px 0px #19191604,0px 2px 4px 0px #19191606;
  --shadow-m:0px 2px 6px 0px #19191606,0px 8px 24px 0px #19191609;
  --shadow-l:0px 4px 10px 0px #1919160b,0px 16px 40px 0px #19191610;
  --border-shadow-s:inset 0 0 0 1px var(--neutral-4);
  --t-early:#D9AE62; --t-catholic:#DE8DAD; --t-lutheran:#86B3E0; --t-reformed:#6FC1A6; --t-anabaptist:#E99577; --t-arminian:#B49CE8; --t-modern:#B4BE6E;
  color-scheme:dark}}
:root[data-theme="dark"]{
  --color-1:#adcbe8; --color-1-translucent:#adcbe866; --color-1-transparent:#adcbe833;
  --color-2:#607d96; --color-3:#b6b19e; --color-4:#cfa488;
  --brand-green:#7dbfa6;
  --neutral-1:#191916; --neutral-2:#20201c; --neutral-3:#292923; --neutral-3-transparent:#29292333; --neutral-4:#37372f; --neutral-4-transparent:#37372f33;
  --neutral-5:#4b4a40; --neutral-6:#77756a; --neutral-7:#aaa79b; --neutral-8:#cbc8bc; --neutral-9:#e6e3d9; --neutral-10:#faf9f4; --neutral-10-transparent:#faf9f433;
  --success:#88cbaa; --warning:#ddbc74; --warning-transparent:#ddbc7433; --error:#ee9991;
  --on-color-1:#20201c; --option-badge-foreground:#adcbe8;
  --shadow-s:0px 0.5px 1px 0px #19191604,0px 2px 4px 0px #19191606;
  --shadow-m:0px 2px 6px 0px #19191606,0px 8px 24px 0px #19191609;
  --shadow-l:0px 4px 10px 0px #1919160b,0px 16px 40px 0px #19191610;
  --border-shadow-s:inset 0 0 0 1px var(--neutral-4);
  --t-early:#D9AE62; --t-catholic:#DE8DAD; --t-lutheran:#86B3E0; --t-reformed:#6FC1A6; --t-anabaptist:#E99577; --t-arminian:#B49CE8; --t-modern:#B4BE6E;
  color-scheme:dark}

*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--neutral-2);color:var(--neutral-10);font-family:var(--font-body);font-size:0.875rem;line-height:1.25rem;letter-spacing:.01em}
.wrap{max-width:1180px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:var(--space-xl) var(--space-xxl);display:flex;flex-direction:column;gap:var(--space-l)}
h1,h2,h3{font-family:var(--font-display);text-wrap:balance;margin:0}
h1{font-size:2.25rem;line-height:2.5rem;letter-spacing:-.01em;font-weight:500}
h2{font-size:1.5rem;line-height:2rem;letter-spacing:-.01em;font-weight:500}
h3{font-size:1rem;line-height:1.5rem;font-weight:500;font-family:var(--font-body)}
@media (max-width:520px){h1{font-size:1.875rem;line-height:2.25rem}}
p{margin:0}
code{font-family:var(--font-data);background:var(--neutral-3);border-radius:var(--radius-xs);padding:0 4px;font-size:0.75rem}
.eyebrow{font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--neutral-7);letter-spacing:.01em}
.muted{color:var(--neutral-7)}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:2px solid var(--color-1);outline-offset:2px}
.ico{width:16px;height:16px;stroke-width:2;flex:0 0 auto}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- Button (spec: button.md, variants primary / outline / ghost) ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-xs);border:0;border-radius:var(--radius-s);padding:var(--space-xs) var(--space-m);font-size:0.875rem;line-height:1.25rem;font-weight:500;letter-spacing:.01em;background:none;color:var(--neutral-10);box-shadow:none;transition:background-color var(--motion-duration) var(--motion-easing),box-shadow var(--motion-duration) var(--motion-easing),transform var(--motion-duration) var(--motion-easing)}
.btn:active:not(:disabled){transform:translateY(var(--motion-press-distance))}
.btn-primary{background:var(--color-1);color:var(--neutral-1)}
.btn-primary:hover{box-shadow:var(--shadow-s)}
.btn-outline{box-shadow:inset 0 0 0 1px var(--neutral-4)}
.btn-outline:hover{background:var(--neutral-3-transparent);background:color-mix(in srgb,var(--neutral-3) 60%,transparent)}
.btn-ghost:hover{background:color-mix(in srgb,var(--neutral-3) 60%,transparent)}
.btn:disabled{background:var(--neutral-3);color:var(--neutral-6);box-shadow:none;cursor:default}
.btn-icon{padding:var(--space-xs)}

/* ---------- Toggle group (spec: toggle-group.md) — view switch ---------- */
.tgroup{display:inline-flex;gap:var(--space-xxs)}
.tgl{display:inline-flex;align-items:center;gap:var(--space-xs);border:0;background:none;color:var(--neutral-10);border-radius:var(--radius-s);padding:var(--space-xs) var(--space-s);font-size:0.875rem;line-height:1.25rem;font-weight:500;letter-spacing:.01em;transition:background-color var(--motion-duration) var(--motion-easing)}
.tgl:hover,.tgl[aria-pressed="true"],.tgl[aria-current="page"]{background:var(--neutral-3)}
a.tgl{text-decoration:none}
.tgl:disabled{color:var(--neutral-6)}

/* ---------- Toggle (spec: toggle.md) — tradition filters, with a color dot ---------- */
.legend{display:flex;flex-wrap:wrap;gap:var(--space-xxs);align-items:center}
.legend .lab{font-size:0.75rem;line-height:1rem;color:var(--neutral-7);margin-right:var(--space-xs)}
.trad{display:inline-flex;align-items:center;gap:var(--space-xs);border:0;background:none;border-radius:var(--radius-s);padding:var(--space-xs) var(--space-s);font-size:0.875rem;line-height:1.25rem;font-weight:500;letter-spacing:.01em;color:var(--neutral-10);transition:background-color var(--motion-duration) var(--motion-easing),color var(--motion-duration) var(--motion-easing)}
.trad:hover{background:var(--neutral-3)}
.trad[aria-pressed="true"]{background:var(--neutral-3)}
.trad[aria-pressed="false"]{color:var(--neutral-7)}
.trad[aria-pressed="false"] .sw{background:transparent;box-shadow:inset 0 0 0 1.5px var(--c)}
.sw{width:10px;height:10px;border-radius:50%;background:var(--c);flex:0 0 auto}

/* ---------- Tabs (spec: tabs.md) — doctrine picker with shared moving indicator ---------- */
.tabs-scroll{overflow-x:auto;max-width:100%;scrollbar-width:none}
.tabs-scroll::-webkit-scrollbar{display:none}
.tabs{position:relative;isolation:isolate;display:inline-flex;gap:var(--space-xxs);padding:var(--space-xxs);background:var(--neutral-3);border-radius:var(--radius-m);width:fit-content}
.tab{position:relative;z-index:1;border:0;background:none;white-space:nowrap;border-radius:var(--radius-s);padding:var(--space-xxs) var(--space-s);min-height:28px;font-size:0.875rem;line-height:1.25rem;font-weight:500;letter-spacing:.01em;color:var(--neutral-7);transition:color var(--motion-duration) var(--motion-easing)}
@media (pointer:coarse),(max-width:700px){.tab{min-height:40px}}
.tab:hover,.tab[aria-selected="true"]{color:var(--neutral-10)}
.tab-ind{position:absolute;z-index:0;top:var(--space-xxs);bottom:var(--space-xxs);left:0;width:0;border-radius:var(--radius-s);background:var(--neutral-1);box-shadow:var(--shadow-s);transition:transform var(--motion-duration) var(--motion-easing),width var(--motion-duration) var(--motion-easing)}
.tabs:not(.measured) .tab[aria-selected="true"]{background:var(--neutral-1);box-shadow:var(--shadow-s)}
.panel-after-tabs{padding-top:var(--space-s)}
/* Many tabs (Josh, 2026-11-25: 15 doctrines): wrap onto more rows instead of hiding them off the edge. The indicator
   then follows both axes (app.js placeIndicator), so it is positioned from the top-left. */
.tabs.tabs-wrap,.tabs-scroll.wrap .tabs{flex-wrap:wrap;width:auto;max-width:100%}
.tabs.tabs-wrap .tab-ind{top:0;bottom:auto;height:0;transition:transform var(--motion-duration) var(--motion-easing),width var(--motion-duration) var(--motion-easing),height var(--motion-duration) var(--motion-easing)}
.tabs-scroll.has-select,.tabs-scroll.wrap{overflow:visible}
.doc-select{display:none}
@media (max-width:700px){
  .tabs-scroll.has-select .tabs{display:none}
  .doc-select{display:flex;flex-direction:column;gap:var(--space-xxs)}
  .doc-select select{appearance:none;-webkit-appearance:none;width:100%;min-height:44px;padding:var(--space-xs) var(--space-xl) var(--space-xs) var(--space-s);border:0;border-radius:var(--radius-m);
    background:var(--neutral-1);
    box-shadow:var(--border-shadow-s),var(--shadow-s);font:inherit;font-size:1rem;line-height:1.375rem;font-weight:500;color:var(--neutral-10)}
  .doc-select{position:relative}
  .doc-select::after{content:"";position:absolute;right:12px;bottom:14px;width:16px;height:16px;pointer-events:none;background:var(--neutral-7);
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat}
  .doc-select select:focus-visible{outline:2px solid var(--color-1);outline-offset:2px}
}

/* ---------- Surfaces (built from theme foundations; no card spec in this theme) ---------- */
.surface{background:var(--neutral-1);border-radius:var(--radius-m);box-shadow:var(--border-shadow-s),var(--shadow-s)}
.scroll-x{overflow-x:auto}
.banner{display:flex;gap:var(--space-s);align-items:flex-start;background:var(--warning-transparent);color:var(--neutral-10);border-radius:var(--radius-m);padding:var(--space-s) var(--space-m);font-size:0.875rem;line-height:1.25rem}
.banner b{font-weight:600}

/* ---------- Drawer (spec: drawer.md) — bottom-aligned sheet with handle ---------- */
.dr-backdrop{position:fixed;inset:0;z-index:40;background:var(--neutral-10-transparent);opacity:0;transition:opacity var(--motion-large-duration) var(--motion-large-easing)}
.dr-backdrop.open{opacity:1}
.dr-viewport{position:fixed;inset:0;z-index:41;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}
.drawer{pointer-events:auto;width:min(760px,calc(100vw - 32px));max-height:85vh;overflow-y:auto;background:var(--neutral-1);color:var(--neutral-10);
  margin-bottom:var(--space-m);border-radius:var(--radius-m);box-shadow:var(--border-shadow-s),var(--shadow-l);container-type:inline-size;
  padding:var(--space-l) var(--space-l) calc(var(--space-xxl) + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:var(--space-s);
  transform:translateY(calc(100% + var(--space-m)));transition:transform var(--motion-large-duration) var(--motion-large-easing);font-size:0.875rem;line-height:1.25rem}
.drawer.open{transform:translateY(0)}
/* Josh, 2026-11-25: wider than the theme's 420px sheet. Above 600px it is a centered dialog that rises and fades in;
   at 600px and below it stays a bottom sheet flush with the screen edge. */
@media (min-width:601px){
  .dr-viewport{align-items:center;padding:var(--space-l) 0}
  .drawer{margin-bottom:0;max-height:min(88vh,calc(100vh - 2 * var(--space-l)));padding-bottom:var(--space-xl);opacity:0;transform:translateY(16px) scale(.98);
    transition:transform var(--motion-large-duration) var(--motion-large-easing),opacity var(--motion-duration) var(--motion-easing)}
  .drawer.open{opacity:1;transform:none}
  .drawer .dr-handle{display:none}
}
@media (max-width:600px){.drawer{width:100%;margin-bottom:0;border-radius:var(--radius-m) var(--radius-m) 0 0;transform:translateY(100%)}}
.pos-refs{display:grid;grid-template-columns:1fr;gap:var(--space-s)}
.pos-refs > div{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}
@container (min-width:640px){.pos-refs{grid-template-columns:1fr 1fr;gap:var(--space-m)}}
.dr-handle{align-self:center;width:calc(2 * var(--space-xl));height:var(--space-xxs);border-radius:var(--radius-full);background:var(--neutral-4);margin-bottom:var(--space-xs);flex:0 0 auto}
.dr-head{display:flex;justify-content:space-between;gap:var(--space-s);align-items:flex-start}
.dr-title{font-family:var(--font-display);font-size:1.5rem;line-height:2rem;font-weight:500;letter-spacing:-.01em;margin:0}
.dr-desc{color:var(--neutral-7)}
.meta{display:flex;flex-wrap:wrap;gap:var(--space-xxs);align-items:center}
.tag{display:inline-flex;align-items:center;gap:6px;font-size:0.75rem;line-height:1rem;border-radius:var(--radius-xs);padding:2px var(--space-xs);background:var(--neutral-3);color:var(--neutral-8)}
.status{font-size:0.75rem;line-height:1rem;font-weight:500;border-radius:var(--radius-xs);padding:2px var(--space-xs)}
.status.placeholder{color:var(--warning);background:var(--warning-transparent)}
.status.draft{color:var(--option-badge-foreground);background:var(--option-badge-background)}
.status.verified{color:var(--success);background:color-mix(in srgb,var(--success) 14%,transparent)}
.sep{height:1px;background:var(--neutral-4);border:0;margin:var(--space-xs) 0}
.pos{display:flex;flex-direction:column;gap:var(--space-s)}
.pos-head{display:flex;justify-content:space-between;align-items:center;gap:var(--space-xs)}
.stance{font-family:var(--font-display);font-size:1rem;line-height:1.5rem;font-weight:500}
.mini-l{display:flex;justify-content:space-between;font-size:0.75rem;line-height:1rem;color:var(--neutral-7);margin-top:var(--space-xs)}
.sub{display:flex;align-items:center;gap:var(--space-xs);font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--neutral-7)}
.slot{border-radius:var(--radius-s);padding:var(--space-s);font-size:0.875rem;line-height:1.25rem;color:var(--neutral-7);display:flex;flex-direction:column;gap:var(--space-xs);box-shadow:inset 0 0 0 1px var(--neutral-4);background:repeating-linear-gradient(135deg,transparent 0 8px,var(--neutral-3) 8px 9px)}
.src{display:flex;flex-direction:column;gap:2px;box-shadow:inset 2px 0 0 var(--color-1);padding:var(--space-xxs) 0 var(--space-xxs) var(--space-s)}
.src i{font-family:var(--font-display);font-style:italic}
.src span{font-size:0.75rem;line-height:1rem;color:var(--neutral-7)}
.works{display:flex;flex-direction:column;gap:var(--space-xs)}
.work{display:flex;justify-content:space-between;gap:var(--space-s)}
.work i{font-family:var(--font-display)}
.work span{font-size:0.75rem;line-height:1.25rem;color:var(--neutral-7);white-space:nowrap;font-variant-numeric:tabular-nums}
.verse{display:flex;flex-direction:column;gap:2px}
.verse .ref{align-self:flex-start}

/* ---------- Text field (spec: input.md) ---------- */
.field{display:flex;flex-direction:column;gap:var(--space-xs)}
.field label{font-size:0.875rem;line-height:1.25rem;font-weight:500}
.input{width:100%;min-height:180px;font-family:var(--font-body);font-size:0.875rem;line-height:1.25rem;letter-spacing:.01em;background:var(--neutral-1);color:var(--neutral-10);border:0;box-shadow:inset 0 0 0 1px var(--neutral-4);border-radius:var(--radius-s);padding:var(--space-xs) var(--space-s);resize:vertical;transition:box-shadow var(--motion-duration) var(--motion-easing)}
.input:hover{box-shadow:inset 0 0 0 1px var(--neutral-5)}
.input:focus{box-shadow:inset 0 0 0 1px var(--color-1-transparent)}
.input[aria-invalid="true"]{box-shadow:inset 0 0 0 1px var(--error)}
.input::placeholder{color:var(--neutral-7)}
