:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9f7e9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #eceef2;
  --text: #111318;
  --text-soft: #3f4654;
  --muted: #6b7280;
  --border: #dfe3ea;
  --border-strong: #c8ced8;
  --accent: #111318;
  --accent-text: #ffffff;
  --accent-soft: #eef0f3;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-line: #efc2bd;
  --danger-line-hover: #df948c;
  --danger-soft: #fee4e2;
  --success: #087443;
  --warning: #a15c07;
  --preview-bg: #151821;
  --preview-text: #f7f7f8;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 10px 28px rgba(16, 24, 40, 0.08);
  --focus-ring: 0 0 0 3px rgba(17, 19, 24, 0.14);
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1013;
  --surface: #16171b;
  --surface-2: #1d1f24;
  --surface-3: #252830;
  --text: #f5f6f8;
  --text-soft: #d2d6de;
  --muted: #9aa3b2;
  --border: #2c3038;
  --border-strong: #3a404c;
  --accent: #f5f6f8;
  --accent-text: #0f1013;
  --accent-soft: #252830;
  --danger: #ff7b72;
  --danger-hover: #ff9b93;
  --danger-line: rgba(255, 123, 114, 0.36);
  --danger-line-hover: rgba(255, 123, 114, 0.56);
  --danger-soft: rgba(255, 123, 114, 0.12);
  --success: #56d364;
  --warning: #e3b341;
  --preview-bg: #0f1218;
  --preview-text: #f5f6f8;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 14px 34px rgba(0, 0, 0, 0.28);
  --focus-ring: 0 0 0 3px rgba(245, 246, 248, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-weight: 400;
  text-decoration: none;
  transform: translateY(-170%);
  transition: transform 140ms ease;
}

.icon-defs {
  display: none;
}

.ui-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.skip-link:focus {
  transform: translateY(0);
}

.login-shell {
  --login-bg: #ffffff;
  --login-copy-bg: #cdfee0;
  --login-copy-ink: #05070a;
  --login-form-ink: #05070a;
  --login-muted: #7d8793;
  --login-control-bg: #ffffff;
  --login-control-border: #cfd5dd;
  --login-control-border-hover: #bfc7d1;
  --login-control-border-focus: #9aa5b1;
  --login-control-focus: 0 0 0 3px rgba(17, 19, 24, 0.08);
  --login-toggle-color: #65717d;
  --login-toggle-hover-color: #111318;
  --login-toggle-hover-bg: #edf1f5;
  --login-toggle-hover-border: #d8dde4;
  --login-check-bg: #18231d;
  --login-check-color: #ffffff;
  --login-submit-bg: #191b18;
  --login-submit-text: #ffffff;
  --login-submit-fill: #7bcf91;
  --login-submit-fill-text: #07130c;
  --login-link-hover: #087443;
  position: relative;
  min-height: 100vh;
  display: grid;
  padding: 0;
  background: var(--login-bg);
}

:root[data-theme="dark"] .login-shell {
  --login-bg: #0f1218;
  --login-copy-bg: #102419;
  --login-copy-ink: #f4fff7;
  --login-form-ink: #f5f7f8;
  --login-muted: #a8b2bf;
  --login-control-bg: #151922;
  --login-control-border: #313948;
  --login-control-border-hover: #465166;
  --login-control-border-focus: #9bd7a8;
  --login-control-focus: 0 0 0 3px rgba(210, 247, 210, 0.16);
  --login-toggle-color: #b3bdc9;
  --login-toggle-hover-color: #f5f7f8;
  --login-toggle-hover-bg: #1e2530;
  --login-toggle-hover-border: #3a4455;
  --login-check-bg: #d2f7d2;
  --login-check-color: #07130c;
  --login-submit-bg: #d2f7d2;
  --login-submit-text: #07130c;
  --login-submit-fill: #8ddfa4;
  --login-submit-fill-text: #06100a;
  --login-link-hover: #9ee3ae;
  background: var(--login-bg);
}

.login-shell .login-theme-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  color: var(--login-toggle-color);
  background: transparent;
  border-color: transparent;
  border-radius: 999px;
}

.login-shell .login-theme-toggle:hover {
  color: var(--login-toggle-hover-color);
  background: var(--login-toggle-hover-bg);
  border-color: var(--login-toggle-hover-border);
}

