/* ============================================================
   SHEPHERD — Global Stylesheet
   Catholic discipleship tool · Mobile-first · No magic colors
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */

:root {
  /* Colors — deep navy primary, clean neutral surfaces */
  --color-header-bg: #1e3a5f;
  --color-header-fg: #ffffff;
  --color-primary: #1e3a5f;
  --color-primary-dark: #142840;
  --color-bg: #f5f5f0;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-border: #d1d5db;
  --color-bg-alt: #e5e7eb;
  --color-danger: #b91c1c;
  --priority-high-fg: #991b1b;
  --priority-high-bg: #fee2e2;
  --priority-high-border: #fca5a5;
  --priority-medium-fg: #92400e;
  --priority-medium-bg: #fef3c7;
  --priority-medium-border: #fcd34d;
  --priority-low-fg: #166534;
  --priority-low-bg: #dcfce7;
  --priority-low-border: #86efac;
  --hero-panel-bg: linear-gradient(155deg, #173151 0%, #1f4068 55%, #2a537f 100%);
  --hero-panel-border: rgba(255, 255, 255, 0.14);
  --hero-panel-shadow: 0 16px 30px rgba(12, 29, 49, 0.28);
  --hero-box-bg: rgba(255, 255, 255, 0.12);
  --hero-box-border: rgba(217, 180, 88, 0.62);
  --hero-signal-chip-bg: rgba(217, 180, 88, 0.18);
  --hero-signal-chip-border: rgba(217, 180, 88, 0.56);
  --priority-card-item-bg: rgba(255, 255, 255, 0.12);
  --priority-card-item-border: rgba(255, 255, 255, 0.22);
  --priority-card-row-bg: rgba(255, 255, 255, 0.1);
  --priority-card-row-border: rgba(255, 255, 255, 0.2);
  --priority-card-row-hover-bg: rgba(255, 255, 255, 0.18);
  --priority-card-row-hover-border: rgba(255, 255, 255, 0.35);
  --font-sans: 'Cabin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Libre Baskerville', Georgia, serif;

  /* Type scale */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-page-title: 1.5rem;
  --text-section-title: 1.25rem;

  /* Spacing — 4px base unit */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-card: 1rem;

  /* Shadows */
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.12);
}

:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --color-header-bg: #1e3a5f;
  --color-header-fg: #ffffff;
  --color-primary: #8fb4ff;
  --color-primary-dark: #6b95f0;
  --color-bg: #0b1220;
  --color-surface: #111a2b;
  --color-surface-soft: #151f33;
  --color-text: #e5e7eb;
  --color-text-muted: #9ca3af;
  --color-border: #2b364b;
  --color-bg-alt: #1a2437;
  --color-danger: #ef4444;
  --shadow-sm: 0 10px 20px -14px rgba(0, 0, 0, 0.9);
  --shadow-md: 0 16px 28px -14px rgba(0, 0, 0, 0.92);
  --color-accent: #63d2de;
  --color-accent-gold: #d9b458;
  --color-accent-gold-strong: #e7c36b;
  --color-accent-gold-soft: rgba(217, 180, 88, 0.18);
  --color-accent-gold-border: rgba(217, 180, 88, 0.52);
  --priority-high-fg: #fecaca;
  --priority-high-bg: rgba(239, 68, 68, 0.22);
  --priority-high-border: rgba(248, 113, 113, 0.44);
  --priority-medium-fg: #fde68a;
  --priority-medium-bg: rgba(217, 180, 88, 0.18);
  --priority-medium-border: rgba(217, 180, 88, 0.42);
  --priority-low-fg: #bbf7d0;
  --priority-low-bg: rgba(34, 197, 94, 0.2);
  --priority-low-border: rgba(74, 222, 128, 0.4);
  --hero-panel-bg: linear-gradient(155deg, #142943 0%, #1b3658 56%, #25476f 100%);
  --hero-panel-border: rgba(148, 163, 184, 0.28);
  --hero-panel-shadow: 0 18px 34px rgba(2, 6, 14, 0.58);
  --hero-box-bg: rgba(143, 180, 255, 0.12);
  --hero-box-border: rgba(217, 180, 88, 0.66);
  --hero-signal-chip-bg: rgba(217, 180, 88, 0.24);
  --hero-signal-chip-border: rgba(217, 180, 88, 0.6);
  --priority-card-item-bg: rgba(143, 180, 255, 0.14);
  --priority-card-item-border: rgba(148, 163, 184, 0.34);
  --priority-card-row-bg: rgba(143, 180, 255, 0.11);
  --priority-card-row-border: rgba(148, 163, 184, 0.3);
  --priority-card-row-hover-bg: rgba(143, 180, 255, 0.2);
  --priority-card-row-hover-border: rgba(191, 219, 254, 0.42);
}

/* ------------------------------------------------------------
   2. RESET / NORMALIZE
   ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100dvh;
}

h1, h2, h3,
.shell-title {
  font-family: var(--font-serif);
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   ------------------------------------------------------------ */

/* Centered content column */
.container {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Vertical flex stack */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Horizontal flex row */
.row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

/* ------------------------------------------------------------
   4. HEADER
   ------------------------------------------------------------ */

.shell-header {
  background-color: var(--color-header-bg);
  color: var(--color-header-fg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.shell-header h1,
.shell-header .header-title,
.shell-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: var(--font-serif);
}

.shell-ptr-indicator {
  --ptr-offset: 0px;
  --ptr-progress: 0;
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 3.15rem);
  transform: translate3d(-50%, calc(-140% + var(--ptr-offset)), 0);
  z-index: 190;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.2);
  background: rgba(255, 255, 255, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.14s ease, opacity 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
  box-shadow: 0 10px 18px -12px rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.shell-ptr-indicator--visible {
  opacity: 1;
}

.shell-ptr-indicator--tracking {
  transition: none;
}

.shell-ptr-indicator--armed {
  border-color: rgba(30, 58, 95, 0.42);
}

.shell-ptr-ring {
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 999px;
  background: conic-gradient(
    var(--color-primary) calc(var(--ptr-progress) * 1turn),
    rgba(148, 163, 184, 0.25) 0
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2px));
  transition: transform 0.14s ease, filter 0.14s ease;
  will-change: transform, filter;
}

.shell-ptr-indicator--armed .shell-ptr-ring {
  filter: saturate(1.12);
}

.shell-ptr-indicator--tracking .shell-ptr-ring {
  transition: none;
}

.shell-ptr-indicator--refreshing .shell-ptr-ring {
  animation: shell-ptr-spin 0.8s linear infinite;
}

@keyframes shell-ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------
   5. BOTTOM NAVIGATION
   ------------------------------------------------------------ */

nav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

nav.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  gap: var(--space-1);
  transition: color 0.15s ease;
}

nav.bottom-nav a.active,
nav.bottom-nav a:hover {
  color: var(--color-primary);
}

nav.bottom-nav a svg {
  width: 1.4rem;
  height: 1.4rem;
}

/* ------------------------------------------------------------
   6. CARD
   ------------------------------------------------------------ */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.card-body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   7. BUTTONS
   ------------------------------------------------------------ */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-family: inherit;
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary variant */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* Danger variant */
.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-surface);
  border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
  opacity: 0.88;
}

/* Full-width helper */
.btn-block {
  width: 100%;
}

/* ------------------------------------------------------------
   8. FORM ELEMENTS
   ------------------------------------------------------------ */

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

input:not([type='checkbox']):not([type='radio']),
textarea,
select {
  width: 100%;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

input:not([type='checkbox']):not([type='radio']):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

input[type='checkbox'],
input[type='radio'] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  box-shadow: none;
  flex: 0 0 auto;
  accent-color: var(--color-primary);
}

input[type='checkbox'] {
  -webkit-appearance: checkbox;
}

input[type='radio'] {
  -webkit-appearance: radio;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-6);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field-error {
  font-size: var(--text-sm);
  color: var(--color-danger);
}

/* ------------------------------------------------------------
   9. MODAL OVERLAY
   ------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(191, 219, 254, 0.18), transparent 36%),
    radial-gradient(circle at 82% 82%, rgba(147, 197, 253, 0.2), transparent 42%),
    rgba(2, 6, 23, 0.48);
  backdrop-filter: blur(6px) saturate(112%);
  -webkit-backdrop-filter: blur(6px) saturate(112%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2200;
  padding: var(--space-4);
}

.modal-panel {
  background-color: var(--color-surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  width: 100%;
  max-width: 40rem;
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  will-change: transform;
}

.modal-drag-handle {
  display: block;
  flex: 0 0 auto;
  align-self: center;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 5px;
  min-height: 5px;
  margin: 0 auto var(--space-3);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.85);
  pointer-events: none;
}

:root[data-theme='dark'] .modal-drag-handle {
  background: rgba(203, 213, 225, 0.7);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.calendar-export-modal {
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.calendar-export-modal__panel {
  width: min(100%, 30rem);
  max-height: min(84dvh, 36rem);
  border-radius: 1rem;
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.7), rgba(241, 245, 249, 0.58)),
    rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px) saturate(126%);
  -webkit-backdrop-filter: blur(16px) saturate(126%);
  overflow-x: hidden;
  color: #0f172a;
}

.calendar-export-modal__top {
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.calendar-export-modal__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.calendar-export-modal__title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  color: #0f172a;
}

.calendar-export-modal__message {
  margin-top: var(--space-1);
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.calendar-export-modal__close {
  width: 1.75rem;
  min-height: 1.75rem;
  min-width: 1.75rem;
  padding: 0.22rem;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.38);
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  flex: 0 0 auto;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-export-modal__close:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(185, 28, 28, 0.42);
}

.calendar-export-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2);
}

.calendar-export-close-icon {
  width: 0.86rem;
  height: 0.86rem;
}

.calendar-export-modal__actions {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-export-modal__action {
  width: 100%;
  min-height: 2.25rem;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

:root[data-theme='dark'] .calendar-export-modal__panel {
  border-color: rgba(148, 163, 184, 0.32);
  background:
    linear-gradient(170deg, rgba(17, 24, 39, 0.84), rgba(30, 41, 59, 0.8)),
    rgba(17, 24, 39, 0.72);
  color: #f3f4f6;
}

:root[data-theme='dark'] .calendar-export-modal__title {
  color: #f9fafb;
}

:root[data-theme='dark'] .calendar-export-modal__message {
  color: #cbd5e1;
}

:root[data-theme='dark'] .calendar-export-modal__close {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.2);
}

:root[data-theme='dark'] .calendar-export-modal__close:hover {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.28);
  border-color: rgba(252, 165, 165, 0.62);
}

/* ------------------------------------------------------------
   10. UTILITIES
   ------------------------------------------------------------ */

.text-muted {
  color: var(--color-text-muted);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.font-semibold {
  font-weight: 600;
}

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

/* Main content padded above bottom-nav */
#app {
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

/* Page wrapper for container + spacing */
.page {
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
}

/* ------------------------------------------------------------
   11. APP VIEWS
   ------------------------------------------------------------ */

.shell-header {
  background-color: var(--color-header-bg);
  color: var(--color-header-fg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  position: sticky;
  top: 0;
  z-index: 110;
}

.shell-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.shell-header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.shell-theme-toggle {
  color: var(--color-header-fg);
  border: none;
  background: transparent;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
}

.shell-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.shell-theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.shell-theme-toggle-glyph {
  font-size: 0.95rem;
  line-height: 1;
}

.shell-ai-toggle {
  color: var(--color-header-fg);
  border: none;
  background: transparent;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.shell-ai-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.shell-ai-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.shell-ai-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.shell-search-wrap {
  position: relative;
}

.shell-search-toggle {
  color: var(--color-header-fg);
  border: none;
  background: transparent;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.shell-search-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.shell-search-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.shell-search-toggle-icon {
  width: 1rem;
  height: 1rem;
}

.shell-search-panel {
  position: absolute;
  top: calc(100% + 0.12rem);
  right: 0.5rem;
  left: 0.5rem;
  width: auto;
  max-width: 44rem;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 1.75rem;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    0 24px 56px -30px rgba(15, 23, 42, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: hidden;
  z-index: 150;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.shell-search-panel--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.shell-search-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0 0.08rem;
}

.shell-search-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  transform: translateY(-0.12rem);
  transition: grid-template-rows 0.22s ease, opacity 0.16s ease, padding 0.22s ease, transform 0.22s ease;
  will-change: grid-template-rows, opacity, transform;
}

.shell-search-body--open {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 0.08rem 0 0.1rem;
  transform: translateY(0);
}

.shell-search-body-inner {
  min-height: 0;
  overflow: hidden;
}

.shell-search-composer-icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--color-text-muted);
}

.shell-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  min-height: 1.95rem;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}

.shell-search-input:focus {
  outline: none;
  box-shadow: none;
}

.shell-search-shortcut {
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  background: rgba(248, 250, 252, 0.78);
}

.shell-search-status {
  margin: 0;
  padding: 0 0.2rem 0.22rem;
}

.shell-search-status--error {
  color: var(--color-danger);
}

.shell-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: min(56dvh, 27rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.1rem;
}

.shell-search-results-message {
  margin: 0;
  padding: 0.12rem 0.5rem 0.2rem;
}

.shell-search-result {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  background: transparent;
  color: var(--color-text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: flex-start;
}

.shell-search-result:hover,
.shell-search-result--active {
  background: rgba(30, 58, 95, 0.08);
}

.shell-search-result-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.3rem;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--color-text-muted);
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.shell-search-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.shell-search-result-title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
}

.shell-search-result-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .shell-search-panel {
    max-width: none;
    left: 0.5rem;
    right: 0.5rem;
  }

  .shell-search-shortcut {
    display: none;
  }
}

.shell-menu-toggle {
  color: var(--color-header-fg);
  border: none;
  background: transparent;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 0;
  padding: 0;
}

.shell-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.shell-ai-panel {
  position: absolute;
  top: calc(100% + 0.12rem);
  right: 0.5rem;
  left: 0.5rem;
  width: auto;
  max-width: 54rem;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.75rem 0.9rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 1.4rem;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9)),
    rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  box-shadow:
    0 24px 56px -30px rgba(15, 23, 42, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: var(--color-text);
  overflow: hidden;
  z-index: 150;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.shell-ai-panel--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.shell-ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.25rem;
  padding: 0 0.25rem 0.5rem;
}

.shell-ai-panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shell-ai-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.shell-ai-panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0.1rem 0;
  max-height: min(55dvh, 38rem);
}

.ai-chat-close-btn {
  border: 1px solid rgba(220, 38, 38, 0.38);
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-radius: 999px;
  width: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ai-chat-close-btn:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(185, 28, 28, 0.42);
}

.ai-chat-close-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.ai-chat-close-icon {
  width: 0.86rem;
  height: 0.86rem;
}

.ai-chat-clear-btn {
  border: 1px solid rgba(100, 116, 139, 0.42);
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-text);
  border-radius: 999px;
  min-height: 2rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.ai-chat-clear-btn:hover:not(:disabled) {
  border-color: rgba(30, 58, 95, 0.5);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.ai-chat-clear-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.ai-chat-clear-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.ai-chat-transcript {
  flex: 1 1 auto;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(241, 245, 249, 0.42)),
    rgba(248, 250, 252, 0.38);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  min-height: 15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ai-chat-message {
  max-width: 90%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.ai-chat-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-chat-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ai-chat-body p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-chat-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.ai-chat-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  background: rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.25rem;
  padding: 0.02rem 0.28rem;
}

.ai-chat-code {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.14);
  overflow-x: auto;
}

.ai-chat-code code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.ai-chat-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ai-chat-list--ordered {
  list-style: decimal;
}

.ai-chat-message--user {
  align-self: flex-end;
  background: rgba(30, 58, 95, 0.2);
  border: 1px solid rgba(30, 58, 95, 0.28);
}

.ai-chat-message--assistant,
.ai-chat-message--system {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.38);
}

.ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: end;
}

.ai-chat-composer {
  min-height: 5.25rem;
  resize: vertical;
}

.ai-chat-send-btn {
  min-height: 2.5rem;
  padding: 0 var(--space-4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-send-btn:hover {
  transform: translateY(-1px);
}

.ai-chat-send-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.24);
}

.ai-chat-confirm-card {
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(254, 242, 242, 0.72);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.ai-chat-message--confirm {
  align-self: flex-start;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  line-height: 1.4;
}

.ai-chat-confirm-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
}

.ai-chat-confirm-card ul {
  margin: 0 0 var(--space-2) 1rem;
  padding: 0;
  list-style: disc;
}

.ai-chat-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ai-chat-confirm-btn {
  min-height: 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ai-chat-confirm-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-soft);
}

.ai-chat-confirm-btn--yes {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}

@media (max-width: 640px) {
  .shell-ai-panel {
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
  }

  .shell-ai-panel-body {
    max-height: min(70dvh, 34rem);
  }

  .ai-chat-transcript {
    min-height: 12rem;
  }

  .ai-chat-form {
    grid-template-columns: 1fr;
  }
}

.shell-menu-bars {
  width: 1.15rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.shell-menu-bars span {
  width: 100%;
  height: 2px;
  background: var(--color-header-fg);
  border-radius: 999px;
}

.shell-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  min-width: 15.5rem;
  width: min(82vw, 16.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.28rem;
  display: none;
  flex-direction: column;
  gap: 1px;
  z-index: 120;
  max-height: min(78vh, 34rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.shell-menu-panel--open {
  display: flex;
}

.shell-menu-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.34rem 0.52rem;
  margin-bottom: 1px;
  gap: var(--space-2);
}

.shell-menu-theme-toggle {
  color: var(--color-text);
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  width: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  display: inline-grid;
  place-items: center;
}

.shell-menu-theme-toggle:hover {
  background: rgba(30, 58, 95, 0.08);
}

.shell-menu-theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.3);
}

.shell-menu-sync-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}

.shell-menu-sync-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: right;
  line-height: 1;
}

.shell-sync-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  line-height: 1;
  transition: color 150ms ease;
}

.shell-sync-indicator--synced {
  color: #15803d;
}

.shell-sync-indicator--syncing {
  color: #1d4ed8;
}

