:root {
  --web-bg: #f2f2ee;
  --web-surface: #ffffff;
  --web-surface-2: #f7f5f0;
  --web-ink: #221d18;
  --web-ink-2: #6a6157;
  --web-ink-3: #9c9385;
  --web-line: #e6ddcd;
  --web-clay: #bc4b2c;
  --web-clay-deep: #93351c;
  --web-clay-tint: #faede5;
  --web-sage: #5e7a52;
  --web-sage-soft: #e3ebdb;
  --web-amber: #bc8417;
  --web-amber-soft: #f5e7c7;
  --web-plum: #5b3a57;
  --web-display: "Bricolage Grotesque", system-ui, sans-serif;
  --web-ui: "Hanken Grotesk", system-ui, sans-serif;
  --web-mono: "JetBrains Mono", ui-monospace, monospace;
}

.web-liturgy-model-list { align-items: stretch; }
.web-liturgy-model-list .web-btn { min-width: max-content; }
.web-template-picker { width: auto; min-width: 190px; }
.web-save-template-row { gap: 14px; align-items: end; }
.web-save-template-row .web-btn { margin-bottom: 1px; }

@media (max-width: 760px) {
  .web-liturgy-model-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .web-template-picker { width: 100%; }
  .web-save-template-row { align-items: stretch; flex-direction: column; }
  .web-save-template-row .web-btn { width: 100%; }
}

body:has(.web-app) {
  background: var(--web-bg);
}

.web-app {
  min-height: 100vh;
  background: var(--web-bg);
  color: var(--web-ink);
  font-family: var(--web-ui);
}

.web-app button,
.web-app input,
.web-app select,
.web-app textarea,
.web-picker button,
.web-picker input,
.web-picker select {
  font-family: var(--web-ui);
  letter-spacing: 0;
}

.web-app button,
.web-picker button {
  appearance: none;
  -webkit-appearance: none;
}

.web-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.web-auth-card {
  width: min(440px, 100%);
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(70,45,20,.12);
  padding: 24px;
}

.web-brand {
  font-family: var(--web-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.web-brand span { color: var(--web-clay); }
.web-brand-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.web-demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--web-sage-soft);
  color: var(--web-sage);
  font: 800 10px/1 var(--web-body);
  text-transform: uppercase;
}

.web-title {
  font-family: var(--web-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0;
}

.web-muted {
  color: var(--web-ink-2);
  font-weight: 650;
  line-height: 1.5;
}

.web-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.web-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--web-line);
  background: rgba(255,252,246,.74);
  backdrop-filter: blur(12px);
}

.web-main {
  min-width: 0;
  padding: 24px;
}

.web-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.web-demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--web-sage) 42%, var(--web-line));
  border-left: 4px solid var(--web-sage);
  border-radius: 8px;
  background: color-mix(in srgb, var(--web-sage-soft) 72%, white);
}
.web-demo-banner > div:first-child { display: grid; gap: 2px; }
.web-demo-banner strong { color: var(--web-ink); }
.web-demo-banner span { color: var(--web-ink-2); font-size: 13px; font-weight: 700; }

.web-nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.web-nav button,
.web-bottom button {
  border: 0;
  background: transparent;
  color: var(--web-ink-2);
  font: inherit;
  font-weight: 800;
}

.web-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 13px;
  text-align: left;
}

.web-nav button.active {
  background: var(--web-ink);
  color: var(--web-bg);
}

.web-bottom {
  display: none;
}

.web-grid {
  display: grid;
  gap: 14px;
}

.web-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.web-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.web-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.web-dashboard { grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); align-items: start; }

.web-card {
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(50,35,20,.04);
  padding: 16px;
}

.web-card.dark {
  background: #302924;
  color: var(--web-bg);
}

.web-card.clickable {
  cursor: pointer;
  text-align: left;
  width: 100%;
  border: 1px solid var(--web-line);
  font: inherit;
}

