/* Shared page layouts, forms, navigation, dialogs, and responsive styles. */
:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  color: #173632;
  background: #f6f8f5;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #166e60;
  text-underline-offset: 4px;
}
header {
  max-width: 1240px;
  margin: auto;
  padding: 26px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #dce5df;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 750;
  font-size: 23px;
  color: #173632;
}
.mark {
  background: #173f36;
  color: #e2f5c9;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
nav a[aria-current] {
  text-decoration: underline;
}
nav form {
  margin: 0;
}
.quiet {
  border: 1px solid #c9d6cf;
  background: transparent;
  border-radius: 8px;
  padding: 10px 15px;
  color: inherit;
  cursor: pointer;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 0 24px 72px;
  min-height: calc(100vh - 190px);
}
h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -2px;
  font-weight: 650;
  margin: 24px 0;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 12px 0;
}
p {
  line-height: 1.7;
}
.lead {
  font-size: 18px;
  color: #64756f;
  max-width: 560px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #517265;
}
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 90px;
  align-items: center;
  padding: 90px 0 70px;
}
.actions {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 15px 23px;
  background: #1d5e4f;
  color: #fff;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.button:hover {
  background: #174c40;
}
.small {
  padding: 11px 17px;
}
.text-link {
  font-size: 13px;
}
.hero-card {
  padding: 38px;
  border-radius: 22px;
  background: #e1ebdb;
  transform: rotate(1deg);
  box-shadow: 0 18px 45px #284d3510;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  background: #d7eacb;
  padding: 7px 11px;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 750;
}
.avatars {
  display: flex;
  padding: 36px 0 22px;
}
.avatars span {
  width: 72px;
  height: 72px;
  border: 4px solid #e1ebdb;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #496349;
  font-size: 15px;
  font-weight: 750;
  margin-right: -10px;
}
.avatars span:last-child {
  background: #345e4c;
  color: #fff;
}
.hero-card p {
  color: #5d7162;
  font-size: 15px;
}
.card-note {
  border-top: 1px solid #c3d4bd;
  margin-top: 26px;
  padding-top: 20px;
  font-size: 12px;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #dbe5df;
  gap: 36px;
  padding-top: 35px;
}
.features h2 {
  font-size: 19px;
}
.features p {
  font-size: 14px;
  color: #64756f;
}
.number {
  color: #78977f;
  font-size: 12px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  padding: 65px 0;
  align-items: center;
}
.auth-intro h1 {
  font-size: 48px;
}
.panel {
  background: #fff;
  border: 1px solid #dfe7e0;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 24px;
}
.auth-panel {
  max-width: 460px;
  width: 100%;
  padding: 34px;
}
.muted {
  color: #748279;
  font-size: 14px;
}
.auth-panel label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 18px 0 8px;
}
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd7ce;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: #203e35;
  background: #fff;
}
input:focus {
  outline: 2px solid #5b9475;
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid #87aa58;
  outline-offset: 4px;
}
small {
  display: block;
  color: #6b7c72;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}
.full {
  width: 100%;
  margin-top: 25px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  margin-top: 24px;
}
.alert {
  background: #fff0ee;
  border: 1px solid #f0c6bf;
  color: #933c2c;
  padding: 13px;
  border-radius: 8px;
  font-size: 14px;
}
.page-heading {
  padding: 55px 0 22px;
}
.page-heading h1 {
  font-size: 42px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.stat {
  display: block;
  font-size: 55px;
  margin: 12px 0;
}
.stats a {
  font-size: 13px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading p {
  margin: 8px 0 0;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
th {
  padding: 14px 10px;
  color: #738378;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #f6f8f5;
}
td {
  padding: 18px 10px;
  border-bottom: 1px solid #edf0ec;
  color: #64756b;
}
.member {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #274839;
}
.avatar {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  background: #eaf1e5;
  border-radius: 50%;
  font-size: 12px;
}
.count {
  background: #edf2e9;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 13px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search input {
  min-width: 180px;
}
.pagination {
  justify-content: space-between;
  margin-top: 24px;
  font-size: 13px;
}
.pagination div {
  display: flex;
  gap: 20px;
}
.empty {
  text-align: center;
  padding: 40px;
  color: #718176;
}
.break {
  overflow-wrap: anywhere;
}
footer {
  max-width: 1160px;
  margin: auto;
  padding: 26px 24px;
  border-top: 1px solid #dce5df;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6e8074;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 760px) {
  header {
    padding: 20px;
    flex-wrap: wrap;
  }
  nav {
    gap: 15px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 20px;
  }
  .hero,
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 45px 0;
  }
  .hero-card {
    transform: none;
  }
  .auth-intro h1 {
    font-size: 38px;
  }
  .auth-panel {
    max-width: none;
  }
  .features {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .search {
    flex-wrap: wrap;
  }
  .search input {
    flex: 1;
  }
  .panel {
    padding: 22px;
  }
  .page-heading h1 {
    font-size: 34px;
  }
  footer {
    gap: 15px;
  }
  .auth-intro .lead {
    font-size: 16px;
  }
}

.login-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #edf2ed;
  border-radius: 10px;
  margin: 22px 0;
}
.login-tabs button {
  flex: 1;
  border: 0;
  border-radius: 7px;
  padding: 12px 8px;
  background: transparent;
  color: #52685b;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.login-tabs button[aria-selected='true'] {
  background: #1d5e4f;
  color: #fff;
}
.auth-panel [hidden] {
  display: none;
}
#profile-dialog {
  width: min(460px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #dfe7e0;
  border-radius: 16px;
  padding: 28px;
  color: #173632;
}
#profile-dialog::backdrop {
  background: #10261db3;
}
.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#profile-dialog label {
  display: block;
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 650;
}
#profile-preview {
  border-radius: 50%;
  object-fit: cover;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}