.shell-sync-indicator--unsynced {
  color: #b45309;
}

.shell-sync-indicator--offline {
  color: #475569;
}

.shell-sync-icon {
  width: 1rem;
  height: 1rem;
}

.shell-sync-icon--spinning {
  animation: shell-ptr-spin 0.8s linear infinite;
}

.shell-menu-item {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  border: none;
  background: transparent;
  color: var(--color-text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.shell-menu-item-icon {
  width: 0.96rem;
  height: 0.96rem;
  flex: 0 0 auto;
  opacity: 0.9;
}

.shell-menu-item:hover {
  background: rgba(30, 58, 95, 0.08);
}

.shell-menu-item--danger {
  color: var(--color-danger);
}

.shell-menu-about-toggle {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  border: none;
  background: transparent;
  color: var(--color-text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.shell-menu-about-toggle::after {
  content: '▾';
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.shell-menu-about-toggle--open::after {
  transform: rotate(180deg);
}

.shell-menu-about-toggle:hover {
  background: rgba(30, 58, 95, 0.08);
}

.shell-menu-about {
  display: none;
  margin: 1px 0 2px;
  padding: 0.42rem 0.48rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: rgba(30, 58, 95, 0.03);
  gap: 0.26rem;
}

.shell-menu-about--open {
  display: grid;
}

.shell-menu-about-copy {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.shell-menu-about-copy--technical {
  color: var(--color-text);
  font-weight: 600;
}

.shell-menu-about-list {
  margin: 0;
  padding-left: 1rem;
  list-style: disc;
  display: grid;
  gap: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.shell-menu-about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.shell-menu-about-cta {
  min-height: 34px;
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  border: 1px solid rgba(30, 58, 95, 0.2);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 0.72rem;
}

.shell-menu-about-cta .shell-menu-item-icon {
  width: 0.84rem;
  height: 0.84rem;
}

@media (max-width: 480px) {
  .shell-menu-panel {
    min-width: 14rem;
    width: min(78vw, 15rem);
    max-height: min(82dvh, 34rem);
  }

  .shell-menu-item,
  .shell-menu-about-toggle {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.8rem;
  }
}

.shell-menu-about-cta:hover {
  background: rgba(30, 58, 95, 0.08);
}

.shell-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: var(--space-5);
}

.shell-content > * {
  margin: 0;
  min-width: 0;
}

.home-view-stack,
.people-view-stack,
.groups-view-stack,
.person-view-stack,
.readings-view-stack,
.logs-view-stack,
.group-detail-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  min-width: 0;
}

.home-slot:empty,
.person-section-slot:empty {
  display: none;
}

.person-view-stack {
  gap: var(--space-3);
}

.home-liturgy-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  background:
    radial-gradient(120% 110% at 90% 10%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    linear-gradient(155deg, #1e3a5f 0%, #142840 100%);
  color: #f8fafc;
  box-shadow: 0 8px 18px -6px rgba(11, 24, 40, 0.18);
  overflow: hidden;
}

.home-liturgy-hero-body {
  padding: var(--space-5) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
}

.home-liturgy-hero-handle {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.82);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem var(--space-4) 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.14s ease;
  border-top: 1px solid rgba(248, 250, 252, 0.1);
}

.home-liturgy-hero-handle:hover {
  color: #f8fafc;
}

.home-liturgy-hero-handle-grip {
  display: inline-block;
  width: 2rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.35);
}

.home-liturgy-hero-drawer {
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.24s ease, opacity 0.2s ease, padding 0.2s ease;
  padding-top: 0;
  padding-bottom: 0;
  touch-action: pan-y;
  cursor: grab;
}
.home-liturgy-hero-drawer:active { cursor: grabbing; }

.home-liturgy-hero--drawer-open .home-liturgy-hero-drawer {
  max-height: 320px;
  opacity: 1;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.home-liturgy-hero-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.home-liturgy-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--color-accent-gold);
}

.home-liturgy-heading {
  margin: 0;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  line-height: 1.1;
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-liturgy-feast {
  margin: 0;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(248, 250, 252, 0.75);
}

.home-liturgy-hero-divider {
  margin: var(--space-4) 0 var(--space-3);
  height: 1px;
  background: rgba(248, 250, 252, 0.18);
}

.home-liturgy-hero-readings {
  display: grid;
  gap: var(--space-3);
}

.home-liturgy-hero-readings--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-liturgy-hero-readings--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .home-liturgy-hero-readings--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.home-liturgy-reading {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.home-liturgy-reading-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--color-accent-gold);
}

.home-liturgy-reading-value {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1rem;
  color: #f8fafc;
  line-height: 1.2;
  word-break: break-word;
}

.home-quick-notes-slot-host {
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

.person-milestones {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.person-milestones-summary {
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-1) 0;
}

.person-milestone-row {
  padding: var(--space-1) 0;
}

.person-milestones input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  -webkit-appearance: checkbox;
  accent-color: var(--color-primary);
  flex: 0 0 auto;
}

.person-milestones input[type="date"] {
  flex: 1 1 auto;
}

.home-quick-notes-slot {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.home-quick-notes-input {
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  padding: 0.4rem 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.45;
  overflow: hidden;
  touch-action: pan-y;
}

.home-quick-notes-input::placeholder {
  color: var(--color-text-muted);
}

.home-quick-notes-input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

.home-quick-notes-pin {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.home-quick-notes-pin svg {
  width: 1.05rem;
  height: 1.05rem;
}

.home-quick-notes-pin:hover {
  background: rgba(30, 58, 95, 0.06);
  color: var(--color-primary);
}

.home-quick-notes-pin--active {
  color: var(--color-accent-gold-strong);
}

.home-quick-notes-pin--active:hover {
  color: var(--color-accent-gold-strong);
  background: rgba(201, 151, 26, 0.1);
}

.home-quick-notes-dots-host {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.home-quick-notes-dots {
  display: inline-flex;
  gap: 0.38rem;
  align-items: center;
}

.home-quick-notes-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  padding: 0;
  border: none;
  background: rgba(30, 58, 95, 0.18);
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.14s ease;
}

.home-quick-notes-dot:hover {
  background: rgba(30, 58, 95, 0.36);
}

.home-quick-notes-dot--active {
  background: var(--color-primary);
  transform: scale(1.15);
}

.home-quick-notes-dot--pinned {
  box-shadow: 0 0 0 2px rgba(201, 151, 26, 0.35);
}

:root[data-theme='dark'] .home-liturgy-hero {
  background:
    radial-gradient(120% 110% at 90% 10%, rgba(148, 180, 220, 0.1) 0%, transparent 50%),
    linear-gradient(155deg, #0f1a2d 0%, #081221 100%);
  box-shadow: 0 18px 40px rgba(2, 6, 14, 0.6);
}

:root[data-theme='dark'] .home-liturgy-hero-divider {
  background: rgba(148, 163, 184, 0.2);
}

:root[data-theme='dark'] .home-liturgy-hero-drawer {
  background: var(--color-surface);
  color: var(--color-text);
}

:root[data-theme='dark'] .home-liturgy-hero-handle {
  color: rgba(248, 250, 252, 0.75);
  border-top-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme='dark'] .home-liturgy-hero-handle-grip {
  background: rgba(148, 163, 184, 0.45);
}

:root[data-theme='dark'] .home-quick-notes-dot {
  background: rgba(148, 163, 184, 0.3);
}

:root[data-theme='dark'] .home-quick-notes-dot--active {
  background: #8fb4ff;
}

@media (max-width: 420px) {
  .home-liturgy-hero {
    border-radius: 1.1rem;
  }

  .home-liturgy-hero-body {
    padding: var(--space-4);
  }

  .home-liturgy-hero-readings {
    gap: var(--space-2);
  }

  .home-liturgy-reading-value {
    font-size: 0.92rem;
  }
}

.calendar-upcoming {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calendar-upcoming-title {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.calendar-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.person-view-stack .home-section {
  padding: var(--space-3);
}

.group-detail-stack {
  gap: var(--space-3);
}

.group-detail-stack .home-section {
  padding: var(--space-3);
}

.groups-toolbar {
  gap: var(--space-3);
}

.groups-search-input,
.people-search-input {
  margin: 0;
  border-color: rgba(30, 58, 95, 0.24);
}

.groups-search-input::placeholder,
.people-search-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.95;
}

:root[data-theme='dark'] .groups-search-input,
:root[data-theme='dark'] .people-search-input {
  background: rgba(17, 26, 43, 0.96);
  border-color: rgba(143, 180, 255, 0.44);
  color: #e5e7eb;
  -webkit-text-fill-color: #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.08);
}

:root[data-theme='dark'] .groups-search-input::placeholder,
:root[data-theme='dark'] .people-search-input::placeholder {
  color: #cbd5e1;
  opacity: 0.92;
}

:root[data-theme='dark'] .groups-search-input:focus,
:root[data-theme='dark'] .people-search-input:focus {
  border-color: rgba(143, 180, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(143, 180, 255, 0.22);
}

.import-view,
.export-view {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.help-view {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.help-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}

.help-list {
  list-style: disc;
  margin: 0;
  padding-left: var(--space-4);
  color: var(--color-text-muted);
  display: grid;
  gap: var(--space-1);
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.help-faq-item {
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.wizard-step-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.wizard-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 1.2rem;
  padding: var(--space-4);
  background:
    radial-gradient(circle at top right, rgba(197, 164, 126, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(30, 58, 95, 0.08), rgba(255, 255, 255, 0.95));
}

.wizard-hero::after {
  content: '';
  position: absolute;
  inset: auto -2rem -2rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.06);
}

.wizard-hero > * {
  position: relative;
  z-index: 1;
}

.wizard-hero--import {
  background:
    radial-gradient(circle at top right, rgba(84, 125, 84, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(30, 58, 95, 0.08), rgba(255, 255, 255, 0.96));
}

.wizard-hero--export {
  background:
    radial-gradient(circle at top right, rgba(196, 133, 79, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(30, 58, 95, 0.08), rgba(255, 255, 255, 0.96));
}

.wizard-hero--graph {
  background: linear-gradient(145deg, rgba(30, 58, 95, 0.08), rgba(84, 125, 84, 0.08), rgba(255, 255, 255, 0.96));
}

.wizard-hero--graph::after {
  display: none;
}

.graph-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.graph-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.graph-stat {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.graph-stat strong {
  display: block;
  font-size: var(--text-xl);
  line-height: 1.1;
  color: var(--color-primary);
}

.graph-stat span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.graph-section {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.graph-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.graph-section-head h2 {
  margin: 0;
  font-size: var(--text-section-title);
}

.graph-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-2);
}

.graph-node {
  min-width: 0;
  min-height: 5.2rem;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  text-align: left;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text);
  box-shadow: none;
}

.graph-node:hover,
.graph-node:focus-visible {
  border-color: rgba(30, 58, 95, 0.36);
  background: rgba(30, 58, 95, 0.06);
}

.graph-node--focused {
  border-color: rgba(84, 125, 84, 0.55);
  background: rgba(84, 125, 84, 0.12);
}

.graph-node-type {
  display: inline-flex;
  width: fit-content;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-transform: capitalize;
}

.graph-node-label {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.graph-edge-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
  list-style: none;
}

.graph-edge-row {
  display: grid;
  grid-template-columns: minmax(6rem, 0.26fr) minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: start;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  color: var(--color-text);
  text-align: left;
  box-shadow: none;
}

.graph-edge-row:hover,
.graph-edge-row:focus-visible {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.06);
}

.graph-edge-kind {
  width: fit-content;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: rgba(197, 164, 126, 0.18);
  color: var(--color-text);
  font-size: 0.74rem;
  text-transform: capitalize;
}

.graph-edge-reason {
  min-width: 0;
  overflow-wrap: anywhere;
}

.graph-edge-endpoints {
  grid-column: 2;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.connections-map {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 42%, rgba(30, 58, 95, 0.035), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 252, 0.95));
  padding: var(--space-3);
  overflow: hidden;
  margin-bottom: 0;
  touch-action: none;
  overscroll-behavior: contain;
}

.connections-map,
.connections-map-svg,
.connections-map-node,
.connections-map-label,
.connections-map-line-hit,
.connections-map-tooltip {
  -webkit-user-select: none;
  user-select: none;
}

.connections-map--compact {
  min-height: 22.5rem;
}

.connections-map--full {
  min-height: 32.5rem;
}

.connections-map--empty {
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.connections-map-toolbar,
.connections-page-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.connections-map-toolbar {
  justify-content: space-between;
}

.connections-map-toolbar--zoom-only {
  justify-content: flex-end;
}

.connections-page-search {
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.connections-map-search-input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.35rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-text);
  font-size: var(--text-sm);
  -webkit-user-select: text;
  user-select: text;
}

.connections-map-search-input:focus {
  outline: none;
  border-color: rgba(30, 58, 95, 0.4);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.connections-map-zoom-controls {
  display: inline-flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.connections-map-control-btn {
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  border-color: rgba(30, 58, 95, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.connections-map-svg {
  display: block;
  width: 100%;
  min-height: 20.5rem;
  border-radius: calc(var(--radius-md) - 0.25rem);
  cursor: grab;
  touch-action: none;
}

.connections-map--panning .connections-map-svg {
  cursor: grabbing;
}

.connections-map--full .connections-map-svg {
  min-height: 34rem;
}

.graph-view .connections-map--full {
  min-height: clamp(42rem, 76vh, 56rem);
}

.graph-view .connections-map--full .connections-map-svg {
  min-height: clamp(38rem, 70vh, 52rem);
}

.connections-map-line {
  stroke: rgba(82, 92, 108, 0.2);
  stroke-width: 0.9;
  stroke-linecap: round;
  pointer-events: none;
}

.connections-map-line-hit {
  stroke: transparent;
  stroke-width: 12;
  stroke-linecap: round;
  cursor: help;
  pointer-events: stroke;
}

.connections-map-line--membership {
  stroke: rgba(138, 91, 19, 0.32);
  stroke-width: 1;
}

.connections-map-line--mention,
.connections-map-line--note_mention {
  stroke: rgba(91, 74, 135, 0.28);
}

.connections-map-line--pastoral_task {
  stroke: rgba(155, 63, 53, 0.3);
}

.connections-map-line--prayer {
  stroke: rgba(47, 107, 85, 0.3);
}

.connections-map-line--relationship {
  stroke: rgba(30, 58, 95, 0.36);
  stroke-width: 1.15;
}

.connections-map-line--muted {
  opacity: 0.18;
}

.connections-map-line--match {
  opacity: 1;
  stroke-width: 1.35;
}

.connections-map-node {
  cursor: grab;
  outline: none;
  touch-action: none;
  opacity: 1;
  transition: opacity 180ms ease;
}

.connections-map-node circle {
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 2;
  filter: drop-shadow(0 4px 8px rgba(18, 33, 52, 0.12));
  transition: transform 180ms ease, filter 180ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.connections-map-node:hover circle,
.connections-map-node:focus-visible circle {
  transform: scale(1.16);
  filter: drop-shadow(0 10px 18px rgba(18, 33, 52, 0.22));
}

.connections-map-node--dragging {
  cursor: grabbing;
}

.connections-map-node--dragging circle {
  transform: scale(1.22);
  filter: drop-shadow(0 12px 20px rgba(18, 33, 52, 0.24));
}

.connections-map-node--focus circle {
  stroke: rgba(197, 164, 126, 0.95);
  stroke-width: 5;
}

.connections-map-node--muted {
  opacity: 0.22;
}

.connections-map-node--match circle {
  filter: drop-shadow(0 10px 18px rgba(18, 33, 52, 0.2));
}

.connections-map-label {
  fill: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.connections-map-tooltip {
  position: absolute;
  z-index: 4;
  max-width: min(18rem, calc(100% - 1.5rem));
  padding: 0.44rem 0.58rem;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 0.48rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 24px rgba(18, 33, 52, 0.16);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}

.connections-map-tooltip[hidden] {
  display: none;
}

.connections-card {
  gap: var(--space-3);
}

.person-view-stack .connections-card,
.group-detail-stack .connections-card {
  padding: var(--space-4);
}

.connections-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 2.25rem;
}

.home-section .connections-card-head h2 {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  margin: 0;
  font-size: var(--text-section-title);
  line-height: 1.1;
}

button.icon-btn.connections-card-link-btn {
  flex: 0 0 auto;
  align-self: center;
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-primary);
}

.connections-card-link-icon {
  width: 1.16rem;
  height: 1.16rem;
}

button.icon-btn.connections-card-link-btn:hover:not(:disabled) {
  background: rgba(30, 58, 95, 0.08);
  color: #173151;
}

.connections-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.connections-card-summary {
  margin: 0;
}

.connections-row {
  width: 100%;
  min-width: 0;
  min-height: 4rem;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  text-align: left;
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.connections-row:hover,
.connections-row:focus-visible {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.06);
}

.connections-row-title,
.connections-row-subtitle {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.connections-row-title {
  line-height: 1.25;
}

.connections-row-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.connections-card--daily-brief {
  border-color: rgba(84, 125, 84, 0.24);
}

.notes-editor-card {
  gap: var(--space-3);
}

.notes-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.notes-editor-head h2 {
  margin: 0;
  font-size: var(--text-section-title);
}

.notes-list {
  gap: var(--space-2);
}

.notes-search-input {
  width: 100%;
  min-height: 2.8rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.notes-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.notes-tag-filter-btn {
  min-height: 1.95rem;
  width: auto;
  padding: 0.22rem 0.62rem;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: none;
}

.notes-tag-filter-btn:hover,
.notes-tag-filter-btn:focus-visible,
.notes-tag-filter-btn--active {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
}

.notes-new-btn {
  min-height: 2.4rem;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  flex: 0 0 auto;
}

.note-list-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  text-align: left;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
  cursor: pointer;
}

.note-list-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.note-list-row:hover,
.note-list-row:focus-visible,
.note-list-row--selected {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.06);
}

.note-list-row strong,
.note-list-row span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.note-list-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.note-row-preview {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 650;
}

.note-preview-paragraph {
  margin: 0;
}

.note-preview-quote,
.note-read-quote {
  margin: 0;
  white-space: pre-wrap;
  border-left: 3px solid rgba(30, 58, 95, 0.22);
  color: var(--color-text-muted);
}

.note-preview-quote {
  padding-left: var(--space-2);
}

.note-read-quote {
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  font-weight: 650;
}

.note-preview-divider,
.note-read-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(30, 58, 95, 0.16);
}

.note-preview-divider {
  margin: var(--space-1) 0;
}

.note-read-divider {
  margin: var(--space-3) 0;
}

.note-preview-list,
.note-read-list {
  margin: 0;
  padding-left: 1.2rem;
}

.note-preview-list {
  display: grid;
  gap: 0.12rem;
}

.note-preview-list--marked,
.note-read-list--marked {
  padding-left: 0;
  list-style: none;
}

.note-preview-list-item,
.note-read-list-item {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: baseline;
  column-gap: var(--space-1);
}

.note-preview-list-marker,
.note-read-list-marker {
  color: var(--color-text-muted);
  font-weight: 800;
  text-align: right;
}

.note-preview-list-text,
.note-read-list-text {
  min-width: 0;
}

.note-preview-list-item,
.note-read-list-item,
.note-preview-check-item-row,
.note-read-check-item-row {
  margin-left: calc(var(--note-list-level, 0) * 1.1rem);
}

.note-preview-checklist,
.note-read-checklist {
  padding-left: 0;
  list-style: none;
}

.note-check-item {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-2);
  max-width: 100%;
}

.note-check-marker {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  min-height: 1.1rem;
  margin-top: 0.1rem;
}

.note-check-item input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0;
  accent-color: var(--color-primary);
}

.note-row-pin-action {
  align-self: center;
  justify-self: end;
}

.note-row-pin-action-icon {
  width: 1.08rem;
  height: 1.08rem;
}

.note-row-tags,
.note-tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-1);
}

.note-meta-row {
  display: block;
  width: 100%;
  margin-top: 0.12rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.note-row-tags + .note-meta-row,
.note-tag-editor + .note-meta-row {
  margin-top: var(--space-1);
}

.note-tag-editor {
  margin-bottom: var(--space-3);
}

.note-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  padding: 0.16rem 0.46rem;
  border-radius: 999px;
  background: rgba(197, 164, 126, 0.18);
  color: var(--color-text);
  font-size: 0.74rem;
  line-height: 1.35;
}

.note-tag-chip--editable {
  padding-right: 0.24rem;
}

.note-tag-remove {
  min-width: 1.05rem;
  min-height: 1.05rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  box-shadow: none;
}

.note-tag-input {
  min-width: 7rem;
  width: 9rem;
  min-height: 1.8rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.note-read-panel,
.notes-editor {
  padding: var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.note-read-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.note-read-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.note-action-btn {
  color: var(--color-text-muted);
}

.note-action-btn--active,
.note-action-btn:hover,
.note-action-btn:focus-visible {
  color: var(--color-primary);
}

.note-action-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.note-read-body {
  display: grid;
  gap: var(--space-2);
}

.note-read-paragraph {
  margin: 0;
  white-space: pre-wrap;
}

.note-history-drawer {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(30, 58, 95, 0.1);
}

.note-history-row {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid rgba(30, 58, 95, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.46);
}

.note-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.note-toolbar-btn {
  min-width: 2.35rem;
  min-height: 2.1rem;
  width: auto;
  padding: 0.18rem 0.62rem;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 900;
  box-shadow: none;
}

.note-toolbar-btn:hover,
.note-toolbar-btn:focus-visible {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.08);
}

.notes-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.notes-editor-mode {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.notes-editor-close {
  flex: 0 0 auto;
}

.notes-editor-actions {
  justify-content: flex-start;
}

.notes-title-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-weight: 700;
}

.notes-textarea {
  min-height: 12rem;
  resize: vertical;
}

@media (max-width: 720px) {
  .connections-map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .connections-map-toolbar--zoom-only {
    align-items: flex-end;
  }

  .connections-map-search-input {
    width: 100%;
    flex-basis: auto;
  }

  .graph-view .connections-map--full {
    min-height: 38rem;
  }

  .graph-view .connections-map--full .connections-map-svg {
    min-height: 34rem;
  }

  .person-prayer-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .person-prayer-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .graph-stat-grid {
    grid-template-columns: 1fr;
  }

  .graph-edge-row {
    grid-template-columns: 1fr;
  }

  .graph-edge-endpoints {
    grid-column: auto;
  }
}

.wizard-step-chip {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.wizard-step-chip--active {
  color: var(--color-primary);
  border-color: rgba(30, 58, 95, 0.35);
  background: rgba(30, 58, 95, 0.08);
}

.import-wizard-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.8rem;
  padding: var(--space-3);
}

.import-sheet-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: var(--text-sm);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.9rem;
  padding: var(--space-3);
  background: rgba(30, 58, 95, 0.03);
}

.import-sheet-check-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.import-sheet-check input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  accent-color: var(--color-primary);
  box-shadow: none;
  flex: 0 0 auto;
}

.import-sheet-summary {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px dashed rgba(30, 58, 95, 0.24);
  border-radius: 0.7rem;
  padding: var(--space-2) var(--space-3);
}

.import-sheet-summary h4 {
  font-size: var(--text-base);
  margin-bottom: 0.35rem;
}

.import-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  min-width: 0;
}

.import-summary-list li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.import-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.import-metric {
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: rgba(30, 58, 95, 0.04);
  border-radius: 0.7rem;
  padding: var(--space-2);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-metric strong {
  display: block;
  color: var(--color-primary);
  font-size: 1rem;
}

.export-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.export-scope-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid rgba(30, 58, 95, 0.18);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  font-size: var(--text-sm);
  background: rgba(30, 58, 95, 0.03);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.export-scope-chip input {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  accent-color: var(--color-primary);
  box-shadow: none;
}

.export-scope-chip__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.export-scope-chip--active {
  border-color: rgba(30, 58, 95, 0.35);
  background: rgba(30, 58, 95, 0.09);
}

.export-selection-summary {
  margin: 0;
}

.wizard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.wizard-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.wizard-format-card {
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: rgba(30, 58, 95, 0.03);
}

.wizard-format-card--active {
  border-color: rgba(30, 58, 95, 0.38);
  background: rgba(30, 58, 95, 0.1);
  box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.08);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: flex-start;
  width: 100%;
  font-family: var(--font-sans);
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.9rem;
  background: rgba(30, 58, 95, 0.03);
}

.settings-toggle-row input {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  accent-color: var(--color-primary);
  box-shadow: none;
}

.shell-bottom-nav {
  position: fixed;
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px) + var(--shell-bottom-nav-visual-offset, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 160;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  padding: 5px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 18px 42px rgba(11, 27, 47, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 18px rgba(30, 58, 95, 0.04);
  width: min(calc(100vw - 1.8rem), 26.2rem);
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform, opacity;
  transform-origin: center bottom;
}

.shell-nav-btn {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 7px 0 5px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    padding 0.2s ease,
    font-size 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  transition: width 0.2s ease, height 0.2s ease;
}

.nav-label {
  line-height: 1;
  letter-spacing: 0.01em;
}

.shell-nav-btn--home {
  color: var(--color-primary);
}

.shell-nav-btn--home .nav-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.shell-nav-btn:hover {
  color: var(--color-primary);
  background-color: rgba(30, 58, 95, 0.05);
}

.shell-nav-btn--active {
  color: var(--color-primary);
  background-color: rgba(30, 58, 95, 0.06);
  box-shadow:
    inset 0 1px 2px rgba(11, 27, 47, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.45);
}

#app {
  padding-bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px));
}

.home-section,
.person-basic-info,
.person-milestones,
.person-meetings,
.person-confessions,
.person-prayer,
.person-extras,
.settings-section,
.meeting-form,
.setup-form,
.setup-mnemonic,
.group-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.shell-content > h1,
.shell-content > h2 {
  font-size: var(--text-page-title);
  line-height: 1.2;
  margin: 0;
}

.home-section h2,
.person-basic-info h2,
.person-milestones h2,
.person-meetings h2,
.person-confessions h2,
.person-prayer h2,
.person-extras h2,
.person-tasks h2,
.person-schedules h2,
.person-contact h2,
.import-view h2,
.export-view h2,
.help-view h2,
.log-entry-card h2 {
  font-size: var(--text-section-title);
  line-height: 1.25;
  margin: 0 0 var(--space-3) 0;
}

.home-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.home-subtitle,
.last-meeting,
.last-confession,
.group-count,
.person-how-we-met {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.48rem;
  font-size: 0.66rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-badge--upcoming {
  color: #1e3a5f;
  background: rgba(30, 58, 95, 0.09);
  border-color: rgba(30, 58, 95, 0.22);
}

.status-badge--met {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.34);
}

.status-badge--missed {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.34);
}

.person-ctas {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  padding-right: max(var(--space-2), env(safe-area-inset-right, 0px));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.person-ctas::-webkit-scrollbar {
  display: none;
}
.person-ctas button {
  flex: 0 0 auto;
}

.person-cta-btn {
  font-size: 0.92rem;
  padding: 0.6rem 0.9rem;
  min-height: 2.72rem;
}

.btn--primary,
.btn--secondary,
.modal-save-btn,
.prayer-mark-btn,
.prayer-confirm-btn {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

/* FAB — unified circular "+" button */
.new-person-btn,
.btn-new-group,
.home-quick-create-fab {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  right: var(--space-4);
  z-index: 90;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  padding: 0;
  font-size: 0;
  line-height: 0;
  background-color: var(--color-primary);
  color: var(--color-surface);
  border: none;
  font-weight: 400;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.fab-plus {
  display: inline-block;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-0.05em);
}

.new-person-btn:hover,
.btn-new-group:hover,
.home-quick-create-fab:hover {
  background-color: var(--color-primary-dark);
}

.new-person-btn:active,
.btn-new-group:active,
.home-quick-create-fab:active {
  transform: scale(0.95);
}

.btn--secondary,
.modal-cancel-btn {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--large {
  padding: var(--space-3) var(--space-5);
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.filter-help {
  display: grid;
  gap: var(--space-3);
}

.filter-help-group h3 {
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.filter-help-group ul {
  list-style: disc;
  padding-left: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.people-list,
.meeting-list,
.confession-list,
.prayer-list,
.group-list,
.member-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.person-row,
.meeting-row,
.confession-row,
.prayer-item,
.group-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

.meeting-row,
.confession-row,
.prayer-item {
  width: 100%;
  text-align: left;
}

.prayer-item {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.view-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-primary);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
}

.view-back-btn:hover {
  background: transparent;
  border: none;
  color: var(--color-primary-dark);
}

.view-back-btn:focus-visible {
  outline: none;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.view-back-icon {
  font-size: 1.2rem;
  line-height: 1;
  transform: translateY(-1px);
}

.logs-filter {
  max-width: 16rem;
  margin: 0;
}

.logs-filter-row {
  display: flex;
  align-items: center;
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.task-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 0.8rem;
  background: rgba(30, 58, 95, 0.03);
}

.task-row--with-corner-action {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding-right: 2.1rem;
}

.task-row--agenda {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  position: relative;
  padding-right: 1.9rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.task-row--agenda::after {
  content: '›';
  position: absolute;
  top: 0.9rem;
  right: 0.78rem;
  color: #8a98ab;
  font-size: 1.1rem;
  font-weight: 700;
  pointer-events: none;
}

.task-row--agenda:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 58, 95, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(30, 58, 95, 0.05) 100%);
}

.task-row--agenda .task-row-actions {
  justify-content: flex-start;
}

.task-row-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.task-row-main--link {
  cursor: pointer;
}

.task-row-actions {
  --task-row-action-height: 2.05rem;
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  max-width: 100%;
  row-gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.task-row-actions > * {
  align-self: center;
  flex: 0 0 auto;
}

.task-row-actions .calendar-link-btn,
.task-row-actions .task-status-pill,
.task-row-actions .task-mini-btn,
.task-row-actions .task-pin-btn,
.task-row-actions .task-action-icon-btn {
  min-height: var(--task-row-action-height);
  height: var(--task-row-action-height);
  margin: 0;
}

.task-row-actions .task-status-pill {
  margin-bottom: 0;
}

.task-row-actions .task-mini-btn {
  border-style: solid;
  border-width: 1px;
  gap: 0;
}

.task-row--with-corner-action .task-row-actions {
  justify-content: flex-start;
}

.icon-glyph {
  width: 0.98rem;
  height: 0.98rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.icon-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}

.btn-inline-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.tag-inline-icon {
  width: 0.78em;
  height: 0.78em;
  opacity: 0.82;
  transform: translateY(0.04em);
}

button.icon-btn,
a.icon-btn {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0.12rem;
  border: none;
  background: transparent;
  color: var(--color-primary);
  border-radius: 0.45rem;
  box-shadow: none;
  text-decoration: none;
  line-height: 1;
}

button.icon-btn:hover:not(:disabled),
a.icon-btn:hover {
  background: rgba(30, 58, 95, 0.08);
  border: none;
}

button.icon-btn:focus-visible,
a.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

button.icon-btn.icon-btn--muted,
a.icon-btn.icon-btn--muted {
  color: var(--color-text-muted);
}

button.icon-btn.icon-btn--danger,
a.icon-btn.icon-btn--danger {
  color: #dc2626;
}

button.icon-btn.icon-btn--danger:hover:not(:disabled),
a.icon-btn.icon-btn--danger:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

button.icon-btn.icon-btn--plain,
a.icon-btn.icon-btn--plain {
  min-width: 1rem;
  min-height: 1rem;
  padding: 0;
  border-radius: 0;
}

button.icon-btn.icon-btn--plain:hover:not(:disabled),
a.icon-btn.icon-btn--plain:hover {
  background: transparent;
}

.inline-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.inline-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1.1;
  color: var(--color-text-muted);
}

.inline-tag--subtle {
  border-color: rgba(30, 58, 95, 0.16);
}

.task-calendar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  min-width: 1.5rem;
  padding: 0.12rem;
  line-height: 1;
}

.calendar-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem;
  padding: 0.18rem 0.48rem;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--color-primary);
  border-color: rgba(30, 58, 95, 0.2);
  background: var(--color-surface);
}

.calendar-link-btn:hover {
  border-color: rgba(30, 58, 95, 0.34);
  background: rgba(30, 58, 95, 0.06);
}

.calendar-link-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.task-row-hint {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.task-row-hint--feedback {
  color: var(--color-danger);
}

.task-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  line-height: 1;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 999px;
  background: var(--color-surface);
}

.task-status-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.task-status-dot--open {
  background: #dc2626;
}

.task-status-dot--in-progress {
  background: #d97706;
}

.task-status-dot--done {
  background: #16a34a;
}

.task-status-select {
  width: auto;
  min-width: 0;
  height: 100%;
  border: none;
  background-color: transparent;
  padding: 0 0.9rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  box-shadow: none;
  background-position: right 0 center;
  background-size: 0.55rem 0.35rem;
}

.task-status-select:focus {
  border: none;
  box-shadow: none;
}

.task-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  background: var(--color-surface);
  border-color: rgba(30, 58, 95, 0.14);
}

.task-mini-btn--archive {
  color: var(--color-primary);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.modal-header .modal-title {
  margin: 0;
  line-height: 1.2;
}

.modal-close-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(220, 38, 38, 0.38);
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-radius: 999px;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-close-btn:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(185, 28, 28, 0.42);
}

.modal-close-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.modal-close-btn-icon {
  width: 0.9rem;
  height: 0.9rem;
}

button.task-action-icon-btn,
a.task-action-icon-btn {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0.12rem;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  box-shadow: none;
}

button.task-action-icon-btn:hover:not(:disabled),
a.task-action-icon-btn:hover {
  color: var(--color-primary);
  background: transparent;
}

.task-action-icon-btn--locked {
  opacity: 0.5;
}

.task-row-corner-action {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.task-pin-btn {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0.12rem;
  color: #64748b;
}

.task-pin-btn:hover {
  color: #475569;
}

.task-pin-btn--active {
  color: #dc2626;
}

.task-pin-btn--active:hover {
  color: #b91c1c;
}

.log-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  text-align: left;
}

.log-row-meta,
.log-row-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.log-entry-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.log-entry-card--with-corner-action {
  position: relative;
  padding-right: 2.4rem;
}

.log-entry-corner-action {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
}

.tag-description,
#login-error,
.setup-error,
.settings-status {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

#login-error,
.setup-error {
  color: var(--color-danger);
}

.mnemonic-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}


/* ---------------------------------------------------------------------------
 * Home Page & Calendar
 * --------------------------------------------------------------------------- */

.home-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

.person-row,
.log-entry-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.person-row-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}

.avatar-wrap {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-initials {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.avatar-edit {
  position: absolute;
  inset: auto 0 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(11, 27, 47, 0.72);
  color: #f8fafc;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.avatar-edit-icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

.avatar-wrap:hover .avatar-edit,
.avatar-wrap:focus-within .avatar-edit,
.avatar-wrap--edit-visible .avatar-edit {
  opacity: 1;
  transform: translateY(0);
}

.person-hero {
  position: relative;
  margin: calc(var(--space-5) * -1) calc(var(--space-4) * -1) 0;
  padding: var(--space-4) var(--space-4) var(--space-5);
  background:
    radial-gradient(120% 110% at 90% 10%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    linear-gradient(155deg, #1e3a5f 0%, #142840 100%);
  color: #f8fafc;
  border-radius: 0 0 1.25rem 1.25rem;
  box-shadow: 0 6px 14px rgba(11, 24, 40, 0.12);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.person-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.person-hero .view-back-btn {
  color: #f8fafc;
}

.person-hero .view-back-btn:hover {
  color: #ffffff;
}

.person-hero-kebab {
  position: relative;
}

.person-hero-kebab-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  transition: background-color 0.16s ease;
}

.person-hero-kebab-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.person-hero-kebab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.person-hero-kebab-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 5;
  min-width: 12rem;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  box-shadow: 0 14px 32px rgba(11, 27, 47, 0.18);
}

.person-hero-kebab-item {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0.55rem;
}

.person-hero-kebab-item:hover {
  background: var(--color-surface-soft);
}

.person-hero-kebab-item--danger {
  color: var(--color-danger);
}

.person-hero-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.person-hero-identity .avatar-wrap {
  width: 4.25rem;
  height: 4.25rem;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #f8fafc;
}

.person-hero-identity .avatar-initials {
  color: var(--color-accent-gold);
  font-size: 1.35rem;
}

.person-hero-name {
  margin: 0;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1.15;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.person-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.person-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
}

.person-hero-chip-icon {
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0.9;
}

.person-hero-contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-3);
  row-gap: 0.3rem;
  margin: 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.person-hero-contact dt {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  font-weight: 700;
  align-self: center;
}

.person-hero-contact dd {
  margin: 0;
  color: #f8fafc;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.person-hero-contact-value {
  flex: 1 1 auto;
  min-width: 0;
}

.person-hero-contact-copy {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.72);
  padding: 0.25rem;
  border-radius: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.person-hero-contact-copy:hover:not(:disabled) {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
}

.person-hero-contact-copy:disabled {
  opacity: 0.4;
  cursor: default;
}

.person-hero-contact-copy svg {
  width: 1rem;
  height: 1rem;
}

.person-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.person-hero-action {
  flex: 1 1 auto;
  min-width: 9rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
}

.person-hero-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.person-hero-action--primary {
  background: var(--color-accent-gold);
  color: #1e3a5f;
  border-color: transparent;
}

.person-hero-action--primary:hover {
  background: var(--color-accent-gold-strong);
  color: #0b1b2f;
}

.person-row-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.person-row-name {
  font-size: 1rem;
  color: var(--color-text);
}

.person-row-meta {
  font-size: 0.86rem;
  color: var(--color-text-muted);
}

.filter-help-row {
  display: flex;
  justify-content: flex-end;
}

.filter-help-trigger {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.35rem 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 999px;
}

.filter-help-trigger:hover {
  color: var(--color-primary);
  background: rgba(30, 58, 95, 0.06);
}

.filter-help-trigger:focus-visible {
  outline: 2px solid rgba(30, 58, 95, 0.4);
  outline-offset: 2px;
}

.filter-help--panel[hidden] {
  display: none;
}

.filter-help--panel {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 0.9rem;
  background: var(--color-surface-soft);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .filter-help--panel {
    grid-template-columns: 1fr 1fr;
  }
}

/* 📋 Copy Button Feedback */
.btn--sm {
  padding: 2px 6px;
  font-size: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn--sm:hover {
  background: var(--color-border);
}

.btn--sm.btn--primary {
  color: var(--color-text);
}

@media (max-width: 640px) {
  .import-preview-grid,
  .export-scope-grid,
  .wizard-format-grid {
    grid-template-columns: 1fr;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: pan-y;
}

.calendar-header-cell {
  background: var(--color-bg);
  padding: var(--space-2);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
}

.calendar-day {
  background: var(--color-surface);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day-label {
  position: relative;
  z-index: 1;
}

.calendar-day:hover {
  background: var(--color-bg);
}

.calendar-day--has-meeting {
  font-weight: 700;
  color: var(--color-primary);
}

.calendar-day--has-task {
  font-weight: 600;
}

.calendar-day-task-indicator {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #16a34a;
}

.calendar-day--has-meeting::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 7px;
  height: 7px;
  background: var(--color-primary);
  border-radius: 50%;
}

@media (min-width: 720px) {
  .calendar-day-task-indicator {
    width: 9px;
    height: 9px;
    right: 7px;
    bottom: 7px;
  }

  .calendar-day--has-meeting::after {
    width: 9px;
    height: 9px;
    bottom: 8px;
  }
}

.calendar-day--today {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.calendar-day--selected {
  background: var(--color-primary) !important;
  color: white !important;
}

.calendar-day--selected::after {
  background: white !important;
}

.calendar-day--selected::before {
  background: white !important;
}

.calendar-day--selected .calendar-day-task-indicator {
  background: white !important;
}

/* ---------------------------------------------------------------------------
 * Note Fields
 * --------------------------------------------------------------------------- */

.notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  resize: vertical;
  background: var(--color-surface);
  line-height: 1.5;
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Notes autosave frame — shared composer wrapper with a Saving/Saved/Error pill. */
.notes-autosave-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.notes-autosave-status {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 1;
  transition: opacity 0.18s ease;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

.notes-autosave-wrap[data-state="idle"] .notes-autosave-status {
  opacity: 0;
}

.notes-autosave-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--color-text-muted);
}

.notes-autosave-wrap[data-state="saving"] .notes-autosave-dot { background: #d97706; }
.notes-autosave-wrap[data-state="saved"] .notes-autosave-dot { background: #16a34a; }
.notes-autosave-wrap[data-state="error"] .notes-autosave-dot { background: #dc2626; }

.notes-autosave-wrap[data-state="error"] .notes-textarea {
  border-color: rgba(220, 38, 38, 0.48);
}

/* Standalone indicator pill (form-level, outside .notes-autosave-wrap).
   Positioned by the caller — sits inline in a row, not absolutely pinned. */
.notes-autosave-status--standalone {
  position: static;
  display: inline-flex;
  box-shadow: none;
}
.notes-autosave-status[data-state="idle"] {
  opacity: 0;
}
.notes-autosave-status[data-state="saving"] .notes-autosave-dot { background: #d97706; }
.notes-autosave-status[data-state="saved"] .notes-autosave-dot { background: #16a34a; }
.notes-autosave-status[data-state="error"] .notes-autosave-dot { background: #dc2626; }

:root[data-theme='dark'] .notes-autosave-status {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
 * Settings Redesign
 * --------------------------------------------------------------------------- */

.settings-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.identity-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.identity-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
}

.identity-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.14rem;
  width: 4rem;
  flex: 0 0 auto;
}

.identity-avatar-file-input {
  display: none;
}

.identity-avatar-edit {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.58rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.14rem;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-0.15rem);
  transition: opacity 140ms ease, transform 140ms ease, max-height 140ms ease, margin-top 140ms ease;
}

.identity-avatar-wrap:hover .identity-avatar-edit,
.identity-avatar-wrap:focus-within .identity-avatar-edit,
.identity-avatar-wrap.identity-avatar-wrap--edit-visible .identity-avatar-edit {
  max-height: 1rem;
  opacity: 1;
  margin-top: 0.14rem;
  pointer-events: auto;
  transform: translateY(0);
}

.identity-avatar-edit:hover {
  color: var(--color-text);
}

.identity-avatar-edit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.16);
  border-radius: 999px;
}

.identity-avatar-edit-icon {
  width: 0.56rem;
  height: 0.56rem;
}

:root[data-theme='dark'] .identity-avatar-edit {
  color: #cbd5e1;
}

:root[data-theme='dark'] .identity-avatar-edit:hover {
  color: #e2e8f0;
}

.identity-info {
  flex: 1;
}

.identity-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

.identity-role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.identity-handle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  opacity: 0.88;
}

.identity-handle-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.identity-admin-key {
  margin-left: auto;
  align-self: flex-start;
}

.settings-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  width: fit-content;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.22);
  background: rgba(30, 58, 95, 0.06);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
}

.settings-session-badge--verified {
  border-color: rgba(180, 130, 20, 0.45);
  background: rgba(237, 197, 79, 0.2);
  color: #755100;
}

.settings-session-badge--verified .icon-glyph {
  width: 0.78rem;
  height: 0.78rem;
  color: #b8860b;
}

.settings-audit-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.settings-audit-value {
  font-size: var(--text-base);
  color: var(--color-text);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-notifications-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-notifications-copy {
  margin: 0;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.45;
}

.settings-notifications-permission {
  margin: 0;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  opacity: 0.88;
}

.settings-notifications-permission-help {
  margin: 0;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  line-height: 1.35;
}

:root[data-theme='dark'] .settings-notifications-card {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .settings-notifications-copy {
  color: #e2e8f0;
}

:root[data-theme='dark'] .settings-notifications-permission {
  color: #cbd5e1;
  opacity: 1;
}

:root[data-theme='dark'] .settings-notifications-permission-help {
  color: #b6c4d8;
}

.settings-group-title {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  font-family: var(--font-serif);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-left: var(--space-2);
  margin-bottom: var(--space-1);
}

.settings-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: background-color 0.15s ease;
}

.settings-row--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.settings-row-action {
  justify-content: space-between;
}

.settings-row-action .stack {
  flex: 1;
}

.settings-danger-note {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.settings-danger-btn {
  white-space: nowrap;
  margin-left: auto;
}

.settings-danger-btn--icon {
  width: auto;
  min-height: 1.5rem;
  padding: 0.12rem;
  border-radius: 0.45rem;
}

.person-delete-btn {
  min-width: 2.9rem;
  min-height: 2.72rem;
  padding: 0.6rem 0.85rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.settings-danger-btn--icon .icon-glyph {
  width: 1.02rem;
  height: 1.02rem;
}

.readings-header {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
}

.readings-header h1 {
  margin: 0;
}

.readings-header-date {
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  opacity: 0.9;
}

.settings-row label {
  flex: 1;
  margin-bottom: 0;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
}

.settings-row input,
.settings-row select {
  width: auto;
  min-width: 6rem;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}

.settings-row select {
  padding-right: var(--space-6);
}

.settings-frequency-select {
  min-width: 11.5rem;
}

.settings-row input[type="time"],
.settings-row input[type="number"],
.settings-row input[type="text"],
.settings-row select {
  min-height: 2.4rem;
}

@media (max-width: 640px) {
  .settings-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .settings-row label {
    flex: none;
  }

  .settings-row input,
  .settings-row select {
    width: 100%;
    min-width: 0;
  }

  .settings-frequency-select {
    width: 100%;
    min-width: 0;
  }

  .settings-row-action {
    flex-direction: row;
    align-items: center;
  }

  .settings-row-action .stack {
    min-width: 0;
  }

}

@media (min-width: 720px) {
  .shell-bottom-nav {
    max-width: 48rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .filter-help {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------------------------
 * 12. 2026 UI Refresh
 * --------------------------------------------------------------------------- */

:root {
  --color-accent: #30c8d6;
}

body {
  background:
    radial-gradient(160% 100% at 20% 0%, #f9fafb 0%, #edf2f7 45%, #eef2f6 100%),
    var(--color-bg);
}

:root[data-theme='dark'] body {
  background:
    radial-gradient(140% 90% at 20% 0%, #1c2942 0%, #101a2b 42%, #0b1220 100%),
    var(--color-bg);
}

.auth-stage {
  min-height: 100dvh;
  padding: max(var(--space-6), env(safe-area-inset-top, 0px) + var(--space-5)) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.auth-card {
  width: min(100%, 29rem);
  max-width: 100%;
  min-width: 0;
  border-radius: 1.35rem;
  padding: clamp(1.1rem, 3vw, 1.5rem);
}

.auth-card--elevated {
  background:
    radial-gradient(130% 90% at 0% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(246, 250, 255, 0.78) 54%, rgba(240, 246, 255, 0.72) 100%),
    rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 22px 44px rgba(16, 32, 51, 0.14),
    0 6px 14px rgba(16, 32, 51, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

.auth-heading {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: #102744;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  color: #4a5d75;
  font-size: var(--text-sm);
  line-height: 1.45;
  margin-bottom: var(--space-4);
}

.auth-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 2.9rem;
  border-radius: 0.8rem;
}

.auth-primary-btn,
.auth-secondary-btn {
  width: 100%;
  min-height: 2.8rem;
  border-radius: 0.8rem;
  font-weight: 600;
}

.auth-primary-btn {
  background: linear-gradient(140deg, #1e3a5f 0%, #29588a 100%);
  color: #fff;
  border-color: transparent;
}

.auth-secondary-btn {
  background: rgba(20, 40, 64, 0.06);
  color: #1e3a5f;
  border-color: rgba(20, 40, 64, 0.12);
}

.auth-error,
#login-error,
.setup-error,
.recover-status {
  min-height: 1.2rem;
  font-size: var(--text-sm);
}

.auth-error,
#login-error,
.setup-error {
  color: var(--color-danger);
}

.login-splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(130% 90% at 25% 0%, #2c507d 0%, #1a3353 42%, #10223b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  z-index: 1500;
  opacity: 1;
  transition: opacity 0.32s ease;
}

.login-splash--fade {
  opacity: 0;
  pointer-events: none;
}

.login-splash-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.03);
}

.login-splash-badge {
  width: 5.8rem;
  height: 5.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-splash-title {
  color: #f4f8ff;
  letter-spacing: 0.02em;
}

.auth-stage--login {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.auth-stage--login.auth-stage--ready {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.auth-stage--unlock,
.auth-stage--passkey {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  animation: auth-stage-fade-in 0.24s ease-out forwards;
}

@keyframes auth-stage-fade-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-pill-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.login-brand-title {
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.05;
  color: #163252;
  text-align: center;
}

#tg-widget-slot iframe {
  border-radius: 0.9rem !important;
  box-shadow: none;
}

.dev-local-login-slot {
  width: min(100%, 22rem);
}

.dev-local-login {
  width: 100%;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(16, 32, 51, 0.08);
}

.dev-local-login-account {
  color: #4a5d75;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
}

.dev-local-login-input {
  background: rgba(255, 255, 255, 0.92);
}

.dev-local-login-submit {
  min-height: 2.65rem;
}

.setup-form,
.setup-mnemonic,
.recover-card,
.unlock-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.recover-card::before,
.unlock-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 0.2rem;
  background: linear-gradient(90deg, rgba(30, 58, 95, 0.72), rgba(44, 88, 138, 0.36), rgba(30, 58, 95, 0));
  pointer-events: none;
}

.unlock-account-context {
  margin: 0;
  padding: 0.5rem 0.68rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: linear-gradient(160deg, rgba(30, 58, 95, 0.08), rgba(30, 58, 95, 0.03));
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.unlock-forgot-link {
  align-self: flex-start;
  margin-top: var(--space-3);
  margin-left: 0.05rem;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.83rem;
  font-weight: 500;
  color: #596b84;
  text-decoration: none;
}

.unlock-forgot-link:hover {
  color: #33485f;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.unlock-forgot-link:focus-visible {
  outline: 2px solid rgba(39, 93, 149, 0.55);
  outline-offset: 2px;
  border-radius: 0.3rem;
}

.setup-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0;
}

.setup-ack {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: #334155;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.setup-ack input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: var(--color-primary);
  box-shadow: none;
  flex: 0 0 auto;
}

.prayer-item--with-corner-action {
  position: relative;
  padding-right: 2.1rem;
}

.prayer-item-corner-action {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
}

.recover-header {
  margin-bottom: var(--space-1);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(30, 58, 95, 0.12);
  min-width: 0;
  max-width: 100%;
}

.recover-step-kicker {
  margin: 0 0 0.36rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: #60728a;
}

.recover-step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  max-width: 100%;
}

.recover-form,
.recover-passphrase-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  max-width: 100%;
}

.recover-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.recover-bullet-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: #334155;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.recover-bullet-list li,
.recover-dead-end-list li {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mnemonic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.recover-word-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: #334155;
  min-width: 0;
  max-width: 100%;
}

.recover-word-input {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.recover-status {
  margin: 0;
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recover-status--info {
  color: #4a5d75;
}

.recover-status--warning {
  color: #8a5a11;
}

.recover-status--success {
  color: #166534;
}

.recover-status--error {
  color: var(--color-danger);
}

.recover-dead-end {
  margin-top: var(--space-1);
  border: 1px solid rgba(30, 58, 95, 0.14);
  background: rgba(30, 58, 95, 0.05);
  border-radius: 0.85rem;
  padding: var(--space-3);
}

.recover-dead-end-title {
  margin: 0;
  font-size: var(--text-sm);
  color: #1e3a5f;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recover-dead-end-list {
  margin: var(--space-2) 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: #334155;
  font-size: var(--text-sm);
}

.recover-new-words-grid {
  margin: 0;
  padding: var(--space-2);
  border-radius: 0.85rem;
  border: 1px solid rgba(30, 58, 95, 0.18);
  background: rgba(30, 58, 95, 0.04);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.recover-new-word {
  list-style: none;
  padding: 0.42rem 0.55rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(30, 58, 95, 0.12);
  color: #24364b;
  font-size: var(--text-sm);
}

.recover-warning {
  margin: 0;
  padding: var(--space-2);
  border-radius: 0.75rem;
  border: 1px solid rgba(180, 83, 9, 0.26);
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  color: #6b3f06;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recover-completion-copy {
  margin: 0;
  color: #334155;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 430px) {
  .recover-new-words-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.shell-bottom-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%);
}

.shell-nav-btn {
  position: relative;
  z-index: 1;
}

.shell-bottom-nav--hidden,
.shell-bottom-nav--scroll-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(135%);
  pointer-events: none;
}

.new-person-btn,
.btn-new-group,
.home-quick-create-fab {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #1f3e64 0%, #132b46 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 12px 22px rgba(11, 24, 40, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.fab-plus {
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
  display: inline-block;
  line-height: 0;
  transform: none;
}

.fab-plus::before,
.fab-plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: #f5f9ff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.fab-plus::before {
  width: 1.05rem;
  height: 0.2rem;
}

.fab-plus::after {
  width: 0.2rem;
  height: 1.05rem;
}

.quick-create-modal {
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.quick-create-modal__panel {
  width: min(100%, 34rem);
  max-height: min(90dvh, 44rem);
  border-radius: 1.05rem;
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 255, 0.68)),
    rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  overflow: hidden;
  gap: var(--space-3);
}

.quick-create-modal__header {
  gap: var(--space-1);
}

.quick-create-modal__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.25;
  color: #0f172a;
}

.quick-create-modal__helper {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  line-height: 1.4;
  color: #334155;
}

.quick-create-modal__tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 0.28rem;
  padding: 0.24rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.86);
  overflow: visible;
}

.quick-create-modal__tab {
  width: 100%;
  min-width: 0;
  min-height: 2.45rem;
  border-radius: 0.62rem;
  border: none;
  background: transparent;
  color: #475569;
  padding: 0.42rem 0.25rem;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  justify-content: center;
  gap: 0.22rem;
  white-space: nowrap;
}

.quick-create-modal__tab-icon {
  width: 0.88rem;
  height: 0.88rem;
}

@media (hover: hover) and (pointer: fine) {
  .quick-create-modal__tab:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.18);
    color: #1e293b;
  }
}

.quick-create-modal__tab--active {
  background: linear-gradient(150deg, #1f3e64 0%, #1a3659 100%);
  color: #f8fafc;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.quick-create-modal__tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(48, 200, 214, 0.36);
}

.quick-create-modal__content {
  flex: 1 1 auto;
  min-height: 16.4rem;
  border-radius: 0.88rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.76);
  padding: var(--space-3);
  overflow-y: auto;
}

.quick-create-modal__content [role='tabpanel'] {
  padding-right: 0.1rem;
}

.quick-create-modal__panel-stack {
  gap: var(--space-3);
}

.quick-create-modal__tab-form {
  gap: var(--space-3);
}

.quick-create-modal__field {
  gap: 0.3rem;
}

.quick-create-modal__field label {
  margin-bottom: 0;
}

.group-type-field {
  gap: 0.3rem;
}

.group-type-field label {
  margin-bottom: 0;
}

.group-type-field__custom {
  gap: 0.3rem;
}

.group-type-field__custom[hidden] {
  display: none;
}

.quick-create-modal__error {
  min-height: 1.1rem;
  margin: 0;
}

.quick-create-modal__tab-actions {
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.quick-create-modal__tab-cancel,
.quick-create-modal__tab-submit {
  min-height: 2.35rem;
}

.quick-create-person-picker {
  gap: var(--space-2);
}

.quick-create-person-picker__head {
  justify-content: space-between;
  gap: var(--space-2);
}

.quick-create-person-picker__head label {
  margin-bottom: 0;
}

.quick-create-person-picker__clear-btn {
  border: none;
  background: transparent;
  color: #1f3e64;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0;
}

.quick-create-person-picker__search {
  margin: 0;
}

.quick-create-person-picker__results {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-height: 10.25rem;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 0.72rem;
  padding: 0.48rem;
  background: rgba(248, 250, 252, 0.72);
}

.quick-create-person-picker__option {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  border-color: rgba(148, 163, 184, 0.36);
  border-radius: 0.62rem;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.5rem 0.62rem;
  text-align: left;
}

.quick-create-person-picker__option-copy {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.12rem;
  min-width: 0;
}

.quick-create-person-picker__option-copy strong {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
}

.quick-create-person-picker__option-icon {
  width: 0.94rem;
  height: 0.94rem;
  color: #1f3e64;
  flex: 0 0 auto;
}

.quick-create-person-picker__option--selected {
  border-color: rgba(30, 58, 95, 0.6);
  background: rgba(191, 219, 254, 0.32);
}

.quick-create-person-picker__selected {
  margin: 0;
  color: #1e3a5f;
}

.quick-create-person-picker__empty {
  gap: var(--space-2);
  border: 1px dashed rgba(148, 163, 184, 0.52);
  border-radius: 0.8rem;
  padding: var(--space-3);
  background: rgba(248, 250, 252, 0.68);
}

.quick-create-person-picker__empty-copy {
  margin: 0;
}

.quick-create-person-picker__empty-btn {
  align-self: flex-start;
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
}

.quick-create-group-members {
  gap: var(--space-2);
}

.quick-create-group-members__helper {
  margin: 0;
}

.quick-create-group-members__selected {
  margin: 0;
}

.quick-create-group-members__chip {
  border-color: rgba(30, 58, 95, 0.22);
  background: rgba(191, 219, 254, 0.16);
  color: #1e3a5f;
}

.quick-create-group-members__toggle-btn {
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 1.7rem;
  padding: 0.22rem 0.62rem;
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
}

:root[data-theme='dark'] .quick-create-modal__panel {
  border-color: rgba(148, 163, 184, 0.32);
  background:
    linear-gradient(165deg, rgba(15, 23, 42, 0.8), rgba(16, 28, 47, 0.76)),
    rgba(15, 23, 42, 0.72);
}

:root[data-theme='dark'] .quick-create-modal__title {
  color: #e2e8f0;
}

:root[data-theme='dark'] .quick-create-modal__helper {
  color: #b6c4d8;
}

:root[data-theme='dark'] .quick-create-modal__tabs {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.66);
}

:root[data-theme='dark'] .quick-create-modal__tab {
  color: #cbd5e1;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-theme='dark'] .quick-create-modal__tab:hover:not(:disabled) {
    color: #e2e8f0;
    background: rgba(143, 180, 255, 0.16);
  }
}

:root[data-theme='dark'] .quick-create-modal__content {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.58);
}

:root[data-theme='dark'] .quick-create-modal__tab-actions {
  border-top-color: rgba(148, 163, 184, 0.34);
}

:root[data-theme='dark'] .quick-create-person-picker__clear-btn {
  color: #93c5fd;
}

:root[data-theme='dark'] .quick-create-person-picker__results {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.48);
}

:root[data-theme='dark'] .quick-create-person-picker__option {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.75);
}

:root[data-theme='dark'] .quick-create-person-picker__option-copy strong {
  color: #e2e8f0;
}

:root[data-theme='dark'] .quick-create-person-picker__option--selected {
  border-color: rgba(143, 180, 255, 0.64);
  background: rgba(30, 58, 95, 0.5);
}

:root[data-theme='dark'] .quick-create-person-picker__selected {
  color: #bfdbfe;
}

:root[data-theme='dark'] .quick-create-person-picker__empty {
  border-color: rgba(148, 163, 184, 0.44);
  background: rgba(15, 23, 42, 0.52);
}

:root[data-theme='dark'] .quick-create-group-members__chip {
  border-color: rgba(143, 180, 255, 0.34);
  background: rgba(30, 58, 95, 0.44);
  color: #bfdbfe;
}

@media (max-width: 640px) {
  .quick-create-modal {
    align-items: flex-end;
    padding: var(--space-3);
  }

  .quick-create-modal__panel {
    width: 100%;
    max-height: min(90dvh, 43rem);
    border-radius: 1rem 1rem 0.9rem 0.9rem;
    padding: var(--space-3);
  }

  .quick-create-modal__tab {
    min-width: 0;
    min-height: 3rem;
    flex-direction: column;
    font-size: 0.7rem;
    padding: 0.36rem 0.12rem;
    gap: 0.18rem;
  }

  .quick-create-modal__tab-icon {
    width: 0.84rem;
    height: 0.84rem;
  }

  .quick-create-modal__content {
    min-height: 15.8rem;
    padding: var(--space-2);
  }

  .quick-create-modal__tab-actions {
    width: 100%;
    justify-content: stretch;
  }

  .quick-create-modal__tab-cancel,
  .quick-create-modal__tab-submit {
    flex: 1 1 0;
  }
}

.home-hero {
  border-radius: 1.25rem;
  padding: var(--space-5);
  background: linear-gradient(155deg, #173151 0%, #1f4068 55%, #2a537f 100%);
  color: #f8fbff;
  box-shadow: 0 16px 30px rgba(12, 29, 49, 0.28);
}

.home-hero-title {
  color: #fff;
  font-size: clamp(1.12rem, 4.3vw, 1.38rem);
  margin: 0 0 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.7rem;
}

.home-hero-subtitle {
  font-size: var(--text-sm);
  opacity: 0.9;
  margin-top: 1rem;
}

.home-metrics {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.home-metric {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.85rem;
  padding: 0.55rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.home-metric-value {
  font-size: 1rem;
  font-weight: 700;
}

.home-metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  opacity: 0.88;
}

.hero-brief {
  border-radius: var(--radius-card);
  border: 1px solid var(--hero-panel-border);
  background: var(--hero-panel-bg);
  box-shadow: var(--hero-panel-shadow);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  color: #f5f9ff;
  font-family: var(--font-sans);
}

.hero-brief-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.hero-brief-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(235, 243, 255, 0.86);
}

.hero-brief-priority-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.28);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 0.16rem 0.52rem;
}

.hero-brief-headline {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.06rem, 3.7vw, 1.34rem);
  line-height: 1.3;
  font-family: var(--font-serif);
}

.hero-brief-priority-headline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: #ffffff;
  font-size: var(--text-section-title);
  line-height: 1.25;
  font-family: var(--font-serif);
}

.hero-brief-priority-dot {
  width: 0.72rem;
  height: 0.72rem;
}

.hero-brief-banner-inline {
  display: block;
  width: 100%;
  min-height: 2rem;
  border: none;
  background: transparent;
  color: #ffffff;
  padding: 0;
  font-family: var(--font-serif);
  font-size: var(--text-section-title);
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  direction: ltr;
  unicode-bidi: plaintext;
}

.hero-brief-banner-inline::placeholder {
  color: rgba(235, 243, 255, 0.68);
}

.hero-brief-banner-inline:focus-visible {
  outline: none;
  border-radius: 0.4rem;
  box-shadow: 0 0 0 2px rgba(217, 180, 88, 0.34);
}

.hero-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
}

.hero-brief-box {
  border: 1px solid var(--hero-box-border);
  border-radius: 0.78rem;
  background: var(--hero-box-bg);
  min-height: 3.2rem;
  padding: 0.48rem 0.58rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
}

.hero-brief-box-label {
  margin: 0;
  font-size: 0.68rem;
  color: rgba(235, 243, 255, 0.86);
}

.hero-brief-box-value {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-brief-reason-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.hero-brief-reason-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--hero-signal-chip-border);
  background: var(--hero-signal-chip-bg);
  color: rgba(245, 249, 255, 0.96);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  padding: 0.14rem 0.5rem;
}