.login-panel {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.login-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(58px, 9vh, 92px);
  min-height: 100vh;
  padding: clamp(44px, 7vw, 110px);
  background: var(--login-copy-bg);
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.login-back {
  width: max-content;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  font-size: 0.86rem;
  text-decoration: none;
}

.login-back:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.login-legal-link {
  align-self: center;
  color: var(--muted);
  font-size: 0.74rem;
  opacity: 0.66;
}

.login-legal-link:hover {
  opacity: 0.9;
}

.brand-row,
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
}

.login-copy .brand-row {
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
  width: min(560px, 100%);
}

.login-copy .brand-mark {
  width: clamp(112px, 11vw, 154px);
  height: clamp(112px, 11vw, 154px);
  margin-top: 0;
  border-radius: 0;
}

.login-brand-text {
  min-width: 0;
}

.login-brand-text h1,
.app-brand strong,
.view-header h2 {
  font-family: var(--font-display);
}

.login-brand-text .kicker {
  margin: 0;
  color: var(--login-copy-ink);
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 1.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1.08;
  text-transform: none;
}

.login-brand-text h1 {
  margin-top: 8px;
  color: var(--login-copy-ink);
  font-size: clamp(2.55rem, 4.7vw, 4.45rem);
  line-height: 0.98;
  text-transform: none;
  white-space: nowrap;
}

.app-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
}

.kicker,
.app-overline {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.65rem, 2.3vw, 2.35rem);
  line-height: 1.06;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.login-form,
.editor-form {
  display: grid;
  gap: 16px;
}

.login-form {
  width: min(560px, calc(100% - 96px));
  align-self: center;
  justify-self: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-lead {
  max-width: 520px;
  margin: 0;
  color: var(--text-soft);
  font-size: 1.06rem;
  line-height: 1.6;
}

.login-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-context span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.login-promises {
  display: grid;
  gap: 10px;
  width: min(650px, 100%);
  margin: clamp(-30px, -3.2vh, -18px) 0 0;
  padding: 0;
  color: var(--login-copy-ink);
  font-size: clamp(0.9rem, 1.05vw, 1.04rem);
  font-weight: 700;
  line-height: 1.22;
  list-style: none;
}

.login-promises li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.promise-check {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: inline-grid;
  place-items: center;
  color: var(--login-check-color);
  background: var(--login-check-bg);
  border-radius: 999px;
}

.promise-check::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: translateY(-1px) rotate(45deg);
}

.login-gospel-quote {
  width: min(650px, 100%);
  margin: clamp(-36px, -4vh, -18px) 0 0;
  color: var(--login-copy-ink);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.35vw, 1.24rem);
  line-height: 1.24;
  opacity: 0.82;
}

.login-form-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-bottom: clamp(52px, 8vh, 82px);
}

.login-lock {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.login-form-header h2 {
  color: var(--login-form-ink);
  font-family: var(--font-body);
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
}

.login-submit {
  position: relative;
  width: 100%;
  min-height: 42px;
  justify-content: center;
  margin-top: 2px;
  color: var(--login-submit-text);
  background: var(--login-submit-bg);
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  transition: color 180ms ease;
}

.login-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--login-submit-fill);
  transform: translateX(-102%);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.login-submit > * {
  position: relative;
  z-index: 1;
}

.login-submit:hover::before,
.login-submit:focus-visible::before {
  transform: translateX(0);
}

.login-submit:hover,
.login-submit:focus-visible {
  color: var(--login-submit-fill-text);
  transform: none;
}

.login-input-field {
  position: relative;
  display: block;
  color: var(--login-muted);
  font-size: 0.86rem;
  font-weight: 400;
}

.login-input-field > span:first-child {
  position: absolute;
  top: -9px;
  left: 16px;
  z-index: 2;
  padding: 0 7px;
  background: var(--login-bg);
  line-height: 1;
}

.login-input-field input {
  width: 100%;
  min-height: 50px;
  color: var(--login-form-ink);
  background: var(--login-control-bg);
  border: 1px solid var(--login-control-border);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 1rem;
  box-shadow: none;
}

.login-input-field input:hover {
  border-color: var(--login-control-border-hover);
}