.web-tool-panel {
  background: linear-gradient(180deg, #fffaf4, #fff);
}

.web-search-results {
  margin-top: 10px;
}

.web-result-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.web-small-title {
  display: block;
  color: var(--web-ink-3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.web-mini-media {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  font-weight: 850;
}

.web-mini-media img {
  width: 64px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.web-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.web-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.web-stack {
  display: grid;
  gap: 12px;
}

.web-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.web-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  background: var(--web-clay);
  color: white;
  font: inherit;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}
.web-btn.secondary { background: var(--web-surface-2); color: var(--web-ink); border: 1px solid var(--web-line); }
.web-btn.dark { background: var(--web-ink); color: var(--web-bg); }
.web-btn.ghost { background: transparent; color: var(--web-clay-deep); padding-inline: 8px; }
.web-btn.danger { background: #9c2f23; color: white; }
.web-btn:disabled { opacity: .5; cursor: default; }

.web-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--web-line);
  border-radius: 9px;
  background: var(--web-surface);
  color: var(--web-ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.web-icon-btn:hover:not(:disabled) { border-color: var(--web-clay); color: var(--web-clay-deep); }
.web-icon-btn.danger { color: #9c2f23; }
.web-icon-btn:disabled { opacity: .3; cursor: default; }

.web-input,
.web-textarea,
.web-select {
  width: 100%;
  border: 1.5px solid var(--web-line);
  border-radius: 13px;
  background: var(--web-surface);
  color: var(--web-ink);
  font: inherit;
  font-weight: 700;
  padding: 12px 13px;
  outline: none;
}
.web-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236a6157' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px;
  cursor: pointer;
}
.web-input[type="date"],
.web-input[type="time"] {
  color-scheme: light;
}
.web-input[type="date"]::-webkit-calendar-picker-indicator,
.web-input[type="time"]::-webkit-calendar-picker-indicator {
  border-radius: 8px;
  padding: 5px;
  background-color: var(--web-surface-2);
  cursor: pointer;
  opacity: .78;
}
.web-textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.web-label { display: grid; gap: 7px; font-size: 13px; font-weight: 900; color: var(--web-ink-2); }

.web-form-section {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--web-line);
  border-left: 3px solid var(--web-sage);
  border-radius: 8px;
  background: var(--web-sage-soft);
}

.web-rule-rehearsal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 7px;
  background: var(--web-sage-soft);
  color: var(--web-sage);
  font-size: 12px;
}
.web-rule-rehearsal span { color: var(--web-ink-2); font-weight: 800; }
.web-rule-rehearsal small { grid-column: 2; color: var(--web-ink-3); font-weight: 700; }

.web-input::placeholder,
.web-textarea::placeholder {
  color: var(--web-ink-3);
  -webkit-text-fill-color: var(--web-ink-3);
  font-family: var(--web-ui);
  font-style: italic;
  font-weight: 500;
  opacity: .78;
}

.web-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.web-search-compose {
  align-items: end;
}
.web-search-compose > .web-btn {
  min-height: 44px;
  align-self: end;
}

.web-file-field {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 12px 5px 5px;
  border: 1.5px solid var(--web-line);
  border-radius: 13px;
  background: var(--web-surface);
  overflow: hidden;
  cursor: pointer;
}
.web-file-field:focus-within {
  border-color: var(--web-clay);
  box-shadow: 0 0 0 3px var(--web-clay-tint);
}
.web-file-field input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.web-file-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--web-clay-tint);
  color: var(--web-clay-deep);
  font-weight: 900;
  white-space: nowrap;
}
.web-file-name {
  min-width: 0;
  color: var(--web-ink-3);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-audio-player {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--web-line);
  border-radius: 12px;
  background: var(--web-surface-2);
}
.web-audio-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--web-clay);
  color: white;
  cursor: pointer;
}
.web-audio-toggle:hover { background: var(--web-clay-deep); }
.web-audio-track { min-width: 0; }
.web-audio-range {
  --audio-progress: 0%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.web-audio-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--web-clay) var(--audio-progress), var(--web-line) var(--audio-progress));
}
.web-audio-range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: var(--web-line);
}
.web-audio-range::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--web-clay);
}
.web-audio-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--web-clay);
  box-shadow: 0 1px 5px rgba(50,35,20,.25);
}
.web-audio-range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--web-clay);
  box-shadow: 0 1px 5px rgba(50,35,20,.25);
}
.web-audio-time {
  display: flex;
  justify-content: space-between;
  color: var(--web-ink-3);
  font: 700 11px/1 var(--web-mono);
}

.hidden {
  display: none !important;
}

.web-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--web-surface-2);
  color: var(--web-ink-2);
  border: 1px solid var(--web-line);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.web-chip.sage { background: var(--web-sage-soft); color: var(--web-sage); border: 0; }
.web-chip.amber { background: var(--web-amber-soft); color: #7a5407; border: 0; }
.web-chip.clay { background: var(--web-clay-tint); color: var(--web-clay-deep); border: 0; }
.web-chip.dark { background: var(--web-ink); color: var(--web-bg); border: 0; }

.web-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--web-clay-tint);
  color: var(--web-clay-deep);
  font-weight: 900;
  flex: none;
}

.web-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--web-ink);
  color: var(--web-bg);
  object-fit: cover;
  display: grid;
  place-items: center;
  font-family: var(--web-display);
  font-weight: 800;
  flex: none;
}

.web-table {
  width: 100%;
  border-collapse: collapse;
}
.web-table th,
.web-table td {
  text-align: left;
  border-bottom: 1px solid var(--web-line);
  padding: 11px 8px;
  vertical-align: middle;
}
.web-table th {
  color: var(--web-ink-3);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.web-tabs {
  display: flex;
  gap: 4px;
  background: var(--web-surface-2);
  padding: 4px;
  border: 1px solid var(--web-line);
  border-radius: 14px;
  overflow-x: auto;
}
.web-tabs button {
  border: 0;
  background: transparent;
  color: var(--web-ink-3);
  border-radius: 11px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}
.web-tabs button.active {
  background: var(--web-surface);
  color: var(--web-ink);
}

.web-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--web-line);
  border-radius: 10px;
  background: var(--web-surface-2);
}
.web-segment button {
  appearance: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--web-ink-2);
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.web-segment button:hover:not(:disabled) {
  color: var(--web-ink);
}
.web-segment button.active {
  background: var(--web-surface);
  color: var(--web-clay-deep);
  box-shadow: 0 1px 3px rgba(50,35,20,.1);
}
.web-segment button:focus-visible {
  outline: 2px solid var(--web-clay);
  outline-offset: 1px;
}
.web-segment button:disabled {
  opacity: .5;
  cursor: default;
}

.web-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,15,10,.45);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 1000;
}
.web-modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  background: var(--web-bg);
  border-radius: 22px;
  border: 1px solid var(--web-line);
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  padding: 18px;
}
.web-modal.wide { width: min(1080px, 100%); }
.web-modal-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--web-line);
}
.web-modal-actions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--web-line);
}

.web-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1600;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--web-ink);
  color: white;
  box-shadow: 0 14px 45px rgba(28, 22, 18, .26);
  font-weight: 800;
}
.web-toast.success { border-left: 4px solid #8eb47e; }
.web-toast.error { border-left: 4px solid #e08b6b; }

.web-info-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--web-sage);
  background: var(--web-sage-soft);
  color: #385232;
  border-radius: 8px;
  font-weight: 750;
  line-height: 1.45;
}
.web-info-banner.danger { border-left-color: #9c2f23; background: #f8e4df; color: #74251c; }

.web-support-link {
  width: 100%;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-sage-soft);
  color: var(--web-sage);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.web-support-link:hover { border-color: var(--web-sage); }

.web-support-card {
  display: grid;
  gap: 11px;
  border-left: 4px solid var(--web-sage);
}
.web-support-card .web-chip { justify-self: start; }
.web-support-icon,
.web-donation-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--web-sage-soft);
  color: var(--web-sage);
}