.hero-brief-focus {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.hero-brief-focus-title {
  margin: 0;
  font-size: var(--text-section-title);
  color: #ffffff;
  line-height: 1.25;
  font-family: var(--font-serif);
}

.hero-brief-focus-list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 0.22rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  color: rgba(235, 243, 255, 0.9);
  font-family: var(--font-sans);
}

.hero-brief--group .hero-brief-focus-list {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.hero-brief-support {
  margin: 0;
  color: rgba(235, 243, 255, 0.9);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.hero-brief-support--compact {
  font-size: 0.8rem;
  color: rgba(235, 243, 255, 0.82);
}

.hero-brief-spiritual-line {
  margin: 0;
  color: rgba(235, 243, 255, 0.76);
  font-size: 0.76rem;
  font-style: italic;
}

.hero-brief-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.42rem;
}

.hero-brief-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  min-height: 2.5rem;
  border-radius: 0.8rem;
  padding: 0.42rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(245, 249, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(143, 180, 255, 0.1);
}

.hero-brief-chip--metric {
  text-align: left;
}

.hero-brief-chip-title {
  color: rgba(235, 243, 255, 0.86);
  font-size: 0.68rem;
  line-height: 1.2;
}

.hero-brief-chip-value {
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.hero-brief-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.hero-brief-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  max-width: 100%;
  border-radius: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.26);
  color: #f8fafc;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hero-brief-primary-action:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.36);
}