.login-input-field input:focus {
  border-color: var(--login-control-border-focus);
  box-shadow: var(--login-control-focus);
}

.login-password-control {
  position: relative;
  display: block;
}

.login-password-control input {
  padding-right: 52px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--login-toggle-color);
  background: transparent;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  color: var(--login-toggle-hover-color);
  background: var(--login-toggle-hover-bg);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 10px;
  color: var(--login-form-ink);
  font-size: 0.94rem;
}

.login-remember {
  width: auto;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
  color: var(--login-form-ink);
  font-size: inherit;
}

.login-remember input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--login-submit-bg);
}

.login-forgot {
  flex: 0 0 auto;
  color: var(--login-form-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-forgot:hover {
  color: var(--login-link-hover);
}

.demo-access {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.demo-access summary {
  width: max-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
}

.demo-access summary:hover {
  color: var(--text);
}

.demo-access summary::marker {
  content: "";
}

.demo-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 400;
}

.field-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.field-help {
  position: relative;
  --tooltip-bg: #2f343d;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  cursor: help;
}

.field-help:hover,
.field-help:focus-visible {
  color: var(--text);
  border-color: var(--text-soft);
  outline: none;
}

.field-help::after {
  content: attr(data-help);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: max-content;
  max-width: min(270px, 72vw);
  padding: 8px 10px;
  color: var(--surface);
  background: var(--tooltip-bg);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  white-space: normal;
}

.field-help::before {
  content: "";
  position: absolute;
  left: 3px;
  top: calc(100% + 1px);
  z-index: 61;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid var(--tooltip-bg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.field-help:hover::after,
.field-help:hover::before,
.field-help:focus-visible::after,
.field-help:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.color-field {
  position: relative;
  display: grid;
  gap: 7px;
  z-index: 4;
}

.field-label {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.color-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

.color-trigger:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.color-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--surface);
}

.color-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.color-value {
  color: var(--text);
  font-size: 0.88rem;
}

.color-hint {
  color: var(--muted);
  font-size: 0.74rem;
}

.native-color-input {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  min-height: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.color-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.color-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.color-close {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
}

.color-close:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.color-swatch-option {
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 3px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.color-swatch-option:hover {
  border-color: var(--border-strong);
}

.color-swatch-option.active {
  border-color: var(--text);
}

.color-swatch-option span {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(17, 19, 24, 0.12);
  border-radius: 6px;
}

.color-free-picker {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.color-plane {
  --picker-hue: 112;
  position: relative;
  height: 146px;
  overflow: hidden;
  background:
    linear-gradient(to top, #050505 0%, rgba(5, 5, 5, 0) 100%),
    linear-gradient(to right, #ffffff 0%, hsl(var(--picker-hue) 100% 50%) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(17, 19, 24, 0.04);
  cursor: crosshair;
  touch-action: none;
}

.color-plane:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.color-plane-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: transparent;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(17, 19, 24, 0.58), 0 2px 8px rgba(17, 19, 24, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hue-field {
  gap: 7px;
}

.hue-slider {
  width: 100%;
  min-height: 0;
  height: 22px;
  appearance: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.hue-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hue-slider::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(to right, #ff453a, #ffd60a, #30d158, #64d2ff, #0a84ff, #bf5af2, #ff453a);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hue-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -5px;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: 999px;
  box-shadow: 0 1px 5px rgba(17, 19, 24, 0.24);
  -webkit-appearance: none;
}

.hue-slider::-moz-range-track {
  height: 10px;
  background: linear-gradient(to right, #ff453a, #ffd60a, #30d158, #64d2ff, #0a84ff, #bf5af2, #ff453a);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: 999px;
  box-shadow: 0 1px 5px rgba(17, 19, 24, 0.24);
}

.color-hex-field {
  gap: 6px;
}

.color-hex-field input {
  min-height: 38px;
  text-transform: uppercase;
}

.color-hex-field input.invalid {
  border-color: var(--danger);
}

.color-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.color-preview {
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input.invalid {
  border-color: var(--danger);
}

.toggle-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 400;
}

.field-hint,
.form-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.form-note {
  min-height: 20px;
  margin: 0;
}

.form-note[data-status="success"] {
  color: var(--accent-strong);
}

.form-note[data-status="error"] {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  color: var(--text);
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.app-brand {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.app-brand strong,
.session-box span {
  display: block;
}

.app-brand strong {
  overflow: hidden;
  font-size: 1.06rem;
  font-weight: 400;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand span:not(.app-overline) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.app-brand #parishBadge {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 400;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  font-weight: 400;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.nav-item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--border-strong);
  border-radius: 999px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-item.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.nav-item.active::before {
  background: var(--accent);
}

.session-box {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

.session-box span {
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 400;
}

.session-legal-link {
  display: inline-flex;
  width: max-content;
  margin: 0 0 4px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0.68;
  text-decoration: none;
}

.session-legal-link:hover {
  color: var(--text-soft);
  border-color: var(--border-strong);
  opacity: 0.92;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.workspace:focus {
  outline: none;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.header-actions,
.form-actions,
.section-toolbar,
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions,
.form-actions,
.section-actions {
  flex-wrap: wrap;
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action,
.mini-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 400;
  line-height: 1.1;
  text-decoration: none;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.primary-action {
  color: var(--accent-text);
  background: var(--accent);
}

.primary-action:hover {
  transform: translateY(-1px);
}

.secondary-action,
.mini-action {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.secondary-action:hover,
.mini-action:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.mini-action {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.ghost-action {
  width: 100%;
  margin-top: 8px;
  color: var(--text-soft);
  background: var(--surface-2);
  border-color: var(--border);
  text-align: center;
}

.ghost-action:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.danger-action {
  color: var(--danger);
  background: transparent;
  border-color: var(--danger-line);
}

.danger-action:hover {
  color: var(--danger-hover);
  background: transparent;
  border-color: var(--danger-line-hover);
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.list-pane,
.editor-pane,
.public-preview,
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.list-pane,
.editor-pane {
  padding: 14px;
}

.parish-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: -4px 0 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.parish-toolbar[hidden] {
  display: none;
}

.parish-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.parish-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.list-pane {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.record-list {
  display: grid;
  gap: 7px;
}

.sheet-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  overflow: hidden;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    background 140ms ease,
    border-color 140ms ease;
}

.sheet-record:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.sheet-record.active {
  background: var(--accent-soft);
  border-color: var(--border-strong);
}

.sheet-record .record-button {
  min-height: 58px;
  border: 0;
  border-radius: 0;
}

.sheet-record .record-button:hover,
.sheet-record .record-button.active {
  background: transparent;
  border-color: transparent;
}

.record-delete-action {
  min-height: 58px;
  display: inline-grid;
  place-items: center;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  transition:
    color 140ms ease,
    background 140ms ease;
}

.record-delete-action:hover {
  color: var(--danger-hover);
  background: var(--danger-soft);
}

.record-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 2px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  transition:
    background 140ms ease,
    border-color 140ms ease;
}

.record-button:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.record-button.active {
  background: var(--accent-soft);
  border-color: var(--border-strong);
}

.record-button strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.25;
}

.record-button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

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

.section-toolbar {
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sections-editor {
  display: grid;
  gap: 12px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.section-card-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.section-accordion-toggle {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.section-accordion-toggle:focus-visible {
  border-radius: 8px;
  box-shadow: var(--focus-ring);
  outline: none;
}

.section-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.section-card:not(.is-collapsed) .section-chevron {
  transform: rotate(45deg);
}

.section-title-stack {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.section-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-title-text {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
}

.section-title-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.section-complete-badge {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: none;
  background: #1fbf75;
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(31, 191, 117, 0.35);
}

.section-complete-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 5px;
  height: 8px;
  border-right: 1.8px solid #ffffff;
  border-bottom: 1.8px solid #ffffff;
  transform: translate(-50%, -50%) rotate(45deg);
}

.section-card.is-complete .section-complete-badge {
  display: inline-block;
}

.section-card.complete-pulse .section-complete-badge,
.section-card.is-complete .section-complete-badge {
  animation: section-complete-pop 360ms ease-out;
}

@keyframes section-complete-pop {
  0% {
    transform: scale(0.72);
    box-shadow: 0 0 0 0 rgba(31, 191, 117, 0.38);
  }

  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(31, 191, 117, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(31, 191, 117, 0);
  }
}

.song-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.song-picker {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.song-picker-results {
  max-height: 260px;
  overflow: auto;
  display: none;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.song-picker.is-open .song-picker-results {
  display: grid;
}

.song-picker-result {
  width: 100%;
  display: grid;
  gap: 2px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
}

.song-picker-result strong {
  font-weight: 400;
}

.song-picker-result:hover,
.song-picker-result.active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.song-picker-result span,
.empty-result {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.empty-result {
  margin: 0;
  padding: 8px;
}

.song-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 0.8rem;
}

.song-options input {
  width: auto;
}

.aelf-refresh-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.aelf-refresh-status {
  flex: 1 1 220px;
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.aelf-refresh-status[data-status="success"] {
  color: var(--success);
}

.aelf-refresh-status[data-status="error"] {
  color: var(--danger);
}

.search-field {
  margin-bottom: 10px;
}

.result-count {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.sheet-form-actions {
  justify-content: flex-end;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-weight: 400;
}

.publish-status {
  min-height: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
}

.publish-status[data-status="success"] {
  color: var(--success);
}

.publish-status[data-status="error"] {
  color: var(--danger);
}

.public-preview {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px;
  color: var(--preview-text);
  background: var(--preview-bg);
  box-shadow: var(--shadow-sm);
}

.preview-header {
  margin-bottom: 22px;
  text-align: center;
}

.preview-header h1 {
  color: var(--preview-text);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.preview-header p {
  margin: 8px 0 0;
  color: rgba(245, 246, 248, 0.72);
}

.preview-accordion {
  border: 1px solid rgba(245, 246, 248, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.preview-section {
  border-bottom: 1px solid rgba(245, 246, 248, 0.2);
}

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

.preview-section summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 400;
}

.preview-section summary span {
  color: var(--preview-highlight, #baffbb);
  font-style: italic;
  font-weight: 400;
}

.preview-content {
  padding: 0 16px 16px;
  background: rgba(255, 255, 255, 0.04);
}

.preview-content p {
  margin: 0 0 14px;
  line-height: 1.58;
  white-space: pre-line;
}

.preview-refrain {
  color: var(--preview-highlight, #baffbb);
  border-left: 3px solid var(--preview-highlight, #baffbb);
  padding-left: 10px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .two-pane {
    grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .nav-item::before {
    display: none;
  }

  .session-box {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
  }

  .session-box span,
  .session-legal-link,
  .ghost-action {
    margin: 0;
  }

  .two-pane {
    grid-template-columns: 1fr;
  }

  .parish-toolbar {
    grid-template-columns: 1fr;
  }

  .parish-toolbar-actions {
    justify-content: stretch;
  }

  .list-pane {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .login-shell .login-theme-toggle {
    top: 16px;
    right: 16px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .login-copy {
    align-items: flex-start;
    min-height: auto;
    gap: 34px;
    padding: 78px 22px 38px;
  }

  .login-copy .brand-row {
    gap: 14px;
  }

  .login-copy .brand-mark {
    width: 78px;
    height: 78px;
  }

  .login-brand-text .kicker {
    font-size: clamp(1.08rem, 5vw, 1.5rem);
  }

  .login-brand-text h1 {
    font-size: clamp(2.1rem, 12vw, 3.35rem);
  }

  .login-promises {
    gap: 9px;
    margin-top: -14px;
    font-size: 0.88rem;
  }

  .login-gospel-quote {
    margin-top: -16px;
    font-size: clamp(0.98rem, 4.2vw, 1.14rem);
  }

  .workspace {
    padding: 16px;
  }

  .login-shell {
    padding: 0;
  }

  .login-form {
    width: min(520px, calc(100% - 32px));
    padding: 42px 0 32px;
  }

  .login-form-header {
    padding-bottom: 30px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .view-header,
  .section-card-header,
  .header-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .form-actions,
  .section-actions {
    width: 100%;
  }

  .primary-action,
  .secondary-action,
  .danger-action,
  .mini-action {
    width: 100%;
  }

  .main-nav,
  .form-grid,
  .session-box {
    grid-template-columns: 1fr;
  }

  .nav-item {
    justify-content: flex-start;
    text-align: left;
  }

  .nav-item::before {
    display: block;
  }

  .public-preview {
    padding: 20px;
  }
}
