:root {
  --pastel: #9ccbcc;
  --pastel-soft: #e9f4f4;
  --pastel-deep: #6fabac;
  --coral-black: #515a6a;
  --coral-deep: #3f4653;
  --gray: #e4e7ec;
  --canvas: #f5f7f8;
  --surface: #ffffff;
  --border: #dce1e4;
  --muted: #6f7883;
  --alert: #c0453e;
  --alert-soft: #f7e6e4;
  --success: #5b9d7a;
  --radius: 14px;
  --radius-input: 10px;
  --shadow: 0 2px 10px rgba(60, 70, 83, 0.08);
  --font-sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
}

body {
  background: var(--canvas);
  color: var(--coral-black);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: 900px;
  padding-bottom: 40px;
}

h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 28px;
  line-height: 1.15;
  color: var(--coral-deep);
  margin: 0 0 12px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--coral-black);
  border-bottom: none;
  box-shadow: var(--shadow);
}
.app-header .app-brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  color: #fff;
}
.app-header .app-nav a {
  margin-left: 1.1rem;
  font-size: 15px;
  text-decoration: none;
  color: #fff;
  opacity: 0.82;
}
.app-header .app-nav a:hover {
  opacity: 1;
}

.section-title {
  margin: 22px 2px 8px;
}

h3.section-title,
.section-title > h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.045em;
  line-height: 1.15;
  color: var(--coral-deep);
}

.section-title > h3 {
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-body {
  padding: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-input);
  border: 1.5px solid transparent;
}
.btn[disabled], .btn:disabled {
  opacity: 0.5;
}

.btn-primary {
  background-color: var(--coral-black);
  border-color: var(--coral-black);
  color: #fff;
}
.btn-primary:hover, .btn-primary:active {
  background-color: var(--coral-deep);
  border-color: var(--coral-deep);
  color: #fff;
}

.btn-secondary {
  background-color: var(--surface);
  border-color: var(--coral-black);
  color: var(--coral-deep);
}
.btn-secondary:hover, .btn-secondary:active {
  background-color: var(--pastel-soft);
  border-color: var(--coral-black);
  color: var(--coral-deep);
}

.form-control {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 16px;
  color: var(--coral-black);
}
.form-control:focus {
  outline: 2px solid var(--coral-black);
  outline-offset: 0;
  border-color: var(--coral-black);
  box-shadow: none;
}
.form-control:disabled {
  background: var(--canvas);
  color: var(--muted);
}

.field-label,
form > label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 14px 0 6px;
  color: var(--coral-black);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.25rem 0 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--coral-black);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.chip.is-checked {
  background: var(--pastel);
  border-color: var(--pastel);
  color: var(--coral-deep);
  font-weight: 700;
}

.other-text {
  margin: 0.5rem 0;
}

.goal-row {
  padding: 12px;
  margin-bottom: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
}

.goal-track {
  margin-bottom: 0.75rem;
}

.goal-hist {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.search-bar {
  margin: 1rem 0;
}

.client-list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.list-item:hover {
  background: var(--pastel-soft);
}
.list-item:last-child {
  border-bottom: none;
}
.list-item strong {
  color: var(--coral-deep);
}

.meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.empty-state {
  padding: 1.75rem 0.5rem;
  text-align: center;
  color: var(--muted);
}

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

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--gray);
  color: var(--muted);
}
.badge.badge-ok {
  background: var(--pastel-soft);
  color: var(--coral-deep);
}
.badge.badge-draft {
  background: var(--gray);
  color: var(--muted);
}
.badge.badge-risk {
  background: var(--alert-soft);
  color: var(--alert);
}

.note-type-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.note-type-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.note-type-card:hover {
  background: var(--pastel-soft);
  border-color: var(--pastel);
}
.note-type-card strong {
  color: var(--coral-deep);
  font-size: 16px;
}
.note-type-card span {
  color: var(--muted);
  font-size: 13px;
}

.note-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.risk-banner {
  margin: 0.75rem 0;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-input);
  border: 1px solid var(--alert);
  background: var(--alert-soft);
  color: var(--alert);
  font-weight: 700;
}

.save-indicator {
  font-size: 13px;
  color: var(--muted);
  background: var(--pastel-soft);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.text-danger {
  color: var(--alert) !important;
}

.text-success {
  color: var(--success) !important;
}

.auth-page {
  min-height: 100vh;
  background: var(--canvas);
  padding: 24px;
}

.auth-card {
  max-width: 400px;
  width: 100%;
  padding: 8px;
}
.auth-card .card-body {
  padding: 28px 24px;
}
.auth-card p {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.auth-card .form-control {
  margin-bottom: 12px;
}
.auth-card .btn {
  width: 100%;
  margin-top: 6px;
}

.wordmark {
  text-align: center;
  line-height: 1;
  margin: 0 0 6px;
}

.wordmark-smart {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.04em;
  color: var(--coral-black);
}

.wordmark-brain {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 36px;
  color: var(--pastel-deep);
  margin-left: 6px;
}

.wordmark-sub {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 8px;
}

.offline-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--coral-black);
  box-shadow: 0 -2px 10px rgba(60, 70, 83, 0.15);
}