.hero-brief-primary-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.24);
}

.hero-brief-primary-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(68vw, 18rem);
}

.hero-brief-secondary-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-brief-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 2rem;
  border-radius: 0.74rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.2);
  color: rgba(245, 249, 255, 0.96);
  padding: 0.34rem 0.56rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.hero-brief-secondary-action:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 232, 240, 0.5);
  background: rgba(15, 23, 42, 0.32);
}

.hero-brief-secondary-label {
  line-height: 1.1;
}

.hero-brief-action-icon {
  width: 0.92rem;
  height: 0.92rem;
}

.hero-brief--priority-high {
  box-shadow:
    inset 0 0 0 1px rgba(248, 113, 113, 0.26),
    0 16px 30px rgba(12, 29, 49, 0.28);
}

.hero-brief--priority-medium {
  box-shadow:
    inset 0 0 0 1px rgba(217, 180, 88, 0.34),
    0 16px 30px rgba(12, 29, 49, 0.28);
}

.hero-brief--priority-low {
  box-shadow:
    inset 0 0 0 1px rgba(74, 222, 128, 0.26),
    0 16px 30px rgba(12, 29, 49, 0.28);
}

.hero-brief--priority-high .hero-brief-chip,
.hero-brief--priority-high .hero-brief-primary-action,
.hero-brief--priority-high .hero-brief-secondary-action {
  border-color: rgba(248, 113, 113, 0.36);
}