#profile-camera {
  display: block;
  width: 100%;
  border-radius: 10px;
  margin-top: 16px;
  background: #173632;
}
.camera-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
#camera-panel[hidden] {
  display: none;
}

.record-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.record-actions form {
  margin: 0;
}
textarea,
select {
  font: inherit;
  padding: 10px;
  border: 1px solid #cbd7ce;
  border-radius: 8px;
  max-width: 100%;
}
.auth-panel textarea,
.auth-panel select {
  width: 100%;
}
header nav {
  flex-wrap: wrap;
}
.search {
  margin-bottom: 20px;
}

.management-menu {
  position: relative;
}
.management-menu summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #166e60;
  padding: 10px 0;
}
.management-menu summary:focus-visible {
  outline: 3px solid #87aa58;
  outline-offset: 4px;
  border-radius: 4px;
}
.management-submenu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dfe7e0;
  border-radius: 10px;
  box-shadow: 0 10px 30px #17363220;
  padding: 8px;
  z-index: 20;
}
.management-submenu a {
  display: block;
  padding: 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.management-submenu a:hover,
.management-submenu a[aria-current='page'] {
  background: #edf2ed;
}
@media (max-width: 480px) {
  .management-submenu {
    right: auto;
    left: 0;
  }
}
body:has(.data-grid) main {
  max-width: none;
  padding: 0 24px 20px;
}
.data-grid {
  height: calc(100vh - 175px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  color: #334155;
}
.grid-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
}
.grid-heading h1 {
  font-size: 28px;
  letter-spacing: -0.5px;
  margin: 0;
}
.grid-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grid-tools input {
  max-width: 240px;
}
.grid-scroll {
  flex: 1;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
}
.data-grid table {
  font-size: 13px;
}
.data-grid th {
  position: sticky;
  top: 0;
  background: #edf1f6;
  z-index: 1;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 12px;
  color: #334155;
  white-space: nowrap;
}
.data-grid td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}
.data-grid tbody tr:hover {
  background: #f8fafc;
}
.grid-th {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.grid-options {
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
}
.grid-options.filtered {
  background: #2563eb;
  color: white;
}
.grid-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 14px;
  flex-wrap: wrap;
}
.grid-status label,
.grid-paging {
  display: flex;
  align-items: center;
  gap: 8px;
}
.grid-paging button {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: #334155;
  font-size: 20px;
  cursor: pointer;
}
#grid-page {
  min-width: 60px;
  text-align: center;
}
#grid-filter,
#record-editor {
  width: min(480px, calc(100vw - 32px));
  max-height: 85vh;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 24px;
  color: #334155;
}
#grid-filter::backdrop,
#record-editor::backdrop {
  background: #17203366;
}
#grid-filter h2,
#record-editor h2 {
  font-size: 20px;
}
.filter-sort {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
#grid-columns label,
#grid-values label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
}
#grid-columns input,
#grid-values input {
  width: auto;
}
#grid-values {
  max-height: 230px;
  overflow: auto;
}
#grid-values label[hidden] {
  display: none;
}
#editor-content label {
  display: block;
  margin: 16px 0 8px;
}
#editor-content textarea,
#editor-content select {
  width: 100%;
}
#grid-filter details {
  margin-bottom: 16px;
}
.data-grid [hidden] {
  display: none;
}
.data-grid .record-actions {
  flex-wrap: nowrap;
}
.data-grid .quiet {
  font-size: 12px;
  padding: 6px 10px;
}
.grid-tools .quiet {
  font-size: 13px;
  padding: 10px;
}
@media (max-width: 720px) {
  .grid-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .grid-tools {
    flex-wrap: wrap;
  }
  .data-grid {
    height: calc(100vh - 220px);
  }
  .grid-status {
    justify-content: center;
  }
  #grid-info {
    order: 3;
    width: 100%;
    text-align: center;
  }
}

