:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --surface: #ffffff;
  --surface-2: #eef1ea;
  --ink: #1a1a1a;
  --muted: #5e6863;
  --line: #d6ddd0;
  --sage: #a8b8a0;
  --nav: #1f2f2b;
  --accent: #17635e;
  --accent-soft: #e3eceb;
  --accent-2: #a05a2c;
  --danger: #a43d3d;
  --shadow: 0 18px 40px rgba(31, 47, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  filter: brightness(0.94);
}

button.ghost {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.subtle {
  min-height: 34px;
  padding: 0 12px;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1,
.view-head h2 {
  letter-spacing: 0;
  margin: 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  border-radius: 12px;
  flex-shrink: 0;
  height: 48px;
  width: 48px;
}

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

.about-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.about-brand-mark {
  flex-shrink: 0;
  height: 56px;
  width: 56px;
}

.topbar h1 {
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 3px;
  text-transform: uppercase;
}

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

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

.sidebar {
  align-content: start;
  background: var(--nav);
  display: grid;
  gap: 4px;
  padding: 18px;
}

.nav-item {
  background: transparent;
  color: #dfe5dd;
  min-height: 44px;
  text-align: left;
  width: 100%;
}

.nav-item.active,
.nav-item:focus-visible {
  background: #ffffff;
  color: var(--ink);
  outline: 0;
}

.nav-group {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.nav-group-head {
  align-items: stretch;
  display: flex;
  gap: 2px;
}

.nav-group-toggle {
  background: transparent;
  color: #dfe5dd;
  flex: 1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
  text-transform: uppercase;
}

.nav-group-toggle.active,
.nav-group-toggle:focus-visible {
  background: #ffffff;
  color: var(--ink);
  outline: 0;
}

.nav-group-chevron {
  background: transparent;
  color: #dfe5dd;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 10px;
  width: 36px;
}

.nav-group-chevron span {
  display: inline-block;
  transition: transform 0.15s ease;
}

.nav-group[data-collapsed="true"] .nav-group-chevron span {
  transform: rotate(-90deg);
}

.nav-group[data-collapsed="true"] .nav-group-items {
  display: none;
}

.nav-group-items {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid rgba(223, 229, 221, 0.18);
  margin-left: 6px;
}

.nav-item.nav-sub {
  font-size: 0.94rem;
  font-weight: 600;
  min-height: 38px;
  padding-left: 10px;
}

.workspace {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.view-head {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.view-head h2 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  max-width: 760px;
}

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

.stat,
.panel,
.notice,
.record-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  font-size: 1.85rem;
  font-weight: 850;
}

.stat p {
  color: var(--muted);
  margin: 2px 0 0;
}

.two-column {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
}

.panel,
.notice {
  padding: 18px;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h3,
.notice h3 {
  margin: 0;
}

.stacked-form,
.entry-form {
  display: grid;
  gap: 14px;
}

.entry-form {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  padding: 16px;
}

label {
  color: var(--ink);
  display: grid;
  font-size: 0.9rem;
  font-weight: 750;
  gap: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  cursor: pointer;
  padding: 8px;
}

.file-field {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--sage);
  border-radius: 8px;
  padding: 12px;
}

.file-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

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

.entry-form button {
  align-self: end;
}

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

.record-card {
  box-shadow: none;
  padding: 14px;
}

.record-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.delete-btn {
  background: transparent;
  border: 1px solid #e5c8c8;
  color: var(--danger);
  min-height: 32px;
  padding: 0 10px;
}

.record-card h3 {
  font-size: 1.05rem;
  margin: 10px 0 8px;
}

.record-card dl {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0 0 8px;
}

.record-card dt {
  color: var(--muted);
  font-weight: 800;
}

.record-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-card p {
  margin: 0;
  white-space: pre-wrap;
}

.attachment-link {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  font-weight: 800;
  gap: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.notice {
  max-width: 880px;
}

.notice p {
  margin-bottom: 0;
}

.storage-notice {
  border-left: 4px solid var(--accent-2);
  margin-bottom: 18px;
  max-width: none;
}

.storage-notice h3 {
  margin: 0 0 6px;
}

.storage-notice p + p {
  margin-top: 8px;
}

.storage-notice .small {
  font-size: 0.92rem;
}

.storage-details {
  margin-top: 10px;
}

.storage-details summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
}

.storage-details[open] summary {
  margin-bottom: 6px;
}

.storage-details p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 6px 0 0;
}

.shortcuts {
  margin-bottom: 18px;
}

.shortcuts-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.shortcut-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.shortcut {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.shortcut:hover,
.shortcut:focus-visible {
  border-color: var(--accent);
  filter: none;
  outline: 0;
  transform: translateY(-1px);
}

.first-time-note,
.report-disclaimer {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-size: 0.92rem;
  margin: 0 0 14px;
  padding: 10px 14px;
}

.report-disclaimer {
  border-left-color: var(--accent-2);
}

.report-modal-disclaimer {
  background: #f5e7d6;
  border-bottom: 1px solid var(--line);
  color: #5a3416;
  font-size: 0.9rem;
  margin: 0;
  padding: 10px 22px;
}

.demo-badge {
  background: #f3dfc1;
  color: #5a3416;
  margin-left: 8px;
}

.record-card.is-demo {
  border-left: 3px solid var(--accent-2);
}

.confirm-modal {
  align-items: center;
  background: rgba(15, 25, 22, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1000;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
  max-width: 460px;
  padding: 22px;
  width: 100%;
}

.confirm-modal-shell h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.confirm-modal-shell p {
  margin: 0 0 18px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

  .sidebar {
    grid-auto-flow: row;
    overflow-x: visible;
    padding: 10px;
  }

  .nav-item {
    white-space: normal;
  }

  .stats-grid,
  .two-column,
  .entry-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions button,
  .stats-grid,
  .two-column,
  .entry-form {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .topbar-actions,
  .sidebar,
  form,
  .delete-btn,
  .notice,
  .shortcuts,
  .first-time-note,
  .report-disclaimer,
  .nav-item,
  .nav-group,
  .topbar-account,
  #seedBtn,
  #clearDemoBtn,
  #exportBtn,
  #courtReportBtn,
  #printBtn,
  #reportBtn,
  #loginBtn,
  #signupBtn,
  #accountBtn,
  #logoutBtn,
  #clearFiltersBtn,
  .hub-grid,
  .child-filter-bar,
  .quick-entry,
  .empty-state-cta,
  button,
  input,
  textarea,
  select,
  [data-feature-pro],
  [data-locked="true"] {
    display: none !important;
  }

  .topbar {
    position: static;
  }

  .app-shell,
  .two-column,
  .stats-grid {
    display: block;
  }

  .workspace {
    padding: 16px 0;
  }

  .view {
    display: block;
    break-after: page;
  }

  .record-card,
  .stat,
  .panel {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 12px;
  }

  .report-modal,
  .report-modal-shell {
    background: #fff !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    padding: 0 !important;
  }

  .report-modal-actions {
    display: none !important;
  }
}

.report-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 20, 0.55);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(12px, 4vw, 36px);
  overflow-y: auto;
}

.report-modal[hidden] {
  display: none;
}

body.report-open {
  overflow: hidden;
}

.report-modal-shell {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: 880px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.report-modal-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 18px 22px;
}

.report-modal-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
}

.report-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-body {
  overflow-y: auto;
  padding: 24px clamp(18px, 3vw, 32px);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  line-height: 1.55;
}

.report-body .report-header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.report-body .report-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.report-body .report-generated {
  color: var(--muted);
  font-style: italic;
  margin: 4px 0 10px;
}

.report-body .report-header p {
  margin: 4px 0;
  font-size: 0.95rem;
}

.report-body .report-section {
  margin-bottom: 26px;
}

.report-body .report-section-head {
  align-items: baseline;
  border-bottom: 1px solid var(--sage);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 6px;
}

.report-body .report-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.report-body .report-exhibit {
  background: var(--nav);
  color: #fff;
  padding: 4px 10px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
}

.report-body .report-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-left: auto;
}

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

.report-body .report-item {
  border-left: 3px solid var(--sage);
  margin-bottom: 14px;
  padding: 4px 0 4px 14px;
}

.report-body .report-date {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.report-body .report-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 2px 0;
}

.report-body .report-meta {
  color: #3a4441;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.report-body .report-notes {
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.report-body .report-empty {
  color: var(--muted);
  font-style: italic;
  margin: 4px 0;
}

.report-body .report-footer {
  border-top: 1px solid var(--sage);
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 26px;
  padding-top: 10px;
}

#about .about-section {
  margin-bottom: 18px;
  max-width: 880px;
}

#about .about-section h3 {
  margin: 0 0 8px;
}