.hero-brief--priority-medium .hero-brief-chip,
.hero-brief--priority-medium .hero-brief-primary-action,
.hero-brief--priority-medium .hero-brief-secondary-action {
  border-color: rgba(217, 180, 88, 0.42);
}

.hero-brief--priority-low .hero-brief-chip,
.hero-brief--priority-low .hero-brief-primary-action,
.hero-brief--priority-low .hero-brief-secondary-action {
  border-color: rgba(74, 222, 128, 0.34);
}

.hero-brief--group .hero-brief-chip-row {
  gap: 0.38rem;
}

.group-member-row--highlight {
  border-color: rgba(248, 113, 113, 0.42);
  background:
    linear-gradient(160deg, rgba(239, 68, 68, 0.16) 0%, rgba(143, 180, 255, 0.08) 100%);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.28);
}

.home-section--polished {
  border-color: rgba(30, 58, 95, 0.08);
  box-shadow: 0 10px 18px rgba(11, 27, 47, 0.08);
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.home-inline-link {
  border: none;
  background: transparent;
  color: var(--color-primary);
  border-radius: 0;
  width: auto;
  height: auto;
  padding: 0;
  min-height: auto;
  line-height: 1;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: none;
}

.home-section-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.people-priority-panel {
  gap: var(--space-3);
  border-color: var(--hero-panel-border);
  background: var(--hero-panel-bg);
  box-shadow: var(--hero-panel-shadow);
  color: #f5f9ff;
}

.priority-panel-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.people-priority-panel h2,
.people-priority-panel h3,
.people-priority-panel strong {
  color: #ffffff;
}

.people-priority-panel .text-muted,
.people-priority-panel .priority-reason,
.people-priority-panel .priority-movement {
  color: rgba(235, 243, 255, 0.86);
}

.people-priority-panel .btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #f5f9ff;
}

.people-priority-panel .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.home-pastoral-priority-panel .home-inline-link {
  color: #ffffff;
}

.priority-weekly-title {
  font-size: var(--text-base);
  margin: 0;
}

.priority-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.priority-count-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: rgba(30, 58, 95, 0.04);
  padding: 0.38rem 0.55rem;
  font-size: 0.78rem;
}

.priority-count-chip strong {
  color: var(--color-text);
}

.people-priority-panel .priority-count-chip {
  border-color: var(--priority-card-item-border);
  background: var(--priority-card-item-bg);
  color: rgba(245, 249, 255, 0.96);
}

.people-priority-panel .priority-count-chip strong {
  color: #ffffff;
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.priority-row {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: stretch;
  padding: 0.78rem 0.82rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(30, 58, 95, 0.03);
}

.priority-row:hover {
  border-color: rgba(30, 58, 95, 0.22);
  background: rgba(30, 58, 95, 0.06);
}

.people-priority-panel .priority-row {
  border-color: var(--priority-card-row-border);
  background: var(--priority-card-row-bg);
  color: #f5f9ff;
}

.people-priority-panel .priority-row:hover {
  border-color: var(--priority-card-row-hover-border);
  background: var(--priority-card-row-hover-bg);
}

.people-priority-panel .priority-badge {
  color: #ffffff;
}

.priority-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: var(--color-surface);
  padding: 0.2rem 0.52rem;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.priority-badge--high {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
}

.priority-badge--medium {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.08);
}

.priority-badge--low {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.08);
}

.priority-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.priority-dot--high {
  background: #dc2626;
}

.priority-dot--medium {
  background: #d97706;
}

.priority-dot--low {
  background: #16a34a;
}

.priority-reason,
.priority-movement,
.priority-summary-note {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.priority-movement {
  font-size: 0.78rem;
}

.priority-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.priority-names-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.priority-names-box {
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: 0.75rem;
  background: rgba(30, 58, 95, 0.05);
  padding: 0.5rem 0.6rem;
  min-height: 3.75rem;
}

.priority-names-marker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.25rem;
}

.priority-names-marker .priority-dot {
  width: 0.52rem;
  height: 0.52rem;
}

.priority-names-label {
  margin: 0 0 0.18rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.priority-names-value {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.people-priority-panel .priority-names-box {
  border-color: var(--priority-card-item-border);
  background: var(--priority-card-item-bg);
}

.people-priority-panel .priority-names-label,
.people-priority-panel .priority-names-value {
  color: #ffffff;
}

.priority-summary-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 0.75rem;
  background: rgba(30, 58, 95, 0.04);
  padding: 0.5rem 0.55rem;
  font-size: 0.78rem;
}

.home-pastoral-priority-panel .priority-summary-pill {
  border-color: var(--priority-card-item-border);
  background: var(--priority-card-item-bg);
  color: rgba(245, 249, 255, 0.96);
}

.home-pastoral-priority-panel .priority-count,
.home-pastoral-priority-panel .priority-summary-note {
  color: #ffffff;
}

.home-pastoral-priority-panel .priority-names-box {
  border-color: var(--priority-card-item-border);
  background: var(--priority-card-item-bg);
}

.home-pastoral-priority-panel .priority-names-label,
.home-pastoral-priority-panel .priority-names-value {
  color: #ffffff;
}

.priority-count {
  color: var(--color-text);
}

.person-page-header {
  gap: var(--space-4);
  margin: 0;
  align-items: center;
  background: #1e3a5f;
  border: 1px solid #1e3a5f;
  border-radius: 0;
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-sm);
}

.person-header-title {
  font-size: var(--text-page-title);
  line-height: 1.2;
  color: #f8fafc;
}

.person-page-header .view-back-btn {
  color: #f8fafc;
}

.person-page-header .view-back-btn:hover {
  color: #e2e8f0;
}

.person-page-header .view-back-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.45);
}

.calendar-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.calendar-nav-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  padding: 0;
  min-height: 1.9rem;
  background: rgba(30, 58, 95, 0.06);
  border: 1px solid rgba(30, 58, 95, 0.12);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
}