/* Compact application layout: prioritize content and table space. */
header {
  max-width: none;
  padding: 10px 18px;
  gap: 16px;
}
.brand {
  font-size: 20px;
  gap: 8px;
}
.mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
nav {
  gap: 16px;
}
main {
  max-width: none;
  padding: 0 18px 24px;
  min-height: calc(100vh - 110px);
}
h1 {
  margin: 12px 0;
  font-size: clamp(30px, 4vw, 48px);
}
h2 {
  font-size: 20px;
  margin: 8px 0;
}
p {
  margin: 8px 0;
  line-height: 1.5;
}
.lead {
  font-size: 16px;
}
.page-heading {
  padding: 20px 0 12px;
}
.page-heading h1 {
  font-size: 30px;
}
.panel {
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 10px;
}
.stats {
  gap: 14px;
}
.stat {
  font-size: 38px;
  margin: 8px 0;
}
.section-heading {
  gap: 14px;
  margin-bottom: 14px;
}
.section-heading p {
  margin-top: 4px;
}
.hero {
  gap: 36px;
  padding: 32px 0 26px;
}
.hero-card {
  padding: 24px;
  border-radius: 14px;
}
.avatars {
  padding: 18px 0 12px;
}
.avatars span {
  width: 56px;
  height: 56px;
}
.card-note {
  margin-top: 16px;
  padding-top: 12px;
}
.actions {
  gap: 16px;
  margin-top: 18px;
}
.features {
  gap: 24px;
  padding-top: 18px;
}
.auth-layout {
  max-width: 1040px;
  margin: auto;
  gap: 40px;
  padding: 24px 0;
}
.auth-intro h1 {
  font-size: 36px;
}
.auth-panel {
  padding: 22px;
}
.auth-panel label {
  margin: 12px 0 5px;
}
input,
textarea,
select {
  padding: 8px 10px;
}
.button {
  padding: 10px 16px;
  gap: 12px;
}
.small {
  padding: 8px 12px;
}
.quiet {
  padding: 7px 11px;
}
.full {
  margin-top: 16px;
}
.auth-switch {
  margin-top: 16px;
}
small {
  margin-top: 5px;
}
.login-tabs {
  margin: 14px 0;
  padding: 4px;
}
.login-tabs button {
  padding: 9px 8px;
}
th {
  padding: 9px 8px;
}
td {
  padding: 10px 8px;
}
.member {
  gap: 8px;
}
.avatar {
  min-width: 28px;
  height: 28px;
}
.search {
  gap: 8px;
  margin-bottom: 12px;
}
.pagination {
  margin-top: 12px;
}
.empty {
  padding: 24px;
}
footer {
  max-width: none;
  padding: 10px 18px;
  font-size: 11px;
}
.management-menu summary {
  padding: 7px 0;
}
.management-submenu {
  padding: 5px;
}
.management-submenu a {
  padding: 9px 10px;
}
#profile-dialog,
#grid-filter,
#record-editor {
  padding: 18px;
  border-radius: 10px;
  max-height: 90dvh;
}
.profile-heading {
  gap: 10px;
}
#profile-dialog label,
#editor-content label {
  margin: 12px 0 5px;
}
#profile-camera {
  margin-top: 10px;
}
.camera-actions {
  gap: 8px;
  margin-top: 8px;
}
.filter-sort {
  gap: 8px;
  margin: 10px 0;
}
#grid-filter details {
  margin-bottom: 10px;
}
#grid-columns label,
#grid-values label {
  padding: 4px;
  gap: 6px;
}
body:has(.data-grid) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 480px;
}
body:has(.data-grid) > header,
body:has(.data-grid) > footer {
  flex: none;
  width: 100%;
}
body:has(.data-grid) main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding: 0 14px;
}
.data-grid {
  height: auto;
  min-height: 0;
  flex: 1;
}
.grid-heading {
  gap: 12px;
  padding: 12px 0;
}
.grid-heading h1 {
  font-size: 24px;
}
.grid-tools {
  gap: 8px;
}
.grid-tools .quiet {
  padding: 8px;
}
.grid-scroll {
  min-height: 0;
}
.data-grid th {
  padding: 6px 9px;
}
.data-grid td {
  padding: 6px 9px;
}
.grid-th {
  gap: 10px;
}
.record-actions {
  gap: 10px;
}
.data-grid .quiet {
  padding: 5px 8px;
}
.grid-status {
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}
.grid-status label,
.grid-paging {
  gap: 6px;
}
.grid-paging button {
  width: 30px;
  height: 30px;
}
.grid-status select {
  padding: 5px 8px;
}
@media (max-width: 760px) {
  header {
    padding: 10px 12px;
    gap: 10px;
  }
  nav {
    gap: 10px;
  }
  main {
    padding: 0 12px 18px;
  }
  .hero,
  .auth-layout {
    gap: 20px;
    padding: 20px 0;
  }
  .auth-intro h1 {
    font-size: 30px;
  }
  .panel,
  .auth-panel {
    padding: 16px;
  }
  .features {
    gap: 12px;
  }
  .stats {
    gap: 0;
  }
  .page-heading {
    padding: 16px 0 10px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  footer {
    padding: 8px 12px;
  }
  .grid-heading {
    gap: 8px;
    padding: 10px 0;
  }
  body:has(.data-grid) main {
    padding: 0 10px;
  }
  .grid-tools input {
    max-width: 190px;
  }
}
@media (pointer: coarse) {
  .grid-options,
  .grid-paging button {
    min-width: 36px;
    min-height: 36px;
  }
  .button,
  .quiet,
  .login-tabs button,
  .management-menu summary {
    min-height: 38px;
  }
}

/* Responsive layouts: keep wide data inside its own scroll area. */
html {
  max-width: 100%;
}
body {
  min-width: 0;
}
main,
section,
.panel,
.auth-intro,
.auth-panel,
.hero-card,
.grid-tools {
  min-width: 0;
}
img,
video {
  max-width: 100%;
}
input,
textarea,
select {
  max-width: 100%;
  min-width: 0;
}
#main-navigation[hidden],
.nav-toggle[hidden] {
  display: none;
}
.grid-scroll {
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.data-grid table {
  min-width: 640px;
}
.data-grid td {
  max-width: 340px;
  overflow-wrap: anywhere;
}
.table-wrap {
  max-width: 100%;
}
.table-wrap table {
  min-width: 500px;
}
.profile-heading h2,
.page-heading h1,
.brand,
#profile-dialog p {
  overflow-wrap: anywhere;
}
#profile-dialog,
#record-editor,
#grid-filter {
  box-sizing: border-box;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
}
.grid-paging {
  flex-wrap: wrap;
}
.filter-sort {
  flex-wrap: wrap;
}
@media (min-width: 761px) and (max-width: 1100px) {
  .hero {
    gap: 24px;
    grid-template-columns: 1fr 1fr;
  }
  .hero h1 {
    font-size: 40px;
  }
  .auth-layout {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .auth-intro h1 {
    font-size: 32px;
  }
  .auth-panel {
    width: 100%;
    max-width: none;
  }
  .grid-heading {
    align-items: flex-start;
  }
  .grid-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
@media (max-width: 900px) {
  header {
    position: relative;
    flex-wrap: wrap;
    z-index: 30;
  }
  .nav-toggle {
    margin-left: auto;
    min-width: 64px;
    min-height: 40px;
  }
  #main-navigation {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid #dce5df;
  }
  #main-navigation > a,
  #main-navigation > .quiet,
  #main-navigation > form button {
    display: block;
    text-align: left;
    width: 100%;
    padding: 10px 12px;
    min-height: 42px;
  }
  .management-menu summary {
    padding: 10px 12px;
    min-height: 42px;
  }
  .management-submenu {
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    padding: 4px 8px;
    background: #edf2ed;
  }
  .management-submenu a {
    white-space: normal;
    min-height: 42px;
  }
  body:has(.data-grid) {
    height: auto;
    min-height: 100dvh;
  }
  body:has(.data-grid) main {
    display: block;
    flex: auto;
  }
  .data-grid {
    height: calc(100dvh - 120px);
    min-height: 400px;
  }
  .grid-heading {
    flex-direction: column;
    align-items: stretch;
  }
  .grid-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .grid-tools input {
    flex: 1;
    max-width: none;
    min-width: 140px;
  }
  .grid-status {
    justify-content: space-between;
  }
  #grid-info {
    order: 3;
    width: 100%;
    text-align: left;
  }
}
@media (max-width: 600px) {
  .hero,
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .auth-intro h1 {
    font-size: 27px;
    margin: 8px 0;
  }
  .auth-intro .lead {
    font-size: 14px;
  }
  .auth-panel {
    max-width: none;
    width: 100%;
  }
  .hero h1 {
    font-size: 34px;
  }
  .hero-card {
    transform: none;
    padding: 18px;
  }
  .stats,
  .features {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-heading {
    align-items: stretch;
    gap: 10px;
  }
  .actions {
    gap: 12px;
    flex-wrap: wrap;
  }
  .grid-heading h1 {
    font-size: 22px;
  }
  .grid-status {
    justify-content: center;
    gap: 10px;
  }
  #grid-info {
    text-align: center;
    font-size: 12px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  #profile-dialog,
  #record-editor,
  #grid-filter {
    width: calc(100vw - 24px);
    padding: 16px;
  }
  .camera-actions > * {
    flex: 1;
  }
  footer {
    flex-wrap: wrap;
    gap: 6px;
  }
}
@media (pointer: coarse) {
  .grid-options,
  .grid-paging button {
    min-width: 44px;
    min-height: 44px;
  }
  .button,
  .quiet,
  .login-tabs button,
  .management-menu summary {
    min-height: 44px;
  }
  .record-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  #grid-values label,
  #grid-columns label {
    min-height: 40px;
  }
}
@media (max-height: 500px) and (max-width: 1000px) {
  .data-grid {
    height: auto;
    min-height: 340px;
  }
  .grid-scroll {
    max-height: 55vh;
  }
}