.web-donation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: 26px;
  align-items: start;
}
.web-public-donations {
  min-height: 100vh;
  padding: 28px;
  background: var(--web-bg);
}
.web-public-donations > .web-modal {
  position: static;
  width: min(1080px, 100%);
  max-height: none;
  margin: 0 auto;
  box-shadow: var(--web-shadow);
}
.web-donation-story { padding-right: 6px; }
.web-donation-story h3 {
  margin: 0 0 12px;
  font-size: 25px;
}
.web-donation-story p,
.web-purpose-item p {
  color: var(--web-ink-2);
  line-height: 1.58;
  margin: 0 0 14px;
}
.web-donation-purpose {
  border-top: 3px solid var(--web-clay);
  padding-top: 14px;
}
.web-purpose-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 0 0;
  border-top: 1px solid var(--web-line);
}
.web-purpose-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--web-clay-tint);
  color: var(--web-clay-deep);
  font-family: var(--web-mono);
  font-weight: 900;
}
.web-purpose-item p { margin-top: 5px; }
.web-pix-box {
  padding: 18px;
  border-radius: 8px;
  background: var(--web-ink);
  color: var(--web-bg);
}
.web-pix-box .web-chip { justify-self: start; }
.web-pix-intro {
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.5;
}
.web-pix-label {
  margin-bottom: -6px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.web-pix-key {
  overflow-wrap: anywhere;
  font-family: var(--web-mono);
  font-size: 15px;
  font-weight: 800;
}
.web-pix-thanks {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  line-height: 1.5;
}
.web-donation-transparency {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 3px solid var(--web-sage);
}
.web-transparency-heading { align-items: end; }
.web-transparency-heading .web-title {
  margin: 4px 0 0;
  font-size: 24px;
}
.web-donation-transparency > p { margin: 0; }
.web-transparency-empty {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-sage-soft);
  color: var(--web-sage);
  font-weight: 750;
}
.web-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.web-report-card {
  padding: 16px;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-surface);
}
.web-report-card p {
  margin: 0;
  color: var(--web-ink-2);
  line-height: 1.55;
}
.web-report-card .web-btn { justify-self: start; }
.web-report-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.web-report-metrics > div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 6px;
  background: var(--web-sage-soft);
}
.web-report-metrics span {
  color: var(--web-ink-3);
  font-size: 11px;
  font-weight: 700;
}

.web-leader-picker {
  display: grid;
  gap: 7px;
}
.web-leader-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.web-field-help {
  color: var(--web-ink-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.web-saved-leaders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.web-saved-leader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--web-line);
  border-radius: 999px;
  background: var(--web-sage-soft);
  color: var(--web-sage);
  font-size: 13px;
  font-weight: 800;
}
.web-saved-leader .web-icon-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
}

.web-generated-label {
  display: inline-block;
  margin-top: 4px;
  color: var(--web-sage);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.web-service-selector { max-width: 620px; }
.web-mobile-only-row { display: none; }

.web-setlist-list {
  display: grid;
  gap: 6px;
  max-height: 390px;
  overflow: auto;
}
.web-setlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--web-line);
  border-radius: 10px;
  background: var(--web-surface);
}
.web-setlist-row:has(input:checked) { border-color: rgba(188,75,44,.45); background: var(--web-clay-tint); }
.web-setlist-row label { min-width: 0; flex: 1; cursor: pointer; }
.web-setlist-artist { display: block; font-size: 12px; }

.web-subpanel {
  padding: 12px;
  border: 1px solid var(--web-line);
  border-radius: 10px;
  background: var(--web-surface-2);
}
.web-liturgy-item-head { margin-bottom: 10px; }

.web-liturgy-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--web-line);
  border-radius: 12px;
  background: var(--web-surface);
}

.web-liturgy-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.web-liturgy-summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--web-clay-tint);
  color: var(--web-clay-deep);
}

.web-liturgy-summary strong,
.web-liturgy-summary span { display: block; }
.web-liturgy-summary strong { font-size: 14px; }
.web-liturgy-summary span { margin-top: 2px; color: var(--web-ink-3); font-size: 12px; font-weight: 800; }

.web-liturgy-blocks {
  display: grid;
  gap: 20px;
}

.liturgy-editor-block {
  overflow: hidden;
  border: 1px solid #d9cbb8;
  border-left: 4px solid var(--web-clay);
  border-radius: 12px;
  background: var(--web-surface);
  box-shadow: 0 5px 18px rgba(50,35,20,.06);
}

.web-liturgy-block-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  background: #302924;
  color: #fff;
}