.calendar-month-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1b3658;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 720px) {
  .calendar-month-label {
    font-size: 1.1rem;
  }
}

.calendar-day--empty {
  cursor: default;
  background: transparent;
}

.home-row {
  background: rgba(30, 58, 95, 0.03);
  border: 1px solid rgba(30, 58, 95, 0.07);
  border-radius: 0.8rem;
  padding: 0.7rem 0.8rem;
}

.home-row--with-corner-action {
  position: relative;
  padding-right: 2.1rem;
}

.person-prayer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.person-prayer-intention {
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.35;
}

.person-prayer-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
}

.person-prayer-action-btn {
  flex: 0 0 auto;
  min-height: 2.15rem;
  padding: 0.34rem 0.62rem;
  border-color: rgba(30, 58, 95, 0.14);
  background: rgba(30, 58, 95, 0.06);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  box-shadow: none;
  white-space: nowrap;
}

.person-prayer-action-btn:hover:not(:disabled) {
  background: rgba(30, 58, 95, 0.1);
  border-color: rgba(30, 58, 95, 0.22);
}

.person-prayer-edit-btn {
  position: static;
  flex: 0 0 auto;
}

.schedule-row {
  display: grid;
  gap: 0.4rem;
}

.schedule-row-export {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.schedule-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.schedule-row-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 520px) {
  .priority-count-grid,
  .priority-summary-grid,
  .priority-names-grid {
    grid-template-columns: 1fr;
  }

  .hero-brief-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-brief-primary-label {
    max-width: 100%;
  }

  .task-row {
    flex-direction: column;
    align-items: stretch;
  }

  .task-row-actions {
    justify-content: flex-start;
  }

  .calendar-export-modal {
    align-items: flex-end;
    padding: var(--space-3);
  }

  .calendar-export-modal__panel {
    width: 100%;
    border-radius: var(--radius-md);
    padding: var(--space-3);
  }

  .calendar-export-modal__actions {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 420px) {
  .hero-brief-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-brief-primary-action {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-brief-secondary-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-brief-chip-row {
    grid-template-columns: 1fr;
  }
}

:root {
  --color-accent-gold: #c9971a;
  --color-accent-gold-strong: #a77f13;
  --color-accent-gold-soft: #f3e3b4;
  --color-accent-gold-border: #e2c36b;
}

.shell-nav-btn--faith {
  color: var(--color-accent-gold-strong);
}

.shell-nav-btn--faith:hover,
.shell-nav-btn--faith.shell-nav-btn--active {
  color: var(--color-accent-gold-strong);
  background: rgba(201, 151, 26, 0.16);
}

.faith-view {
  gap: var(--space-4);
}

.faith-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
}

.faith-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.faith-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.faith-tab-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.faith-tab:hover {
  color: var(--color-primary);
}

.faith-tab--active {
  background: var(--color-primary);
  color: var(--color-surface);
  box-shadow: 0 2px 6px rgba(11, 27, 47, 0.18);
}

.faith-tab--active:hover {
  color: var(--color-surface);
}

.faith-tab:focus-visible {
  outline: 2px solid rgba(30, 58, 95, 0.4);
  outline-offset: 2px;
}

.faith-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faith-overview {
  display: grid;
  gap: var(--space-3);
}

.faith-summary-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: inherit;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.faith-summary-card:hover {
  background: var(--color-surface-soft);
  border-color: rgba(30, 58, 95, 0.18);
  box-shadow:
    0 4px 10px rgba(11, 27, 47, 0.06),
    inset 0 0 0 1px rgba(30, 58, 95, 0.04);
}

.faith-summary-card:focus-visible {
  outline: 2px solid rgba(30, 58, 95, 0.4);
  outline-offset: 2px;
}

.faith-summary-card:active {
  background: var(--color-surface-soft);
}

.faith-summary-title {
  font-size: 1.02rem;
  margin: 0;
  color: var(--color-primary);
}

.faith-summary-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-3);
  row-gap: 0.2rem;
  margin: 0;
  font-size: 0.88rem;
}

.faith-summary-meta dt {
  color: var(--color-text-muted);
  font-weight: 500;
}

.faith-summary-meta dd {
  margin: 0;
  color: var(--color-text);
}

.faith-summary-quote {
  color: var(--color-text-muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme='dark'] .faith-tabs {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme='dark'] .faith-tab {
  color: #cbd5e1;
}

:root[data-theme='dark'] .faith-tab--active {
  background: rgba(30, 58, 95, 0.95);
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .faith-summary-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

:root[data-theme='dark'] .faith-summary-card:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.32);
}

:root[data-theme='dark'] .faith-summary-title {
  color: #f8fafc;
}

.group-card-add-member-btn {
  width: auto;
  min-height: 1.5rem;
  padding: 0.12rem;
  border-radius: 0.45rem;
  border: none;
  background: transparent;
  color: var(--color-primary);
  line-height: 1;
  flex: 0 0 auto;
  box-shadow: none;
  transition: color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.group-card-add-member-btn:hover {
  color: var(--color-accent-gold-strong);
  background: rgba(30, 58, 95, 0.08);
  transform: translateY(-1px);
}

.group-member-check-actions {
  justify-content: space-between;
  gap: var(--space-2);
}

.group-member-checklist {
  display: grid;
  gap: 0.35rem;
  max-height: min(45dvh, 21rem);
  overflow-y: auto;
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: 0.85rem;
  padding: 0.35rem;
  background: rgba(30, 58, 95, 0.03);
}

.group-member-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: 0.7rem;
  padding: 0.5rem 0.55rem;
  margin: 0;
  cursor: pointer;
}

.group-member-check:hover {
  background: rgba(30, 58, 95, 0.08);
}

.group-member-check-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 auto;
}

.group-member-check-name {
  font-weight: 600;
  color: var(--color-text);
}

.group-member-check-contact {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.group-member-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  margin: 0.12rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  accent-color: var(--color-primary);
  box-shadow: none;
  flex: 0 0 auto;
}

.home-calendar-section {
  border-color: rgba(201, 151, 26, 0.48);
  background: linear-gradient(170deg, rgba(255, 249, 235, 0.86) 0%, rgba(255, 255, 255, 0.98) 28%, #ffffff 100%);
  box-shadow:
    0 8px 16px -8px rgba(20, 28, 40, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.home-calendar-section .home-section-head h2 {
  color: var(--color-accent-gold-strong);
}

.home-calendar-section .calendar-grid {
  border-color: rgba(201, 151, 26, 0.32);
  background: rgba(201, 151, 26, 0.28);
}

.home-calendar-section .calendar-header-cell {
  background: #fcf3d8;
  color: #735610;
}

.home-calendar-section .calendar-nav-btn {
  border-color: rgba(201, 151, 26, 0.44);
  color: #7a5a0f;
  background: rgba(255, 246, 221, 0.9);
}

.calendar-day--has-confession {
  color: #7a5a0f;
  background: rgba(201, 151, 26, 0.12);
}

.calendar-day--has-confession::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-accent-gold);
}

@media (min-width: 720px) {
  .calendar-day--has-confession::after {
    width: 9px;
    height: 9px;
    top: 7px;
    right: 7px;
  }
}

.calendar-day--has-birthday {
  border: 1px solid rgba(219, 39, 119, 0.38);
  background: rgba(236, 72, 153, 0.11);
}

.calendar-day--has-birthday::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #db2777;
}

@media (min-width: 720px) {
  .calendar-day--has-birthday::before {
    width: 9px;
    height: 9px;
    top: 7px;
    left: 7px;
  }
}

.calendar-day--has-sacrament {
  border: 1px solid rgba(124, 58, 237, 0.38);
  background: rgba(139, 92, 246, 0.11);
}

.calendar-day--has-sacrament::before {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7c3aed;
}

@media (min-width: 720px) {
  .calendar-day--has-sacrament::before {
    width: 9px;
    height: 9px;
    bottom: 7px;
    left: 7px;
  }
}

.home-row--sacrament {
  border-color: rgba(124, 58, 237, 0.28);
  background: rgba(139, 92, 246, 0.08);
}

.home-row--confession {
  border-color: rgba(201, 151, 26, 0.35);
  background: rgba(243, 227, 180, 0.3);
}

.home-row--birthday {
  border: 1px solid rgba(219, 39, 119, 0.28);
  background: rgba(253, 242, 248, 0.88);
  border-radius: 0.75rem;
  padding: 0.62rem 0.72rem;
}

/* Home screen refinement overrides */
.shell-nav-btn {
  padding: 6px 0 5px;
  font-size: 0.65rem;
}

.hero-brief {
  padding: 1.05rem;
  gap: 0.82rem;
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(217, 180, 88, 0.18), transparent 30%),
    var(--hero-panel-bg);
}

.hero-brief-head {
  gap: 0.55rem;
  max-width: 100%;
}

.hero-brief-kicker-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.42rem;
  width: 100%;
  min-width: 0;
}

.hero-brief-kicker-row .hero-brief-eyebrow {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-brief-kicker-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(217, 180, 88, 0.14);
}

.hero-brief-banner-inline {
  max-width: 100%;
  min-width: 0;
  min-height: auto;
  font-size: clamp(1.12rem, 4vw, 1.46rem);
}

.hero-brief-context {
  display: grid;
  gap: 0.14rem;
}

.hero-brief-context-title {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.34;
  font-family: var(--font-serif);
}

.hero-brief-context-meta {
  margin: 0;
  color: rgba(235, 243, 255, 0.8);
  font-size: 0.73rem;
  line-height: 1.35;
}

.hero-brief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.hero-brief-box {
  min-height: 4rem;
  padding: 0.56rem 0.5rem;
  border-radius: 0.92rem;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-rows: minmax(1.85rem, auto) auto;
  align-content: start;
  gap: 0.28rem;
}

.hero-brief-box-label {
  display: block;
  min-height: 1.85rem;
  font-size: 0.63rem;
  letter-spacing: 0.04em;
  line-height: 1.28;
}

.hero-brief-box-value {
  align-self: end;
  font-size: 1.08rem;
  line-height: 0.95;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.hero-brief-reason-chip {
  background: rgba(15, 23, 42, 0.22);
}

.hero-brief-focus {
  gap: 0.5rem;
  margin-top: 0;
  padding-top: 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-brief-focus-title {
  font-size: 1.02rem;
}

.hero-brief-focus-list {
  gap: 0.34rem;
  font-size: 0.82rem;
}

.hero-brief-primary-action {
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.34);
}

.home-section--polished {
  padding: 0.92rem 0.95rem 0.98rem;
  border-radius: 1.08rem;
  box-shadow: 0 12px 24px rgba(11, 27, 47, 0.08);
}

.home-section-head {
  margin-bottom: 0.72rem;
  gap: 0.75rem;
  align-items: flex-start;
}

.home-section-heading-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
}

.home-section-heading-wrap h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.home-section-heading-accent {
  width: 0.18rem;
  height: 1.1rem;
  border-radius: 999px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, var(--color-primary) 0%, rgba(30, 58, 95, 0.34) 100%);
}

.home-section-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.home-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.14);
  background: rgba(30, 58, 95, 0.05);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.home-inline-link {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-primary);
  padding: 0;
  min-height: auto;
  line-height: 1;
  font-size: 0.94rem;
  font-weight: 700;
  box-shadow: none;
  transition: color 0.16s ease;
}

.home-inline-link:hover {
  transform: none;
  background: transparent;
  border-color: transparent;
  color: var(--color-primary-dark);
}

.home-section-body {
  gap: 0.72rem;
}

.home-row {
  padding: 0.76rem 0.82rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(30, 58, 95, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(30, 58, 95, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

button.home-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.home-row strong {
  display: block;
  line-height: 1.28;
}

.home-row .home-subtitle {
  display: block;
  text-align: left;
}

.home-row--link {
  position: relative;
  padding-right: 1.9rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.home-row--link::after {
  content: '›';
  position: absolute;
  top: 50%;
  right: 0.78rem;
  transform: translateY(-52%);
  color: #8a98ab;
  font-size: 1.1rem;
  font-weight: 700;
}

.home-row--link:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 58, 95, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(30, 58, 95, 0.05) 100%);
}

.home-subtitle {
  line-height: 1.35;
}

.task-row {
  padding: 0.76rem 0.82rem;
  border-radius: 0.9rem;
  border-color: rgba(30, 58, 95, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(30, 58, 95, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.task-row-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  column-gap: 0.55rem;
  row-gap: 0.22rem;
}

.task-row-title {
  display: block;
  flex: 0 1 auto;
  line-height: 1.15;
  font-size: 0.98rem;
}

.task-due-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: 0 0 auto;
  min-height: 1.3rem;
  padding: 0.08rem 0.44rem;
  margin-top: -0.03rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(30, 58, 95, 0.05);
  color: var(--color-primary);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.task-due-badge--today {
  border-color: rgba(217, 180, 88, 0.44);
  background: rgba(243, 227, 180, 0.48);
  color: #7a5a0f;
}

.task-due-badge--overdue {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(254, 226, 226, 0.78);
  color: #991b1b;
}

.home-needs-attention-section .home-section-heading-accent {
  background: linear-gradient(180deg, #ef4444 0%, rgba(239, 68, 68, 0.28) 100%);
}

.home-needs-attention-section .home-section-count {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(254, 226, 226, 0.86);
  color: #991b1b;
}

.home-pinned-tasks-section .home-section-heading-accent,
.home-calendar-section .home-section-heading-accent {
  background: linear-gradient(180deg, #c9971a 0%, rgba(201, 151, 26, 0.28) 100%);
}

.home-pinned-tasks-section .home-section-count,
.home-calendar-section .home-section-count {
  border-color: rgba(201, 151, 26, 0.28);
  background: rgba(243, 227, 180, 0.5);
  color: #7a5a0f;
}

@media (max-width: 520px) {
  .hero-brief-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .hero-brief-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.confession-view,
.confession-log-view,
.tasks-view,
.logs-view,
.resources-view,
.resources-manage-view,
.ai-access-manage-view,
.admin-hub-view {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}

.confession-page-header {
  border: 1px solid rgba(201, 151, 26, 0.3);
  background: linear-gradient(160deg, rgba(201, 151, 26, 0.14), rgba(255, 255, 255, 0.95));
  border-radius: 0.95rem;
  padding: var(--space-3);
}

.confession-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0.9rem;
  padding: var(--space-3);
}

.confession-card--summary {
  border-color: rgba(201, 151, 26, 0.34);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px rgba(201, 151, 26, 0.16);
}

.confession-card input,
.confession-card textarea,
.confession-card select {
  border: 1.5px solid var(--color-border);
  background-color: var(--color-surface);
}

.confession-card input:focus,
.confession-card textarea:focus,
.confession-card select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.confession-guidance-list {
  display: grid;
  gap: var(--space-3);
}

.confession-guidance-item {
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 0.75rem;
  padding: 0.72rem 0.82rem;
  background: var(--color-surface);
  display: grid;
  gap: 0.38rem;
}

.confession-guidance-next-label {
  margin: 0;
}

.confession-guidance-item--action {
  color: inherit;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

.confession-guidance-item--action:hover {
  background: rgba(30, 58, 95, 0.06);
  border-color: rgba(30, 58, 95, 0.26);
}

.confession-guidance-item--action:active {
  background: rgba(30, 58, 95, 0.1);
  border-color: rgba(30, 58, 95, 0.34);
  transform: translateY(1px);
}

.confession-guidance-item--action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.16);
}

.confession-guidance-source {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.25;
  color: #7a828f;
  font-style: italic;
}

.confession-guidance-source a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.confession-recent-list,
.confession-log-list {
  display: grid;
  gap: var(--space-2);
}

.confession-recent-row,
.confession-log-row {
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: 0.8rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
  background: var(--color-surface);
}

.resources-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.resources-admin-lock {
  width: auto;
  min-height: 1.5rem;
  padding: 0.12rem;
}

.resources-admin-lock:hover {
  background: rgba(30, 58, 95, 0.08);
}

.resources-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(30, 58, 95, 0.2);
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  background: #fff;
  color: var(--color-primary);
  font-size: 0.8rem;
}

.resource-chip--active {
  border-color: var(--color-accent-gold-border);
  background: var(--color-accent-gold-soft);
  color: #664d10;
}

.resource-category-row {
  display: flex;
  align-items: center;
}

.resource-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(30, 58, 95, 0.22);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
}

.resources-list {
  display: grid;
  gap: var(--space-3);
}

.resource-card {
  position: relative;
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 0.9rem;
  padding: var(--space-3);
  padding-top: 2.2rem;
  background: #fff;
  display: grid;
  gap: var(--space-2);
  overflow: hidden;
}

.resource-color-flag {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.4rem;
  border-radius: 0.9rem 0.9rem 0 0;
}

.resource-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.resource-icon-btn {
  width: auto;
  min-height: 1.5rem;
  min-width: 1.5rem;
  padding: 0.12rem;
  border-radius: 0.45rem;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: none;
}

.resource-icon-btn:not(.icon-btn--plain):hover {
  background: rgba(30, 58, 95, 0.06);
}

.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resource-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid rgba(30, 58, 95, 0.22);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.1;
}

.resource-tag--clickable,
.resource-tag-chip {
  cursor: pointer;
}

.resource-tag--clickable:hover,
.resource-tag-chip:hover {
  transform: translateY(-1px);
}

.resource-tag--active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.resources-tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resources-manage-list {
  display: grid;
  gap: var(--space-3);
}

.ai-access-manage-list {
  display: grid;
  gap: var(--space-2);
}

.ai-access-manage-global.settings-row-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-2);
  align-items: flex-start;
}

.ai-access-manage-global .ai-access-switch {
  justify-self: end;
  align-self: flex-start;
  margin-top: 0;
}

.ai-access-manage-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.58rem;
  margin-top: 0.24rem;
  margin-bottom: 0.42rem;
}

.ai-access-filter-search,
.ai-access-filter-select {
  width: 100%;
  min-height: 2.2rem;
}

.ai-access-manage-row {
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.8rem;
  padding: 0.62rem 0.72rem;
  background: rgba(30, 58, 95, 0.03);
  gap: var(--space-2);
}