.page-catalog {
  flex: none;
  border: 1px solid #dfe7e0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  background: #fff;
}
.page-catalog summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 14px;
}
.page-catalog .muted {
  font-size: 12px;
  margin: 6px 0;
}
.catalog-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  max-height: 170px;
  overflow: auto;
}
.catalog-links a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  background: #f6f8f5;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}
.catalog-links code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.page-catalog a:hover {
  background: #e8efe8;
}

.permission-actions {
  border: 1px solid #cbd7ce;
  border-radius: 8px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}
.permission-actions[hidden] {
  display: none;
}
.permission-actions label,
#editor-content .permission-actions label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
}
.permission-actions input {
  width: auto;
  margin-top: 5px;
}
.permission-actions small {
  overflow-wrap: anywhere;
}

.user-list-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  vertical-align: middle;
}
.user-edit-photo {
  width: 80px;
  height: 80px;
}
.user-profile-summary {
  margin-bottom: 8px;
}

.user-permission-tree {
  margin: 8px 0;
  border-left: 2px solid #cbd8d2;
  padding-left: 12px;
}
.user-permission-tree summary {
  cursor: pointer;
  padding: 4px 0;
}

[hidden] {
  display: none !important;
}

.user-permission-tree summary .category-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 0 12px;
  font-size: 13px;
  font-weight: 400;
  vertical-align: middle;
  cursor: pointer;
}
.user-permission-tree summary .category-select-all input {
  width: auto;
  margin: 0;
}