.web-liturgy-block-index {
  min-width: 48px;
  padding-right: 13px;
  border-right: 1px solid rgba(255,255,255,.17);
  text-align: center;
}
.web-liturgy-block-index small,
.web-liturgy-block-index strong { display: block; }
.web-liturgy-block-index small { color: rgba(255,255,255,.62); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.web-liturgy-block-index strong { margin-top: 1px; color: #f29a73; font-family: var(--web-mono); font-size: 19px; }

.web-liturgy-block-heading { min-width: 0; }
.web-liturgy-block-heading > strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.web-liturgy-block-heading > span { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: rgba(255,255,255,.68); font-size: 11px; }
.web-liturgy-block-heading b { font-weight: 750; }
.web-liturgy-block-heading i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.38); }
.web-liturgy-block-actions { display: flex; gap: 4px; }
.web-liturgy-block-header .web-icon-btn { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.web-liturgy-block-header .web-icon-btn.danger { color: #ffb7a5; }

.web-liturgy-block-body { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(360px, 1.28fr); align-items: stretch; }
.web-liturgy-block-settings { padding: 16px; background: var(--web-surface-2); border-right: 1px solid var(--web-line); }
.web-liturgy-block-fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(90px, .7fr) minmax(90px, .7fr); gap: 10px; margin-top: 10px; }
.web-liturgy-block-secondary-fields { display: grid; gap: 10px; margin-top: 10px; }

.web-liturgy-contents { min-width: 0; padding: 16px; background: #fff; }
.web-liturgy-contents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.web-liturgy-contents-head strong { display: block; margin-top: 2px; color: var(--web-ink-2); font-size: 12px; }
.liturgy-items { display: grid; gap: 10px; }

.web-liturgy-empty {
  padding: 20px 14px;
  border: 1px dashed #d9cbb8;
  border-radius: 10px;
  color: var(--web-ink-3);
  background: var(--web-surface-2);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.web-liturgy-content {
  --content-accent: var(--web-amber);
  overflow: hidden;
  border: 1px solid var(--web-line);
  border-left: 3px solid var(--content-accent);
  border-radius: 10px;
  background: #fff;
}
.web-liturgy-content[data-item-type="bible"] { --content-accent: #4a6e8a; }
.web-liturgy-content[data-item-type="prayer"] { --content-accent: var(--web-plum); }
.web-liturgy-content[data-item-type="song"] { --content-accent: var(--web-clay); }
.web-liturgy-content[data-item-type="offering"] { --content-accent: var(--web-sage); }
.web-liturgy-content[data-item-type="sermon"] { --content-accent: #7a3b2e; }

.web-liturgy-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--content-accent) 8%, white);
  border-bottom: 1px solid var(--web-line);
}
.web-liturgy-content-identity { display: flex; align-items: center; gap: 8px; }
.web-liturgy-content-identity > span { color: var(--content-accent); font-family: var(--web-mono); font-size: 11px; font-weight: 900; }
.web-liturgy-content-identity > strong { padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--content-accent) 13%, white); color: var(--content-accent); font-size: 11px; text-transform: uppercase; }
.web-liturgy-content-fields { display: grid; grid-template-columns: minmax(140px, .6fr) minmax(220px, 1.4fr); gap: 10px; padding: 12px; }
.web-liturgy-content-fields .liturgy-song-pick,
.web-liturgy-content-fields .liturgy-prayer-kind { grid-column: 1 / -1; }

.web-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(35, 24, 18, .38);
  display: grid;
  place-items: center;
  padding: 24px;
}

.web-picker {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
  background: var(--web-bg);
  border: 1px solid var(--web-line);
  box-shadow: 0 30px 80px rgba(35, 24, 18, .24);
  border-radius: 18px;
  padding: 20px;
}

.web-bible-books {
  max-height: 580px;
  overflow: hidden;
}

.web-bible-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  overflow: auto;
  max-height: 470px;
  padding-top: 12px;
}

.web-bible-preview {
  white-space: pre-wrap;
  margin: 14px 0;
  background: #fffaf4;
  border: 1px solid var(--web-line);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.55;
  color: var(--web-ink-2);
  font-family: inherit;
  max-height: 310px;
  overflow: auto;
}

.web-mobile-only { display: none; }
.web-empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--web-ink-2);
  font-weight: 700;
}
.web-error {
  background: var(--web-amber-soft);
  color: #7a5407;
  border-radius: 13px;
  padding: 10px 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .web-public-donations { padding: 0; }
  .web-public-donations > .web-modal {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .web-app {
    min-height: 100dvh;
    background: var(--web-bg);
  }
  .web-shell {
    display: block;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .web-sidebar { display: none; }
  .web-main {
    padding: 18px 16px 22px;
  }
  .web-demo-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .web-demo-banner .web-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .web-demo-banner .web-btn { width: 100%; }
  .web-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 8px 0 12px;
    margin-bottom: 10px;
    background: var(--web-bg);
    border-bottom: 1px solid rgba(230,221,205,.72);
  }
  .web-bottom {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    background: rgba(255,252,246,.92);
    border: 1px solid var(--web-line);
    border-radius: 20px;
    padding: 7px;
    box-shadow: 0 10px 40px rgba(70,45,20,.16);
    backdrop-filter: blur(14px);
    z-index: 100;
  }
  .web-bottom button {
    display: grid;
    flex: 1 1 0;
    min-width: 0;
    justify-items: center;
    gap: 2px;
    border-radius: 14px;
    padding: 8px 2px;
    font-size: 11px;
  }
  .web-bottom button small {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 10px;
    line-height: 13px;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
  }
  .web-bottom button.active {
    background: var(--web-ink);
    color: var(--web-bg);
  }
  .web-grid,
  .web-grid.cols-2,
  .web-grid.cols-3,
  .web-grid.cols-4,
  .web-dashboard {
    grid-template-columns: 1fr;
  }
  .web-donation-layout { grid-template-columns: 1fr; gap: 20px; }
  .web-donation-story { padding-right: 0; }
  .web-transparency-heading { align-items: start; }
  .web-report-grid { grid-template-columns: 1fr; }
  .web-leader-custom { grid-template-columns: 1fr; }
  .web-desktop-only { display: none !important; }
  .web-mobile-only { display: block; }
  .web-mobile-only-row { display: flex; }
  .web-table { display: block; overflow-x: auto; }
  .web-input-row {
    grid-template-columns: 1fr;
  }
  .web-picker-backdrop {
    padding: 0;
    align-items: end;
  }
  .web-picker {
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
  }
  .web-bible-books {
    max-height: none;
  }
  .web-bible-list {
    max-height: 260px;
  }
  .web-auth-card {
    border-radius: 22px;
    padding: 20px;
  }
  .web-modal-backdrop {
    padding: 0;
    place-items: stretch;
  }
  .web-modal,
  .web-modal.wide {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 0 16px 20px;
  }
  .web-modal-header {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: 0 -16px 14px;
    padding: 16px;
    background: var(--web-bg);
  }
  .web-modal form > .web-modal-actions:last-child,
  .web-modal > .web-stack > .web-modal-actions:last-child {
    position: sticky;
    bottom: -20px;
    z-index: 8;
    margin: 4px -16px -20px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--web-bg);
  }
  .web-modal-actions .web-btn { flex: 1; }
  .web-toast {
    left: 16px;
    right: 16px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .web-service-selector { max-width: none; }
  .web-setlist-list { max-height: none; }
  .web-setlist-row { align-items: flex-start; }
  .web-liturgy-editor-toolbar { align-items: stretch; flex-direction: column; }
  .web-liturgy-editor-toolbar .web-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .web-liturgy-editor-toolbar .web-actions .web-btn:first-child { grid-column: 1 / -1; }
  .web-liturgy-blocks { gap: 16px; }
  .liturgy-editor-block { border-left-width: 3px; }
  .web-liturgy-block-header { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px; }
  .web-liturgy-block-index { min-width: 42px; padding-right: 10px; }
  .web-liturgy-block-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); }
  .web-liturgy-block-body { grid-template-columns: 1fr; }
  .web-liturgy-block-settings { border-right: 0; border-bottom: 1px solid var(--web-line); }
  .web-liturgy-block-fields,
  .web-liturgy-content-fields { grid-template-columns: 1fr; }
  .web-liturgy-contents { padding: 14px 12px; }
  .web-liturgy-contents-head { align-items: flex-start; }
  .web-liturgy-contents-head .web-btn { min-height: 38px; padding: 8px 10px; font-size: 12px; }
  .web-liturgy-content-fields .liturgy-song-pick,
  .web-liturgy-content-fields .liturgy-prayer-kind { grid-column: auto; }
}