.ai-access-user-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.ai-access-expiry-controls {
  width: 100%;
  align-items: center;
  gap: var(--space-2);
}

.ai-access-expiry-label {
  white-space: nowrap;
  flex: 0 0 auto;
}

.ai-access-expiry-input {
  min-width: 9rem;
  max-width: 13.5rem;
  flex: 0 1 10.5rem;
  min-height: 2rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.92rem;
}

.ai-access-preset-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  flex: 0 0 auto;
}

.ai-access-preset-btn {
  min-width: 2.7rem;
  min-height: 1.9rem;
  padding: 0 0.45rem;
  border-radius: 0.58rem;
  border: 1px solid rgba(30, 58, 95, 0.2);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.92rem;
  line-height: 1;
  font-weight: 600;
}

.ai-access-preset-btn:disabled {
  opacity: 0.55;
}

.ai-access-expiry-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  flex: 0 0 auto;
}

.admin-hub-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.admin-hub-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  touch-action: pan-y;
}

.admin-hub-tab {
  appearance: none;
  width: auto;
  min-height: 2.4rem;
  padding: 0.56rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: rgba(30, 58, 95, 0.05);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .admin-hub-tab:hover {
    border-color: rgba(30, 58, 95, 0.28);
    background: rgba(30, 58, 95, 0.09);
  }
}

.admin-hub-tab--active,
.admin-hub-tab--active:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-surface);
  box-shadow: 0 8px 20px rgba(30, 58, 95, 0.18);
}

.admin-hub-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.admin-hub-tab-icon svg {
  width: 1rem;
  height: 1rem;
}

.admin-user-list,
.admin-notice-grid,
.admin-notice-list,
.admin-policy-grid,
.admin-policy-list,
.admin-audit-list {
  display: grid;
  gap: var(--space-3);
}

.admin-user-card,
.admin-notice-editor-card,
.admin-notice-list-card,
.admin-notice-row,
.admin-policy-card,
.admin-policy-row,
.admin-audit-row {
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.9rem;
  background: rgba(30, 58, 95, 0.03);
  padding: var(--space-3);
}

.admin-user-card-header,
.admin-user-action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.admin-user-action-row {
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: 999px;
  padding: 0.14rem 0.52rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
}

.admin-user-badge--locked,
.admin-user-badge--self {
  border-color: rgba(30, 58, 95, 0.24);
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
}

.admin-user-badge--danger {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(185, 28, 28, 0.08);
  color: var(--color-danger);
}

.admin-user-badge--accent {
  border-color: rgba(217, 180, 88, 0.34);
  background: rgba(217, 180, 88, 0.16);
  color: #775813;
}

.admin-user-badge--ok {
  border-color: rgba(22, 101, 52, 0.26);
  background: rgba(22, 101, 52, 0.08);
  color: #166534;
}

.admin-user-badge--warn {
  border-color: rgba(146, 64, 14, 0.24);
  background: rgba(146, 64, 14, 0.08);
  color: #92400e;
}

.admin-user-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.admin-user-summary-card {
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.75rem;
  background: var(--color-surface);
  padding: 0.72rem 0.8rem;
}

.admin-capability-grid {
  display: grid;
  gap: 0.55rem;
}

.admin-capability-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.68rem;
  align-items: flex-start;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.75rem;
  background: var(--color-surface);
  padding: 0.62rem 0.72rem;
}

.admin-capability-option > span,
.admin-user-kick-toggle > span {
  min-width: 0;
}

.admin-capability-option input {
  margin-top: 0.2rem;
}

.admin-native-checkbox {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  accent-color: var(--color-primary);
  flex: 0 0 1rem;
  align-self: flex-start;
}

.admin-user-reason-input {
  width: 100%;
}

.admin-user-kick-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 0.68rem;
  margin: 0;
}

.admin-user-kick-toggle .admin-native-checkbox {
  margin-top: 0.18rem;
}

.admin-notice-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.admin-notice-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
  gap: var(--space-3);
  align-items: start;
}

.admin-notice-form {
  min-width: 0;
}

.admin-notice-body {
  min-height: 7.5rem;
}

.admin-notice-expiry-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  min-height: 1.75rem;
  margin: 0;
}

.admin-notice-expiry-toggle .admin-native-checkbox {
  align-self: center;
}

.admin-notice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.admin-notice-row-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
}

.admin-notice-link-summary {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-notice-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-notice-row-action {
  min-height: 2rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.16);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.admin-notice-row-action:hover,
.admin-notice-row-action:focus-visible {
  border-color: rgba(30, 58, 95, 0.28);
  background: rgba(30, 58, 95, 0.08);
}

.admin-notice-row-action--danger {
  color: var(--color-danger);
  border-color: rgba(185, 28, 28, 0.18);
}

.admin-notice-row-action--danger:hover,
.admin-notice-row-action--danger:focus-visible {
  border-color: rgba(185, 28, 28, 0.3);
  background: rgba(185, 28, 28, 0.08);
}

.admin-notice-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.admin-notice-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(30, 58, 95, 0.16);
  border-radius: 999px;
  padding: 0.14rem 0.52rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
}

.admin-notice-badge--locked {
  border-color: rgba(30, 58, 95, 0.24);
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
}

.admin-notice-badge--accent {
  border-color: rgba(217, 180, 88, 0.34);
  background: rgba(217, 180, 88, 0.16);
  color: #775813;
}

.admin-notice-badge--ok {
  border-color: rgba(22, 101, 52, 0.26);
  background: rgba(22, 101, 52, 0.08);
  color: #166534;
}

.admin-notice-badge--warn {
  border-color: rgba(146, 64, 14, 0.24);
  background: rgba(146, 64, 14, 0.08);
  color: #92400e;
}

.admin-notice-badge--danger {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(185, 28, 28, 0.08);
  color: var(--color-danger);
}

.admin-notice-preview {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.admin-notice-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.admin-notice-preview-shell {
  display: grid;
  gap: var(--space-2);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.8rem;
  background: var(--color-surface);
  padding: var(--space-3);
}

.admin-notice-preview-shell--banner {
  border-left: 0.25rem solid var(--color-primary);
}

.admin-notice-preview-title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.2;
}

.app-notice-banner {
  margin: 0 var(--space-4) var(--space-3);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.9rem;
  background: rgba(30, 58, 95, 0.03);
  padding: var(--space-3);
}

.app-notice-banner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.app-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.app-notice-actions--stacked {
  flex-direction: column;
}

.app-notice-actions--stacked button {
  width: 100%;
}

.app-notice-modal-panel {
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 1rem;
}

.app-notice-gate .auth-card {
  width: min(100%, 32rem);
}

.app-notice-gate-window {
  margin: 0;
}

.admin-audit-payload {
  display: block;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 0.7rem;
  background: var(--color-surface);
  padding: 0.62rem 0.72rem;
  color: var(--color-text);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (min-width: 860px) {
  .ai-access-manage-filters {
    grid-template-columns: minmax(0, 1fr) 11.5rem 11.5rem;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .ai-access-manage-global.settings-row-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
  }

  .ai-access-user-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .ai-access-expiry-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.42rem;
  }

  .ai-access-user-main .ai-access-switch {
    justify-self: end;
    align-self: flex-start;
  }

  .ai-access-expiry-label {
    margin: 0;
  }

  .ai-access-expiry-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
  }

  .ai-access-preset-actions {
    flex-wrap: wrap;
    gap: 0.32rem;
  }

  .ai-access-expiry-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .admin-user-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-user-badges {
    justify-content: flex-start;
  }

  .admin-user-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-notice-two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-notice-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-notice-badges {
    justify-content: flex-start;
  }

  .admin-notice-row-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-notice-row-actions {
    justify-content: flex-start;
  }

  .app-notice-banner {
    margin-left: var(--space-3);
    margin-right: var(--space-3);
  }

  .app-notice-banner-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

.ai-access-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ai-access-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.ai-access-switch-track {
  width: 3.2rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.2);
  background: #d1d5db;
  padding: 0.16rem;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.ai-access-switch-thumb {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
  transition: transform 0.16s ease;
}

.ai-access-switch-input:checked + .ai-access-switch-track {
  background: #2e8b57;
  border-color: #2e8b57;
}

.ai-access-switch-input:checked + .ai-access-switch-track .ai-access-switch-thumb {
  transform: translateX(1.26rem);
}

.ai-access-switch-input:focus-visible + .ai-access-switch-track {
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.22);
}

.ai-access-switch-input:disabled + .ai-access-switch-track {
  opacity: 0.58;
  cursor: not-allowed;
}

.resources-manage-card {
  border: 1px solid rgba(30, 58, 95, 0.15);
  border-radius: 0.9rem;
  padding: var(--space-3);
  background: rgba(30, 58, 95, 0.03);
}

.resources-manage-published {
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: fit-content;
}

.resources-manage-published input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  appearance: auto;
  accent-color: var(--color-primary);
  box-shadow: none;
  flex: 0 0 auto;
}

.resources-manage-actions {
  justify-content: flex-end;
  gap: 0.25rem;
}

.resources-manage-action-btn {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0.12rem;
}

.resources-manage-tag-entry {
  align-items: center;
  gap: 0.35rem;
}

.resources-manage-tag-entry input {
  flex: 1 1 auto;
}

.resources-manage-tag-list {
  display: grid;
  gap: 0.35rem;
}

.resources-manage-tag-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10.5rem, 12.25rem) auto;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(30, 58, 95, 0.18);
  border-radius: 0.78rem;
  padding: 0.36rem 0.4rem 0.36rem 0.62rem;
}

.resources-manage-tag-name {
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.resources-manage-tag-item select {
  min-width: 10.5rem;
  font-size: 0.78rem;
  min-height: 2rem;
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
}

@media (max-width: 640px) {
  .resources-manage-tag-item {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 0.72rem;
  }

  .resources-manage-tag-item select {
    min-width: 0;
    width: 100%;
  }
}

.search-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.search-selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.search-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(30, 58, 95, 0.24);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
}

.search-selected-pill:hover {
  transform: translateY(-1px);
}

.search-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(30, 58, 95, 0.2);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  background: rgba(30, 58, 95, 0.05);
  color: var(--color-primary);
}

.search-tag-chip:hover {
  transform: translateY(-1px);
}

.search-tag-chip--active {
  box-shadow: inset 0 0 0 1px currentColor;
}

:root[data-theme='dark'] .shell-header {
  background-color: var(--color-header-bg);
}

:root[data-theme='dark'] .shell-ptr-indicator {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(17, 26, 43, 0.9);
}

:root[data-theme='dark'] .shell-ptr-indicator--armed {
  border-color: rgba(143, 180, 255, 0.68);
}

:root[data-theme='dark'] .shell-ptr-ring {
  background: conic-gradient(
    #8fb4ff calc(var(--ptr-progress) * 1turn),
    rgba(148, 163, 184, 0.28) 0
  );
}

:root[data-theme='dark'] input:not([type='checkbox']):not([type='radio']):not(.hero-brief-banner-inline),
:root[data-theme='dark'] textarea,
:root[data-theme='dark'] select:not(.task-status-select) {
  color: var(--color-text);
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color-scheme: dark;
}

:root[data-theme='dark'] input::placeholder,
:root[data-theme='dark'] textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.92;
}

:root[data-theme='dark'] select:not(.task-status-select) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
}

:root[data-theme='dark'] .shell-menu-toggle:hover,
:root[data-theme='dark'] .shell-theme-toggle:hover,
:root[data-theme='dark'] .shell-ai-toggle:hover,
:root[data-theme='dark'] .shell-search-toggle:hover {
  background: rgba(143, 180, 255, 0.16);
}

:root[data-theme='dark'] .shell-menu-panel {
  background: #0f1a2b;
}

:root[data-theme='dark'] .shell-search-panel {
  background:
    linear-gradient(165deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.66)),
    rgba(15, 23, 42, 0.58);
  border-color: rgba(143, 180, 255, 0.38);
  box-shadow:
    0 24px 56px -30px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(191, 219, 254, 0.18);
}

:root[data-theme='dark'] .shell-search-composer {
  background: transparent;
  border-color: transparent;
}

:root[data-theme='dark'] .shell-search-shortcut {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(143, 180, 255, 0.35);
}

:root[data-theme='dark'] .shell-search-result:hover,
:root[data-theme='dark'] .shell-search-result--active {
  background: rgba(143, 180, 255, 0.18);
}

:root[data-theme='dark'] .shell-search-result-kind {
  border-color: rgba(143, 180, 255, 0.4);
  color: #dbeafe;
}

:root[data-theme='dark'] .shell-ai-panel {
  background:
    linear-gradient(165deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.66)),
    rgba(15, 23, 42, 0.58);
  border-color: rgba(143, 180, 255, 0.38);
  box-shadow:
    0 24px 56px -30px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(191, 219, 254, 0.18);
}

:root[data-theme='dark'] .ai-chat-transcript {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.64), rgba(15, 23, 42, 0.54)),
    rgba(15, 23, 42, 0.44);
  border-color: rgba(143, 180, 255, 0.3);
}

:root[data-theme='dark'] .ai-chat-message--assistant,
:root[data-theme='dark'] .ai-chat-message--system {
  background: rgba(30, 41, 59, 0.74);
  border-color: rgba(143, 180, 255, 0.26);
}

:root[data-theme='dark'] .ai-chat-message--user {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(147, 197, 253, 0.36);
}

:root[data-theme='dark'] .ai-chat-clear-btn {
  border-color: rgba(143, 180, 255, 0.45);
  background: rgba(15, 23, 42, 0.54);
  color: #e6efff;
}

:root[data-theme='dark'] .ai-chat-clear-btn:hover:not(:disabled) {
  border-color: rgba(191, 219, 254, 0.75);
  background: rgba(30, 41, 59, 0.72);
}

:root[data-theme='dark'] .ai-chat-close-btn {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.2);
}

:root[data-theme='dark'] .ai-chat-close-btn:hover {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.28);
  border-color: rgba(252, 165, 165, 0.62);
}

:root[data-theme='dark'] .ai-chat-close-btn:focus-visible,
:root[data-theme='dark'] .ai-chat-send-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(143, 180, 255, 0.3);
}

:root[data-theme='dark'] .ai-chat-confirm-card {
  background: rgba(127, 29, 29, 0.24);
  border-color: rgba(248, 113, 113, 0.42);
}

:root[data-theme='dark'] .ai-chat-confirm-btn:hover {
  border-color: rgba(143, 180, 255, 0.55);
  background: rgba(143, 180, 255, 0.14);
}

:root[data-theme='dark'] .ai-chat-body a {
  color: #8fb4ff;
}

:root[data-theme='dark'] .ai-chat-body code {
  background: rgba(143, 180, 255, 0.14);
  border-color: rgba(143, 180, 255, 0.28);
}

:root[data-theme='dark'] .ai-chat-code {
  background: rgba(143, 180, 255, 0.12);
  border-color: rgba(143, 180, 255, 0.24);
}

:root[data-theme='dark'] .shell-menu-item:hover {
  background: rgba(143, 180, 255, 0.14);
}

:root[data-theme='dark'] .shell-menu-about-toggle:hover {
  background: rgba(143, 180, 255, 0.14);
}