.user-permission-tree > summary {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-permission-tree > summary::before {
  content: '▸';
  flex: none;
}
.user-permission-tree[open] > summary::before {
  content: '▾';
}
.user-permission-tree > summary .category-select-all,
#editor-content .user-permission-tree > summary .category-select-all {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin: 0;
  padding: 0;
  width: auto;
}
.user-permission-tree > summary .category-select-all input {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
}

.html-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}
.html-editor {
  min-height: 160px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #bdccc5;
  border-radius: 6px;
  padding: 10px;
  background: white;
}
.html-editor:focus {
  outline: 2px solid #1e6555;
}
.portfolio-description {
  max-width: 440px;
  max-height: 160px;
  overflow: auto;
  white-space: normal;
}
.portfolio-description p {
  margin: 4px 0;
}

.portfolio-gallery {
  padding: 28px 0;
}
.portfolio-gallery-intro {
  max-width: 650px;
  margin-bottom: 24px;
}
.portfolio-gallery-intro h1 {
  margin-bottom: 8px;
}
.portfolio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.portfolio-card {
  display: block;
  overflow: hidden;
  border: 1px solid #dfe7e0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px #1736320a;
}
.portfolio-cards a.portfolio-card {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.portfolio-cards a.portfolio-card:hover {
  box-shadow: 0 10px 24px #1736321a;
  transform: translateY(-2px);
}
.portfolio-cards a.portfolio-card:focus-visible {
  outline-offset: 3px;
}
.portfolio-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #d7eacb;
  color: #173632;
  font-size: 52px;
  font-weight: 750;
  letter-spacing: -2px;
}
.portfolio-thumbnail img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  inset: 0;
}
.portfolio-card-content {
  padding: 18px;
}
.portfolio-card h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
.portfolio-card-description {
  color: #64756f;
  font-size: 14px;
  line-height: 1.55;
}
.portfolio-card-description p {
  margin: 0 0 8px;
}
.portfolio-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 650;
}
.portfolio-empty {
  padding: 36px;
  border: 1px dashed #bdccc5;
  border-radius: 12px;
  color: #64756f;
  text-align: center;
}
@media (max-width: 600px) {
  .portfolio-gallery {
    padding: 18px 0;
  }
  .portfolio-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.family-card {
  position: relative;
}
.family-member-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  margin: 0;
}
.family-member-remove button {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  background: #eef2ed;
  color: #365047;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.family-member-remove button:hover {
  background: #dce7dd;
}

.family-generation {
  margin: 0 auto 24px;
}
.family-card {
  position: relative;
}
.family-card[data-family-card] {
  cursor: pointer;
}
.family-card-menu {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.family-card.is-selected .family-card-menu {
  display: block;
}
.family-card-menu summary {
  list-style: none;
  width: 25px;
  height: 25px;
  border: 1px solid #b8c8bc;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 750;
}
.family-card-menu summary::-webkit-details-marker {
  display: none;
}
.family-card-actions {
  position: absolute;
  top: 31px;
  left: 0;
  width: 145px;
  padding: 5px;
  border: 1px solid #c8d5ca;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px #17363222;
}
.family-card-actions button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px;
  text-align: left;
  cursor: pointer;
}
.family-card-actions button:hover {
  background: #edf5ea;
}
.family-member-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 50px #102a1e55;
}
.family-member-dialog::backdrop {
  background: #102a1e88;
}
.family-member-dialog label {
  display: block;
  margin: 13px 0 5px;
  font-size: 13px;
  font-weight: 650;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  margin: 0;
}
.family-grandparents {
  display: flex;
  justify-content: center;
  gap: 64px;
  flex-wrap: wrap;
}
.family-couple {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
}
.family-couple::before {
  content: '';
  position: absolute;
  height: 2px;
  width: 34px;
  background: #75957d;
  left: calc(50% - 17px);
  top: 50%;
  z-index: 0;
}
.family-couple > .family-card {
  z-index: 1;
}
.family-parents {
  display: flex;
  justify-content: center;
}
.family-children {
  padding-top: 4px;
}
@media (max-width: 600px) {
  .family-grandparents {
    gap: 22px;
  }
  .family-couple {
    gap: 16px;
  }
  .family-couple::before {
    width: 16px;
    left: calc(50% - 8px);
  }
}
.partner-relationship {
  position: relative;
  overflow: visible;
}
.family-partner-menu {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
}
.family-partner-menu > summary {
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid #1d5e4f;
  border-radius: 50%;
  background: #fff;
  color: #164c40;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}
.family-partner-menu > summary::-webkit-details-marker {
  display: none;
}
.family-partner-menu > .family-card-actions {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 21;
  display: none;
  min-width: 104px;
  padding: 5px;
  border: 1px solid #cad8cb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px #17363222;
  transform: translateX(-50%);
}
.family-partner-menu[open] > .family-card-actions {
  display: grid;
  gap: 2px;
}
.family-partner-menu .family-card-actions button {
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #164c40;
  font: inherit;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.family-partner-menu .family-card-actions button:hover {
  background: #e5f0df;
}
.family-partner-children {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  flex-basis: 100%;
  order: 10;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #bdccc5;
}
.family-partner-menu {
  display: none;
}
.partner-relationship.is-selected .family-partner-menu {
  display: block;
}
.partner-relationship.is-selected > span {
  display: none;
}
.partner-relationship[data-partner-circle],
.partner-relationship[data-parent-partner-circle] {
  cursor: pointer;
}
.family-partner-children-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  flex-basis: 100%;
  order: 10;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #bdccc5;
}
.family-partner-children-row .family-partner-children {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.family-partner-children-row .family-partner-children {
  flex: 0 0 auto;
  order: initial;
  margin: 0;
  padding: 0;
  border: 0;
}
.family-partner-children-row .family-partner-children {
  position: relative;
  padding-top: 42px;
}
.family-partner-children-row .family-partner-children::before {
  content: '';
  position: absolute;
  top: -34px;
  left: 50%;
  width: 2px;
  height: 58px;
  background: #75957d;
  transform: translateX(-50%);
}
.family-partner-children-row .family-partner-children--multiple::after {
  content: '';
  position: absolute;
  top: 23px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #75957d;
}
.family-partner-children-row .family-partner-children .family-card {
  position: relative;
  z-index: 1;
}
.partner-relationship::before,
.partner-relationship::after {
  width: 25px;
}
.family-partner-children-row .family-partner-children .family-card::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: #75957d;
  transform: translateX(-50%);
  z-index: -1;
}

/* Password visibility controls on the sign-in and registration forms. */
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 64px;
}
.toggle-password {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #355e50;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px;
  cursor: pointer;
}
.toggle-password:hover {
  background: #e7f0e8;
}
.toggle-password:focus-visible {
  outline: 3px solid #87aa58;
  outline-offset: 1px;
}