@media (max-width: 380px) {
  .web-bottom {
    left: 6px;
    right: 6px;
    gap: 0;
    padding-inline: 5px;
  }
  .web-bottom button {
    padding-inline: 0;
  }
  .web-bottom button small {
    font-size: 9px;
  }
}

/* ── Reset de cor — cirúrgico, não global ── */

/* Remove flash azul ao tocar em mobile (iOS/Android) */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Headings — browser UA às vezes injeta azul */
.web-app h1, .web-app h2, .web-app h3, .web-app h4,
.web-modal h1, .web-modal h2, .web-modal h3,
.web-auth h1, .web-auth h2 {
  color: inherit;
  margin: 0;
}

.web-title {
  color: inherit;
}

/* Links — evita azul padrão */
.web-app a, .web-modal a, .web-auth a {
  color: inherit;
  text-decoration: none;
}

/* Inputs/selects/textareas — iOS Safari usa -webkit-text-fill-color
   em vez de color para form elements */
.web-input,
.web-select,
.web-textarea {
  color: var(--web-ink);
  -webkit-text-fill-color: var(--web-ink);
}

/* Botões-card clicáveis — iOS Safari pode defaultar pro azul do sistema */
.web-card.clickable {
  color: var(--web-ink);
  -webkit-text-fill-color: var(--web-ink);
}

/* ── Polish pass ────────────────────────────────────── */

/* Hover lift em cards clicáveis */
.web-card.clickable {
  transition: box-shadow .16s ease, transform .13s ease;
}
.web-card.clickable:hover {
  box-shadow: 0 8px 28px rgba(50,35,20,.12);
  transform: translateY(-2px);
}
.web-card.clickable:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(50,35,20,.07);
}

/* Input focus state */
.web-input:focus,
.web-select:focus,
.web-textarea:focus {
  border-color: var(--web-clay);
  box-shadow: 0 0 0 3px rgba(188,75,44,.10);
}

/* Buttons hover */
.web-btn:not(:disabled):hover {
  filter: brightness(1.06);
}
.web-btn.secondary:not(:disabled):hover {
  background: var(--web-line);
}
.web-btn.ghost:not(:disabled):hover {
  background: var(--web-clay-tint);
}

/* Nav hover + active */
.web-nav button {
  transition: background .12s ease, color .12s ease;
}
.web-nav button:hover:not(.active) {
  background: var(--web-surface-2);
  color: var(--web-ink);
}
.web-nav button.active {
  box-shadow: 0 2px 10px rgba(35,22,14,.18);
}

/* Member card rows (substitui a tabela) */
.web-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--web-line);
}

/* Stat card número grande */
.web-stat-number {
  font-family: var(--web-display);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--web-ink);
}

/* Service date badge */
.web-service-badge {
  width: 48px;
  min-height: 54px;
  border-radius: 13px;
  background: var(--web-ink);
  color: var(--web-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex: none;
  padding: 6px 4px;
}
.web-service-day {
  font-family: var(--web-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.web-service-month {
  font-size: 10px;
  font-weight: 800;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.web-service-badge,
.web-service-badge * {
  -webkit-text-fill-color: var(--web-bg);
}

/* Focus visible acessibilidade */
:focus-visible {
  outline: 2px solid var(--web-clay);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar suave */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--web-line) transparent;
}

/* Escala — section header (Louvor / Som & Transmissão) */
.web-scale-section-head {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--web-ink-3);
  padding: 2px 0;
}

.web-share-option {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--web-sage) 42%, var(--web-line));
  border-left: 4px solid var(--web-sage);
  border-radius: 8px;
  background: color-mix(in srgb, var(--web-sage-soft) 58%, white);
}
.web-share-option[hidden] {
  display: none !important;
}

.web-holyrics-layout {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.45fr);
  gap: 22px;
  align-items: start;
}

.web-holyrics-guide ol {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  color: var(--web-ink-2);
  line-height: 1.45;
}

.web-import-list {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-gutter: stable;
}

.web-import-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-surface);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.web-import-row.selected {
  border-color: color-mix(in srgb, var(--web-clay) 48%, var(--web-line));
  background: var(--web-clay-tint);
}

.web-import-row.blocked {
  cursor: default;
  opacity: .68;
}

.web-import-row > input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--web-clay-deep);
}

.web-import-row > span,
.web-import-row strong,
.web-import-row small {
  min-width: 0;
}

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

.web-import-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-import-row small {
  color: var(--web-ink-3);
  margin-top: 3px;
}

.web-import-row .web-actions {
  margin-top: 8px;
  gap: 5px;
}

.web-import-row i {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--web-ink-2);
  background: var(--web-surface-2);
}

.web-import-row i.warn {
  color: var(--web-amber);
  background: var(--web-amber-soft);
}