:root[data-theme='dark'] .shell-menu-about {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .shell-menu-about-copy--technical {
  color: #dce8ff;
}

:root[data-theme='dark'] .shell-menu-about-cta {
  border-color: rgba(143, 180, 255, 0.34);
  background: rgba(143, 180, 255, 0.12);
  color: #dce8ff;
}

:root[data-theme='dark'] .shell-menu-about-cta:hover {
  background: rgba(143, 180, 255, 0.2);
}

:root[data-theme='dark'] .shell-sync-indicator--synced {
  color: #86efac;
}

:root[data-theme='dark'] .shell-sync-indicator--syncing {
  color: #bfdbfe;
}

:root[data-theme='dark'] .shell-sync-indicator--unsynced {
  color: #fcd34d;
}

:root[data-theme='dark'] .shell-sync-indicator--offline {
  color: #cbd5e1;
}

:root[data-theme='dark'] .person-page-header {
  background: #1e3a5f;
  border-color: #1e3a5f;
}

:root[data-theme='dark'] .person-header-title,
:root[data-theme='dark'] .person-page-header .view-back-btn {
  color: #f8fafc;
}

:root[data-theme='dark'] .person-page-header .view-back-btn:hover {
  color: #e2e8f0;
}

:root[data-theme='dark'] .shell-bottom-nav {
  background: rgba(14, 22, 38, 0.52);
  border-color: rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 18px 42px rgba(2, 6, 14, 0.6),
    inset 0 1px 0 rgba(148, 163, 184, 0.18),
    inset 0 -10px 18px rgba(2, 6, 14, 0.25);
}

:root[data-theme='dark'] .shell-bottom-nav::before {
  background:
    radial-gradient(circle at top left, rgba(148, 180, 220, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(148, 180, 220, 0.08), transparent 50%);
}

:root[data-theme='dark'] .shell-nav-btn:hover {
  background-color: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .shell-nav-btn--active {
  background-color: rgba(143, 180, 255, 0.1);
  box-shadow:
    inset 0 1px 2px rgba(2, 6, 14, 0.35),
    inset 0 -1px 0 rgba(148, 180, 220, 0.12);
}

:root[data-theme='dark'] .wizard-hero {
  border-color: rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(circle at top right, rgba(201, 151, 26, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(143, 180, 255, 0.12), rgba(17, 26, 43, 0.94));
}

:root[data-theme='dark'] .wizard-hero--import {
  background:
    radial-gradient(circle at top right, rgba(84, 125, 84, 0.22), transparent 33%),
    linear-gradient(145deg, rgba(143, 180, 255, 0.1), rgba(17, 26, 43, 0.94));
}

:root[data-theme='dark'] .wizard-hero--export {
  background:
    radial-gradient(circle at top right, rgba(196, 133, 79, 0.22), transparent 33%),
    linear-gradient(145deg, rgba(143, 180, 255, 0.1), rgba(17, 26, 43, 0.94));
}

:root[data-theme='dark'] .hero-brief {
  border-color: var(--hero-panel-border);
  background: var(--hero-panel-bg);
  box-shadow: var(--hero-panel-shadow);
}

:root[data-theme='dark'] .hero-brief-headline {
  color: #e6efff;
}

:root[data-theme='dark'] .hero-brief-priority-headline {
  color: #ffffff;
}

:root[data-theme='dark'] .hero-brief-support {
  color: #c4d2e7;
}

:root[data-theme='dark'] .hero-brief-support--compact,
:root[data-theme='dark'] .hero-brief-spiritual-line,
:root[data-theme='dark'] .hero-brief-eyebrow {
  color: #a7b7cf;
}

:root[data-theme='dark'] .hero-brief-priority-badge,
:root[data-theme='dark'] .hero-brief-banner-inline,
:root[data-theme='dark'] .hero-brief-chip,
:root[data-theme='dark'] .hero-brief-primary-action,
:root[data-theme='dark'] .hero-brief-secondary-action {
  border-color: rgba(148, 163, 184, 0.38);
}

:root[data-theme='dark'] .hero-brief-banner-inline {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-color: transparent;
  color: #e6efff;
  caret-color: #ffffff;
  color-scheme: normal;
}

:root[data-theme='dark'] .hero-brief-focus-title,
:root[data-theme='dark'] .hero-brief-focus-list,
:root[data-theme='dark'] .hero-brief-box-label {
  color: #c4d2e7;
}

:root[data-theme='dark'] .hero-brief-focus-title,
:root[data-theme='dark'] .hero-brief-banner-inline {
  color: #ffffff;
}

:root[data-theme='dark'] .group-member-row--highlight {
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34);
}

:root[data-theme='dark'] .import-wizard-section,
:root[data-theme='dark'] .import-sheet-check,
:root[data-theme='dark'] .import-sheet-summary,
:root[data-theme='dark'] .import-metric,
:root[data-theme='dark'] .export-scope-chip,
:root[data-theme='dark'] .wizard-format-card,
:root[data-theme='dark'] .graph-section,
:root[data-theme='dark'] .connections-card,
:root[data-theme='dark'] .notes-editor-card,
:root[data-theme='dark'] .settings-toggle-row,
:root[data-theme='dark'] .task-row,
:root[data-theme='dark'] .home-row,
:root[data-theme='dark'] .confession-card,
:root[data-theme='dark'] .resources-manage-card {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .connections-map {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at 50% 42%, rgba(143, 180, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.58));
}

:root[data-theme='dark'] .btn-primary {
  color: #f8fafc;
}

:root[data-theme='dark'] .connections-map-search-input,
:root[data-theme='dark'] .connections-map-control-btn {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.76);
  color: var(--color-text);
}

:root[data-theme='dark'] .connections-map-control-btn {
  color: #dbeafe;
}

:root[data-theme='dark'] .connections-map-search-input:focus {
  border-color: rgba(143, 180, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(143, 180, 255, 0.18);
}

:root[data-theme='dark'] button.icon-btn.connections-card-link-btn {
  border-color: transparent;
  background: transparent;
  color: #dbeafe;
}

:root[data-theme='dark'] button.icon-btn.connections-card-link-btn:hover:not(:disabled) {
  background: rgba(143, 180, 255, 0.16);
  color: #eff6ff;
}

:root[data-theme='dark'] .connections-map-label {
  fill: #e5edf8;
  stroke: rgba(15, 23, 42, 0.96);
}

:root[data-theme='dark'] .connections-map-tooltip {
  border-color: rgba(143, 180, 255, 0.28);
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
}

:root[data-theme='dark'] .note-list-row,
:root[data-theme='dark'] .note-read-panel,
:root[data-theme='dark'] .notes-editor,
:root[data-theme='dark'] .note-history-row {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.54);
}

:root[data-theme='dark'] .notes-search-input,
:root[data-theme='dark'] .notes-title-input,
:root[data-theme='dark'] .note-tag-input,
:root[data-theme='dark'] .notes-textarea {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
}

:root[data-theme='dark'] .note-list-row:hover,
:root[data-theme='dark'] .note-list-row:focus-visible,
:root[data-theme='dark'] .note-list-row--selected {
  border-color: rgba(143, 180, 255, 0.46);
  background: rgba(143, 180, 255, 0.12);
}

:root[data-theme='dark'] .note-tag-chip {
  background: rgba(197, 164, 126, 0.18);
  color: #f8fafc;
}

:root[data-theme='dark'] .note-row-pin-action {
  color: #dbeafe;
}

:root[data-theme='dark'] .notes-tag-filter-btn {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.56);
  color: #cbd5e1;
}

:root[data-theme='dark'] .notes-tag-filter-btn:hover,
:root[data-theme='dark'] .notes-tag-filter-btn:focus-visible,
:root[data-theme='dark'] .notes-tag-filter-btn--active {
  border-color: rgba(143, 180, 255, 0.46);
  background: rgba(143, 180, 255, 0.14);
  color: #dbeafe;
}

:root[data-theme='dark'] .note-toolbar-btn {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.56);
  color: #dbeafe;
}

:root[data-theme='dark'] .note-toolbar-btn:hover,
:root[data-theme='dark'] .note-toolbar-btn:focus-visible {
  border-color: rgba(143, 180, 255, 0.46);
  background: rgba(143, 180, 255, 0.14);
}

:root[data-theme='dark'] .note-preview-quote,
:root[data-theme='dark'] .note-read-quote {
  border-left-color: rgba(143, 180, 255, 0.42);
  color: #cbd5e1;
}

:root[data-theme='dark'] .note-preview-divider,
:root[data-theme='dark'] .note-read-divider {
  border-top-color: rgba(148, 163, 184, 0.28);
}

:root[data-theme='dark'] .note-history-drawer {
  border-top-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme='dark'] .person-prayer-action-btn {
  border-color: rgba(143, 180, 255, 0.3);
  background: rgba(143, 180, 255, 0.12);
  color: #dbeafe;
}

:root[data-theme='dark'] .person-prayer-action-btn:hover:not(:disabled) {
  background: rgba(143, 180, 255, 0.18);
  border-color: rgba(143, 180, 255, 0.46);
}

:root[data-theme='dark'] .ai-access-manage-row,
:root[data-theme='dark'] .ai-access-manage-global.settings-row-action {
  border-color: rgba(250, 204, 21, 0.62);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.22);
}

:root[data-theme='dark'] .admin-user-card,
:root[data-theme='dark'] .admin-notice-editor-card,
:root[data-theme='dark'] .admin-notice-list-card,
:root[data-theme='dark'] .admin-notice-row,
:root[data-theme='dark'] .admin-notice-preview-shell,
:root[data-theme='dark'] .admin-policy-card,
:root[data-theme='dark'] .admin-policy-row,
:root[data-theme='dark'] .admin-audit-row,
:root[data-theme='dark'] .admin-user-summary-card,
:root[data-theme='dark'] .admin-capability-option,
:root[data-theme='dark'] .admin-audit-payload {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .app-notice-banner,
:root[data-theme='dark'] .app-notice-modal-panel {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .admin-hub-tab {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.08);
  color: #dbe7ff;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-theme='dark'] .admin-hub-tab:hover {
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(143, 180, 255, 0.14);
  }
}

:root[data-theme='dark'] .admin-hub-tab--active,
:root[data-theme='dark'] .admin-hub-tab--active:hover {
  border-color: rgba(143, 180, 255, 0.76);
  background: rgba(56, 101, 186, 0.92);
  color: #f8fbff;
}

:root[data-theme='dark'] .auth-card--elevated {
  background:
    radial-gradient(130% 90% at 0% 0%, rgba(33, 49, 74, 0.92) 0%, rgba(17, 26, 43, 0.94) 58%, rgba(17, 26, 43, 0.98) 100%),
    rgba(17, 26, 43, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow:
    0 22px 42px rgba(2, 6, 14, 0.74),
    inset 0 1px 0 rgba(148, 163, 184, 0.14);
}

:root[data-theme='dark'] .auth-heading,
:root[data-theme='dark'] .login-brand-title {
  color: #e6efff;
}

:root[data-theme='dark'] .auth-subtitle,
:root[data-theme='dark'] .setup-ack,
:root[data-theme='dark'] .recover-word-field {
  color: #b6c4d8;
}

:root[data-theme='dark'] .dev-local-login {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(17, 26, 43, 0.82);
  box-shadow: 0 18px 34px rgba(2, 6, 14, 0.52);
}

:root[data-theme='dark'] .dev-local-login-account {
  color: #c1d0e5;
}

:root[data-theme='dark'] .dev-local-login-input {
  background: rgba(11, 18, 32, 0.78);
  color: #f8fbff;
  border-color: rgba(148, 163, 184, 0.32);
}

:root[data-theme='dark'] .recover-card::before,
:root[data-theme='dark'] .unlock-card::before {
  background: linear-gradient(90deg, rgba(143, 180, 255, 0.66), rgba(143, 180, 255, 0.32), rgba(143, 180, 255, 0));
}

:root[data-theme='dark'] .unlock-account-context {
  border-color: rgba(148, 163, 184, 0.26);
  background: linear-gradient(160deg, rgba(143, 180, 255, 0.12), rgba(143, 180, 255, 0.06));
  color: #c1d0e5;
}

:root[data-theme='dark'] .unlock-forgot-link {
  color: #9fb3cf;
}

:root[data-theme='dark'] .unlock-forgot-link:hover {
  color: #c8d8ee;
}

:root[data-theme='dark'] .recover-step-kicker {
  color: #96abc7;
}

:root[data-theme='dark'] .recover-header {
  border-bottom-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme='dark'] .recover-bullet-list,
:root[data-theme='dark'] .recover-dead-end-list,
:root[data-theme='dark'] .recover-completion-copy {
  color: #c1d0e5;
}

:root[data-theme='dark'] .recover-status--info {
  color: #b6c4d8;
}

:root[data-theme='dark'] .recover-status--warning {
  color: #f9d89b;
}

:root[data-theme='dark'] .recover-status--success {
  color: #86efac;
}

:root[data-theme='dark'] .recover-dead-end {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(143, 180, 255, 0.09);
}

:root[data-theme='dark'] .recover-dead-end-title {
  color: #d9e5f7;
}

:root[data-theme='dark'] .recover-new-words-grid {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(143, 180, 255, 0.1);
}

:root[data-theme='dark'] .recover-new-word {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(17, 26, 43, 0.88);
  color: #e0eaff;
}

:root[data-theme='dark'] .recover-warning {
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
}

:root[data-theme='dark'] .auth-secondary-btn {
  background: rgba(143, 180, 255, 0.14);
  color: #dce8ff;
  border-color: rgba(143, 180, 255, 0.24);
}

:root[data-theme='dark'] .status-badge--upcoming {
  color: #cfe0ff;
  background: rgba(143, 180, 255, 0.16);
  border-color: rgba(143, 180, 255, 0.38);
}

:root[data-theme='dark'] .status-badge--met {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
}

:root[data-theme='dark'] .status-badge--missed {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.44);
}

:root[data-theme='dark'] .calendar-month-label {
  color: #cbd5e1;
}

:root[data-theme='dark'] .home-calendar-section {
  border-color: rgba(217, 180, 88, 0.5);
  background: linear-gradient(165deg, rgba(217, 180, 88, 0.2) 0%, rgba(17, 26, 43, 0.95) 38%, rgba(17, 26, 43, 0.98) 100%);
}

:root[data-theme='dark'] .home-calendar-section .calendar-grid {
  border-color: rgba(217, 180, 88, 0.36);
  background: rgba(217, 180, 88, 0.28);
}

:root[data-theme='dark'] .home-calendar-section .calendar-header-cell {
  background: rgba(217, 180, 88, 0.2);
  color: #f7e7bc;
}

:root[data-theme='dark'] .home-calendar-section .calendar-nav-btn {
  border-color: rgba(217, 180, 88, 0.46);
  color: #f8e7bb;
  background: rgba(217, 180, 88, 0.18);
}

:root[data-theme='dark'] .home-row--confession,
:root[data-theme='dark'] .calendar-day--has-confession {
  border-color: rgba(217, 180, 88, 0.42);
  background: rgba(217, 180, 88, 0.18);
}

:root[data-theme='dark'] .home-row--birthday,
:root[data-theme='dark'] .calendar-day--has-birthday {
  border-color: rgba(244, 114, 182, 0.42);
  background: rgba(236, 72, 153, 0.18);
}

:root[data-theme='dark'] .calendar-day--has-birthday::before {
  background: #f472b6;
}

:root[data-theme='dark'] .home-row--sacrament,
:root[data-theme='dark'] .calendar-day--has-sacrament {
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(139, 92, 246, 0.18);
}

:root[data-theme='dark'] .calendar-day--has-sacrament::before {
  background: #a78bfa;
}

:root[data-theme='dark'] .calendar-day-task-indicator {
  background: #4ade80;
}

:root[data-theme='dark'] .hero-brief {
  background:
    radial-gradient(circle at top right, rgba(217, 180, 88, 0.18), transparent 32%),
    var(--hero-panel-bg);
}

:root[data-theme='dark'] .hero-brief-kicker-dot {
  box-shadow: 0 0 0 3px rgba(217, 180, 88, 0.16);
}

:root[data-theme='dark'] .hero-brief-context-meta,
:root[data-theme='dark'] .hero-brief-box-label {
  color: #b7c6da;
}

:root[data-theme='dark'] .home-section--polished {
  box-shadow: 0 18px 30px rgba(2, 6, 14, 0.38);
}

:root[data-theme='dark'] .home-section-count {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(143, 180, 255, 0.12);
  color: #dce8ff;
}

:root[data-theme='dark'] .home-inline-link {
  color: #dce8ff;
}

:root[data-theme='dark'] .home-row--link::after {
  color: #9fb3cf;
}

:root[data-theme='dark'] .task-due-badge {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(143, 180, 255, 0.12);
  color: #dce8ff;
}

:root[data-theme='dark'] .task-due-badge--today,
:root[data-theme='dark'] .home-pinned-tasks-section .home-section-count,
:root[data-theme='dark'] .home-calendar-section .home-section-count {
  border-color: rgba(217, 180, 88, 0.44);
  background: rgba(217, 180, 88, 0.2);
  color: #f6e3ab;
}

:root[data-theme='dark'] .task-due-badge--overdue,
:root[data-theme='dark'] .home-needs-attention-section .home-section-count {
  border-color: rgba(248, 113, 113, 0.44);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

:root[data-theme='dark'] .confession-recent-row,
:root[data-theme='dark'] .confession-log-row,
:root[data-theme='dark'] .resource-chip,
:root[data-theme='dark'] .resource-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

:root[data-theme='dark'] .group-card-add-member-btn {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}

:root[data-theme='dark'] .group-member-checklist {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(143, 180, 255, 0.08);
}

:root[data-theme='dark'] .group-member-check:hover {
  background: rgba(143, 180, 255, 0.14);
}

:root[data-theme='dark'] .resource-chip--active {
  color: #ffe7a4;
}

:root[data-theme='dark'] .confession-page-header {
  border-color: rgba(217, 180, 88, 0.42);
  background: linear-gradient(160deg, rgba(217, 180, 88, 0.2), rgba(17, 26, 43, 0.96));
}

:root[data-theme='dark'] .confession-card input:focus,
:root[data-theme='dark'] .confession-card textarea:focus,
:root[data-theme='dark'] .confession-card select:focus {
  box-shadow: 0 0 0 3px rgba(143, 180, 255, 0.2);
}

:root[data-theme='dark'] .confession-guidance-item--action:hover {
  background: rgba(143, 180, 255, 0.14);
  border-color: rgba(143, 180, 255, 0.32);
}

:root[data-theme='dark'] .confession-guidance-item--action:active {
  background: rgba(143, 180, 255, 0.2);
  border-color: rgba(143, 180, 255, 0.42);
}

:root[data-theme='dark'] .confession-guidance-item--action:focus-visible {
  box-shadow: 0 0 0 3px rgba(143, 180, 255, 0.26);
}

:root[data-theme='dark'] .resources-admin-lock {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* ==========================================================================
   Priority signal drawer (person detail)
   Compact row: "Priority Signal {flag}" — flag color encodes the level.
   Users may close the drawer even when a signal is active; the flag on the
   handle is a sufficient visual indicator.
   ========================================================================== */

.priority-signal-drawer-section {
  margin: 0 0 var(--space-3);
}

.priority-signal-drawer {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface);
  overflow: hidden;
}

.priority-signal-drawer-handle {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text);
  width: 100%;
  min-height: 48px;
  padding: 0.5rem var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background-color 0.14s ease;
}

.priority-signal-drawer-handle:hover {
  background: rgba(30, 58, 95, 0.04);
}

.priority-signal-drawer-handle:focus-visible {
  outline: 2px solid var(--color-accent, #1e3a5f);
  outline-offset: -2px;
}

.priority-signal-drawer-label {
  color: var(--color-text);
  white-space: nowrap;
}

.priority-signal-drawer-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  transition: color 0.14s ease;
}

.priority-signal-drawer-flag--none {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.priority-signal-drawer-flag--high {
  color: #dc2626;
}

.priority-signal-drawer-flag--medium {
  color: #d97706;
}

.priority-signal-drawer-flag--low {
  color: #16a34a;
}

.priority-signal-drawer-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 var(--space-4);
  transition: max-height 0.24s ease, opacity 0.18s ease, padding 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid transparent;
}

.priority-signal-drawer--open .priority-signal-drawer-body {
  max-height: 640px;
  opacity: 1;
  padding: var(--space-3) var(--space-4) var(--space-3);
  border-top-color: var(--color-border);
}

.priority-signal-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.priority-signal-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

.priority-signal-level-select,
.priority-signal-expires {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.priority-signal-reason {
  min-height: 3.75rem;
}

.priority-signal-error:empty {
  display: none;
}

:root[data-theme='dark'] .priority-signal-drawer {
  background: var(--color-surface);
  border-color: var(--color-border);
}
:root[data-theme='dark'] .priority-signal-drawer-handle:hover {
  background: rgba(248, 250, 252, 0.04);
}
