:root {
  --ink: #18231f;
  --ink-soft: #52605a;
  --ink-faint: #78837d;
  --paper: #f5f1e8;
  --paper-deep: #e9e3d6;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --forest: #1f493d;
  --forest-bright: #2d6756;
  --forest-pale: #dce8df;
  --gold: #b9893f;
  --gold-pale: #f0e2c2;
  --rust: #a44f3c;
  --rust-pale: #f5dfd9;
  --line: #d9d3c6;
  --line-strong: #c3bcad;
  --shadow-sm: 0 1px 2px rgb(24 35 31 / 7%), 0 5px 16px rgb(24 35 31 / 5%);
  --shadow-lg: 0 18px 60px rgb(19 35 29 / 15%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar: 256px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 72% 4%, rgb(185 137 63 / 8%), transparent 32rem),
    var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(45 103 86 / 28%);
  outline-offset: 2px;
}

.boot-screen,
.noscript {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--ink-soft);
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 11px;
  color: #f9f2e3;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 12%), transparent 55%),
    var(--forest-bright);
  box-shadow: inset 0 0 0 3px rgb(20 45 38 / 24%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}

.brand-mark--large {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 20px;
  box-shadow: var(--shadow-lg), inset 0 0 0 4px rgb(20 45 38 / 22%);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(300px, 44%) minmax(420px, 56%);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 72px);
  color: #f8f3e9;
  background:
    linear-gradient(180deg, rgb(11 31 25 / 12%), rgb(11 31 25 / 68%)),
    radial-gradient(circle at 20% 10%, #427161 0, transparent 36%),
    radial-gradient(circle at 80% 65%, #785a30 0, transparent 36%),
    #183b32;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  width: 26rem;
  height: 26rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
  content: "";
}

.auth-story::before {
  top: -14rem;
  right: -7rem;
  box-shadow: 0 0 0 4rem rgb(255 255 255 / 2%), 0 0 0 8rem rgb(255 255 255 / 2%);
}

.auth-story::after {
  bottom: -18rem;
  left: -9rem;
  box-shadow: 0 0 0 5rem rgb(255 255 255 / 2%);
}

.auth-brand,
.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-brand strong,
.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.auth-brand small,
.brand small {
  display: block;
  margin-top: 2px;
  color: rgb(255 255 255 / 58%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 5rem 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 680px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.4vw, 78px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.auth-copy p:last-child {
  max-width: 520px;
  margin: 28px 0 0;
  color: rgb(255 255 255 / 69%);
  font-size: 16px;
  line-height: 1.65;
}

.auth-footnote {
  position: relative;
  z-index: 1;
  color: rgb(255 255 255 / 48%);
  font-size: 12px;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px clamp(24px, 7vw, 100px);
}

.auth-card {
  width: min(100%, 480px);
}

.auth-card h2,
.page-heading h1,
.section-heading h2,
.detail-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.025em;
}

.auth-card h2 {
  font-size: 34px;
}

.auth-card > p {
  margin: 10px 0 30px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.tab-list {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
}

.tab-button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-stack {
  display: grid;
  min-width: 0;
  gap: 17px;
}

.form-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.form-stack > *,
.form-grid > *,
.field {
  min-width: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select,
.select-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-strong);
  padding: 10px 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.select-control:focus {
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 3px rgb(45 103 86 / 12%);
  outline: none;
}

.field-hint,
.muted {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button-row--between {
  justify-content: space-between;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: .58;
}

.button--primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 5px 14px rgb(31 73 61 / 16%);
}

.button--primary:hover:not(:disabled) {
  background: var(--forest-bright);
}

.button--secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button--quiet {
  color: var(--forest);
  background: transparent;
}

.button--danger {
  border-color: #e7bdb3;
  color: var(--rust);
  background: #fff8f6;
}

.button--small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.button--full {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e5bcb3;
  border-radius: 9px;
  color: #833d2f;
  background: var(--rust-pale);
  font-size: 13px;
  line-height: 1.45;
}

.security-note {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding: 13px;
  border: 1px solid #dfd2b2;
  border-radius: 10px;
  color: #685630;
  background: #fbf5e7;
  font-size: 12px;
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 24px 18px 18px;
  color: #edf3ef;
  background:
    radial-gradient(circle at 15% 4%, rgb(93 145 125 / 22%), transparent 17rem),
    #172d27;
  box-shadow: inset -1px 0 rgb(255 255 255 / 5%);
}

.sidebar .brand {
  padding: 0 8px;
}

.nav-label {
  margin: 32px 10px 10px;
  color: rgb(255 255 255 / 35%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  color: rgb(255 255 255 / 67%);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover {
  color: #fff;
  background: rgb(255 255 255 / 5%);
}

.nav-link.is-active {
  color: #fff;
  background: rgb(255 255 255 / 10%);
  box-shadow: inset 3px 0 var(--gold);
}

.nav-icon {
  display: inline-grid;
  width: 20px;
  place-items: center;
  color: rgb(255 255 255 / 50%);
  font-size: 15px;
}

.nav-link.is-active .nav-icon {
  color: #e7c889;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 9px 6px;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #173a30;
  background: var(--gold-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 12px;
}

.sidebar-user small {
  margin-top: 2px;
  color: rgb(255 255 255 / 42%);
  font-size: 10px;
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 56px);
  border-bottom: 1px solid rgb(195 188 173 / 68%);
  background: rgb(245 241 232 / 88%);
  backdrop-filter: blur(18px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b9b71;
  box-shadow: 0 0 0 4px rgb(75 155 113 / 12%);
}

.connection-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.menu-button {
  display: none;
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px);
}

.page-heading,
.section-heading,
.detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1,
.detail-heading h1 {
  font-size: clamp(31px, 4vw, 47px);
}

.page-heading p,
.detail-heading p {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 23px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.stat-card,
.panel,
.list-card,
.project-card,
.team-card,
.plan-card,
.empty-state {
  border: 1px solid var(--line);
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 19px;
  border-radius: var(--radius);
}

.stat-card__label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.stat-card__value {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
}

.stat-card__detail {
  display: block;
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 11px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr);
  gap: 22px;
}

.content-grid--equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
}

.panel__header h2,
.panel__header h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.panel__body {
  padding: 21px;
}

.panel__body--flush {
  padding: 0;
}

.panel + .panel,
.stack > * + * {
  margin-top: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.team-card,
.plan-card {
  position: relative;
  display: flex;
  min-height: 184px;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.project-card:hover,
.team-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgb(24 35 31 / 9%);
  transform: translateY(-2px);
}

.card-link {
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  padding: 20px;
  text-decoration: none;
}

.accent-line {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--forest-bright);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 21px;
}

.card-id {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.badge--gold {
  color: #6b5223;
  background: var(--gold-pale);
}

.badge--muted {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.badge--danger {
  color: var(--rust);
  background: var(--rust-pale);
}

.project-card h2,
.team-card h2,
.plan-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
}

.project-card p,
.team-card p,
.plan-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--ink-faint);
  font-size: 11px;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row__main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.list-row strong,
.list-row small {
  display: block;
}

.list-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.color-swatch {
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 3px rgb(24 35 31 / 11%));
}

.color-edit-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-muted);
}

.color-edit-preview .color-swatch {
  width: 42px;
  height: 42px;
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  padding: 36px;
  border-style: dashed;
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.empty-state h2,
.empty-state h3 {
  margin: 15px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.empty-state p {
  max-width: 420px;
  margin: 0 0 17px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.detail-heading {
  align-items: center;
  margin-bottom: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 13px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.project-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
  margin: -7px 0 24px;
}

.project-nav__link {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 34px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink-soft);
  background: rgb(255 253 248 / 72%);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.project-nav__link:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px rgb(24 35 31 / 8%);
  transform: translateY(-1px);
}

.project-nav__link.is-active {
  border-color: rgb(45 103 86 / 38%);
  color: var(--forest);
  background: var(--surface);
  box-shadow: inset 3px 0 var(--forest-bright), var(--shadow-sm);
}

.project-nav__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
}

.project-nav__copy {
  min-width: 0;
}

.project-nav__copy strong,
.project-nav__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-nav__copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.project-nav__copy small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.project-nav__count {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 21px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 10px;
  text-align: center;
}

.project-nav__link.is-active .project-nav__count {
  background: var(--forest-pale);
}

.project-page {
  animation: project-page-in 160ms ease-out;
}

@keyframes project-page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
}

.feature span,
.feature strong {
  display: block;
}

.feature span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.feature strong {
  margin-top: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.term-dates {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.term-date {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.term-date strong {
  color: var(--ink);
  font-weight: 700;
}

.plan-card {
  min-height: 320px;
  padding: 23px;
}

.plan-card.is-current {
  border-color: #8baa9d;
  box-shadow: 0 0 0 2px rgb(45 103 86 / 8%), var(--shadow-sm);
}

.plan-features {
  display: grid;
  gap: 9px;
  margin: 20px 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plan-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.plan-feature strong {
  color: var(--ink);
}

.plan-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
}

.notice {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  padding: 15px 17px;
  border: 1px solid #d5c79f;
  border-radius: var(--radius);
  color: #5f512f;
  background: #faf3df;
  font-size: 13px;
  line-height: 1.5;
}

.notice--success {
  border-color: #b7d0c2;
  color: #285343;
  background: #edf5f0;
}

.loading-page {
  display: grid;
  min-height: 55vh;
  place-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--ink-soft);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--forest-bright);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 18px;
  right: 20px;
  display: grid;
  width: min(380px, calc(100vw - 40px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid #a8c1b5;
  border-radius: 11px;
  color: #fff;
  background: #245345;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.45;
  animation: toast-in 180ms ease-out;
}

.toast--error {
  border-color: #cb8779;
  background: #7c392e;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

.mobile-overlay {
  display: none;
}

.danger-zone {
  border-color: #e2bcb3;
  background: #fffaf8;
}

.danger-zone .panel__header {
  border-color: #ebd0c9;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .45fr) auto;
  gap: 9px;
  align-items: end;
}

.inline-form--two {
  grid-template-columns: minmax(0, 1fr) auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.location-workspace {
  --location-accent: var(--forest-bright);
  min-width: 0;
}

.location-topbar,
.location-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 253 248 / 88%);
  box-shadow: var(--shadow-sm);
}

.location-topbar__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.location-topbar h2,
.location-detail-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.location-topbar .eyebrow,
.location-detail-header .eyebrow {
  margin-bottom: 3px;
}

.location-symbol {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(45 103 86 / 14%);
  border-radius: 10px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.location-symbol--large {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 22px;
}

.location-view-nav {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-deep);
}

.location-view-nav a {
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.location-view-nav a.is-active {
  color: var(--forest);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.location-collection {
  display: grid;
  min-height: 480px;
  grid-template-columns: 225px minmax(0, 1fr);
  overflow: hidden;
}

.location-browser {
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  background: rgb(233 227 214 / 30%);
}

.location-browser__heading {
  padding: 3px 10px 10px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.location-browser > a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.location-browser > a:hover,
.location-browser > a.is-active {
  color: var(--forest);
  background: var(--surface);
}

.location-browser > a > span:first-child {
  text-align: center;
}

.location-browser > a span,
.location-browser > a small {
  display: block;
}

.location-browser > a small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.location-list-panel {
  min-width: 0;
  background: var(--surface);
}

.location-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.location-list-toolbar strong,
.location-list-toolbar small {
  display: block;
}

.location-list-toolbar strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.location-list-toolbar small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.location-search {
  display: grid;
  width: min(420px, 60%);
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-faint);
  background: var(--surface-strong);
}

.location-search input {
  min-width: 0;
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.location-rows {
  display: grid;
}

.location-row {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 34px minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.location-row:last-child {
  border-bottom: 0;
}

.location-row:hover {
  background: #fbf9f3;
}

.location-row--context {
  color: var(--ink-soft);
  background: rgb(233 227 214 / 28%);
}

.location-row__hierarchy {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  color: var(--line-strong);
  font-size: 12px;
}

.location-depth-steps {
  display: inline-flex;
  align-self: stretch;
  align-items: stretch;
}

.location-depth-steps > i {
  display: block;
  width: 9px;
  border-left: 1px solid var(--line-strong);
  opacity: .72;
}

.location-row__identity {
  min-width: 0;
  text-decoration: none;
}

.location-row__identity strong,
.location-row__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-row__identity strong {
  font-size: 12px;
}

.location-row__identity small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.location-row__meta,
.location-row__actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.location-hierarchy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .7fr);
  gap: 18px;
}

.location-tree {
  display: grid;
  max-height: 640px;
  overflow: auto;
  padding: 8px;
}

.location-tree-node {
  display: grid;
  width: 100%;
  grid-template-columns: auto 18px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.location-tree-node:hover {
  background: var(--paper);
}

.location-tree-node.is-selected {
  color: var(--forest);
  background: var(--forest-pale);
  box-shadow: inset 3px 0 var(--location-accent);
}

.location-tree-node > span:first-child {
  color: var(--line-strong);
  text-align: right;
}

.location-tree-node strong,
.location-tree-node small {
  display: block;
}

.location-tree-node strong {
  color: var(--ink);
  font-size: 12px;
}

.location-tree-node small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.location-inspector .panel__body > h3 {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.location-path-copy {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.5;
}

.location-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -4px 0 17px;
  color: var(--ink-faint);
  font-size: 11px;
}

.location-breadcrumb a {
  color: var(--forest);
  text-decoration: none;
}

.location-breadcrumb a[aria-current="page"] {
  color: var(--ink);
  font-weight: 750;
}

.location-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr);
  gap: 18px;
}

.entity-summary > summary {
  padding: 18px 20px;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.entity-summary[open] > summary {
  border-bottom: 1px solid var(--line);
}

.entity-summary .panel__body p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
}

.location-empty-prompt {
  display: grid;
  gap: 4px;
  color: var(--ink-faint);
  font-size: 12px;
}

.contained-location-grid {
  display: grid;
}

.contained-location-grid > a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.contained-location-grid > a:last-child {
  border-bottom: 0;
}

.contained-location-grid strong,
.contained-location-grid small {
  display: block;
}

.contained-location-grid strong {
  font-size: 12px;
}

.contained-location-grid small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.empty-state--compact {
  min-height: 220px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.location-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.location-facts > div {
  display: grid;
  grid-template-columns: minmax(95px, .45fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.location-facts > div:last-child {
  border-bottom: 0;
}

.location-facts dt {
  color: var(--ink-faint);
}

.location-facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}

.location-facts a {
  color: var(--forest);
}

.entry-lifecycle .panel__header p,
.entry-names .panel__header p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.lifecycle-track {
  display: grid;
  grid-template-columns: minmax(160px, .85fr) minmax(90px, 1fr) minmax(160px, .85fr);
  align-items: center;
  gap: 12px;
}

.lifecycle-point {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf9f4;
}

.lifecycle-point__marker {
  grid-row: 1 / span 4;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-pale);
}

.lifecycle-point.is-unknown .lifecycle-point__marker {
  grid-row: 1 / span 3;
}

.lifecycle-point > strong,
.lifecycle-point > span,
.lifecycle-point > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lifecycle-point > .lifecycle-point__mapping {
  color: var(--ink-soft);
}

.lifecycle-point.is-mapped > .lifecycle-point__mapping {
  color: var(--forest-bright);
  font-weight: 750;
}

.lifecycle-point > strong {
  font-size: 11px;
}

.lifecycle-point > span:not(.lifecycle-point__marker) {
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.lifecycle-point > small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
}

.lifecycle-point.is-unknown {
  border-style: dashed;
  background: transparent;
}

.lifecycle-track__span {
  display: grid;
  gap: 7px;
  text-align: center;
}

.lifecycle-track__span > span {
  height: 2px;
  background: linear-gradient(90deg, var(--forest-pale), var(--forest-bright), var(--forest-pale));
}

.lifecycle-track__span > small {
  color: var(--ink-faint);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.entry-name-list {
  display: grid;
}

.entry-name-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.entry-name-row:last-child {
  border-bottom: 0;
}

.entry-name-row__mark {
  color: var(--forest-bright);
  text-align: center;
}

.entry-name-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.entry-name-row p,
.entry-name-row small {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.entry-name-row p {
  line-height: 1.45;
}

.entry-temporal-loading {
  margin: 0;
  padding: 18px;
  color: var(--ink-faint);
  font-size: 11px;
}

.lifecycle-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.lifecycle-editor-grid--temporal-inputs {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.lifecycle-editor-grid--temporal-inputs .lifecycle-editor-arrow {
  transform: rotate(90deg);
}

.lifecycle-editor-arrow {
  color: var(--forest-bright);
  text-align: center;
  font-size: 20px;
}

.lifecycle-boundary-card {
  display: grid;
  gap: 13px;
  align-self: stretch;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf9f4;
}

.lifecycle-boundary-card__heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lifecycle-boundary-card__heading > span {
  color: var(--forest-bright);
}

.lifecycle-boundary-card__heading strong,
.lifecycle-boundary-card__heading small {
  display: block;
}

.lifecycle-boundary-card__heading small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.lifecycle-boundary-card:has(input[name$="_known"]:not(:checked)) .lifecycle-coordinate-field {
  display: none;
}

.lifecycle-boundary-card:has(input[name$="_known"]:not(:checked)) .lifecycle-mapping {
  display: none;
}

.lifecycle-boundary-card:has(input[name$="_known"]:checked) .lifecycle-unknown-copy {
  display: none;
}

.lifecycle-unknown-copy {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-style: italic;
}

.lifecycle-mapping {
  display: grid;
  gap: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lifecycle-mapping:has(input[name$="_mapped"]:not(:checked)) .lifecycle-master-date-fields {
  display: none;
}

.lifecycle-master-date-fields {
  display: grid;
  gap: 10px;
}

.lifecycle-mapping:has(input[name$="_mapped"]:checked) .lifecycle-local-only-copy {
  display: none;
}

.lifecycle-local-only-copy {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.modal-actions__spacer {
  flex: 1;
}

.location-type-grid {
  display: grid;
}

.location-type-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
}

.location-type-card:last-child {
  border-bottom: 0;
}

.location-type-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.location-type-card p {
  max-width: 720px;
  margin: 5px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.location-type-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  color: var(--ink-faint);
  font-size: 9px;
}

.app-modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: start center;
  padding: 5vh 18px;
  background: rgb(8 22 18 / 56%);
  backdrop-filter: blur(7px);
}

.app-modal {
  width: min(820px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.app-modal > .form-stack {
  gap: 0;
}

.modal-heading,
.modal-actions {
  position: sticky;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  background: var(--surface-strong);
}

.modal-heading {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.modal-heading > div {
  min-width: 0;
}

.modal-heading > .button {
  flex: 0 0 auto;
}

.modal-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.modal-actions {
  bottom: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
}

.editor-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf9f4;
}

.editor-section__heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.editor-section__heading > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 10px;
  font-weight: 800;
}

.editor-section__heading h3,
.editor-section__heading p {
  margin: 0;
}

.editor-section__heading h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.editor-section__heading p {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.tag-picker,
.type-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.tag-picker legend,
.type-chip-picker legend {
  width: 100%;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.tag-picker label,
.type-chip-picker label,
.position-kind-picker label {
  position: relative;
  cursor: pointer;
}

.tag-picker input,
.type-chip-picker input,
.position-kind-picker input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.tag-picker input:focus-visible + span,
.type-chip-picker input:focus-visible + span,
.position-kind-picker input:focus-visible + span {
  outline: 2px solid var(--forest-bright);
  outline-offset: 2px;
}

.tag-picker label span,
.type-chip-picker label span {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
}

.tag-picker input:checked + span,
.type-chip-picker input:checked + span {
  border-color: var(--forest-bright);
  color: var(--forest);
  background: var(--forest-pale);
}

.position-kind-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}

.position-kind-picker label > span {
  display: grid;
  min-height: 64px;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.position-kind-picker strong,
.position-kind-picker small {
  display: block;
}

.position-kind-picker strong {
  font-size: 11px;
}

.position-kind-picker small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.position-kind-picker input:checked + span {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px var(--forest-bright);
}

.coordinate-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coordinate-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.coordinate-field input {
  grid-area: 1 / 1 / 2 / 3;
  padding-right: 44px;
}

.coordinate-field span {
  z-index: 1;
  grid-area: 1 / 2;
  padding-right: 11px;
  color: var(--ink-faint);
  font-size: 10px;
}

.containment-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}

.containment-sentence strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.containment-sentence select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 7px 10px;
  color: var(--forest);
  background: var(--surface);
  font-size: 11px;
  font-weight: 750;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--forest-bright);
}

.deletion-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.deletion-impact > div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
}

.deletion-impact strong,
.deletion-impact span {
  display: block;
}

.deletion-impact strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.deletion-impact span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-rule-deletion .deletion-impact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-rule-deletion .button:disabled {
  cursor: not-allowed;
}

.calendar-workspace .panel__header p,
.calendar-section__heading p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

.calendar-section {
  padding: 21px;
}

.calendar-section + .calendar-section {
  border-top: 1px solid var(--line);
}

.calendar-section--instances {
  background: rgb(233 227 214 / 24%);
}

.calendar-section__heading,
.calendar-editor__heading,
.calendar-result__heading,
.calendar-record__title,
.calendar-unit__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-section__heading {
  margin-bottom: 14px;
}

.calendar-rule-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.calendar-rule-actions [data-action="open-gregorian-rule"] span {
  color: var(--gold);
  font-size: 13px;
}

.calendar-system-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  align-items: end;
  gap: 18px;
  padding: 16px 21px;
  border-bottom: 1px solid var(--line);
  background: var(--forest-pale);
}

.calendar-system-summary > div span,
.calendar-system-summary > div small {
  display: block;
}

.calendar-system-summary > div span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.calendar-system-summary > div strong {
  display: block;
  margin: 3px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.calendar-system-summary > div small {
  color: var(--ink-soft);
}

.calendar-tick-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.calendar-tick-form .field {
  min-width: 180px;
}

.calendar-section__heading h3,
.calendar-editor__heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.calendar-records {
  display: grid;
  gap: 9px;
}

.calendar-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.calendar-record--instance {
  background: #fffefb;
}

.calendar-record__body {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.calendar-record__body > div {
  min-width: 0;
}

.calendar-glyph {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.calendar-record__title {
  justify-content: flex-start;
}

.calendar-record__body p,
.calendar-record__body small {
  display: block;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-editor {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f2;
  scroll-margin-top: 88px;
}

.calendar-editor__heading .eyebrow {
  margin-bottom: 4px;
}

.calendar-composer {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}

.calendar-composer > .calendar-editor__heading,
.calendar-composer > .notice {
  margin: 18px 18px 0;
}

.composer-mode-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 16px 18px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf8f2;
}

.composer-mode-switch > span {
  padding: 0 7px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.composer-mode-switch button {
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.composer-mode-switch button[aria-pressed="true"] {
  color: #fff;
  background: var(--forest);
}

.composer-advanced-note[hidden],
.composer-stages[hidden] {
  display: none;
}

.composer-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border-block: 1px solid var(--line);
  background: var(--line);
}

.composer-error {
  display: grid;
  gap: 3px;
  margin: 14px 18px 0;
}

.composer-error strong,
.composer-error span {
  display: block;
}

.calendar-structure-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.calendar-structure-guide > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf8f2;
}

.calendar-structure-guide small,
.calendar-structure-guide strong,
.calendar-structure-guide span {
  display: block;
}

.calendar-structure-guide small {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-structure-guide strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-structure-guide span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-structure-guide > b {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.cycle-visibility-choice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.cycle-visibility-choice input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--forest-bright);
}

.cycle-visibility-choice strong,
.cycle-visibility-choice small {
  display: block;
}

.cycle-visibility-choice strong {
  color: var(--ink);
  font-size: 11px;
}

.cycle-visibility-choice small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
}

.composer-stage {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 11px 12px;
  border: 0;
  color: var(--ink-soft);
  background: #faf8f2;
  text-align: left;
  cursor: pointer;
}

.composer-stage > span {
  display: grid;
  width: 27px;
  height: 27px;
  grid-row: 1 / span 2;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink-faint);
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
}

.composer-stage strong,
.composer-stage small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-stage strong {
  color: var(--ink);
  font-size: 11px;
}

.composer-stage small {
  color: var(--ink-faint);
  font-size: 11px;
}

.composer-stage.is-active {
  background: var(--forest-pale);
  box-shadow: inset 0 -3px var(--forest-bright);
}

.composer-stage.is-active > span {
  border-color: var(--forest-bright);
  color: #fff;
  background: var(--forest-bright);
}

.composer-stage:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.composer-panel {
  display: none;
}

.composer-panel.is-active {
  display: block;
  min-height: 360px;
  animation: project-page-in 160ms ease-out;
}

.calendar-composer.is-advanced .composer-panel {
  display: block;
  min-height: 0;
  border-top: 1px solid var(--line);
  animation: none;
}

.calendar-composer.is-advanced .composer-panel:first-of-type {
  margin-top: 18px;
}

.calendar-composer.is-guided .mapping-editor,
.calendar-composer.is-guided .inline-advanced,
.calendar-composer.is-guided .advanced-only,
.calendar-composer.is-guided .advanced-only-inline,
.calendar-composer.is-guided .advanced-format-editor {
  display: none;
}

.calendar-composer.is-advanced .guided-format-choices,
.calendar-composer.is-advanced .calendar-builder-start,
.calendar-composer.is-advanced .guided-only-unit,
.calendar-composer.is-advanced .guided-only,
.calendar-composer.is-advanced .guided-exception-sentence {
  display: none;
}

.guided-only-unit {
  min-width: 72px;
  color: var(--ink-soft);
  font-weight: 700;
}

.guided-exception-sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #faf8f2;
  font-size: 12px;
}

.calendar-period-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.guided-format-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guided-format-choice {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.guided-format-choice > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.guided-format-choice > strong {
  overflow-wrap: anywhere;
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
}

.guided-format-choice > small {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
}

.guided-format-choice.is-selected,
.guided-format-choice[aria-checked="true"] {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
  box-shadow: 0 0 0 2px rgb(45 103 86 / 10%);
}

.guided-label-origin {
  margin-top: 12px;
}

.composer-panel > header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(233 227 214 / 24%);
}

.composer-panel > header > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 11px;
  font-weight: 800;
}

.composer-panel h4,
.composer-panel header p {
  margin: 0;
}

.composer-panel h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.composer-panel header p,
.composer-explanation {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

.composer-panel__body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.composer-panel__body .notice {
  margin-bottom: 0;
}

.composer-panel__body > .mapping-editor {
  margin: 0;
}

.composer-preview {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
}

.composer-preview span,
.composer-preview strong {
  display: block;
}

.composer-preview span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.composer-preview strong {
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
}

.calendar-formats {
  min-height: 130px !important;
}

.composer-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #faf8f2;
}

.composer-actions > span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.composer-actions > :last-child {
  justify-self: end;
}

.composer-actions--advanced {
  grid-template-columns: 1fr auto;
}

.composer-actions--advanced > span {
  text-align: left;
}

.calendar-builder-start {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid rgb(45 103 86 / 20%);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--forest-pale);
}

.calendar-builder-start > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--forest);
  font-size: 18px;
}

.calendar-builder-start strong {
  font-size: 13px;
}

.calendar-builder-start p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.calendar-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.calendar-review__item {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.calendar-review__item div {
  min-width: 0;
}

.calendar-review__item small,
.calendar-review__item strong {
  display: block;
}

.calendar-review__item small,
.calendar-review-examples small {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calendar-review__item strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.calendar-review-status {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 160px;
  justify-content: center;
  color: var(--ink-soft);
  text-align: left;
}

.calendar-review-status strong,
.calendar-review-status p {
  display: block;
  margin: 0;
}

.calendar-review-status p {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 12px;
}

.calendar-review-error strong,
.calendar-review-error span {
  display: block;
}

.calendar-review-examples {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--forest-pale);
}

.calendar-review-examples h5 {
  margin: 3px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.calendar-review-examples > div:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calendar-review-examples article {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgb(45 103 86 / 16%);
  border-radius: 9px;
  background: rgb(255 255 255 / 68%);
}

.calendar-review-examples article strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 13px;
}

.calendar-units {
  display: grid;
  gap: 12px;
}

.calendar-unit {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.calendar-unit legend {
  padding: 0 7px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-unit__topline {
  margin-bottom: 12px;
  color: var(--ink-faint);
  font-size: 11px;
}

.identity-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgb(220 232 223 / 58%), rgb(255 255 255 / 82%));
}

.identity-preview .calendar-glyph {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  font-size: 27px;
}

.visual-name-input {
  min-height: 45px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px !important;
}

.base-scale-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  align-items: end;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.calendar-scale-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--forest-pale);
}

.calendar-scale-editor > legend {
  padding: 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.calendar-scale-editor .fraction-editor {
  margin-bottom: 9px;
}

.fraction-editor {
  display: grid;
  grid-template-columns: auto 24px 86px auto;
  grid-template-rows: 1fr 1px 1fr;
  align-items: center;
  gap: 7px 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.fraction-editor > :first-child {
  grid-row: 1 / span 3;
  font-weight: 800;
}

.fraction-editor > strong {
  grid-row: 1 / span 3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  text-align: center;
}

.fraction-editor label {
  display: contents;
}

.fraction-editor label > span {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
}

.fraction-editor input {
  width: 86px;
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
}

.fraction-editor label:first-of-type input {
  grid-column: 3;
  grid-row: 1;
}

.fraction-editor label:last-of-type input {
  grid-column: 3;
  grid-row: 3;
}

.fraction-editor__line {
  width: 100%;
  height: 1px;
  grid-column: 3;
  grid-row: 2;
  background: var(--ink-soft);
}

.fraction-editor > :last-child {
  grid-column: 4;
  grid-row: 1 / span 3;
}

.scale-diagram {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  padding: 15px;
  border-radius: 13px;
  color: var(--forest);
  background: var(--forest-pale);
}

.scale-diagram > div {
  display: grid;
  min-width: 120px;
  place-items: center;
  padding: 10px 14px;
  border: 1px solid rgb(45 103 86 / 20%);
  border-radius: 10px;
  background: rgb(255 255 255 / 64%);
}

.scale-diagram > div span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.scale-diagram > div strong,
.scale-diagram__arrow {
  font-size: 10px;
}

.scale-diagram__arrow {
  align-self: center;
  color: var(--ink-faint);
  font-weight: 800;
}

.structured-fixed-unit {
  background: linear-gradient(90deg, rgb(220 232 223 / 30%), var(--surface) 34%);
}

.unit-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.unit-equation strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.unit-equation input {
  width: 90px;
}

.unit-equation select {
  width: auto;
  min-width: 130px;
}

.inline-advanced {
  margin-top: 11px;
  border-top: 1px dashed var(--line-strong);
}

.inline-advanced summary {
  padding-top: 10px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.inline-advanced .field,
.inline-advanced .form-grid {
  margin-top: 9px;
}

.visual-editor-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f2;
}

.visual-editor-heading,
.format-card__heading,
.rule-card__heading,
.period-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.visual-editor-heading > div > strong,
.visual-editor-heading > div > span {
  display: block;
}

.visual-editor-heading > div > strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.visual-editor-heading > div > span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 12px;
}

.period-track {
  display: grid;
  grid-auto-columns: minmax(190px, 1fr);
  grid-auto-flow: column;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}

.period-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  scroll-snap-align: start;
}

.period-card__bar {
  width: var(--period-width);
  height: 5px;
  margin: -13px 0 12px -13px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, var(--gold), var(--forest-bright));
  transition: width 180ms ease;
}

.period-card__heading > span,
.label-card > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 10px;
  font-weight: 800;
}