/* Shared donation link, with room for mobile safe areas. */
.donate-float {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  min-height: 48px;
  gap: 9px;
  border-radius: 999px;
  padding: 14px 22px;
  box-shadow: 0 6px 24px #17363230;
}
.donate-float span {
  font-size: 23px;
  line-height: 1;
}
body > footer {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 600px) {
  .donate-float {
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding: 12px 18px;
  }
}
@media print {
  .donate-float {
    display: none;
  }
}

.payments-table {
  overflow-x: auto;
  margin-bottom: 24px;
}
.payments-table table {
  min-width: 720px;
}

.family-tree-terms-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  margin-bottom: 24px;
}

#family-tree-terms-dialog {
  box-sizing: border-box;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid #dfe7e0;
  border-radius: 16px;
  padding: 24px;
  color: #173632;
  background: #fff;
  box-shadow: 0 18px 60px #10261d40;
}
#family-tree-terms-dialog::backdrop {
  background: #10261db3;
}
#family-tree-terms-dialog h2 {
  margin-top: 0;
}
#family-tree-terms-dialog .family-tree-terms-content {
  max-height: 45dvh;
  overflow: auto;
  padding: 16px;
  border: 1px solid #dfe7e0;
  border-radius: 8px;
  background: #f8faf8;
}
#family-tree-terms-dialog label {
  display: block;
  margin: 16px 0;
}
#family-tree-terms-dialog input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
}

#donate-dialog {
  box-sizing: border-box;
  width: min(480px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid #dfe7e0;
  border-radius: 14px;
  padding: 24px;
  background: white;
  color: #173632;
}
#donate-dialog::backdrop {
  background: #10261db3;
}
#donate-dialog label {
  display: block;
  margin: 12px 0 6px;
}
#donate-dialog fieldset {
  margin: 18px 0;
  border: 1px solid #dfe7e0;
  border-radius: 8px;
}
#donate-dialog input[type='checkbox'] {
  width: auto;
  margin-right: 6px;
}
#donate-portfolios {
  max-height: 200px;
  overflow: auto;
}
.donation-notice {
  position: fixed;
  bottom: 90px;
  right: 20px;
  max-width: min(400px, 90vw);
  padding: 16px;
  background: #e8f5e9;
  border: 1px solid #287b43;
  border-radius: 8px;
  z-index: 100;
}

/* Social sign-in sits alongside the existing email/password methods. */
.social-login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.social-login form {
  margin: 0;
  min-width: 0;
}
.social-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.social-login-button:hover:not(:disabled) {
  background: #f8faff;
  border-color: #b8c4d5;
}
.social-login-button svg {
  display: block;
  flex: none;
}
.social-login-button:disabled {
  cursor: not-allowed;
  background: #fafafa;
}
.social-login-availability {
  text-align: center;
  font-size: 12px;
  margin: 10px 0 0;
}