.print-header {
  margin-bottom: 1rem;
}
.print-header p {
  margin: 0.15rem 0;
}

.print-field {
  margin: 0.5rem 0;
}

@media print {
  .no-print,
.app-header,
.offline-banner,
.btn {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card {
    box-shadow: none;
    border: none;
    margin: 0;
  }
  .print-header {
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }
  .print-header h1 {
    color: #000;
  }
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.slider-row:last-child {
  border-bottom: none;
}
.slider-row .field-label {
  flex: 1;
  margin: 0;
}
.slider-row input[type=range] {
  flex: 0 0 40%;
  accent-color: var(--pastel-deep);
}

.slider-val {
  min-width: 1.6rem;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scorebox .card-body {
  gap: 1rem;
}

.scorebox-total {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.03em;
  color: var(--coral-black);
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--pastel-soft);
  border-radius: var(--radius-input);
  padding: 0.5rem 0.7rem;
  margin: 0.5rem 0;
}

.tool-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.ref-list > *,
.ref-block {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.ref-list > *:last-child,
.ref-block:last-child {
  border-bottom: none;
}

.ref-block ol {
  margin: 0.25rem 0 0 1.1rem;
}

.intake-page {
  max-width: 720px;
}

.doc-card .card-body {
  padding-bottom: 12px;
}

.doc-name {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--coral-deep);
  margin: 0 0 10px;
}

.doc-required {
  color: var(--pastel-deep);
}

.doc-body {
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--pastel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 14px;
  line-height: 1.5;
}
.doc-body .doc-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--pastel-deep);
  margin: 14px 0 4px;
}
.doc-body .doc-heading:first-child {
  margin-top: 0;
}
.doc-body .doc-para {
  margin: 0 0 8px;
}
.doc-body .doc-bullet {
  margin: 0 0 4px;
  padding-left: 14px;
}

.doc-accept {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}
.doc-accept input {
  margin-top: 0.25rem;
}

.intake-url {
  word-break: break-all;
  color: var(--pastel-deep);
}

.homework-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.homework-row:last-child {
  border-bottom: none;
}
.homework-row .badge {
  margin-left: 8px;
}

.homework-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.homework-answers {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--pastel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
}

.answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 4px 0;
}

.answer-label {
  font-weight: 700;
  color: var(--muted);
  min-width: 140px;
}

.answer-value {
  color: var(--coral-black);
}

.fee-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.fee-row .form-control {
  flex: 1 1 130px;
  margin: 0;
}
.fee-row .btn {
  flex: 0 0 auto;
}

.fee-row-new {
  border-bottom: none;
  margin-top: 6px;
}

.fee-notify {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.fee-notify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.fee-notify-row label {
  margin: 0;
  font-weight: 700;
  color: var(--coral-deep);
}
.fee-notify-row .form-control {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.fee-notice-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-input);
  border: 1px solid var(--pastel);
  background: var(--pastel-soft);
}
.fee-notice-banner strong {
  color: var(--coral-deep);
}

.fee-notice-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.fee-notice-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.fee-notice-line {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.fee-notice-line:last-child {
  border-bottom: none;
}

@media (max-width: 900px) {
  .fee-row .form-control {
    flex-basis: 100%;
  }
}
.btn {
  white-space: nowrap;
}

.app-header .app-brand {
  display: flex;
  align-items: center;
}

.app-brand-logo {
  display: block;
  height: 40px;
  width: auto;
  background: #fff;
  padding: 3px 8px;
  border-radius: 8px;
}

.brand-logo-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.brand-logo {
  display: block;
  width: 170px;
  max-width: 60%;
  height: auto;
  margin: 0 auto;
}

.brand-sub {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 8px;
}

.resource-upload {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1rem;
}
.resource-upload .form-control {
  margin: 0 0 6px;
}
.resource-upload .btn {
  align-self: flex-start;
  margin-top: 6px;
}

.resource-faith-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-weight: 400;
}
.resource-faith-toggle input {
  width: auto;
  margin: 0;
}

.resource-list {
  margin-top: 0.5rem;
}

.resource-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.resource-row .form-control {
  flex: 1 1 130px;
  margin: 0;
}
.resource-row .btn {
  flex: 0 0 auto;
}

.resource-icon {
  font-size: 20px;
  flex: 0 0 auto;
}

.resource-meta {
  font-size: 13px;
  color: var(--muted);
  flex: 0 0 auto;
}

.resource-view {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
}

.resource-view-image {
  max-height: 70vh;
  object-fit: contain;
  background: var(--pastel-soft);
}

.resource-view-pdf {
  width: 100%;
  height: 70vh;
}

.resource-view-video {
  max-height: 70vh;
  background: #000;
}

.resource-view-audio {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .resource-row .form-control {
    flex-basis: 100%;
  }
}