.period-reorder,
.label-card__actions {
  display: flex;
  gap: 3px;
}

.period-reorder button,
.label-card__actions button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: #faf8f2;
  cursor: pointer;
}

.period-reorder button:last-child,
.label-card__actions button:last-child {
  color: #a3473d;
}

.period-reorder button:disabled,
.label-card__actions button:disabled {
  opacity: .3;
  cursor: default;
}

.period-card > .field {
  margin-top: 11px;
}

.period-length > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.period-length > div span {
  color: var(--ink-faint);
  font-size: 10px;
}

.period-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 10px;
}

.period-total strong {
  color: var(--forest);
  font-size: 12px;
}

.rule-cards,
.adjustment-cards,
.format-cards {
  display: grid;
  gap: 10px;
}

.rule-card,
.adjustment-card,
.format-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.rule-card__heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.rule-icon,
.adjustment-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
}

.rule-sentence,
.adjustment-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: #faf8f2;
  font-size: 12px;
  line-height: 1.5;
}

.rule-sentence input,
.adjustment-sentence input {
  width: 72px;
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
}

.rule-sentence select,
.adjustment-sentence select {
  width: auto;
  min-height: 34px;
  padding: 6px 28px 6px 9px;
}

.rule-card > p {
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.adjustment-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.adjustment-card .adjustment-sentence {
  margin: 0;
}

.visual-empty {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-faint);
  background: rgb(255 255 255 / 46%);
}