/* Consistent roomy add/edit dialogs, constrained to the viewport. */
#record-editor,
#profile-dialog,
.family-member-dialog {
  box-sizing: border-box;
  width: min(800px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
@media (max-width: 600px) {
  #record-editor,
  #profile-dialog,
  .family-member-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }
}

.terms-editor {
  border: 1px solid #bdccc5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.terms-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: #f4f7f5;
  border-bottom: 1px solid #bdccc5;
}
.terms-toolbar button {
  font: inherit;
  font-size: 13px;
  padding: 6px 9px;
  border: 1px solid #cbd7ce;
  border-radius: 4px;
  background: white;
  color: #173632;
  cursor: pointer;
}
.terms-toolbar button[aria-pressed='true'] {
  background: #d7eacb;
  border-color: #517265;
}
.terms-editable {
  min-height: 260px;
  max-height: 50vh;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
}
.terms-editable:focus {
  box-shadow: inset 0 0 0 2px #5b9475;
}
.terms-editable p {
  margin: 0 0 12px;
}
.terms-editable ul,
.terms-editable ol {
  padding-left: 28px;
}
.terms-editable li p {
  margin: 0;
}
.terms-editable blockquote {
  border-left: 3px solid #bdccc5;
  margin-left: 0;
  padding-left: 16px;
}

/* Compact Tiptap document surface and grouped icon toolbar. */
.terms-editor {
  --terms-bg: #fff;
  --terms-fg: #24262b;
  --terms-muted: #666b75;
  --terms-border: #e5e5e8;
  --terms-hover: #eeeef1;
  --terms-active: #dedee6;
  background: var(--terms-bg);
  color: var(--terms-fg);
  border: 1px solid var(--terms-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px #00000014;
}
.terms-editor.terms-editor-dark {
  --terms-bg: #0e0e11;
  --terms-fg: #f1f1f3;
  --terms-muted: #aaaab2;
  --terms-border: #252529;
  --terms-hover: #25252b;
  --terms-active: #363640;
  color-scheme: dark;
}
.terms-editor .terms-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--terms-bg);
  border-bottom: 1px solid var(--terms-border);
}
.terms-tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  border-right: 1px solid var(--terms-border);
}
.terms-tool-group:last-child {
  border: 0;
  padding: 0;
}
.terms-theme-group {
  margin-left: auto;
}
.terms-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  color: var(--terms-muted);
  background: transparent;
}
.terms-toolbar button svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.terms-toolbar button:hover:not(:disabled) {
  background: var(--terms-hover);
  color: var(--terms-fg);
}
.terms-toolbar button[aria-pressed='true'] {
  background: var(--terms-active);
  color: var(--terms-fg);
}
.terms-toolbar button:disabled {
  opacity: 0.3;
  cursor: default;
}
.terms-toolbar select {
  width: 64px !important;
  height: 32px;
  padding: 4px;
  border: 0;
  background: var(--terms-bg);
  color: var(--terms-muted);
  font: inherit;
  font-size: 13px;
  border-radius: 5px;
}
.terms-toolbar button:focus-visible,
.terms-toolbar select:focus-visible {
  outline: 2px solid #9095ee;
  outline-offset: 2px;
}
.terms-editor .terms-editable {
  min-height: 340px;
  max-height: 55vh;
  padding: 28px clamp(18px, 5vw, 64px);
  font-size: 16px;
  line-height: 1.65;
  color: var(--terms-fg);
  caret-color: var(--terms-fg);
  background: var(--terms-bg);
}
.terms-editable p {
  line-height: 1.65;
  color: inherit;
  margin: 0 0 16px;
}
.terms-editable h2 {
  font-size: 24px;
  margin: 24px 0 12px;
}
.terms-editable h3 {
  font-size: 20px;
  margin: 20px 0 10px;
}
.terms-editable blockquote {
  border-left-color: var(--terms-muted);
  color: var(--terms-muted);
}
.terms-editable ::selection {
  background: #6466a9;
  color: white;
}
@media (max-width: 600px) {
  .terms-editor .terms-toolbar {
    padding: 8px;
    gap: 5px;
  }
  .terms-toolbar button {
    width: 36px;
    height: 36px;
  }
  .terms-tool-group {
    padding-right: 5px;
  }
  .terms-editor .terms-editable {
    padding: 20px 16px;
    min-height: 260px;
  }
}

.terms-editor .rich-text-count {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--terms-border);
  color: var(--terms-muted);
}
.terms-editor .rich-text-over-limit {
  color: #e77676;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
}
.icon-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.icon-action svg {
  flex-shrink: 0;
  pointer-events: none;
}

.donate-charity-note {
  padding: 16px 18px;
  background: #e5f3e8;
  color: #173f36;
  border: 1px solid #b7d8bf;
  border-left: 4px solid #1d5e4f;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.5;
  margin: 16px 0 20px;
}
.donate-charity-note strong {
  font-weight: 750;
}
#donate-pay {
  min-height: 48px;
  margin-top: 8px;
}
#donate-pay:disabled {
  opacity: 0.65;
  cursor: wait;
}

.terms-editor:not(.terms-editor-dark) {
  color-scheme: light;
}

.grid-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
}
.grid-exports {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.data-grid .grid-exports .icon-action {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: #334155;
  cursor: pointer;
}
.grid-exports .icon-action svg {
  width: 22px;
  height: 22px;
}
@media (pointer: coarse) {
  .data-grid .grid-exports .icon-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

#management-print-sheet {
  display: none;
}
@media print {
  body.printing-management-grid {
    background: #fff;
    color: #000;
  }
  body.printing-management-grid > :not(#management-print-sheet) {
    display: none !important;
  }
  body.printing-management-grid > #management-print-sheet {
    display: block !important;
  }
  #management-print-sheet table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 9pt;
  }
  #management-print-sheet th,
  #management-print-sheet td {
    border: 1px solid #999;
    padding: 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #000;
    background: #fff;
  }
  #management-print-sheet thead {
    display: table-header-group;
  }
  #management-print-sheet tr {
    break-inside: avoid;
  }
  #management-print-sheet h1 {
    font-size: 20pt;
    letter-spacing: normal;
  }
}