@media (max-width: 820px) {
  .web-holyrics-layout {
    grid-template-columns: 1fr;
  }

  .web-import-list {
    max-height: 52vh;
  }
}
.web-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.web-check-row input {
  width: 19px;
  height: 19px;
  flex: none;
}
.web-app input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin: 0;
  flex: none;
  border: 1.5px solid #b7aa98;
  border-radius: 6px;
  background: white;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.web-app input[type="checkbox"]:hover { border-color: var(--web-clay); }
.web-app input[type="checkbox"]:checked {
  border-color: var(--web-clay);
  background-color: var(--web-clay);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px;
}
.web-app input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--web-clay-tint);
  outline-offset: 2px;
}
.web-chip:has(input[type="checkbox"]:checked) {
  border-color: var(--web-clay);
  background: var(--web-clay-tint);
  color: var(--web-clay-deep);
}
.web-catalog-version {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: white;
  color: var(--web-ink);
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}
.web-catalog-version:hover {
  border-color: var(--web-sage);
  background: var(--web-sage-soft);
}
.web-catalog-version span {
  color: var(--web-ink-2);
  font-size: 12px;
}
.web-lyric-credits {
  margin-top: 12px;
  padding: 12px;
  border-left: 3px solid var(--web-sage);
  background: var(--web-sage-soft);
  color: var(--web-ink-2);
  font-size: 13px;
  line-height: 1.55;
}
.web-catalog-review-grid {
  align-items: start;
}

.web-catalog-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--web-sage) 38%, var(--web-line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--web-sage-soft) 72%, white);
}

.web-catalog-bulk-bar > div {
  display: grid;
  gap: 3px;
}

.web-catalog-bulk-bar span {
  color: var(--web-ink-2);
  font-size: 13px;
}

.web-catalog-bulk-bar .web-btn {
  flex: none;
}

@media (max-width: 640px) {
  .web-catalog-bulk-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .web-catalog-bulk-bar .web-btn {
    width: 100%;
  }
}
.web-catalog-review {
  border-top: 3px solid var(--web-clay);
}

.web-catalog-admin-tabs {
  width: fit-content;
}

.web-cifra-report-links {
  padding-top: 2px;
}