.visual-empty > span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.visual-empty strong,
.visual-empty p {
  display: block;
  margin: 0;
}

.visual-empty strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.visual-empty p {
  margin-top: 3px;
  font-size: 10px;
}

.label-cycle {
  background: linear-gradient(135deg, rgb(220 232 223 / 32%), var(--surface) 44%);
}

.label-sequence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 13px 0;
}

.label-card {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.label-card.is-epoch {
  border-color: rgb(180 133 53 / 45%);
  box-shadow: inset 3px 0 var(--gold);
}

.format-card__heading > div > span,
.format-card__heading > div > strong {
  display: block;
}

.format-card__heading > div > span,
.format-preview > span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.format-card__heading > div > strong {
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.format-card > .field {
  margin-top: 12px;
}

.format-pattern {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.format-preview {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding: 13px;
  border-radius: 10px;
  color: #fff;
  background: var(--forest);
}

.format-preview > span {
  color: rgb(255 255 255 / 62%);
}

.format-preview > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.format-token-row,
.token-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.format-token-row button,
.token-palette code {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.format-token-row button {
  cursor: pointer;
}

.field textarea.calendar-values {
  min-height: 78px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.mapping-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.placement-editor {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.placement-editor > legend {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.placement-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.placement-mode {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 86px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.placement-mode:has(input:checked) {
  border-color: rgb(45 103 86 / 48%);
  background: rgb(220 232 223 / 45%);
  box-shadow: inset 3px 0 var(--forest-bright);
}

.placement-mode:focus-within {
  outline: 3px solid rgb(45 103 86 / 28%);
  outline-offset: 2px;
}

.placement-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.placement-mode__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.placement-mode strong,
.placement-mode small {
  display: block;
}

.placement-mode strong {
  font-size: 12px;
}

.placement-mode small,
.placement-editor__note {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.placement-mode small {
  margin-top: 4px;
}

.placement-editor__note {
  margin: 9px 0 0;
}

.placement-details {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.placement-copy {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface);
}

.placement-copy strong,
.placement-copy span {
  display: block;
}

.placement-copy strong {
  color: var(--ink);
  font-size: 11px;
}

.placement-copy span {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.45;
}

.epoch-editor {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(233 227 214 / 24%);
}

.epoch-editor > legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.epoch-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.epoch-modes label {
  position: relative;
  display: inline-flex;
  min-width: 180px;
  flex: 1;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.epoch-modes label:has(input:checked) {
  border-color: rgb(45 103 86 / 42%);
  background: var(--forest-pale);
}

.epoch-modes input {
  margin: 2px 0 0;
  accent-color: var(--forest-bright);
}

.epoch-modes strong,
.epoch-modes small {
  display: block;
}

.epoch-modes strong {
  font-size: 11px;
}

.epoch-modes small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}

.epoch-date {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}

.epoch-anchor-source {
  display: grid;
  gap: 10px;
}

.epoch-anchor-source .form-grid {
  padding: 0;
}

.epoch-anchor-source:has(input[name="anchor_mode"][value="existing"]:checked) .new-anchor,
.epoch-anchor-source:has(input[name="anchor_mode"][value="new"]:checked) .existing-anchor {
  display: none;
}

.calendar-editor:has(input[name="placement_mode"][value="not_placed"]:checked) .mapping-editor,
.calendar-editor:has(input[name="placement_mode"][value="not_placed"]:checked) .epoch-editor,
.calendar-editor:has(input[name="placement_mode"][value="not_placed"]:checked) .placement-details,
.epoch-editor:has(input[name="epoch_mode"][value="unknown"]:checked) .epoch-date {
  display: none;
}

.mapping-editor summary {
  padding: 13px 15px;
  cursor: pointer;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.mapping-editor[open] summary {
  border-bottom: 1px solid var(--line);
}

.mapping-editor > p {
  margin: 14px 15px 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.5;
}

.mapping-editor .form-grid {
  padding: 15px;
}

.mapping-editor > .coordinate-grid {
  margin: 15px;
}

.advanced-mapping {
  min-width: 0;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

.advanced-mapping summary {
  padding: 10px 2px 2px;
  color: var(--forest);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.advanced-mapping .coordinate-grid {
  margin-top: 9px;
}

.calendar-record--instance .calendar-record__body small {
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
}

.calendar-tools {
  grid-column: 1 / -1;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.calendar-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calendar-tool-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.calendar-tool-grid form {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf8f2;
}

.calendar-tool-grid form > div:first-child p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

.conversion-context {
  display: grid;
  grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.conversion-context span {
  grid-row: 1 / span 2;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.conversion-context strong {
  font-size: 12px;
}

.conversion-context small {
  color: var(--ink-faint);
  font-size: 10px;
}

.compound-date {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.compound-date > legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.compound-date__grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 8px;
}

.compound-date__component {
  min-width: 0;
}

.compound-date__component label {
  font-size: 9px;
}

.compound-date__component input,
.compound-date__component select {
  min-height: 39px;
  background: var(--surface-strong);
}

.compound-date__familiar-year > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 6px;
}

.conversion-targets {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.conversion-targets > legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.conversion-targets__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}

.conversion-targets__grid label {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.conversion-targets__grid label:has(input:checked) {
  border-color: rgb(45 103 86 / 42%);
  background: var(--forest-pale);
}

.conversion-targets__grid input {
  margin: 2px 0 0;
  accent-color: var(--forest-bright);
}

.conversion-targets__grid strong,
.conversion-targets__grid small {
  display: block;
}

.conversion-targets__grid strong {
  font-size: 11px;
}

.conversion-targets__grid small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.calendar-tools__advanced {
  margin-top: 10px;
  padding-bottom: 10px;
}

.calendar-tools__advanced form {
  margin: 11px 2px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
}

.calendar-result__date {
  color: var(--ink) !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px !important;
}

.conversion-results {
  margin-top: 12px;
}

.conversion-results h4 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.conversion-results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.conversion-result {
  padding: 12px;
  border: 1px solid #b7d0c2;
  border-radius: 10px;
  background: #edf5f0;
}

.conversion-result--unavailable {
  border-color: var(--line);
  background: #faf8f2;
}

.conversion-result > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversion-result p {
  margin: 8px 0 3px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.35;
}

.conversion-result--unavailable p {
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
}

.conversion-result small {
  color: var(--ink-faint);
  font-size: 9px;
}

.conversion-route-positions {
  grid-column: 1 / -1;
}

.conversion-route-positions ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conversion-route-positions li {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.conversion-route-positions li span {
  color: var(--ink-faint);
  font-family: var(--font-sans, sans-serif);
  font-size: 9px;
}

.conversion-route-positions code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
}

.calendar-tools__empty {
  margin: 12px 2px 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.calendar-result {
  margin: 12px 0 0;
}

.calendar-result p,
.calendar-result small {
  margin: 5px 0 0;
  color: inherit;
  font-size: 11px;
  line-height: 1.5;
}

.calendar-result--mapped {
  padding: 14px;
  border: 1px solid #b7d0c2;
  border-radius: 11px;
  color: #285343;
  background: #edf5f0;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.coordinate-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgb(40 83 67 / 15%);
  border-radius: 8px;
  background: rgb(255 255 255 / 55%);
}

.coordinate-grid dt {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.coordinate-grid dd {
  overflow-wrap: anywhere;
  margin: 4px 0 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.chronology-workspace {
  display: grid;
  gap: 18px;
}

.chronology-introduction {
  overflow: hidden;
}

.chronology-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: linear-gradient(135deg, rgb(244 239 225 / 70%), rgb(239 247 242 / 72%));
}

.chronology-principles > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 3px 10px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.chronology-principles > div:last-child {
  border-right: 0;
}

.chronology-principles > div > span {
  grid-row: 1 / 3;
  color: var(--forest-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  text-align: center;
}

.chronology-principles strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.chronology-principles small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.chronology-layout {
  display: grid;
  grid-template-columns: minmax(330px, .82fr) minmax(440px, 1.18fr);
  align-items: start;
  gap: 18px;
}

.chronology-events,
.chronology-view {
  min-width: 0;
}

.chronology-scope-bar,
.chronology-perspective-bar {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.chronology-selector {
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(170px, 1.15fr) auto;
  align-items: end;
  gap: 10px;
}

.chronology-selector .field {
  margin: 0;
}

.chronology-scope-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.chronology-scope-facts > div {
  display: flex;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 9px;
}

.chronology-scope-facts dd,
.chronology-scope-facts dt {
  margin: 0;
}

.chronology-scope-facts dd {
  color: var(--ink);
  font-weight: 800;
}

.timeline-event-list {
  display: grid;
}

.timeline-event-record {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.timeline-event-record:last-child {
  border-bottom: 0;
}

.timeline-event-record.is-route-target {
  border-radius: 12px;
  outline: 2px solid rgb(185 137 63 / 58%);
  outline-offset: -2px;
  background: var(--gold-pale);
}

.timeline-event-record:focus-visible {
  outline: 2px solid var(--forest-bright);
  outline-offset: -2px;
}

.timeline-event-record__mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgb(40 83 67 / 18%);
  border-radius: 50%;
  color: var(--forest-bright);
  background: var(--forest-pale);
  font-size: 15px;
}

.timeline-event-record__body {
  min-width: 0;
}

.timeline-event-record__title,
.chronology-occurrence__body > div,
.chronology-exception-list article > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.timeline-event-record__body p,
.timeline-event-record__body small {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.timeline-event-record code,
.chronology-occurrence code {
  color: var(--ink);
  font-size: 11px;
}

.working-range-warning {
  display: grid;
  gap: 10px;
  margin-top: 11px;
  padding: 11px 12px;
  border: 1px solid rgb(185 137 63 / 38%);
  border-radius: 11px;
  background: var(--gold-pale);
}

.working-range-warning:focus {
  outline: 3px solid rgb(185 137 63 / 30%);
  outline-offset: 2px;
}

.working-range-warning__copy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.working-range-warning__copy > span {
  color: #8a682d;
  font-size: 15px;
}

.working-range-warning__copy strong,
.working-range-warning__copy p {
  display: block;
  margin: 0;
}

.working-range-warning__copy strong {
  color: #5f512f;
  font-size: 10px;
}

.working-range-warning__copy p {
  margin-top: 3px;
  color: #776844;
  font-size: 9px;
  line-height: 1.45;
}

.working-range-warning__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.working-range-warning .form-error {
  margin: 0;
}

.chronology-loading {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}

.chronology-loading .spinner {
  width: 22px;
  height: 22px;
}

.chronology-result {
  display: grid;
  gap: 0;
}

.chronology-cardinality {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chronology-cardinality > div {
  display: grid;
  gap: 3px;
  padding: 13px 10px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.chronology-cardinality > div:last-child {
  border-right: 0;
}

.chronology-cardinality strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.chronology-cardinality span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.chronology-result__context {
  display: grid;
  gap: 3px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface), rgb(237 245 240 / 75%));
}

.chronology-result__context span,
.chronology-result__context small {
  color: var(--ink-faint);
  font-size: 9px;
}

.chronology-result-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.chronology-result-section:last-child {
  border-bottom: 0;
}

.chronology-result-section__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chronology-result-section__heading h4,
.chronology-result-section__heading p {
  margin: 0;
}

.chronology-result-section__heading h4 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.chronology-result-section__heading p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.chronology-occurrence-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chronology-occurrence {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.chronology-occurrence.has-temporal-tie {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgb(236 211 151 / 15%), var(--paper) 34%);
}

.chronology-occurrence__coordinate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: start;
  gap: 5px;
}

.chronology-occurrence__coordinate > span:first-child {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--forest-bright);
  font-size: 9px;
  font-weight: 800;
}

.chronology-occurrence__coordinate em {
  color: var(--ink-faint);
  font-size: 8px;
  font-style: normal;
}

.chronology-occurrence__body {
  min-width: 0;
}

.chronology-occurrence__body p,
.chronology-occurrence__body small {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
}

.chronology-exceptions {
  background: rgb(250 248 242 / 58%);
}

.chronology-exception-list {
  display: grid;
  gap: 8px;
}

.chronology-exception-list article {
  padding: 11px 12px;
  border: 1px solid rgb(139 105 45 / 22%);
  border-radius: 9px;
  background: rgb(255 253 247 / 90%);
}

.chronology-exception-list p,
.chronology-exception-list small,
.chronology-none {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.temporal-problem {
  display: grid;
  gap: 8px;
  margin: 14px 18px;
  padding: 13px;
  border: 1px solid rgb(153 80 65 / 28%);
  border-radius: 10px;
  color: var(--rust);
  background: rgb(252 241 238 / 82%);
}

.modal-body > .temporal-problem {
  margin: 0;
}

.temporal-problem > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.temporal-problem small {
  color: var(--ink-faint);
  font-size: 9px;
}

.temporal-problem dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.temporal-problem dl > div {
  display: grid;
  grid-template-columns: minmax(90px, .3fr) minmax(0, 1fr);
  gap: 8px;
  font-size: 9px;
}

.temporal-problem dt {
  font-weight: 800;
  text-transform: capitalize;
}

.temporal-problem dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.event-coordinate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.event-end-toggle {
  grid-column: 1 / -1;
}

.event-editor-modal {
  width: min(1120px, 100%);
}

.event-editor-body {
  gap: 20px;
  background: var(--paper);
}

.event-editor-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
}

.event-editor-section > .editor-section__heading {
  margin-bottom: 0;
}

.event-editor-section > .notice,
.event-date-wording-card .notice {
  margin: 0;
}

.event-body-input {
  min-height: 180px;
  resize: vertical;
}

.event-extent-choice,
.event-date-wording-card {
  min-width: 0;
  margin: 0;
  border: 0;
}

.event-extent-choice > legend,
.event-date-wording-card > legend {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.event-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.event-choice-grid label {
  position: relative;
  cursor: pointer;
}

.event-choice-grid input {
  position: absolute;
  opacity: 0;
}

.event-choice-grid label > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  background: var(--paper);
}

.event-choice-grid label > span strong {
  color: var(--ink);
  font-size: 12px;
}

.event-choice-grid label > span small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.4;
}

.event-choice-grid input:checked + span {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px rgb(45 103 86 / 12%);
}

.event-choice-grid input:focus-visible + span,
.event-tag-picker input:focus-visible + span {
  outline: 3px solid rgb(45 103 86 / 28%);
  outline-offset: 2px;
}

.event-coordinate-grid,
.event-date-wording-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 410px), 1fr));
  align-items: start;
  gap: 14px;
}

.event-end-coordinate {
  min-width: 0;
}

.event-end-coordinate[hidden],
.event-representative-placement-notice[hidden] {
  display: none;
}

.project-correspondence-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.project-correspondence-summary > span {
  color: var(--forest-bright);
  font-size: 1.15rem;
}

.project-correspondence-summary div {
  display: grid;
  gap: .25rem;
}

.project-correspondence-summary small,
.project-correspondence-summary span,
.project-correspondence-summary p {
  color: var(--ink-soft);
}

.project-correspondence-summary p {
  margin: 0;
  font-weight: 650;
  color: var(--ink);
}

.project-correspondence-impact {
  display: grid;
  gap: .75rem;
}

.project-correspondence-impact > h3,
.project-correspondence-impact > p {
  margin: 0;
}

.project-correspondence-impact > div {
  display: grid;
  gap: .55rem;
}

.project-correspondence-impact article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.project-correspondence-impact article > span {
  color: var(--forest-bright);
}

.project-correspondence-impact article div {
  display: grid;
  gap: .1rem;
}

.event-date-wording-card {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.event-date-presentation-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 11px;
}

.event-date-wording-preview {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid var(--forest-bright);
  border-radius: 4px 9px 9px 4px;
  background: var(--forest-pale);
}

.event-date-wording-preview span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.event-date-wording-preview strong {
  overflow-wrap: anywhere;
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
}

.event-participant-list,
.event-relation-list,
.entry-event-panels {
  display: grid;
  gap: 12px;
}

.event-participant-editor,
.event-relation-editor {
  display: grid;
  min-width: 0;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.event-participant-editor > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-participant-editor > header > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.event-relation-editor > .button {
  justify-self: end;
}

.event-editor-empty {
  margin: 0;
  padding: 13px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 11px;
}

.event-record-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.event-date-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.event-date-facts > span {
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--paper-deep);
  font-size: 8px;
  font-weight: 750;
}

.event-participant-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  border: 1px solid rgb(45 103 86 / 18%);
  border-radius: 999px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 9px;
}

.timeline-event-record__summary {
  max-width: 72ch;
  color: var(--ink-soft) !important;
  line-height: 1.5;
}

.event-display-caveat {
  color: #79612e !important;
  line-height: 1.45;
}

.event-open-end {
  color: var(--ink-faint);
  font-size: 9px;
  font-style: italic;
}

.archived-event-recovery {
  margin-top: 18px;
}

.event-recovery-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.event-recovery-actions .advanced-actions {
  text-align: right;
}

.event-record-detail {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.event-record-detail > summary {
  width: max-content;
  max-width: 100%;
  padding-top: 9px;
  color: var(--forest-bright);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.event-record-detail__body {
  display: grid;
  gap: 13px;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.event-record-detail__body section,
.event-record-detail__body ul {
  display: grid;
  gap: 8px;
  margin: 0;
}

.event-record-detail__body h4,
.event-record-detail__body p {
  margin: 0;
}

.event-record-detail__body h4 {
  color: var(--ink);
  font-size: 10px;
}

.event-record-detail__body ul {
  padding: 0;
  list-style: none;
}

.event-record-detail__body li {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.event-record-detail__body li:first-child {
  padding-top: 0;
  border-top: 0;
}

.event-record-detail__body li > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.event-record-detail__body li span,
.event-record-detail__body li p {
  color: var(--ink-faint);
  font-size: 9px;
}

.event-record-detail__narrative {
  padding-top: 0;
  border-top: 0;
  color: var(--ink-soft) !important;
  font-size: 11px !important;
  line-height: 1.65;
}

.event-record-detail__narrative h5 { font-size: 17px; }
.event-record-detail__narrative h6 { font-size: 14px; }

.collection-filter-actions,
.lore-toolbar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.collection-filter-actions .location-search {
  width: min(420px, 48vw);
}

.lore-toolbar {
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.lore-toolbar > .location-search {
  width: min(520px, 52vw);
}

.lore-toolbar > .field {
  min-width: 180px;
}

.entity-section-nav {
  position: sticky;
  z-index: 3;
  top: 63px;
  display: flex;
  overflow-x: auto;
  gap: 3px;
  margin: 0 0 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 253 248 / 94%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.entity-section-nav button {
  flex: 1 0 auto;
  padding: 7px 9px;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.entity-section-nav button:hover,
.entity-section-nav button:focus-visible {
  color: var(--forest);
  background: var(--forest-pale);
}

.entity-detail-sections > [id] {
  scroll-margin-top: 118px;
}

.entity-body {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.entity-body > :first-child {
  margin-top: 0;
}

.entity-body > :last-child {
  margin-bottom: 0;
}

.entity-body h4,
.entity-body h5,
.entity-body h6 {
  margin: 1.5em 0 .55em;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.25;
}

.entity-body h4 { font-size: 22px; }
.entity-body h5 { font-size: 18px; }
.entity-body h6 { font-size: 15px; }

.entity-body p,
.entity-body ul,
.entity-body ol,
.entity-body blockquote,
.entity-body pre,
.entity-body table {
  margin: 0 0 1em;
}

.entity-body ul,
.entity-body ol {
  padding-left: 24px;
}

.entity-body blockquote {
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
}

.entity-body pre,
.entity-body code {
  border-radius: 6px;
  background: var(--surface-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.entity-body code { padding: 1px 4px; }

.entity-body pre {
  overflow-x: auto;
  padding: 12px;
}

.entity-body pre code { padding: 0; }

.entity-body__table-scroll {
  width: max-content;
  max-width: 100%;
  margin: 0 0 1em;
  overflow-x: auto;
}

.entity-body__table-scroll:focus-visible {
  outline: 2px solid var(--forest-bright);
  outline-offset: 3px;
}

.entity-body table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.entity-body th,
.entity-body td {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.entity-body th {
  color: var(--ink);
  background: var(--surface-muted);
}

.entity-body-align--left { text-align: left; }
.entity-body-align--center { text-align: center; }
.entity-body-align--right { text-align: right; }

.entity-body__unresolved-mention {
  padding: 1px 4px;
  border: 1px dashed var(--gold);
  border-radius: 5px;
  color: var(--ink-soft);
  background: var(--gold-pale);
}

.entity-body__reference {
  padding: 1px 2px;
  border-radius: 4px;
  color: var(--forest-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.entity-body__reference:hover,
.entity-body__reference:focus-visible {
  color: var(--forest);
  background: var(--forest-pale);
}

.entity-body__reference--unavailable {
  color: var(--ink-faint);
  background: var(--surface-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.entity-body-editor {
  min-height: min(46vh, 480px);
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.55;
  tab-size: 2;
}

.body-reference-tools {
  display: grid;
  justify-items: start;
  gap: 7px;
  margin-top: 7px;
}

.body-reference-chooser {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .8fr) auto;
  align-items: end;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.body-reference-chooser .field { margin: 0; }

.body-reference-chooser > small {
  grid-column: 1 / -1;
  color: var(--ink-faint);
  font-size: 9px;
}

.entry-structured-details {
  display: grid;
  gap: 14px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry-structured-details--empty,
.entry-structured-details__heading,
.detail-settings-toolbar,
.detail-definition-group__heading,
.entry-detail-field__heading,
.detail-claim-value-row__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.entry-structured-details h4,
.entry-structured-details h5,
.detail-definition-group h3 {
  margin: 0;
}

.entry-structured-details p,
.detail-definition-group__heading p,
.detail-settings-toolbar small {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.entry-detail-section-list,
.entry-detail-field-list,
.entry-detail-claim-list,
.detail-definition-field-list,
.detail-claim-value-list {
  display: grid;
  gap: 10px;
}

.entry-detail-section {
  display: grid;
  gap: 9px;
}

.entry-detail-section + .entry-detail-section {
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.entry-detail-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.entry-detail-field__heading strong,
.entry-detail-field__heading small {
  display: block;
}

.entry-detail-field__heading small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.entry-detail-unrecorded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 10px;
}

.entry-detail-disagreement {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-ink) !important;
}

.entry-detail-claim {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.entry-detail-claim.is-preferred {
  border-left: 3px solid var(--gold);
}

.entry-detail-claim__main,
.entry-detail-claim__actions {
  display: grid;
  align-content: start;
  gap: 7px;
}

.entry-detail-claim__actions {
  grid-auto-flow: column;
}

.entry-detail-claim__value {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.entry-detail-text {
  white-space: pre-wrap;
}

.entry-detail-state {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 700;
}

.entry-detail-value-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.entry-detail-rich-text {
  padding: 0;
  border: 0;
}

.entry-detail-rich-text h6 {
  margin-top: 10px;
  font-size: 14px;
}

.entry-detail-claim__context summary {
  width: fit-content;
  color: var(--forest-bright);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.entry-detail-claim__context dl {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.entry-detail-claim__context dl > div {
  display: grid;
  grid-template-columns: minmax(80px, .35fr) minmax(0, 1fr);
  gap: 8px;
}

.entry-detail-claim__context dt,
.entry-detail-claim__context dd {
  margin: 0;
  font-size: 9px;
  line-height: 1.45;
}

.entry-detail-claim__context dt { color: var(--ink-faint); }

.detail-settings-browser,
.detail-definition-group {
  display: grid;
  gap: 12px;
}

.schema-ownership-notice {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--forest-pale);
}

.schema-ownership-notice > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--paper);
  background: var(--forest);
}

.schema-ownership-notice strong,
.schema-ownership-notice p {
  display: block;
}

.schema-ownership-notice p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.detail-settings-toolbar {
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.detail-settings-toolbar strong,
.detail-settings-toolbar small {
  display: block;
}

.detail-definition-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.detail-definition-group__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.detail-definition-group__summary,
.detail-definition-field__summary,
.detail-definition-group__actions,
.detail-definition-field__actions {
  min-width: 0;
}

.detail-definition-group__actions,
.detail-definition-field__actions {
  justify-content: flex-end;
}

.detail-definition-group__actions .button--danger {
  margin-left: auto;
}

.detail-definition-group.is-archived,
.detail-definition-field.is-archived {
  opacity: .72;
}

.detail-definition-field {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.detail-definition-field__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--forest-pale);
}

.detail-definition-field p {
  margin: 5px 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.detail-definition-field small {
  color: var(--ink-faint);
  font-size: 9px;
}

.schema-editor-modal .detail-definition-group h3,
.schema-editor-modal .detail-definition-group__heading p,
.schema-editor-modal .detail-definition-field strong,
.schema-editor-modal .detail-definition-field p,
.schema-editor-modal .detail-definition-field small,
.schema-editor-modal .type-chip-picker span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.schema-editor-modal .button,
.schema-editor-modal .badge {
  white-space: nowrap;
}

.schema-order-controls {
  display: inline-flex;
  gap: 2px;
}

.schema-order-controls .button {
  width: 28px;
  padding-inline: 0;
}

.schema-order-controls .button:disabled {
  cursor: default;
}

.detail-type-scope,
.claim-state-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.detail-type-scope {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-type-scope > label,
.claim-state-picker > label {
  position: relative;
  cursor: pointer;
}

.detail-type-scope input,
.claim-state-picker input {
  position: absolute;
  opacity: 0;
}

.detail-type-scope label > span,
.claim-state-picker label > span {
  display: block;
  height: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.detail-type-scope input:checked + span,
.claim-state-picker input:checked + span {
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 2px var(--forest-pale);
}

.detail-type-scope input:focus-visible + span,
.claim-state-picker input:focus-visible + span {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.detail-type-scope strong,
.detail-type-scope small,
.claim-state-picker strong,
.claim-state-picker small {
  display: block;
}

.detail-type-scope small,
.claim-state-picker small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.4;
}

.claim-state-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.claim-state-picker legend {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
}

.detail-claim-values {
  display: grid;
  gap: 10px;
}

.detail-claim-value-row {
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.detail-number-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, .45fr);
  gap: 8px;
}

.detail-claim-editor__help {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.entry-see-also-list,
.entry-reference-list,
.entry-reference-sections {
  display: grid;
  gap: 10px;
}

.entry-see-also-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}

.entry-see-also-row__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--forest-pale);
}

.entry-see-also-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.entry-see-also-row__title > a,
.entry-see-also-row__title > span {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.entry-see-also-row p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.entry-see-also-row__actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.entry-reference-sections {
  margin-top: 6px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.entry-reference-sections > section {
  display: grid;
  gap: 9px;
}

.entry-reference-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.entry-reference-row > span {
  color: var(--forest-bright);
}

.entry-reference-row strong,
.entry-reference-row small {
  display: block;
}

.entry-reference-row strong a,
.entry-reference-row strong > span {
  color: var(--forest);
  text-decoration: none;
}

.entry-reference-row small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.entry-unresolved-references {
  padding: 13px;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  background: var(--gold-pale);
}

.entry-unresolved-references ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.entry-unresolved-reference-list {
  display: grid;
  gap: 9px;
}

.entry-unresolved-reference {
  display: grid;
  grid-template-columns: minmax(130px, .65fr) minmax(180px, 1fr) minmax(150px, .75fr) auto;
  align-items: end;
  gap: 9px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
  border-radius: 9px;
  background: var(--paper);
}

.entry-unresolved-reference .field { margin: 0; }

.entry-unresolved-reference__source strong,
.entry-unresolved-reference__source small {
  display: block;
}

.entry-unresolved-reference__source strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.entry-unresolved-reference__source small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.entry-unresolved-references li strong,
.entry-unresolved-references li span {
  display: block;
}

.entry-unresolved-references li span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.see-also-fixed-target {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--forest-pale);
}

.see-also-fixed-target > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--surface);
}

.see-also-fixed-target small,
.see-also-fixed-target strong,
.see-also-fixed-target div > span {
  display: block;
}

.see-also-fixed-target small,
.see-also-fixed-target div > span {
  color: var(--ink-faint);
  font-size: 9px;
}

.connection-choice-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.connection-choice-field > legend {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.choice-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 9px;
}

.choice-grid label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
}

.choice-grid label > span {
  display: grid;
  min-height: 66px;
  align-content: center;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  background: var(--paper);
}

.choice-grid label > span strong {
  color: var(--ink);
  font-size: 12px;
}

.choice-grid label > span small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}

.choice-grid input:checked + span {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px rgb(45 103 86 / 12%);
}

.choice-grid input:focus-visible + span {
  outline: 3px solid rgb(45 103 86 / 28%);
  outline-offset: 2px;
}

.choice-grid input:disabled + span {
  opacity: .48;
  cursor: not-allowed;
}

.choice-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.entity-connection-list {
  display: grid;
  gap: 10px;
}

.entity-connection-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.entity-connection-row.is-archived {
  opacity: .72;
  background: var(--surface-muted);
}

.entity-connection-row__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-pale);
}

.entity-connection-row p {
  margin: 0;
  line-height: 1.55;
}

.entity-connection-row .button-row {
  margin-top: 6px;
}

.entity-connection-row__notes {
  margin-top: 8px !important;
  color: var(--ink-faint);
  font-size: 13px;
  white-space: pre-wrap;
}

.connection-applicability-summary {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.connection-applicability-summary details,
.connection-applicability-context {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.connection-applicability-summary summary,
.connection-applicability-context > summary {
  padding: 9px 11px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.connection-applicability-source {
  display: grid;
  gap: 5px;
  padding: 0 11px 11px;
  color: var(--ink-soft);
  font-size: 12px;
}

.connection-applicability-context > .form-stack,
.connection-applicability-context > .form-grid {
  padding: 4px 12px 12px;
}

.connection-applicability-states {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.connection-applicability-states > legend {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.connection-applicability-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
  align-items: start;
  gap: 14px;
}

.connection-applicability-point {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.connection-refresh-notice {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.connection-refresh-notice .button {
  flex: 0 0 auto;
}

.field.is-disabled {
  opacity: .58;
}

.location-specialty-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.location-specialty-details > section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.location-specialty-details > section:last-child {
  grid-column: 1 / -1;
}

.entity-specialty-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entity-specialty-heading h4,
.entity-specialty-heading p,
.location-specialty-details > section > p {
  margin: 0;
}

.entity-specialty-heading h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.entity-specialty-heading p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.location-specialty-details > section > p {
  margin-top: 12px;
  font-size: 11px;
}

.contained-location-grid {
  margin: 12px -14px -14px;
  border-top: 1px solid var(--line);
}

.character-next-actions {
  display: grid;
  gap: 14px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--forest) 24%, var(--line));
  border-radius: 14px;
  background: linear-gradient(135deg, var(--forest-pale), var(--surface));
  box-shadow: var(--shadow-sm);
}

.character-next-actions h3,
.character-next-actions p,
.character-next-action p {
  margin: 0;
}

.character-next-actions h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.character-next-actions > div:first-child > p:last-child,
.character-next-action p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.character-next-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.character-next-action {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.character-next-action > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-pale);
}

.character-next-action .button {
  margin-top: 10px;
}

.character-card-grid,
.lore-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  padding: 14px;
}

.character-card,
.lore-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.character-card > a,
.lore-card > a {
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 15px;
  text-decoration: none;
}

.character-card h3,
.character-card p,
.lore-card h3,
.lore-card p {
  margin: 0;
}

.character-card h3,
.lore-card h3 {
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.character-card p:not(.eyebrow),
.lore-card p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.character-card > .button,
.lore-card > .button {
  justify-self: end;
  margin: 0 12px 12px;
}

.advanced-actions {
  position: relative;
  align-self: center;
}

.advanced-actions > summary {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.advanced-actions[open] {
  display: grid;
  gap: 6px;
}

.initial-name-choice {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.initial-name-choice > legend {
  padding: 0 5px;
  font-weight: 750;
}

.initial-name-choice > [data-initial-name-fields] {
  margin-top: 10px;
}

.editor-section > summary {
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
}

.editor-section[open] > summary {
  margin-bottom: 14px;
}

.editor-section__body {
  display: grid;
  gap: 12px;
}

.type-capability-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.type-capability-picker label {
  position: relative;
  cursor: pointer;
}

.type-capability-picker input {
  position: absolute;
  opacity: 0;
}

.type-capability-picker span {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.type-capability-picker small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
}

.type-capability-picker input:checked + span {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.type-capability-picker input:focus-visible + span {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.type-capability-picker input:disabled + span {
  cursor: not-allowed;
  opacity: .64;
}

.type-capability-picker__choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.type-capability-picker__choice > input {
  position: absolute;
  opacity: 0;
}

.type-capability-picker__choice > span {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.type-capability-picker__choice small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
}

.type-capability-picker__choice > input:checked + span {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.type-capability-picker__choice > input:focus-visible + span {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.type-capability-picker__choice > input:disabled + span {
  cursor: not-allowed;
  opacity: .64;
}

@media (max-width: 1120px) {
  .character-next-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chronology-layout {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composer-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .calendar-structure-guide {
    grid-template-columns: 1fr;
  }

  .calendar-structure-guide > b {
    text-align: center;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 340px;
    padding: 30px;
  }

  .auth-copy {
    padding: 54px 0 20px;
  }

  .auth-copy h1 {
    max-width: 600px;
    font-size: clamp(38px, 9vw, 64px);
  }

  .auth-copy p:last-child,
  .auth-footnote {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    padding: 45px 24px 70px;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 190ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-shell {
    margin-left: 0;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(8 22 18 / 50%);
  }

  .content-grid,
  .content-grid--equal {
    grid-template-columns: 1fr;
  }

  .location-hierarchy-layout,
  .location-detail-grid {
    grid-template-columns: 1fr;
  }

  .schema-editor-modal .detail-definition-group__heading {
    grid-template-columns: 1fr;
  }

  .schema-editor-modal .detail-definition-group__actions {
    justify-content: flex-start;
  }

  .schema-editor-modal .detail-definition-field {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .schema-editor-modal .detail-definition-field__actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .character-next-action-grid {
    grid-template-columns: 1fr;
  }

  .guided-format-choices {
    grid-template-columns: 1fr;
  }

  .calendar-period-actions {
    width: 100%;
    justify-content: stretch;
  }

  .calendar-period-actions .button {
    flex: 1 1 auto;
  }

  .composer-mode-switch {
    display: grid;
    width: auto;
  }

  .composer-mode-switch > span {
    padding-block: 4px 1px;
  }

  .calendar-review,
  .calendar-review-examples > div:last-child {
    grid-template-columns: 1fr;
  }

  .calendar-review__item {
    display: grid;
  }

  .calendar-review__item .button {
    justify-self: start;
  }

  .chronology-principles,
  .chronology-cardinality,
  .event-coordinate-grid {
    grid-template-columns: 1fr;
  }

  .chronology-principles > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chronology-principles > div:last-child {
    border-bottom: 0;
  }

  .chronology-selector {
    grid-template-columns: 1fr;
  }

  .chronology-selector .button {
    width: 100%;
  }

  .chronology-cardinality > div {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .chronology-cardinality > div:last-child {
    border-bottom: 0;
  }

  .timeline-event-record {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .timeline-event-record > .button-row,
  .timeline-event-record > .event-recovery-actions {
    grid-column: 2;
    justify-self: start;
  }

  .working-range-warning__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .working-range-warning__actions .button {
    width: 100%;
    justify-content: center;
  }

  .chronology-occurrence {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .connection-label {
    display: none;
  }

  .page {
    padding: 25px 16px 50px;
  }

  .project-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: -3px;
  }

  .project-nav__link {
    min-height: 58px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 27px 8px 8px;
  }

  .project-nav__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 15px;
  }

  .composer-stages {
    grid-template-columns: 1fr;
  }

  .composer-stage small {
    white-space: normal;
  }

  .composer-panel.is-active {
    min-height: 0;
  }

  .composer-panel > header,
  .composer-panel__body {
    padding: 16px;
  }

  .identity-preview,
  .base-scale-editor {
    grid-template-columns: 1fr;
  }

  .identity-preview .calendar-glyph {
    display: none;
  }

  .fraction-editor {
    grid-template-columns: minmax(70px, auto) 20px 74px minmax(76px, auto);
  }

  .scale-diagram {
    display: grid;
  }

  .scale-diagram__arrow {
    text-align: center;
  }

  .visual-editor-heading,
  .period-total,
  .calendar-unit__topline {
    align-items: flex-start;
  }

  .calendar-section__heading {
    align-items: flex-start;
  }

  .calendar-rule-actions {
    justify-content: flex-start;
  }

  .calendar-system-summary {
    grid-template-columns: 1fr;
  }

  .adjustment-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .adjustment-card > .button {
    grid-column: 2;
    justify-self: start;
  }

  .rule-card__heading {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .rule-card__heading > .button {
    grid-column: 2;
    justify-self: start;
  }

  .composer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .composer-actions > span {
    display: none;
  }

  .project-nav__copy small {
    display: none;
  }

  .location-topbar,
  .location-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .location-topbar > .button-row,
  .location-detail-header > .button-row {
    width: 100%;
  }

  .location-view-nav {
    width: 100%;
    overflow-x: auto;
  }

  .location-view-nav a {
    flex: 1 0 auto;
    text-align: center;
  }

  .location-collection {
    grid-template-columns: 1fr;
  }

  .location-browser {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .location-browser__heading {
    display: none;
  }

  .location-browser > a {
    min-width: 145px;
  }

  .location-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .location-search,
  .collection-filter-actions .location-search,
  .lore-toolbar > .location-search {
    width: 100%;
  }

  .collection-filter-actions,
  .lore-toolbar {
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
  }

  .location-row {
    grid-template-columns: auto 32px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .location-row__meta {
    display: none;
  }

  .location-row__actions .button:first-child {
    display: none;
  }

  .location-type-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .location-type-card > .button-row {
    grid-column: 2;
  }

  .entity-section-nav {
    top: 55px;
  }

  .location-specialty-details,
  .type-capability-picker {
    grid-template-columns: 1fr;
  }

  .location-specialty-details > section,
  .location-specialty-details > section:last-child {
    grid-column: auto;
  }

  .character-card-grid,
  .lore-card-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .lifecycle-track,
  .lifecycle-editor-grid {
    grid-template-columns: 1fr;
  }

  .lifecycle-track__span {
    min-height: 35px;
  }

  .lifecycle-track__span > span {
    width: 2px;
    height: 28px;
    justify-self: center;
  }

  .lifecycle-editor-arrow {
    transform: rotate(90deg);
  }

  .entry-name-row {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .entry-name-row > .button,
  .entry-name-row > .muted {
    grid-column: 2;
    justify-self: start;
  }

  .entity-connection-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .entry-see-also-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .entry-see-also-row__actions {
    grid-column: 2;
    justify-items: start;
  }

  .entry-structured-details--empty,
  .entry-structured-details__heading,
  .detail-settings-toolbar,
  .detail-definition-group__heading,
  .entry-detail-field__heading {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-detail-claim {
    grid-template-columns: 1fr;
  }

  .entry-detail-claim__actions {
    justify-content: start;
  }

  .detail-definition-field {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .detail-definition-field > .button-row {
    grid-column: 2;
    justify-content: flex-start;
  }

  .detail-type-scope,
  .claim-state-picker,
  .detail-number-input,
  .body-reference-chooser,
  .entry-unresolved-reference {
    grid-template-columns: 1fr;
  }

  .body-reference-chooser > small {
    grid-column: auto;
  }

  .entity-connection-row > .button,
  .entity-connection-row > .button-row {
    grid-column: 2;
    justify-self: start;
  }

  .connection-refresh-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-refresh-notice .button {
    width: 100%;
    justify-content: center;
  }

  .entity-body-editor {
    min-height: 42vh;
  }

  .app-modal-backdrop {
    padding: 0;
    place-items: end stretch;
  }

  .app-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .modal-actions__spacer {
    display: none;
  }

  .position-kind-picker,
  .coordinate-input-grid,
  .deletion-impact {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .section-heading,
  .detail-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .stats-grid,
  .card-grid,
  .feature-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .inline-form--two,
  .plan-actions,
  .calendar-tool-grid,
  .coordinate-grid {
    grid-template-columns: 1fr;
  }

  .placement-modes {
    grid-template-columns: 1fr;
  }

  .placement-mode {
    min-height: 66px;
  }

  .placement-details {
    grid-template-columns: 1fr;
  }

  .calendar-record {
    grid-template-columns: 1fr;
  }

  .calendar-record > .button-row {
    padding-left: 52px;
  }

  .button-row--between {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row--between .button {
    width: 100%;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.optional-label {
  margin-left: 4px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.entity-calendar-list {
  display: grid;
}

.entity-calendar-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.entity-calendar-card:last-child {
  border-bottom: 0;
}

.entity-calendar-card__glyph {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--forest-pale);
  font-weight: 800;
}

.entity-calendar-card--used .entity-calendar-card__glyph {
  color: #73551f;
  background: var(--gold-pale);
}

.entity-calendar-card__title,
.entity-calendar-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.entity-calendar-card__body p,
.entity-calendar-card__body small {
  display: block;
  margin: 4px 0 0;
}

.entity-calendar-card__body p {
  color: var(--ink-soft);
  font-size: 11px;
}

.entity-calendar-card__body small {
  color: var(--ink-faint);
  font-size: 9px;
}

.entity-calendar-card__note {
  max-width: 680px;
  line-height: 1.5;
}

.entity-calendar-card__actions {
  justify-content: flex-end;
}

.entity-calendar-editor {
  min-width: min(760px, 78vw);
}

.entity-calendar-anchor-choice {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.entity-calendar-anchor-choice > legend {
  padding: 0 7px;
  font-weight: 750;
}

.entity-calendar-anchor-choice > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.calendar-catalog-groups {
  display: grid;
  gap: 16px;
}

.calendar-catalog-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.calendar-catalog-group > header,
.calendar-catalog-group > header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.calendar-catalog-group > header {
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #faf8f2;
}

.calendar-catalog-group > header strong,
.calendar-catalog-group > header small {
  display: block;
}

.calendar-catalog-group > header small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-fixed-attachment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 11px;
  background: var(--forest-pale);
}

.calendar-fixed-attachment > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: rgb(255 255 255 / 72%);
}

.calendar-fixed-attachment strong,
.calendar-fixed-attachment small,
.calendar-fixed-epoch small,
.calendar-fixed-epoch strong,
.calendar-fixed-epoch span {
  display: block;
}

.calendar-fixed-attachment small,
.calendar-fixed-epoch small,
.calendar-fixed-epoch span,
.calendar-fixed-epoch p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-fixed-epoch {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}

.calendar-fixed-epoch p {
  max-width: 620px;
  line-height: 1.5;
}

.calendar-borrower-list {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}

.calendar-borrower-list ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.calendar-borrower-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
}

.calendar-borrower-list li span {
  color: var(--ink-faint);
}

@media (max-width: 720px) {
  .entity-calendar-card {
    grid-template-columns: 1fr;
  }

  .entity-calendar-card__actions {
    justify-content: flex-start;
  }

  .entity-calendar-editor {
    min-width: 0;
  }
}

.app-modal--wide {
  width: min(980px, 100%);
}

.project-create-invitation,
.project-time-relative-state {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}

.project-create-invitation > span,
.project-time-relative-state > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.project-create-invitation strong,
.project-time-relative-state strong {
  display: block;
  margin-bottom: 4px;
}

.project-create-invitation p,
.project-time-relative-state p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.55;
}

.project-time-onboarding {
  min-height: 520px;
}

.project-time-progress {
  padding: 12px 20px 0;
  background: var(--surface);
}

.project-time-progress ol {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  list-style: none;
}

.project-time-progress li {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 10px 0;
  color: var(--ink-faint);
}

.project-time-progress li::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--line);
}

.project-time-progress li.is-current,
.project-time-progress li.is-complete {
  color: var(--forest);
}

.project-time-progress li.is-current::after,
.project-time-progress li.is-complete::after {
  background: var(--forest-bright);
}

.project-time-progress li > span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.project-time-progress li small {
  overflow: hidden;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-time-intro h3 {
  margin: 2px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 500;
}

.project-time-intro > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.project-time-card-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-time-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.project-time-choice-grid--recipes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-time-choice,
.project-time-radio > span {
  display: flex;
  min-width: 0;
  min-height: 102px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  background: #fbf9f4;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

button.project-time-choice {
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.project-time-choice:hover,
.project-time-choice:focus-visible,
.project-time-radio input:focus-visible + span {
  border-color: var(--forest-bright);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgb(45 103 86 / 11%);
  outline: none;
  transform: translateY(-1px);
}

.project-time-choice strong,
.project-time-radio strong {
  font-size: 13px;
  font-weight: 800;
}

.project-time-choice small,
.project-time-radio small {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

.project-time-choice__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.project-time-radio {
  position: relative;
  cursor: pointer;
}

.project-time-radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.project-time-radio input:checked + span {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
  box-shadow: inset 4px 0 var(--forest-bright);
}

.project-time-radio strong em {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--surface);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-time-familiar-date {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgb(45 103 86 / 25%);
  border-radius: 13px;
  background: var(--forest-pale);
}

.project-time-familiar-date[hidden],
.project-time-reference-date-fields[hidden] {
  display: none;
}

.project-time-familiar-date > legend {
  padding: 0 5px;
  font-weight: 800;
}

.project-time-familiar-date > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.project-time-reference-date-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-time-reference-date-fields > .field {
  min-width: 0;
}

.project-time-recommendation,
.project-time-preview-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgb(45 103 86 / 25%);
  border-radius: 13px;
  background: var(--forest-pale);
}

.project-time-recommendation > span,
.project-time-preview-summary > span {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.project-time-recommendation p,
.project-time-preview-summary p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.project-time-explanation {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf9f4;
}

.project-time-explanation summary {
  cursor: pointer;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.project-time-explanation p {
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.55;
}

.project-time-project-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf9f4;
}

.project-time-project-summary small,
.project-time-project-summary strong,
.project-time-project-summary p {
  display: block;
}

.project-time-project-summary small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-time-project-summary p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.project-time-summary {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-time-summary > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf9f4;
}

.project-time-summary dt {
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.project-time-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.project-time-summary dd small {
  display: block;
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
}

.project-time-warnings {
  display: grid;
  gap: 7px;
}

.project-time-warnings p {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #6e5320;
  background: #fff4d8;
  font-size: 11px;
  line-height: 1.5;
}

.project-time-settings .panel__header {
  align-items: flex-start;
}

.project-time-settings .panel__header p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.project-time-advanced {
  margin-top: 20px;
  overflow: hidden;
}

.project-time-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
}

.project-time-advanced > summary::-webkit-details-marker {
  display: none;
}

.project-time-advanced > summary small,
.project-time-advanced > summary strong {
  display: block;
}

.project-time-advanced > summary small {
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-time-advanced > summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.project-time-advanced[open] > summary {
  border-bottom: 1px solid var(--line);
}

@media (max-width: 720px) {
  .project-time-choice-grid--recipes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-time-progress li small {
    display: none;
  }

  .project-time-progress ol {
    display: flex;
  }

  .project-time-progress li {
    flex: 1 1 0;
    justify-content: center;
    padding-right: 3px;
  }

  .project-time-progress li::after {
    right: 3px;
    left: 3px;
  }

  .project-time-reference-date-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {
  .project-time-choice-grid,
  .project-time-choice-grid--recipes,
  .project-time-summary {
    grid-template-columns: 1fr;
  }

  .project-time-choice,
  .project-time-radio > span {
    min-height: 82px;
  }

  .project-time-project-summary {
    flex-direction: column;
  }

  .project-time-onboarding .modal-actions {
    flex-wrap: wrap;
  }

  .project-time-onboarding .modal-actions .button {
    flex: 1 1 auto;
  }

  .project-time-reference-date-fields {
    grid-template-columns: 1fr;
  }
}

.temporal-coordinate-input {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 15px;
  border: 1px solid rgb(45 103 86 / 25%);
  border-radius: 13px;
  background: rgb(255 255 255 / 62%);
}

.temporal-coordinate-input > legend {
  padding: 0 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.coordinate-entry-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.coordinate-entry-modes label {
  min-width: 0;
  cursor: pointer;
}

.coordinate-entry-modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.coordinate-entry-modes span {
  display: grid;
  min-height: 50px;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.coordinate-entry-modes strong,
.coordinate-entry-modes small {
  overflow-wrap: anywhere;
}

.coordinate-entry-modes strong {
  font-size: 10px;
}

.coordinate-entry-modes small {
  color: var(--ink-faint);
  font-size: 8px;
}

.coordinate-entry-modes input:checked + span {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
  color: var(--forest);
  background: var(--forest-pale);
}

.coordinate-entry-modes input:focus-visible + span {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.coordinate-entry-modes input:disabled + span {
  cursor: not-allowed;
  opacity: .52;
}

.coordinate-entry-body,
.coordinate-calendar-entry {
  display: grid;
  gap: 11px;
}

.coordinate-resolution {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgb(185 137 63 / 28%);
  border-radius: 10px;
  background: var(--gold-pale);
}

.coordinate-resolution > header,
.coordinate-resolution-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coordinate-resolution > header span,
.coordinate-resolution-option small {
  color: var(--ink-faint);
  font-size: 8px;
}

.coordinate-resolution-list {
  display: grid;
  gap: 6px;
}

.coordinate-resolution-option {
  padding: 8px;
  border-radius: 8px;
  background: rgb(255 255 255 / 70%);
}

.coordinate-resolution-option > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.coordinate-resolution-option strong {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.coordinate-resolution-option.is-unavailable,
.coordinate-resolution-option.is-interval {
  opacity: .78;
}

.coordinate-input-error {
  margin: 0;
}

.event-coordinate-grid > .temporal-coordinate-input,
.event-end-coordinate > .temporal-coordinate-input {
  align-self: stretch;
}

@media (max-width: 720px) {
  .event-choice-grid,
  .event-date-wording-grid {
    grid-template-columns: 1fr;
  }

  .event-editor-section {
    padding: 15px;
  }

  .event-participant-editor > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .event-relation-editor > .button {
    justify-self: start;
  }

  .event-recovery-actions {
    justify-items: start;
  }

  .event-recovery-actions .advanced-actions {
    text-align: left;
  }

  .coordinate-resolution-option {
    align-items: flex-start;
    flex-direction: column;
  }
}

.event-point-input {
  background: #fbf9f4;
}

.event-point-modes {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.event-relative-point,
.event-point-body,
.event-time-confirmation {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.event-relative-duration {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: start;
  gap: 10px;
}

.calendar-duration-editor {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: start;
  gap: 10px;
}

.event-relative-duration[hidden] {
  display: none;
}

.event-point-saved {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgb(45 103 86 / 22%);
  border-radius: 11px;
  background: var(--forest-pale);
}

.event-point-saved > span {
  color: var(--forest);
}

.event-point-saved p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.event-point-status {
  display: flex;
  min-height: 42px;
  box-sizing: border-box;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 10px;
}

.event-point-status.is-resolved {
  border-color: rgb(45 103 86 / 35%);
  color: var(--forest);
  background: var(--forest-pale);
}

.event-time-confirmation {
  margin: 0;
  padding: 15px;
  border: 1px solid rgb(185 137 63 / 35%);
  border-radius: 13px;
  background: var(--gold-pale);
}

.event-time-confirmation > legend {
  padding: 0 5px;
  font-weight: 800;
}

.event-time-confirmation > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.event-time-confirmation__choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
}

.event-time-confirmation__choices .project-time-radio > span {
  min-height: 78px;
}

.calendar-duration-editor > .field,
.event-relative-duration > .field {
  min-width: 0;
}

@media (max-width: 720px) {
  .event-point-modes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .calendar-duration-editor,
  .event-time-confirmation__choices {
    grid-template-columns: 1fr;
  }

  .schema-editor-modal .modal-body {
    padding: 12px;
  }

  .schema-editor-modal .detail-definition-group {
    padding: 10px;
  }

  .schema-editor-modal .detail-definition-field {
    gap: 8px;
    padding: 9px;
  }
}

/* Type-owned genealogy guides, fact authoring, and bounded graph projection. */
.entry-genealogy,
.entry-genealogy .panel__body,
.genealogy-settings,
.genealogy-rule-guide,
.genealogy-fact-editor,
.genealogy-graph-stack,
.genealogy-semantic-list {
  min-width: 0;
}

.genealogy-modal {
  width: min(1040px, 100%);
}

.genealogy-settings-intro,
.genealogy-rule-card,
.genealogy-review-card,
.genealogy-boundary-notice {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.genealogy-settings-intro {
  padding: 15px;
  border: 1px solid rgb(45 103 86 / 24%);
  border-radius: 13px;
  background: var(--forest-pale);
}

.genealogy-settings-intro > div,
.genealogy-rule-card > div:nth-child(2),
.genealogy-review-card > div {
  min-width: 0;
}

.genealogy-settings-intro strong,
.genealogy-settings-intro span {
  display: block;
}

.genealogy-settings-intro span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.genealogy-rule-list {
  display: grid;
  gap: 12px;
}

.genealogy-rule-card,
.genealogy-review-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.genealogy-rule-card.is-archived,
.genealogy-fact-row.is-archived {
  opacity: .72;
}

.genealogy-rule-card__symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: var(--forest-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.genealogy-rule-card__heading {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.genealogy-rule-card h3,
.genealogy-review-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.genealogy-rule-card p,
.genealogy-review-card p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.genealogy-rule-facts {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0 0;
}

.genealogy-rule-facts div {
  min-width: 0;
}

.genealogy-rule-facts dt {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.genealogy-rule-facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 700;
}

.genealogy-guide-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.genealogy-guide-progress span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-wrap: anywhere;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
}

.genealogy-guide-progress i {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-style: normal;
}

.genealogy-guide-progress .is-current,
.genealogy-guide-progress .is-complete {
  color: var(--forest);
}

.genealogy-guide-progress .is-current i,
.genealogy-guide-progress .is-complete i {
  border-color: var(--forest-bright);
  color: white;
  background: var(--forest-bright);
}

.genealogy-guide-step {
  display: grid;
  min-width: 0;
  gap: 17px;
}

.genealogy-recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.genealogy-recipe-grid button {
  display: grid;
  min-width: 0;
  min-height: 142px;
  align-content: start;
  gap: 8px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
}

.genealogy-recipe-grid button:hover {
  border-color: var(--forest-bright);
  background: var(--forest-pale);
}

.genealogy-recipe-grid button > span {
  color: var(--forest-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.genealogy-recipe-grid strong,
.genealogy-recipe-grid small {
  overflow-wrap: anywhere;
}

.genealogy-recipe-grid small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.genealogy-count-summary {
  padding: 13px 15px;
  border: 1px solid rgb(185 137 63 / 32%);
  border-radius: 12px;
  color: var(--ink);
  background: var(--gold-pale);
  overflow-wrap: anywhere;
  font-size: 11px;
}

.genealogy-role-fieldset,
.genealogy-fact-role {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.genealogy-role-list,
.genealogy-fact-participants,
.genealogy-participant-slots {
  display: grid;
  min-width: 0;
  gap: 13px;
}

.genealogy-role-list {
  margin-bottom: 13px;
}

.genealogy-role-card,
.genealogy-fact-role,
.genealogy-participant-slot {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbf9f4;
}

.genealogy-role-card > header,
.genealogy-fact-row > header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.genealogy-role-card > header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.genealogy-role-card > header strong,
.genealogy-fact-role > legend span,
.genealogy-fact-role > legend small {
  overflow-wrap: anywhere;
}

.genealogy-count-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.genealogy-count-choices label {
  min-width: 0;
  cursor: pointer;
}

.genealogy-count-choices input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.genealogy-count-choices span {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-wrap: anywhere;
  background: var(--surface-strong);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.genealogy-count-choices input:checked + span {
  border-color: var(--forest-bright);
  color: var(--forest);
  background: var(--forest-pale);
  box-shadow: inset 0 0 0 1px var(--forest-bright);
}

.genealogy-count-choices input:focus-visible + span {
  outline: 3px solid rgb(45 103 86 / 28%);
  outline-offset: 2px;
}

.genealogy-exact-count,
.genealogy-count-advanced,
.genealogy-role-options {
  margin-top: 11px;
}

.genealogy-exact-count {
  display: grid;
  width: min(240px, 100%);
  gap: 7px;
}

.genealogy-exact-count input {
  width: 100%;
}

.genealogy-count-advanced {
  padding: 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.genealogy-count-advanced summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.genealogy-count-advanced[open] summary {
  margin-bottom: 11px;
}

.genealogy-role-options {
  display: grid;
  gap: 13px;
}

.genealogy-review-card {
  justify-content: flex-start;
}

.genealogy-fact-role > legend {
  display: grid;
  gap: 3px;
  padding: 0 5px;
  font-weight: 800;
}

.genealogy-fact-role > legend small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 600;
}

.genealogy-fact-role > .button-row {
  margin-top: 11px;
}

.genealogy-participant-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--surface-strong);
}

.genealogy-unknown-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.genealogy-graph-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.genealogy-graph-viewport {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background-color: #fbfaf6;
  background-image:
    linear-gradient(rgb(45 103 86 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(45 103 86 / 5%) 1px, transparent 1px);
  background-size: 24px 24px;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.genealogy-graph-canvas {
  position: relative;
  min-width: 100%;
}

.genealogy-graph-canvas > svg {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: visible;
}

.genealogy-graph-path {
  fill: none;
  stroke: var(--line-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.genealogy-graph-path.is-archived {
  stroke-dasharray: 5 5;
  opacity: .65;
}

#genealogy-arrow path {
  fill: var(--line-strong);
}

.genealogy-generation-label {
  position: absolute;
  z-index: 1;
  left: 50%;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-wrap: anywhere;
  color: var(--ink-faint);
  background: var(--surface-strong);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.genealogy-edge-role {
  position: absolute;
  z-index: 2;
  max-width: 150px;
  transform: translate(-50%, -50%);
  padding: 2px 6px;
  border: 1px solid rgb(45 103 86 / 24%);
  border-radius: 999px;
  overflow-wrap: anywhere;
  color: var(--forest);
  background: rgb(251 250 246 / 94%);
  box-shadow: 0 1px 3px rgb(24 35 31 / 8%);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.genealogy-edge-role.is-archived {
  border-style: dashed;
  opacity: .72;
}

.genealogy-graph-node {
  position: absolute;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.genealogy-graph-node.is-focus {
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 2px rgb(45 103 86 / 18%), var(--shadow-sm);
}

.genealogy-graph-node.is-unknown {
  border-style: dashed;
  background: var(--paper);
}

.genealogy-graph-node > span:last-child {
  display: block;
  min-width: 0;
}

.genealogy-graph-node strong,
.genealogy-graph-node small,
.genealogy-graph-node em {
  display: block;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.genealogy-graph-node strong {
  max-height: 3.9em;
  font-size: 11px;
  line-height: 1.3;
}

.genealogy-graph-node small {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.genealogy-graph-node em {
  width: fit-content;
  margin-top: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.genealogy-node-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--forest-bright);
  font-family: Georgia, "Times New Roman", serif;
}

.genealogy-graph-node.is-unknown .genealogy-node-symbol {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.genealogy-junction {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.genealogy-junction i {
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-strong);
  border-radius: 50%;
  background: var(--forest-bright);
  box-shadow: 0 0 0 1px var(--forest-bright);
}

.genealogy-junction b {
  max-width: 180px;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 8px;
  text-align: center;
}

.genealogy-junction.is-archived b {
  border-style: dashed;
}

.genealogy-boundary-notice {
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgb(185 137 63 / 32%);
  border-radius: 12px;
  background: var(--gold-pale);
  font-size: 10px;
  line-height: 1.45;
}

.genealogy-semantic-list {
  display: grid;
  gap: 10px;
}

.genealogy-direct-facts {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.genealogy-direct-facts__heading,
.genealogy-fact-pagination {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.genealogy-direct-facts__heading h4,
.genealogy-direct-facts__heading p,
.genealogy-fact-pagination__summary {
  margin: 0;
}

.genealogy-direct-facts__heading p,
.genealogy-fact-pagination,
.genealogy-fact-pagination__summary {
  color: var(--ink-faint);
  font-size: 10px;
}

.genealogy-direct-facts__heading p {
  margin-top: 3px;
}

.genealogy-direct-fact-list {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.genealogy-fact-pagination {
  padding-top: 2px;
}

.genealogy-semantic-list__heading h4,
.genealogy-semantic-list__heading p {
  margin: 0;
}

.genealogy-semantic-list__heading p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.genealogy-fact-row {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.genealogy-fact-row h5 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.genealogy-fact-row ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.genealogy-fact-row li {
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  font-size: 10px;
  line-height: 1.45;
}

.genealogy-fact-row li > a,
.genealogy-fact-row li > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.genealogy-fact-row li > a {
  text-decoration-color: rgb(45 103 86 / 32%);
  text-underline-offset: 2px;
}

.genealogy-fact-row li span span {
  display: block;
  color: var(--ink-faint);
}

.genealogy-side-label {
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--forest-pale);
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.genealogy-fact-event {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
}

.genealogy-panel-state {
  display: grid;
  min-height: 160px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

@media (max-width: 720px) {
  .genealogy-settings-intro,
  .genealogy-rule-card,
  .genealogy-boundary-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .genealogy-rule-card > .button-row,
  .genealogy-boundary-notice .button {
    width: 100%;
  }

  .genealogy-rule-card > .button-row .button,
  .genealogy-boundary-notice .button {
    justify-content: center;
  }

  .genealogy-count-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genealogy-unknown-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .entry-genealogy .panel__header,
  .genealogy-direct-facts__heading,
  .genealogy-fact-pagination,
  .genealogy-role-card > header,
  .genealogy-fact-row > header {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-genealogy .panel__header > .button-row,
  .genealogy-fact-pagination > .button-row,
  .genealogy-role-card > header > .button,
  .genealogy-fact-row > header > .button-row {
    width: 100%;
  }

  .genealogy-fact-pagination > .button-row {
    justify-content: space-between;
  }

  .genealogy-guide-progress {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    padding-inline: 14px;
  }

  .genealogy-recipe-grid,
  .genealogy-rule-guide .form-grid,
  .genealogy-fact-editor .form-grid,
  .genealogy-count-advanced .form-grid {
    grid-template-columns: 1fr;
  }

  .genealogy-rule-guide input,
  .genealogy-rule-guide select,
  .genealogy-rule-guide textarea,
  .genealogy-fact-editor input,
  .genealogy-fact-editor select,
  .genealogy-fact-editor textarea,
  .genealogy-modal .button {
    max-width: 100%;
  }

  .genealogy-graph-stack {
    display: flex;
  }

  .genealogy-semantic-list {
    order: -1;
  }

  .genealogy-graph-viewport {
    max-height: min(62vh, 560px);
    overflow-y: auto;
  }

  .genealogy-fact-row li {
    grid-template-columns: 1fr;
  }

  .genealogy-side-label {
    width: fit-content;
  }
}

@media (max-width: 400px) {
  .genealogy-modal .modal-body,
  .entry-genealogy .panel__body {
    padding: 12px;
  }

  .genealogy-guide-progress {
    grid-template-columns: repeat(5, minmax(92px, 1fr));
  }

  .genealogy-count-choices {
    grid-template-columns: 1fr;
  }

  .genealogy-role-card,
  .genealogy-fact-role,
  .genealogy-participant-slot,
  .genealogy-fact-row {
    padding: 11px;
  }

  .genealogy-modal .modal-actions .button,
  .genealogy-settings-intro .button,
  .genealogy-fact-role > .button-row .button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .genealogy-graph-viewport {
    scroll-behavior: auto;
  }
}