.brand-wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wallet-toggle {
  white-space: nowrap;
  font-size: 13px;
  background: #eaf1e5;
}
.wallet-toggle span {
  font-weight: 700;
}
#wallet-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid #c9d6cf;
  border-radius: 16px;
  padding: 24px;
  color: #173632;
}
#wallet-dialog::backdrop {
  background: #102d2670;
}
#wallet-dialog input {
  width: 100%;
}
#wallet-dialog button:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (max-width: 480px) {
  .brand-wallet {
    gap: 8px;
  }
  .wallet-toggle {
    padding: 8px;
    font-size: 12px;
  }
}

.wallet-menu {
  position: relative;
}
.wallet-menu > summary {
  cursor: pointer;
}
.wallet-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 150px;
  padding: 6px;
  background: #fff;
  border: 1px solid #c9d6cf;
  border-radius: 10px;
  box-shadow: 0 8px 24px #17363220;
  z-index: 45;
}
.wallet-options button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.wallet-options button:hover,
.wallet-options button:focus-visible {
  background: #eaf1e5;
}
#wallet-withdraw-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid #c9d6cf;
  border-radius: 16px;
  padding: 24px;
  color: #173632;
}
#wallet-withdraw-dialog::backdrop {
  background: #102d2670;
}
#wallet-withdraw-dialog input {
  width: 100%;
}
#wallet-withdraw-dialog fieldset {
  border: 1px solid #c9d6cf;
  border-radius: 10px;
  padding: 14px;
}
#wallet-withdraw-dialog button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#wallet-bank-ifsc {
  text-transform: uppercase;
}
.wallet-history {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.wallet-history li {
  padding: 12px 0;
  border-bottom: 1px solid #dce5df;
}
.wallet-history small {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 6px;
  font-size: 11px;
}
#wallet-saved-bank {
  padding: 12px;
  background: #eaf1e5;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
#wallet-check-withdrawals {
  margin-top: 16px;
}

.app-message-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: 85vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid #cbdcd2;
  border-radius: 16px;
  background: #fff;
  color: #173632;
  box-shadow: 0 24px 80px #17363240;
}
.app-message-dialog::backdrop {
  background: #102f2b88;
}
.app-message-dialog h2 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.3;
}
.app-message-dialog p {
  margin: 0 0 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: #49635c;
}
.app-message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.app-message-actions button {
  font: inherit;
  font-weight: 650;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  border: 1px solid transparent;
}
.app-message-accept {
  background: #186747;
  color: #fff;
}
.app-message-cancel {
  background: #eff5f0;
  color: #173632;
  border-color: #cbdcd2 !important;
}
.app-message-danger {
  background: #b33838;
  color: #fff;
}
.app-message-actions button:focus-visible {
  outline: 3px solid #76ae97;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .app-message-dialog {
    padding: 22px;
  }
  .app-message-actions button {
    flex: 1;
  }
}

.home-carousel {
  border: 1px solid #dce5df;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.home-carousel-window {
  overflow: hidden;
}
.home-carousel-track {
  display: flex;
  transition: transform 0.55s ease;
}
.home-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  position: relative;
}
.home-carousel-slide img {
  display: block;
  width: 100%;
  height: clamp(240px, 42vw, 480px);
  object-fit: contain;
  background: #edf3ee;
}
.home-carousel-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}
.home-carousel-caption h3 {
  margin: 0;
}
.home-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 20px 20px;
}
.home-carousel-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.home-carousel-dots button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #b8cdbf;
  background: #eff5f0;
  color: #173632;
  cursor: pointer;
}
.home-carousel-dots button[aria-pressed='true'] {
  background: #186747;
  color: #fff;
}
@media (max-width: 600px) {
  .home-carousel-caption {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-carousel-track {
    transition: none;
  }
}

.home-carousel-frame-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.home-carousel-frame-link:focus-visible {
  outline: 3px solid #186747;
  outline-offset: -3px;
}
.home-carousel-frame-link:hover .home-carousel-caption h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.app-message-dialog #app-message-text {
  white-space: pre-line;
  max-height: 55vh;
  overflow-y: auto;
}

/* WhatsApp verification stays beside the profile's mobile field. */
.whatsapp-verification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}
#whatsapp-device-dialog { max-width: min(520px, calc(100vw - 32px)); }
#whatsapp-device-qr { display: block; max-width: 100%; height: auto; margin: 16px auto; }
#whatsapp-device-qr[hidden] { display: none; }
#whatsapp-otp-status { overflow-wrap: anywhere; }

/* Draw attention to email delivery reminders with readable amber contrast. */
.email-delivery-reminder {
  color: #854d0e;
  background: #fffbeb;
  border-left: 3px solid #d97706;
  border-radius: 4px;
  padding: 10px 12px;
  font-weight: 600;
}