.web-link-line {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.web-link-line a {
  color: var(--web-clay-deep);
  font-weight: 850;
  width: fit-content;
}

.web-link-line span {
  color: var(--web-ink-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.web-catalog-meta {
  padding: 12px 0;
  border-top: 1px solid var(--web-line);
  border-bottom: 1px solid var(--web-line);
  font-size: 13px;
}
.web-catalog-meta > div {
  min-width: 0;
}
.web-catalog-lyrics summary {
  cursor: pointer;
  color: var(--web-clay-deep);
  font-weight: 800;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.web-catalog-lyrics summary::-webkit-details-marker { display: none; }
.web-catalog-lyrics summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .14s ease;
}
.web-catalog-lyrics[open] summary::before { transform: rotate(45deg); }
.web-catalog-lyrics pre {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
  padding: 14px;
  background: var(--web-surface-2);
  border-radius: 8px;
}

.web-optional-details {
  overflow: hidden;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-surface);
}
.web-optional-details summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 11px 46px 11px 14px;
  list-style: none;
  cursor: pointer;
}
.web-optional-details summary::-webkit-details-marker { display: none; }
.web-optional-details summary::after {
  content: "";
  position: absolute;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--web-ink-3);
  border-bottom: 2px solid var(--web-ink-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .14s ease;
}
.web-optional-details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.web-optional-details summary span { display: grid; gap: 2px; }
.web-optional-details summary small { color: var(--web-ink-3); font-size: 12px; }
.web-optional-details-content { padding: 14px; border-top: 1px solid var(--web-line); background: var(--web-surface-2); }

@media (max-width: 720px) {
  .web-catalog-filters {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .web-catalog-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .web-file-field {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
  }
  .web-file-action { justify-content: center; }
  .web-file-name {
    padding: 2px 5px 4px;
    text-align: center;
  }
}

/* Chord chart creator */
.web-modal.web-chord-modal {
  width: min(1480px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #f6efe7;
}
.web-chord-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 68px 48px minmax(0, 1fr);
}
.web-chord-header {
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--web-line);
  background: rgba(255,250,245,.96);
}
.web-chord-brand {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.web-chord-brand > div { display: grid; }
.web-chord-brand strong { font: 800 20px/1 var(--web-display); }
.web-chord-brand span:not(.web-chord-mark) {
  margin-top: 3px;
  color: var(--web-ink-3);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.web-chord-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--web-clay);
  color: white;
  font: 800 23px/1 var(--web-display);
  box-shadow: 0 5px 14px rgba(188,75,44,.22);
}
.web-chord-path {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--web-ink-3);
  font-size: 13px;
}
.web-chord-path::before { content: "/"; }
.web-chord-path b {
  max-width: 280px;
  overflow: hidden;
  color: var(--web-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-chord-header > .web-actions { margin-left: auto; }
.web-chord-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  border-bottom: 1px solid var(--web-line);
  background: #fffaf5;
}
.web-chord-steps button {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--web-ink-3);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.web-chord-steps button span {
  width: 24px;
  height: 24px;
  border: 1px solid var(--web-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  font: 700 10px/1 var(--web-mono);
}
.web-chord-steps button.active { color: var(--web-clay-deep); }
.web-chord-steps button.active span { border-color: var(--web-clay); background: var(--web-clay); color: white; }

.web-chord-input-screen {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 36%) minmax(0, 1fr);
}
.web-chord-intro {
  padding: 48px clamp(28px, 4vw, 60px);
  border-right: 1px solid var(--web-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, rgba(188,75,44,.08), transparent 45%);
}
.web-chord-intro h2 {
  max-width: 470px;
  margin: 18px 0;
  font: 800 clamp(40px, 4vw, 62px)/.96 var(--web-display);
}
.web-chord-intro h2 em { color: var(--web-clay); font-style: normal; }
.web-chord-intro p { max-width: 430px; color: var(--web-ink-2); font-size: 16px; line-height: 1.55; }
.web-chord-tip { display: flex; align-items: flex-start; gap: 12px; color: var(--web-ink-2); font-size: 13px; line-height: 1.45; }
.web-chord-tip strong {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--web-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  color: var(--web-clay);
}
.web-chord-input-workspace {
  min-width: 0;
  padding: 30px clamp(24px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}
.web-chord-input-workspace h2 { margin: 4px 0; font: 800 29px/1.1 var(--web-display); }
.web-chord-meta-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(120px, 180px); gap: 10px; }
.web-chord-readonly {
  min-height: 44px;
  padding: 12px 13px;
  border: 1.5px solid var(--web-line);
  border-radius: 13px;
  background: rgba(255,255,255,.55);
  color: var(--web-ink-2);
}
.web-chord-lyrics-field { flex: 1; min-height: 320px; }
.web-chord-lyrics-input {
  width: 100%;
  min-height: 310px;
  flex: 1;
  padding: 20px 22px;
  border: 1.5px solid var(--web-line);
  border-radius: 16px;
  outline: none;
  resize: vertical;
  background: #fffaf5;
  color: var(--web-ink);
  font: 600 14px/1.75 var(--web-mono);
}
.web-chord-lyrics-input:focus { border-color: var(--web-clay); box-shadow: 0 0 0 3px var(--web-clay-tint); }
.web-chord-input-actions { gap: 18px; }
.web-chord-input-actions > .web-muted { max-width: 380px; }

.web-chord-workspace {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: 230px minmax(440px, 1fr) 280px;
}
.web-chord-sections,
.web-chord-inspector {
  min-height: 0;
  padding: 20px 15px;
  overflow: auto;
  background: #fffaf5;
}
.web-chord-sections { border-right: 1px solid var(--web-line); }
.web-chord-inspector { border-left: 1px solid var(--web-line); }
.web-chord-song-meta { padding: 18px 3px; margin-bottom: 12px; border-bottom: 1px solid var(--web-line); }
.web-chord-song-meta h3 { font: 800 22px/1.05 var(--web-display); }
.web-chord-song-meta p { margin: 5px 0 12px; color: var(--web-ink-3); font-size: 13px; }
.web-chord-song-meta > div { display: flex; flex-wrap: wrap; gap: 5px; }
.web-chord-song-meta span {
  padding: 5px 7px;
  border: 1px solid var(--web-line);
  border-radius: 7px;
  background: white;
  color: var(--web-ink-2);
  font: 700 9px/1 var(--web-mono);
  text-transform: uppercase;
}
.web-chord-section-list { display: grid; gap: 4px; }
.web-chord-section-list button {
  min-height: 42px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--web-ink-2);
  text-align: left;
  cursor: pointer;
}
.web-chord-section-list button:hover { background: white; }
.web-chord-section-list span,
.web-chord-section-list small { color: var(--web-ink-3); font: 700 9px/1 var(--web-mono); }
.web-chord-section-list strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.web-chord-add-section { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.web-chord-add-section .web-input { min-height: 38px; padding: 8px 10px; font-size: 12px; }
.web-chord-sections > p { margin-top: 22px; font-size: 12px; line-height: 1.5; }

.web-chord-score-area { min-width: 0; min-height: 0; overflow: auto; }
.web-chord-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 22px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(#f6efe7 82%, rgba(246,239,231,.2));
}
.web-chord-toolbar h2 { margin-top: 4px; font: 800 24px/1.1 var(--web-display); }
.web-chord-score { max-width: 820px; margin: 0 auto; padding: 10px 34px 120px; }
.web-chord-score-section { padding: 20px 0; border-bottom: 1px solid rgba(188,164,146,.55); scroll-margin-top: 100px; }
.web-chord-score-heading { margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.web-chord-score-heading::after { content: ""; height: 1px; flex: 1; background: var(--web-line); }
.web-chord-score-heading span { color: var(--web-clay-deep); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.web-chord-line { min-height: 56px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; }
.web-chord-line-number { padding-top: 25px; color: var(--web-ink-3); font: 700 9px/1 var(--web-mono); text-align: right; }
.web-chord-words { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 7px; }
.web-chord-word {
  min-height: 49px;
  padding: 2px 2px 4px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  background: transparent;
  color: var(--web-ink);
  cursor: pointer;
}
span.web-chord-word { cursor: default; }
.web-chord-word:hover:not(span) { background: rgba(255,255,255,.7); }
.web-chord-word.selected { background: var(--web-clay-tint); box-shadow: 0 0 0 2px var(--web-clay-tint); }
.web-chord-word > span { min-height: 19px; color: var(--web-clay-deep); font: 800 12px/1.1 var(--web-mono); }
.web-chord-word > b { font-size: 15px; line-height: 1.25; white-space: nowrap; }

.web-chord-inspector h3 { font: 800 20px/1.1 var(--web-display); }
.web-chord-inspector > p { margin: 5px 0 16px; font-size: 12px; }
.web-chord-target {
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid var(--web-line);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  background: #f6efe7;
}
.web-chord-target span { color: var(--web-ink-3); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.web-chord-target strong { overflow: hidden; font: 800 19px/1.2 var(--web-display); text-overflow: ellipsis; white-space: nowrap; }
.web-chord-target small { color: var(--web-ink-3); }
.web-chord-palette { margin: 8px 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.web-chord-palette button,
.web-chord-mobile-dock > div:last-child button {
  min-height: 38px;
  border: 1px solid var(--web-line);
  border-radius: 9px;
  background: #fbf3eb;
  color: var(--web-ink);
  font: 800 11px/1 var(--web-mono);
  cursor: pointer;
}
.web-chord-palette button:hover,
.web-chord-palette button.active { border-color: var(--web-clay); background: var(--web-clay-tint); color: var(--web-clay-deep); }
.web-chord-custom { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.web-icon-btn.dark { border-color: var(--web-ink); background: var(--web-ink); color: white; }
.web-chord-inspector > .web-actions { margin: 9px 0 18px; }
.web-chord-transpose { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--web-line); }
.web-chord-transpose > div { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.web-chord-transpose strong { min-width: 44px; color: var(--web-clay-deep); font: 800 16px/1 var(--web-mono); text-align: center; }
.web-chord-mobile-dock { display: none; }

.web-chord-preview-screen { min-height: 0; padding: 20px 28px 70px; overflow: auto; }
.web-chord-preview-toolbar { max-width: 980px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.web-chord-preview-toolbar h2 { margin-top: 3px; font: 800 26px/1.1 var(--web-display); }
.web-chord-paper {
  width: min(900px, 100%);
  min-height: 620px;
  margin: 0 auto;
  padding: 42px 48px 28px;
  border: 1px solid var(--web-line);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  background: #fffdfa;
  box-shadow: 0 18px 50px rgba(55,34,20,.12);
}
.web-chord-paper > header { padding-bottom: 20px; border-bottom: 2px solid var(--web-ink); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.web-chord-paper h1 { font: 800 34px/1.05 var(--web-display); }
.web-chord-paper header p { margin: 6px 0 0; color: var(--web-ink-2); }
.web-chord-paper header > div:last-child { min-width: 70px; padding: 10px; border: 1px solid var(--web-line); text-align: center; }
.web-chord-paper header small { display: block; color: var(--web-ink-3); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.web-chord-paper header strong { color: var(--web-clay-deep); font: 800 21px/1.2 var(--web-mono); }
.web-chord-paper > div { flex: 1; padding-top: 10px; }
.web-chord-paper .web-chord-score-section { padding: 18px 0; }
.web-chord-paper > footer { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--web-line); display: flex; justify-content: space-between; color: var(--web-ink-3); font-size: 10px; font-weight: 800; }

.web-chord-public-toggle {
  width: min(100%, 560px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--web-line);
  border-radius: 8px;
  background: var(--web-surface-2);
  color: var(--web-ink);
  text-align: left;
  cursor: pointer;
}
.web-chord-public-toggle > span { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--web-ink-3); border-radius: 6px; }
.web-chord-public-toggle div { display: grid; gap: 2px; }
.web-chord-public-toggle small { color: var(--web-ink-3); }
.web-chord-public-toggle.active { border-color: color-mix(in srgb, var(--web-clay) 45%, var(--web-line)); background: var(--web-clay-tint); }
.web-chord-public-toggle.active > span { border-color: var(--web-clay); background: var(--web-clay); color: white; }

@media (max-width: 1040px) {
  .web-chord-workspace { grid-template-columns: 190px minmax(380px, 1fr) 250px; }
  .web-chord-toolbar { align-items: flex-start; flex-direction: column; }
  .web-chord-toolbar > .web-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
}

@media (max-width: 760px) {
  .web-modal.web-chord-modal {
    width: 100%;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
  }
  .web-chord-shell { grid-template-rows: 60px 46px minmax(0, 1fr); }
  .web-chord-header { padding: 0 12px; gap: 10px; }
  .web-chord-brand { min-width: 0; }
  .web-chord-brand > div,
  .web-chord-path { display: none; }
  .web-chord-mark { width: 36px; height: 36px; }
  .web-chord-header > .web-actions { flex-wrap: nowrap; }
  .web-chord-header > .web-actions .web-btn { min-height: 38px; padding: 9px 11px; font-size: 12px; }
  .web-chord-steps { gap: 16px; }
  .web-chord-input-screen { display: block; overflow: auto; }
  .web-chord-intro { padding: 22px 18px; border-right: 0; border-bottom: 1px solid var(--web-line); gap: 18px; }
  .web-chord-intro h2 { margin: 8px 0; font-size: 34px; }
  .web-chord-intro p { font-size: 14px; }
  .web-chord-tip { display: none; }
  .web-chord-input-workspace { padding: 20px 16px 110px; overflow: visible; }
  .web-chord-meta-row { grid-template-columns: 1fr 1fr; }
  .web-chord-lyrics-field { min-height: 360px; }
  .web-chord-input-actions { align-items: stretch; flex-direction: column; }
  .web-chord-input-actions .web-btn { width: 100%; }
  .web-chord-workspace { display: block; overflow: hidden; }
  .web-chord-sections,
  .web-chord-inspector { display: none; }
  .web-chord-score-area { height: 100%; padding-bottom: 92px; }
  .web-chord-toolbar { padding: 13px 14px 10px; }
  .web-chord-toolbar h2 { font-size: 20px; }
  .web-chord-toolbar > .web-actions { padding-bottom: 3px; }
  .web-chord-toolbar > .web-actions .web-btn { min-width: max-content; padding: 9px 11px; font-size: 11px; }
  .web-chord-score { padding: 4px 16px 150px; }
  .web-chord-word > b { font-size: 14px; }
  .web-chord-mobile-dock {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 12;
    padding: 10px;
    border: 1px solid var(--web-line);
    border-radius: 16px;
    display: block;
    background: rgba(255,250,245,.98);
    box-shadow: 0 -8px 28px rgba(57,35,20,.13);
    transform: translateY(130%);
    transition: transform .18s ease;
  }
  .web-chord-mobile-dock.open { transform: translateY(0); }
  .web-chord-mobile-dock > div:last-child { margin-top: 7px; display: flex; gap: 6px; overflow-x: auto; }
  .web-chord-mobile-dock > div:last-child button { min-width: 44px; flex: none; }
  .web-chord-preview-screen { padding: 16px 12px 80px; }
  .web-chord-preview-toolbar { align-items: flex-start; flex-direction: column; }
  .web-chord-preview-toolbar > .web-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .web-chord-preview-toolbar .web-btn { min-width: max-content; }
  .web-chord-paper { min-height: 0; padding: 25px 18px 20px; }
  .web-chord-paper h1 { font-size: 26px; }
  .web-chord-paper .web-chord-line { grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
  .web-chord-paper .web-chord-word > b { font-size: 13px; }
  .web-chord-paper > footer { gap: 12px; }
}