#about .about-section p + p {
  margin-top: 8px;
}

.about-list {
  margin: 8px 0 0;
  padding-left: 22px;
}

.about-list li {
  margin-bottom: 4px;
}

.about-callout {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin-top: 12px;
  padding: 12px 14px;
}

.about-emergency {
  border-left: 4px solid var(--danger);
}

.deescalation-intro {
  margin: 0 0 14px;
  max-width: 760px;
}

.safety-alert {
  background: #fbe7e7;
  border-color: #e5c8c8;
  border-left: 4px solid var(--danger);
  margin-bottom: 14px;
  max-width: none;
}

.safety-alert h3 {
  color: var(--danger);
  margin: 0 0 6px;
}

.deescalation-result {
  padding: 18px;
}

.deescalation-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deescalation-meta {
  font-size: 0.88rem;
  margin: 0 0 10px;
}

.deescalation-draft {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.55;
  padding: 14px 16px;
  white-space: pre-wrap;
}

.deescalation-reminder {
  font-size: 0.88rem;
  margin: 10px 0 0;
}

.deescalation-file-info {
  color: var(--ink, #1a1a1a);
  font-weight: 600;
  margin-top: 6px;
}

.tone-checker-panel {
  margin-top: 18px;
  padding: 18px;
}

.tone-checker-intro {
  margin: 0 0 12px;
  max-width: 760px;
}

.tone-checker-label {
  display: block;
  margin-top: 8px;
}

.tone-checker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tone-result {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px 14px;
}

.tone-result.tone-result-low {
  border-left: 4px solid var(--accent);
}

.tone-result.tone-result-medium {
  border-left: 4px solid #c98a1f;
  background: #fdf6e7;
}

.tone-result.tone-result-high {
  border-left: 4px solid var(--danger);
  background: #fbe7e7;
}

.tone-label {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.tone-feedback {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tone-rewrite {
  margin-top: 14px;
}

.tone-rewrite-heading {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.child-filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.child-filter-bar[hidden] {
  display: none;
}

.child-filter-label {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.child-filter-label select {
  flex: 1 1 auto;
  max-width: 320px;
  min-height: 38px;
}

.profile-panel {
  margin-bottom: 18px;
}

.profile-panel .entry-form {
  margin-bottom: 0;
}

.children-list {
  display: grid;
  gap: 12px;
}

.child-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
}

.child-card-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.child-card-head h4 {
  font-size: 1.05rem;
  margin: 0;
}

.child-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.child-card dl {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
}

.child-card dt {
  color: var(--muted);
  font-weight: 800;
}

.child-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.child-count {
  font-size: 0.88rem;
  font-weight: 700;
}

.child-selector-field {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.child-selector-field[hidden] {
  display: none;
}

.report-child-filter select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9rem;
  min-height: 38px;
  padding: 6px 10px;
}

.hub-intro {
  margin: 0 0 16px;
  max-width: 720px;
}

.hub-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 18px;
}

.hub-grid-two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 760px;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  padding: 16px 18px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover,
.hub-card:focus-visible {
  border-color: var(--accent);
  filter: none;
  outline: 0;
  transform: translateY(-1px);
  box-shadow: 0 22px 44px rgba(31, 47, 43, 0.14);
}

.hub-card h3 {
  color: var(--ink);
  font-size: 1.05rem;
  margin: 0;
}

.hub-card p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0;
}

.hub-jump {
  margin-top: 18px;
}

.link-btn {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  min-height: 0;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover,
.link-btn:focus-visible {
  color: var(--accent-2);
  filter: none;
  outline: 0;
}

.shortcuts-head {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.shortcuts-head .shortcuts-title {
  margin: 0;
}

.shortcuts-head .link-btn {
  font-size: 0.85rem;
}

.report-launch-actions {
  margin-top: 12px;
}

.messages-photos-gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 8px;
}

.messages-photos-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.messages-photos-card h3 {
  font-size: 1.05rem;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.messages-photos-card dl {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
}

.messages-photos-card dt {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
}

.messages-photos-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.messages-photos-preview {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.messages-photos-preview img {
  display: block;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  width: 100%;
}

.messages-photos-section-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 4px 0 -4px;
  text-transform: uppercase;
}

.messages-photos-notes,
.messages-photos-transcription {
  background: var(--surface-2);
  border-left: 3px solid var(--sage);
  border-radius: 4px;
  margin: 0;
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.messages-photos-warning {
  background: #fdf2e3;
  border-left: 3px solid var(--accent-2);
  border-radius: 4px;
  color: #6b3a16;
  font-size: 0.86rem;
  margin: 0;
  padding: 8px 10px;
}

.messages-photos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.messages-photos-actions button {
  flex: 1 1 auto;
  min-height: 38px;
}

@media (max-width: 620px) {
  .messages-photos-gallery {
    grid-template-columns: 1fr;
  }

  .messages-photos-actions button {
    flex: 1 1 100%;
  }
}
