@font-face {
  font-family: "Pacifico Local";
  src: url("./assets/fonts/Pacifico-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
  color: #332822;
  background: #f7f1e8;
  --earth: #713f2f;
  --earth-dark: #4d281d;
  --leaf: #426a4b;
  --cream: #fffaf2;
  --line: #d9c8b6;
  --danger: #a6302c;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.2rem max(1rem, calc((100vw - 900px) / 2));
  color: white; background: linear-gradient(135deg, var(--earth-dark), var(--earth));
}
.site-header h1 { margin: .15rem 0 0; font-size: clamp(1.55rem, 5vw, 2.25rem); }
.eyebrow { margin: 0; color: #f1d7b6; font-size: .9rem; }
.eyebrow.dark { color: var(--earth); font-weight: 800; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .65rem; }
.community-summary { color: #fff4e6; font-size: .9rem; font-weight: 800; }
main { width: min(900px, calc(100% - 2rem)); margin: 1.5rem auto 4rem; }
.card { padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: 18px; background: var(--cream); box-shadow: 0 8px 28px rgb(72 41 26 / 8%); }
.card + .card { margin-top: 1rem; }
.narrow { max-width: 480px; margin-inline: auto; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1.25rem; padding: .35rem; border-radius: 12px; background: #f1e4d4; }
.auth-switch-button { padding: .7rem; border: 0; border-radius: 9px; color: #6c402f; background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.auth-switch-button.active { color: white; background: var(--earth); }
.application-summary { margin: 1.25rem 0; padding: 1rem; border-radius: 12px; background: #f7ecdd; }
.application-summary div { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; padding: .35rem 0; }
.application-summary dt { font-weight: 800; }
.application-summary dd { margin: 0; }
h2 { margin-top: 0; color: var(--earth-dark); }
label { display: grid; gap: .4rem; margin-bottom: 1rem; font-weight: 700; }
.checkbox-label { display: flex; align-items: flex-start; gap: .65rem; }
.checkbox-label input { width: auto; margin-top: .2rem; flex: 0 0 auto; }
input, textarea, select {
  width: 100%; padding: .78rem; border: 1px solid #bda996; border-radius: 10px;
  background: white; color: inherit;
}
textarea { resize: vertical; }
.field-help { color: #746359; font-size: .86rem; font-weight: 400; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 3px solid rgb(66 106 75 / 28%); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.button {
  min-height: 44px; padding: .7rem 1rem; border: 0; border-radius: 10px;
  color: white; background: var(--earth); font-weight: 800;
}
.button:hover { background: var(--earth-dark); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.secondary { color: var(--earth-dark); background: #eadac7; }
.button.ghost { color: var(--danger); background: transparent; border: 1px solid #d9aaa7; }
.button.danger { background: var(--danger); }
.button.record { background: var(--leaf); }
.button.wide { width: 100%; margin-top: 1rem; }
.button-row, .audio-state { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.audio-panel, .photo-panel, .video-panel, .rights-panel { margin: 1.5rem 0; padding: 1.2rem; border: 2px solid #ceb69c; border-radius: 14px; background: #fffdf9; }
.audio-panel legend, .photo-panel legend, .video-panel legend, .rights-panel legend { padding: 0 .5rem; color: var(--earth-dark); font-size: 1.2rem; font-weight: 900; }
.audio-panel audio { width: min(100%, 420px); }
.photo-state { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.photo-state img {
  display: block; width: min(100%, 280px); max-height: 280px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 12px; background: #f3ece3;
}
.photo-details { min-width: 0; }
.photo-details p { overflow-wrap: anywhere; }
.video-state { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; min-width: 0; }
.video-state video { display: block; width: min(100%, 420px); max-height: 420px; background: #111; border-radius: 12px; }
.video-details { min-width: 0; }
.video-details p { overflow-wrap: anywhere; }
.consent { color: #665147; font-weight: 700; }
.recording-indicator { color: var(--danger); font-size: 1.2rem; font-weight: 900; }
.recording-indicator span { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.warning { color: #854d0e; font-weight: 800; }
.status { min-height: 1.5em; margin-bottom: 0; }
.status.error { color: var(--danger); font-weight: 700; }
.status.success { color: #286136; font-weight: 700; }
.notice { margin-bottom: 1rem; background: #fff3cd; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.community-bar {
  display: grid; grid-template-columns: 1.2fr repeat(3, minmax(145px, 1fr)); align-items: end; gap: .6rem 1rem;
  margin-bottom: 1rem; padding: 1rem 1.2rem; border-radius: 14px; color: #fdf8f1; background: var(--leaf);
}
.community-bar strong, .community-bar span { display: block; }
.community-bar span { margin-top: .2rem; font-size: .86rem; opacity: .9; }
.community-bar label { margin: 0; }
.community-bar select { color: #332822; }
.community-bar .status { grid-column: 1 / -1; margin: 0; color: white; }
.admin-badge { display: inline-block; margin-left: .35rem; padding: .15rem .48rem; border-radius: 999px; color: #4d281d; background: #ffe1a8; font-size: .72rem; vertical-align: middle; }
.admin-panel { margin-top: 1.5rem; padding: 1rem; border: 2px solid #c7923d; border-radius: 14px; background: #fff8e8; }
.admin-panel h3 { margin-top: 0; color: #74490a; }
.count-badge { display: inline-flex; min-width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center; margin-left: .3rem; border-radius: 999px; color: #633119; background: #ffe1a8; font-size: .75rem; }
.account-list { display: grid; gap: 1rem; margin-top: 1rem; }
.account-card { padding: 1rem; border: 1px solid #dbc4aa; border-radius: 14px; background: #fffdf9; }
.account-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.account-heading h3, .account-heading p { margin: 0 0 .25rem; }
.account-status { flex: 0 0 auto; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.account-status.pending { color: #76500b; background: #fff0b9; }
.account-status.approved { color: #21552d; background: #d9f0de; }
.account-status.rejected, .account-status.suspended { color: #792f2f; background: #f8dada; }
.record-management { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 2px solid var(--line); }
.edit-record-form { margin-top: 1rem; padding: 1rem; border: 2px solid #c7923d; border-radius: 14px; background: #fff8e8; }
.trash-list, .activity-list { display: grid; gap: 1rem; margin-top: 1rem; }
.trash-card, .activity-item { padding: 1rem; border: 1px solid #dbc4aa; border-radius: 14px; background: #fffdf9; }
.trash-card h3, .trash-card p, .activity-item p { margin: 0 0 .45rem; }
.trash-meta { color: #665147; font-size: .9rem; }
.activity-panel { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 2px solid var(--line); }
.activity-action { display: inline-block; margin-right: .45rem; padding: .15rem .5rem; border-radius: 999px; color: #315038; background: #dfeedd; font-size: .78rem; font-weight: 900; }
.consent-check { display: flex; align-items: flex-start; gap: .65rem; margin: 1rem 0; padding: .9rem; border-radius: 10px; background: #f5eadc; }
.consent-check input { width: auto; margin-top: .25rem; transform: scale(1.15); }
.consent-check span { flex: 1; }
.site-footer { max-width: 900px; margin: 1.5rem auto 2rem; padding: 1rem; text-align: center; color: #665147; font-size: .9rem; }
.site-footer p { margin: .35rem 0; }
.legal-dialog { width: min(760px, calc(100% - 2rem)); max-height: 85vh; padding: 1.4rem; border: 0; border-radius: 16px; color: var(--ink); background: #fffdf9; box-shadow: 0 18px 60px #27160f55; }
.legal-dialog::backdrop { background: #27160f99; }
.legal-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: sticky; top: 0; padding-bottom: .75rem; background: #fffdf9; }
.legal-dialog-heading h2 { margin: 0; }
.legal-content { line-height: 1.75; }
.legal-content h3 { margin-top: 1.4rem; color: var(--earth-dark); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.record-destination { padding: .7rem .9rem; border-left: 4px solid var(--leaf); border-radius: 6px; background: #eef5ed; font-weight: 800; }
.dialect-filter { max-width: 320px; margin: .8rem 0 0; }
.dialect-badge { display: inline-block; margin-bottom: .35rem; padding: .2rem .55rem; border-radius: 999px; color: #315038; background: #dfeedd; font-size: .78rem; font-weight: 900; }
.pending-badge { color: #7a4a08; background: #fff0c7; }
.verification-badge { display: inline-block; padding: .2rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 900; }
.verification-badge.pending { color: #76500b; background: #fff0b9; }
.verification-badge.confirmed { color: #21552d; background: #d9f0de; }
.verification-badge.needs_revision { color: #8a4c0e; background: #ffe1bd; }
.verification-badge.is-hidden { color: #5b5b5b; background: #e5e5e5; }
.tab { flex: 1; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; color: var(--earth-dark); background: white; font-weight: 800; }
.tab.active { color: white; background: var(--earth); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.search-panel { margin: 1rem 0; padding: 1rem; border-radius: 12px; background: #f5eadc; }
.search-panel label { margin-bottom: .45rem; }
.search-row { display: flex; align-items: stretch; gap: .6rem; }
.search-row input { flex: 1; }
.search-primary-row { display: flex; align-items: flex-start; gap: .75rem; }
.search-field { position: relative; flex: 1; margin: 0 !important; }
.search-field::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.15rem;
  width: 17px;
  height: 17px;
  border: 3px solid var(--fern-800, #2a6043);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}
.search-field::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: .88rem;
  bottom: 1.02rem;
  width: 9px;
  height: 3px;
  border-radius: 3px;
  background: var(--fern-800, #2a6043);
  pointer-events: none;
  transform: rotate(45deg);
}
.search-field input { width: 100%; min-height: 58px; padding-right: 3.5rem; border-radius: 16px; background: white; }
.advanced-filter-disclosure { position: relative; flex: 0 0 auto; }
.advanced-filter-disclosure > summary {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: var(--fern-800, #2a6043);
  background: white;
  cursor: pointer;
  list-style: none;
}
.advanced-filter-disclosure > summary::-webkit-details-marker { display: none; }
.advanced-filter-disclosure > summary::before {
  content: "";
  width: 27px;
  height: 20px;
  background: linear-gradient(currentColor, currentColor) 0 2px / 27px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 0 9px / 27px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 0 16px / 27px 3px no-repeat;
}
.advanced-filter-disclosure > summary::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 13px 7px 0 currentColor, -5px 14px 0 currentColor;
}
.advanced-filter-disclosure > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.advanced-filter-disclosure[open] > summary { color: white; background: var(--fern-800, #2a6043); }
.advanced-filter-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + .65rem);
  right: 0;
  width: min(760px, calc(100vw - 3rem));
  padding: 1rem;
  border: 1px solid var(--line-2, #cdd5c1);
  border-radius: 16px;
  background: var(--paper, white);
  box-shadow: 0 18px 45px rgb(18 59 42 / 18%);
}
.advanced-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.advanced-filter-heading h3 { margin: 0; color: var(--fern-900, #1f4b35); }
.advanced-filter-note { margin: 0 0 .85rem; padding: .7rem .85rem; border-radius: 10px; color: var(--muted, #5d6d62); background: var(--sage-100, #eef2e8); font-size: .86rem; }
.advanced-filter-actions { position: sticky; bottom: -1rem; display: flex; justify-content: flex-end; margin: 1rem -1rem -1rem; padding: .8rem 1rem; border-top: 1px solid var(--line-2, #cdd5c1); background: var(--paper, white); }
.advanced-filter-actions .button { min-width: 150px; }
.preference-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 900px; margin-top: 1.25rem; }
.default-search-summary { margin: .55rem .25rem 0; color: var(--fern-800, #2a6043); font-size: .88rem; font-weight: 700; }
.default-search-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.text-button.compact { flex: 0 0 auto; margin: 0; padding: .35rem .25rem; font-size: .88rem; }
.search-help { margin: .6rem 0 0; color: #665147; font-size: .9rem; }
.record-list-header,
.record-list-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.4fr)
    minmax(150px, 1.4fr)
    minmax(90px, .8fr)
    minmax(90px, .8fr)
    minmax(110px, .8fr);
  gap: 1rem;
  align-items: center;
}
.record-list-header {
  padding: .75rem;
  border-bottom: 2px solid var(--earth);
  border-radius: 10px 10px 0 0;
  color: var(--earth-dark);
  background: #eadac7;
  font-weight: 900;
}
.record-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-bottom: 1px solid var(--line); }
.record-favorite-slot { display: grid; place-items: center; width: 60px; padding: .45rem; }
.record-favorite-control { display: grid; place-items: center; }
.favorite-button { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #8b2942; background: #fffdf8; font-size: 1.55rem; line-height: 1; cursor: pointer; }
.favorite-button:hover { border-color: #8b2942; background: #fff2f4; }
.favorite-button[aria-pressed="true"] { color: #9e183d; background: #ffe8ed; }
.favorite-button:disabled { cursor: wait; opacity: .55; }
.favorite-global-status:empty { display: none; }
.favorite-global-status:not(:empty) { position: fixed; z-index: 1300; right: 1rem; bottom: 1rem; max-width: min(420px, calc(100vw - 2rem)); margin: 0; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper, white); box-shadow: 0 10px 30px rgb(18 59 42 / 22%); }
.my-database-tabs { display: flex; gap: .65rem; margin: 1rem 0; }
.my-database-tabs .button { min-width: 120px; }
.personal-record-list { display: grid; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.detail-heading h2 { margin: 0; }
.song-list { display: grid; gap: 1rem; }
.song-card { padding: 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper, white); }
.song-card h3 { margin: 0 0 .45rem; }
.song-card p { margin: .35rem 0; }
.song-card .button { margin-top: .6rem; }
.song-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.record-link { width: 100%; padding: 1rem .75rem; border: 0; text-align: left; color: inherit; background: transparent; }
.record-link:hover { background: #f8efe3; }
.record-field { min-width: 0; overflow-wrap: anywhere; }
.record-indigenous, .record-translation {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.record-indigenous { font-weight: 900; }
.record-speaker, .record-recorder { font-weight: 700; }
.record-date { color: #746359; font-size: .9rem; }
.text-button { margin-bottom: 1rem; padding: .4rem 0; border: 0; color: var(--earth); background: transparent; font-weight: 800; }
.detail-audio { width: 100%; margin-top: .6rem; }
.detail-photo { display: block; width: 100%; max-height: 680px; object-fit: contain; border-radius: 14px; }
.detail-video { display: block; width: 100%; max-height: 680px; margin-top: .6rem; background: #111; border-radius: 14px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Public listening page and fixed share-card templates. */
.share-entry { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 1.25rem 0; padding: 1rem; border: 1px solid #cbd4bd; border-radius: 16px; background: #f5f6ed; }
.share-entry-copy { flex: 1 1 260px; margin: 0; color: #526455; }
.share-entry .button { flex: 0 0 auto; }
.share-dialog { width: min(620px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto; padding: 1.4rem; border: 1px solid #b9c5ad; border-radius: 20px; color: #173f31; background: #fbfaf4; box-shadow: 0 22px 70px rgb(18 59 42 / 28%); }
.share-dialog::backdrop { background: rgb(18 41 31 / 58%); backdrop-filter: blur(3px); }
.share-dialog h2 { margin-top: 0; }
.share-dialog ul { padding-left: 1.4rem; }
.dialog-actions, .share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin-top: 1rem; }
.share-preview-dialog { width: min(720px, calc(100vw - 1.5rem)); }
.share-preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.share-preview-header h2 { margin-bottom: .2rem; }
.share-dialog-close { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid #b9c5ad; border-radius: 50%; color: #173f31; background: #fffdf8; font-size: 1.65rem; cursor: pointer; }
.share-canvas-frame { width: min(100%, 432px); margin-inline: auto; overflow: hidden; border: 1px solid #d7ceb9; border-radius: 14px; background: #f7f3e8; box-shadow: 0 12px 35px rgb(18 59 42 / 12%); }
#share-card-canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.audio-share-video-panel { margin-top: 1rem; padding: 1rem; border: 1px solid #cbd4bd; border-radius: 14px; background: #f5f6ed; }
.audio-share-video-panel h3 { margin: 0 0 .7rem; }
.audio-share-video-panel audio { width: 100%; }
.share-video-availability { margin: .6rem 0; color: #526455; font-size: .92rem; }
.share-video-warning { margin: .8rem 0; color: #654b3a; font-size: .92rem; line-height: 1.6; }
.share-video-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: center; margin-top: .75rem; }
.share-video-progress progress { width: 100%; accent-color: #214f38; }
.share-video-actions { margin-top: .75rem; }
.public-share-mode .site-header .header-actions { display: none; }
.public-share-mode main { width: min(100% - 1rem, 760px); }
.public-share-view { padding: clamp(1rem, 5vw, 3rem) 0; }
.public-listening-card { position: relative; overflow: hidden; padding: clamp(1.5rem, 6vw, 4rem); border: 1px solid #ccd5bd; border-radius: 26px; background: linear-gradient(155deg, #fbfaf3 0 64%, #e3e8d6 64%); box-shadow: 0 18px 55px rgb(18 59 42 / 10%); }
.public-listening-card::after { content: ""; position: absolute; z-index: 0; right: -8%; bottom: -12%; width: 56%; aspect-ratio: 1; border: 2px solid rgb(89 119 82 / 22%); border-radius: 58% 42% 62% 38%; transform: rotate(-14deg); }
.public-listening-content { position: relative; z-index: 1; }
.public-listening-brand { margin: 0 0 2.5rem; color: #214f38; font-weight: 900; letter-spacing: .02em; }
.public-listening-meta { color: #6d533e; font-weight: 800; }
.public-listening-text { margin: 1rem 0; color: #173f31; font-size: clamp(2rem, 7vw, 4.4rem); line-height: 1.25; overflow-wrap: anywhere; }
.public-listening-translation { max-width: 34rem; color: #654b3a; font-size: clamp(1.12rem, 3vw, 1.45rem); line-height: 1.75; overflow-wrap: anywhere; }
.public-audio-wrap { margin: 2rem 0; padding: 1rem; border-left: 4px solid #d98b31; border-radius: 12px; background: rgb(255 253 248 / 82%); }
.public-audio-wrap audio { width: 100%; }
.public-listening-footer { position: relative; z-index: 1; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px dashed #9faa8e; }
.public-listening-footer p { color: #627163; }
.public-unavailable { position: relative; z-index: 1; min-height: 280px; display: grid; place-items: center; text-align: center; }
.share-loading { min-height: 280px; display: grid; place-items: center; color: #526455; font-weight: 800; }

@media (max-width: 620px) {
  .share-entry { align-items: stretch; }
  .share-entry .button { flex: 1 1 100%; }
  .share-dialog { padding: 1rem; }
  .dialog-actions, .share-actions { display: grid; grid-template-columns: 1fr; }
  .share-actions .button, .dialog-actions .button { width: 100%; }
  .share-actions { padding-bottom: max(.5rem, env(safe-area-inset-bottom)); }
  .public-listening-card { border-radius: 18px; }
}

@media (max-width: 620px) {
  .site-header { align-items: flex-start; }
  .header-actions { flex-direction: column; align-items: flex-end; }
  .community-bar { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; gap: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .record-list-header { display: none; }
  .record-item {
    grid-template-columns: minmax(0, 1fr) 56px;
    margin-top: .8rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
    overflow: hidden;
  }
  .song-filter-grid { grid-template-columns: 1fr; }
  .record-list-row { display: block; }
  .record-link { padding: 1rem; }
  .record-favorite-slot { width: 56px; padding: .35rem; }
  .my-database-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .my-database-tabs .button { min-width: 0; min-height: 44px; }
  .record-field { display: block; }
  .record-field::before {
    content: attr(data-label);
    display: block;
    margin: .7rem 0 .18rem;
    color: #746359;
    font-size: .78rem;
    font-weight: 700;
  }
  .record-indigenous::before { margin-top: 0; }
  .record-indigenous { color: var(--earth-dark); font-size: 1.08rem; }
  .record-translation { margin-top: .15rem; }
  .record-speaker, .record-recorder, .record-date { font-size: .9rem; font-weight: 500; }
  .button-row .button, .audio-state > .button { flex: 1; }
  .search-row { align-items: stretch; }
  .search-panel { padding: .75rem; background: transparent; }
  .search-primary-row { gap: .55rem; }
  .search-field input { min-height: 56px; border-radius: 14px; }
  .advanced-filter-disclosure > summary { width: 56px; height: 56px; border: 1px solid var(--line-2, #cdd5c1); border-radius: 14px; }
  .advanced-filter-panel { position: fixed; z-index: 100; inset: auto .5rem .75rem; width: auto; max-height: min(76vh, 680px); overflow-y: auto; padding: 1rem; border-radius: 20px; }
  .advanced-filter-heading { position: sticky; top: -1rem; z-index: 1; padding: 1rem 0 .65rem; background: var(--paper, white); }
  .advanced-filter-actions .button { width: 100%; }
  .default-search-row { align-items: center; }
  .preference-settings-grid { grid-template-columns: 1fr; gap: .25rem; }
}

/* Approved reference — final visual layer */
:root {
  --forest-950: #173f2d;
  --forest-900: #1f4b35;
  --forest-800: #2a6043;
  --sage-700: #7f9363;
  --sage-500: #98a876;
  --sage-300: #bdc6a9;
  --ivory-100: #fbfaf6;
  --ivory-200: #f7f5ee;
  --warm-line: #dfd1bf;
  --soft-shadow: 0 5px 18px rgb(42 63 45 / 6%);
  --content-width: 1330px;
  --soft-radius: 15px;
}

html { background: var(--ivory-100); }
body {
  position: relative;
  color: var(--forest-950);
  background-color: var(--ivory-100);
  background-image: url("./assets/botanical-corner.svg"), url("./assets/botanical-corner.svg");
  background-repeat: no-repeat;
  background-position: left 54vh, right 105px;
  background-size: clamp(150px, 17vw, 280px) auto;
}
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  right: -45px;
  bottom: 3%;
  width: 230px;
  height: 280px;
  opacity: .45;
  background: url("./assets/botanical-corner.svg") center / contain no-repeat;
  transform: rotate(180deg);
  pointer-events: none;
}

.header-inner, main, .site-footer {
  width: min(80%, var(--content-width));
  max-width: var(--content-width);
  margin-inline: auto;
}
.site-header {
  min-height: 94px;
  padding: 0;
  border: 0;
  color: white;
  background: linear-gradient(108deg, #244f38, #173f2d);
  box-shadow: none;
}
.site-header::after { display: none; }
.header-inner { min-height: 94px; }
.brand-lockup { gap: .8rem; }
.brand-lockup .eyebrow { display: none; }
.brand-mark {
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark { position: relative; padding: 0; cursor: pointer; }
.mobile-menu-button { display: none; }
.site-header h1 { gap: 1rem; margin: 0; font-size: clamp(1.05rem, 1.4vw, 1.3rem); }
.brand-script { font-size: clamp(2.8rem, 4vw, 3.35rem); }
.header-actions { gap: 1rem; }
.community-summary { color: #fffdf6; font-size: .95rem; letter-spacing: .02em; }
.site-header .button.secondary:not(.hidden) { position: relative; min-width: 76px; margin-left: 58px; border-radius: 18px; color: var(--forest-950); background: #fffdf8; }
.site-header .button.secondary:not(.hidden)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -58px;
  width: 48px;
  height: 48px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fffdf8 url("./assets/ngai-mark.png") center / 92% no-repeat;
  transform: translateY(-50%);
}

main { margin-top: 1.15rem; margin-bottom: 1.25rem; }
.community-bar {
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.8rem);
  min-height: 128px;
  margin-bottom: .8rem;
  padding: 1rem clamp(1.5rem, 3vw, 3rem);
  border: 1px solid #bdc6aa;
  border-radius: var(--soft-radius);
  color: var(--forest-950);
  background: linear-gradient(105deg, rgb(249 248 241 / 96%), rgb(245 246 237 / 96%));
  box-shadow: none;
}
.community-bar > div { position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-right: 2.4rem; border-right: 1px dashed #98a376; }
.community-bar > div::after {
  content: "";
  position: absolute;
  right: -15px;
  top: 50%;
  width: 29px;
  height: 38px;
  background: #f7f7ef url("./assets/leaf-sprig.svg") center / contain no-repeat;
  transform: translateY(-50%);
}
.community-bar strong { font-size: 1.05rem; }
.community-bar span { font-size: .85rem; }
.community-bar label { gap: .4rem; margin: 0; font-size: .93rem; }
.community-bar select {
  min-height: 50px;
  padding: .55rem 2.4rem .55rem 2.55rem;
  border: 1px solid #b9c2aa;
  border-radius: 11px;
  background-color: #fffefa;
  background-image: url("./assets/leaf-sprig.svg");
  background-repeat: no-repeat;
  background-position: .65rem center;
  background-size: 23px;
}
.admin-badge { display: block; width: 100%; margin: .35rem 0 .15rem; padding: .2rem .7rem; border-radius: 999px; color: white !important; background: linear-gradient(90deg, #79936c, #a7b284); }

.tabs { gap: 1rem; margin-bottom: .8rem; }
.tab {
  min-height: 50px;
  padding: .65rem 1rem;
  border: 1px solid var(--warm-line);
  border-radius: 12px;
  color: var(--forest-900);
  background: rgb(255 253 248 / 92%);
  box-shadow: none;
  font-size: 1rem;
}
.tab::before { content: ""; display: inline-block; width: 22px; height: 22px; margin-right: .5rem; vertical-align: -.35rem; background: url("./assets/leaf-sprig.svg") center / contain no-repeat; }
.tab:hover { border-color: var(--sage-500); }
.tab.active { border-color: var(--forest-800); color: white; background: linear-gradient(105deg, #2c6546, #25593e); box-shadow: none; }
.tab.active::before { filter: brightness(0) invert(1); opacity: .9; }
.count-badge { min-width: 1.45rem; height: 1.45rem; margin-left: .25rem; padding: 0 .35rem; color: #4d3600; background: #f2a900; }

.card {
  padding: clamp(1.4rem, 2.3vw, 2rem);
  border: 1px solid var(--warm-line);
  border-radius: var(--soft-radius);
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--soft-shadow);
}
.section-heading { position: relative; padding-bottom: 1rem; border-bottom: 1px dashed #a5ad7d; }
.section-heading::before,
#new-view > h2::before { content: ""; flex: 0 0 auto; width: 42px; height: 62px; background: url("./assets/leaf-sprig.svg") center / contain no-repeat; transform: rotate(-16deg); }
.section-heading::after,
#new-view > h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -17px;
  width: 86px;
  height: 34px;
  background: var(--ivory-100) url("./assets/floral-divider.svg") center / 160px auto no-repeat;
  transform: translateX(-50%);
}
.section-heading > div { flex: 1; }
.section-heading .eyebrow { margin-bottom: .1rem; color: var(--forest-800); font-size: .92rem; letter-spacing: .03em; }
.section-heading h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.55rem, 2.2vw, 2rem); }
.section-heading h2::before, .section-heading h2::after { display: none; }
.section-heading .button.secondary { min-width: 128px; border: 1px solid #849777; color: var(--forest-900); background: #fbfbf5; }
.section-heading .button.secondary::before { content: "↻"; margin-right: .45rem; font-size: 1.35rem; vertical-align: -.08rem; }

#new-view > h2 { position: relative; display: flex; align-items: center; gap: .55rem; margin: 0 0 1.25rem; padding: 0 0 1rem; border-bottom: 1px dashed #a5ad7d; font-size: clamp(1.45rem, 2vw, 1.8rem); }
#new-view > h2::before { display: block; }
.record-destination { display: none; }

input, textarea, select { border: 1px solid #b9c3ad; border-radius: 11px; background-color: rgb(255 255 252 / 94%); box-shadow: inset 0 1px 2px rgb(31 75 53 / 2%); }
#accounts-view .admin-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.7rem; }
#accounts-view .admin-grid input, #accounts-view .admin-grid select { min-height: 60px; }
#account-search { padding-right: 3rem; background-image: url("./assets/leaf-sprig.svg"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 25px; }
#accounts-status:not(:empty) { display: flex; align-items: center; gap: 1rem; min-height: 110px; margin: .8rem 0 0; padding-left: 12%; color: #2f3d34; }
#accounts-status:not(:empty)::before { content: ""; flex: 0 0 54px; width: 54px; height: 54px; border: 1px dashed var(--sage-500); border-radius: 50%; background: url("./assets/leaf-sprig.svg") center / 31px no-repeat; }
.account-list { margin-top: .8rem; }

#new-view form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(340px, .82fr); gap: 0 1.25rem; }
#new-view form > label { grid-column: 1 / 3; margin-bottom: .55rem; }
#new-view #record-tribe-field { grid-column: 1; grid-row: 1; }
#new-view #record-tribe-field + label { grid-column: 2; grid-row: 1; }
#new-view .form-grid { grid-column: 1 / 3; grid-row: 2; gap: 1rem; }
#new-view #recorded-date { min-height: 40px; }
#new-view form > label:has(#recorded-date) { grid-row: 3; }
#new-view form > label:has(#indigenous-text) { grid-row: 4; }
#new-view form > label:has(#translation) { grid-row: 5; }
#new-view form > label:has(#notes) { grid-row: 6; }
#new-view input, #new-view select { min-height: 40px; padding: .45rem .75rem; }
#new-view textarea { min-height: 48px; height: 48px; padding: .55rem .75rem; resize: vertical; }
#new-view label:has(input:not([type="checkbox"])), #new-view label:has(textarea) { position: relative; }
#new-view label:has(input:not([type="checkbox"]))::after, #new-view label:has(textarea)::after { content: ""; position: absolute; right: .5rem; bottom: .55rem; width: 21px; height: 21px; background: url("./assets/leaf-sprig.svg") center / contain no-repeat; pointer-events: none; }
#new-view .audio-panel, #new-view .photo-panel, #new-view .video-panel, #new-view .rights-panel { grid-column: 3; margin: 0 0 .6rem; padding: .75rem 1rem; border: 1px solid var(--warm-line); border-radius: 14px; background: rgb(251 250 245 / 95%); }
#new-view .audio-panel, #new-view .photo-panel, #new-view .video-panel, #new-view .rights-panel { min-width: 0; max-width: 100%; box-sizing: border-box; }
#new-view .video-state, #new-view .video-details { min-width: 0; max-width: 100%; }
#new-view #video-preview { display: block; width: 100%; max-width: 100%; }
#new-view .video-panel p, #new-view .video-panel strong { overflow-wrap: anywhere; }
#new-view .video-panel .button { max-width: 100%; white-space: normal; }
#new-view .audio-panel { grid-row: 1 / span 3; display: flex; flex-direction: column; min-height: 205px; }
#new-view .photo-panel { grid-row: 4 / span 2; }
#new-view .video-panel { grid-row: 6 / span 2; }
#new-view .rights-panel { grid-row: 8; }
#new-view .audio-panel legend, #new-view .photo-panel legend, #new-view .video-panel legend, #new-view .rights-panel legend { padding: 0 .4rem; color: var(--forest-900); font-size: .98rem; }
#new-view .audio-panel legend::before, #new-view .photo-panel legend::before, #new-view .video-panel legend::before { content: ""; display: inline-block; width: 20px; height: 20px; margin-right: .4rem; vertical-align: -.3rem; background: url("./assets/leaf-sprig.svg") center / contain no-repeat; }
#new-view .audio-state { order: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 112px; text-align: center; }
#new-view .audio-intro { order: 2; margin: 0; padding-top: .55rem; border-top: 1px dashed #b3b996; font-size: .78rem; }
#new-view #start-recording { justify-self: center; width: 72px; height: 72px; padding: .4rem; border-radius: 50%; color: white; background: #f0a800; }
#new-view #choose-audio, #new-view #choose-photo, #new-view #choose-video { border: 1px solid #6f8d70; color: var(--forest-900); background: #fbfaf4; }
#new-view .photo-panel p, #new-view .video-panel p { margin: .35rem 0 0; font-size: .8rem; }
#new-view .rights-panel .consent-check { margin: 0; padding: .2rem 0; background: transparent; font-size: .85rem; }
#new-view #save-record { grid-column: 1 / 4; min-height: 46px; margin-top: .1rem; }
#new-view #save-status { grid-column: 1 / 4; }

.site-footer { position: relative; max-width: none; margin-top: 1.8rem; padding: 3.4rem 1rem 1.4rem; border: 0; color: #4d5e52; }
.site-footer::before { content: ""; top: 0; left: 50%; width: 100vw; height: 58px; color: transparent; background: url("./assets/floral-divider.svg") center top / 240px 52px no-repeat, linear-gradient(176deg, transparent 46%, #a8b596 47%, #a8b596 48%, transparent 49%); transform: translateX(-50%); }
.site-footer p { margin: .25rem 0; }

@media (max-width: 1100px) {
  .header-inner, main, .site-footer { width: min(92%, var(--content-width)); }
  .community-bar { grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
  .community-bar > div { grid-column: 1 / -1; padding: 0 0 .8rem; border-right: 0; border-bottom: 1px dashed #98a376; }
  .community-bar > div::after { right: 50%; top: auto; bottom: -19px; transform: translateX(50%) rotate(90deg); }
  #new-view form { grid-template-columns: 1fr 1fr; }
  #new-view .audio-panel, #new-view .photo-panel, #new-view .video-panel, #new-view .rights-panel { grid-column: 1 / 3; grid-row: auto; }
  #new-view #save-record, #new-view #save-status { grid-column: 1 / 3; }
}

@media (max-width: 760px) {
  .header-inner, main, .site-footer { width: calc(100% - 1rem); }
  .header-inner { min-height: 82px; }
  .brand-mark { width: 62px; height: 62px; }
  .brand-script { font-size: 2.2rem; }
  .header-actions { max-width: none; }
  .site-header .button.secondary:not(.hidden) { margin-left: 0; }
  .site-header .button.secondary:not(.hidden)::before { display: none; }
  .community-bar { grid-template-columns: 1fr; min-height: 0; padding: 1rem; }
  .community-bar > div, .community-bar label { grid-column: 1; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .tab { min-width: 0; }
  .section-heading { align-items: flex-start; }
  .section-heading::before { width: 34px; height: 48px; }
  #accounts-view .admin-grid { grid-template-columns: 1fr; gap: .2rem; }
  #accounts-status:not(:empty) { padding-left: 4%; }
  #new-view form { display: block; }
  #new-view .audio-panel, #new-view .photo-panel, #new-view .video-panel, #new-view .rights-panel { margin-top: .8rem; }
  #new-view #save-record { position: static; width: 100%; }
  .site-footer { padding-top: 3rem; }
}

@media (max-width: 480px) {
  body { background-size: 130px auto; }
  .site-header h1 { gap: .45rem; }
  .site-header h1 > span:last-child { font-size: .82rem; }
  .tabs { gap: .55rem; }
  .tab { min-height: 46px; padding: .5rem .3rem; font-size: .88rem; }
  .tab::before { width: 18px; height: 18px; margin-right: .25rem; }
  .card { padding: 1rem; }
  .section-heading { flex-wrap: wrap; }
  .section-heading .button.secondary { margin-left: auto; }
  #accounts-status:not(:empty) { align-items: flex-start; padding: 1rem 0; }
}

/* 2026 botanical visual system */
:root {
  --fern-950: #214b35;
  --fern-900: #27563d;
  --fern-800: #2f6949;
  --fern-700: #397755;
  --sage-500: #96a66f;
  --sage-300: #c3cbb0;
  --sage-100: #f1f3e9;
  --marigold: #f1ad08;
  --cockscomb: #d0222b;
  --silver-leaf: #adb9af;
  --canvas: #fbfaf6;
  --paper: #fffdf8;
  --cream-2: #f7f4ec;
  --ink: #204a35;
  --muted: #66766b;
  --line-2: #dfd2c0;
  --earth: var(--fern-800);
  --earth-dark: var(--fern-950);
  --leaf: var(--fern-700);
  --cream: var(--paper);
  --line: var(--line-2);
}

html { background: var(--canvas); }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 52%, rgb(136 155 98 / 7%) 0 2px, transparent 3px),
    radial-gradient(circle at 96% 24%, rgb(136 155 98 / 7%) 0 2px, transparent 3px),
    var(--canvas);
  line-height: 1.6;
}

.site-header {
  position: relative;
  padding: 0;
  color: white;
  background: #234f38;
  border-bottom: 3px solid rgb(236 165 0 / 70%);
  box-shadow: 0 8px 28px rgb(18 59 42 / 18%);
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -3px;
  height: 3px;
  background: linear-gradient(90deg, var(--marigold) 0 33.33%, var(--cockscomb) 33.33% 66.66%, var(--silver-leaf) 66.66%);
}
.header-inner {
  width: min(1120px, calc(100% - 2rem));
  min-height: 112px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}
.brand-lockup { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / 72%);
  border-radius: 50%;
  background: #fffdf5;
  box-shadow: 0 4px 16px rgb(0 0 0 / 16%);
}
.brand-mark img { width: 92%; height: 92%; object-fit: contain; }
.site-header h1 { display: flex; align-items: baseline; gap: .65rem; margin: .1rem 0 0; font-size: clamp(1rem, 2.4vw, 1.35rem); font-weight: 800; }
.brand-script { font-family: "Pacifico Local", cursive; font-size: clamp(2.1rem, 5vw, 3.15rem); font-style: normal; font-weight: 400; letter-spacing: -.055em; line-height: .9; }
.eyebrow { color: #e9d9a8; font-size: .78rem; letter-spacing: .08em; }
.eyebrow.dark { color: var(--fern-700); }
.community-summary { color: #f8f2df; }
.site-header .button.secondary { color: var(--fern-950); background: #fffaf0; }
.site-header .button.secondary:hover { color: white; background: var(--fern-700); }

main { width: min(1120px, calc(100% - 2rem)); margin: 2rem auto 4.5rem; }
.card {
  border-color: var(--line-2);
  border-radius: 18px;
  background: rgb(255 254 249 / 96%);
  box-shadow: 0 12px 32px rgb(39 70 50 / 8%);
}
.card h2 { position: relative; padding-bottom: .75rem; color: var(--fern-900); }
.card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 84px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--marigold) 0 33.33%, var(--cockscomb) 33.33% 66.66%, var(--silver-leaf) 66.66%);
}
.narrow { max-width: 560px; }
.auth-switch { background: var(--sage-100); }
.auth-switch-button { color: var(--fern-800); }
.auth-switch-button.active { background: var(--fern-800); }

label { color: var(--fern-950); }
input, textarea, select {
  min-height: 48px;
  border-color: #bfc7b2;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 96px; }
input:hover, textarea:hover, select:hover { border-color: var(--sage-500); }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgb(236 165 0 / 24%);
  outline-offset: 2px;
  border-color: var(--fern-700);
}
.field-help, .search-help, .record-date, .trash-meta { color: var(--muted); }

.button {
  min-height: 48px;
  border-radius: 11px;
  color: white;
  background: var(--fern-800);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); background: var(--fern-950); box-shadow: 0 6px 18px rgb(18 59 42 / 18%); }
.button.secondary { color: var(--fern-950); background: #ece5d5; }
.button.ghost { color: var(--cockscomb); border-color: rgb(189 31 37 / 32%); }
.button.danger { background: var(--cockscomb); }
.button.record { color: #183724; background: var(--marigold); }

.community-bar {
  grid-template-columns: 1.2fr repeat(3, minmax(160px, 1fr));
  padding: 1.25rem 1.4rem;
  border: 1px solid #c8cfbb;
  border-radius: 18px;
  color: var(--fern-950);
  background: #f5f5ed;
  box-shadow: 0 10px 26px rgb(39 70 50 / 7%);
}
.community-bar strong,
.community-bar span,
.community-bar label { color: var(--fern-950); }
.community-bar select { border-color: #c3cbb7; background: #fffef9; }
.community-bar .status { color: var(--fern-800); }
.admin-badge { color: white !important; background: var(--sage-500); }
.count-badge { color: #5d4100; background: #ffd36b; }
.tabs { gap: .7rem; }
.tab {
  min-height: 52px;
  border-color: var(--line-2);
  border-radius: 13px;
  color: var(--fern-900);
  background: var(--paper);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.tab:hover { transform: translateY(-1px); border-color: var(--sage-500); }
.tab.active { border-color: var(--fern-800); color: white; background: var(--fern-800); box-shadow: 0 8px 18px rgb(18 59 42 / 15%); }

.audio-panel, .photo-panel, .video-panel, .rights-panel {
  border: 1px solid #cdd5c1;
  border-radius: 16px;
  background: #f7f8f2;
}
.audio-panel { border-left: 4px solid var(--marigold); }
.photo-panel { border-left: 4px solid var(--sage-500); }
.video-panel { border-left: 4px solid var(--fern-800); }
.rights-panel { border-left: 4px solid var(--silver-leaf); }
.audio-panel legend, .photo-panel legend, .video-panel legend, .rights-panel legend { color: var(--fern-900); }
.consent-check, .search-panel, .application-summary { border-radius: 12px; background: var(--cream-2); }
.record-destination { border-left-color: var(--marigold); background: #f5f5e9; }
.record-list-header { border-bottom-color: var(--fern-800); color: var(--fern-950); background: var(--sage-100); }
.record-link:hover { background: #f6f7ef; }
.account-card, .trash-card, .activity-item { border-color: var(--line-2); background: var(--paper); }
.activity-action, .dialect-badge { color: var(--fern-900); background: #e2ebdf; }

.site-footer {
  position: relative;
  max-width: 1120px;
  margin-top: 2.5rem;
  padding-top: 2rem;
  color: #5d6d62;
}
.site-footer::before {
  content: "✿  ✿  ✿";
  position: absolute;
  top: 0;
  left: 50%;
  width: 5rem;
  height: auto;
  background: none;
  transform: translateX(-50%);
  color: var(--marigold);
  letter-spacing: .45rem;
  white-space: nowrap;
}
.site-footer .text-button { color: var(--fern-800); }
.preview-empty-state { display: flex; align-items: center; gap: 1rem; min-height: 120px; padding: 1.5rem 8%; }
.preview-empty-state span { display: grid; place-items: center; width: 54px; height: 54px; border: 1px dashed var(--sage-500); border-radius: 50%; color: var(--sage-500); font-size: 1.6rem; }
.preview-empty-state p { margin: 0; }

@media (min-width: 900px) {
  #new-view form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 0 1.5rem; }
  #new-view form > label,
  #new-view form > .form-grid,
  #new-view form > .record-destination { grid-column: 1; }
  #new-view .audio-panel { grid-column: 2; grid-row: 1 / span 5; margin-top: 0; }
  #new-view .photo-panel { grid-column: 2; }
  #new-view .video-panel { grid-column: 2; }
  #new-view .rights-panel { grid-column: 2; }
  #new-view #save-record,
  #new-view #save-status { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 88px; }
  .brand-mark { width: 58px; height: 58px; }
  .site-header h1 { gap: .45rem; }
  .site-header .eyebrow { display: none; }
  .header-actions { max-width: 42%; }
  .community-summary { font-size: .74rem; line-height: 1.35; }
  main { width: min(100% - 1rem, 1120px); margin-top: 1rem; }
  .community-bar { grid-template-columns: 1fr; padding: 1rem; }
  .tabs { overflow-x: auto; padding-bottom: .25rem; scroll-snap-type: x proximity; }
  .tab { flex: 0 0 min(42vw, 170px); scroll-snap-align: start; white-space: nowrap; }
  .card { padding: 1rem; border-radius: 15px; }
}

@media (max-width: 480px) {
  .header-inner { width: calc(100% - 1rem); }
  .brand-script { font-size: 2rem; }
  .site-header h1 > span:last-child { font-size: .9rem; }
  .header-actions .button { min-height: 42px; padding: .5rem .7rem; }
  .community-summary { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .audio-state { align-items: stretch; }
  .audio-state > .button { min-width: 0; }
  .button.wide { position: sticky; bottom: .5rem; z-index: 5; box-shadow: 0 8px 22px rgb(18 59 42 / 25%); }
}

/* Desktop layout locked to the approved botanical reference. */
@media (min-width: 900px) {
  .header-inner, main, .site-footer { width: min(1240px, calc(100% - 3rem)); max-width: 1240px; }
  .header-inner { min-height: 92px; }
  main { margin-top: 1.1rem; margin-bottom: 1.2rem; }
  .site-header { border-bottom: 0; box-shadow: none; background: #234f38; }
  .site-header::after { display: none; }
  .brand-lockup { gap: .75rem; }
  .brand-mark { width: 82px; height: 82px; border: 0; border-radius: 0; overflow: visible; background: transparent; box-shadow: none; }
  .brand-mark img { width: 100%; height: 100%; }
  .brand-lockup .eyebrow { display: none; }
  .brand-script { font-size: 3rem; }
  .site-header h1 { gap: 1rem; font-size: 1.25rem; }
  .header-actions { gap: 1rem; }
  .community-summary { font-size: .92rem; }
  .site-header .button.secondary { min-width: 74px; border-radius: 18px; }

  .community-bar { grid-template-columns: 1.15fr repeat(3, 1fr); align-items: center; gap: 2rem; margin-bottom: .75rem; padding: .8rem 2.5rem; border-radius: 14px; box-shadow: none; background: linear-gradient(100deg, #f8f7ef, #f3f4eb); }
  .community-bar > div { position: relative; padding-right: 2rem; border-right: 1px dashed #9da77a; }
  .community-bar > div::after { content: "❧"; position: absolute; right: -9px; top: 50%; padding: .1rem 0; color: #789068; background: #f5f5ed; transform: translateY(-50%); }
  .community-bar strong { font-size: 1rem; }
  .community-bar label { gap: .35rem; font-size: .92rem; }
  .community-bar select { min-height: 46px; padding-block: .55rem; }
  .admin-badge { display: block; width: 100%; margin: .35rem 0 .15rem; padding: .2rem .7rem; }
  .tabs { margin-bottom: .75rem; gap: .9rem; }
  .tab { min-height: 48px; padding: .55rem; border-radius: 12px; box-shadow: none; }

  .card { padding: 1.25rem 1.5rem; border-radius: 14px; box-shadow: 0 5px 18px rgb(39 70 50 / 6%); }
  .card h2 { margin-bottom: .8rem; padding: 0 0 .65rem 2.4rem; font-size: 1.55rem; border-bottom: 1px dashed #aeb58f; }
  .card h2::before { content: "❧"; position: absolute; left: .25rem; color: #8ca06d; }
  .card h2::after { content: "✿  ❀  ✿"; left: 50%; bottom: -.7rem; width: auto; height: auto; padding: 0 .7rem; color: #d52a29; background: var(--paper); transform: translateX(-50%); font-size: 1rem; letter-spacing: .2rem; }

  #new-view form { grid-template-columns: minmax(0, 1.45fr) minmax(350px, .85fr); gap: 0 1.4rem; }
  #new-view .record-destination { display: none; }
  #new-view form > label { margin-bottom: .45rem; }
  #new-view .form-grid { gap: 1rem; }
  #new-view input, #new-view select { min-height: 38px; padding: .45rem .7rem; }
  #new-view textarea { min-height: 46px; height: 46px; padding: .55rem .7rem; resize: none; }
  #new-view .audio-panel, #new-view .photo-panel, #new-view .video-panel, #new-view .rights-panel { margin: 0 0 .65rem; padding: .75rem 1rem; border: 1px solid var(--line-2); border-left-width: 1px; background: #fbfaf5; }
  #new-view .audio-panel { grid-row: 1 / span 4; min-height: 190px; display: flex; flex-direction: column; }
  #new-view .audio-panel legend, #new-view .photo-panel legend, #new-view .video-panel legend, #new-view .rights-panel legend { font-size: 1rem; }
  #new-view .audio-state { order: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 100px; align-items: center; text-align: center; }
  #new-view .audio-state .button { justify-self: center; }
  #new-view #start-recording { width: 74px; height: 74px; padding: .45rem; border-radius: 50%; }
  #new-view .audio-intro { order: 2; margin: .15rem 0 0; padding-top: .55rem; border-top: 1px dashed #b8ba9c; font-size: .82rem; }
  #new-view .photo-panel p, #new-view .video-panel p { margin: .35rem 0 0; font-size: .82rem; }
  #new-view .rights-panel .consent-check { margin: .2rem 0; padding: .35rem 0; background: transparent; font-size: .88rem; }
  #new-view #save-record { min-height: 46px; margin-top: .25rem; }
  #accounts-view { min-height: 380px; }
  #accounts-view .section-heading h2 { min-width: 100%; }
  #accounts-view .admin-grid { gap: 1.5rem; }
  #accounts-view input, #accounts-view select { min-height: 50px; }
  .site-footer { margin-top: 1.6rem; padding-top: 1.5rem; border-top: 1px solid #aeb99a; }
}
.source-badge{display:inline-block;padding:.2rem .55rem;border-radius:999px;color:#fff;font-size:.76rem;font-weight:900;background:#65717c}.source-badge.ngai{background:#657f53}.source-badge.klokah{background:#376f91}.source-badge.merged{background:#825c96}
.source-license{margin:.8rem 0 0;color:#59645a;font-size:.78rem;line-height:1.55}.source-license a{color:var(--forest-800);font-weight:800}
.klokah-update-notice{margin:1rem 0 0;padding:1rem;border:1px solid var(--line);border-left:4px solid var(--forest-700);border-radius:14px;background:#f7f4e8}.klokah-update-notice p{margin:0 0 .8rem;line-height:1.7}.klokah-update-notice .button{display:inline-flex;align-items:center;justify-content:center;text-align:center}
.staging-banner{position:sticky;z-index:1000;top:0;padding:.45rem 1rem;color:#fff;background:#8a5b16;text-align:center;font-size:.85rem;font-weight:900;letter-spacing:.02em}

/* Collapsible application sidebar */
#app-view:not(.hidden){display:grid;grid-template-columns:220px minmax(0,1fr);gap:1rem;align-items:start;transition:grid-template-columns .2s ease}
#app-view.sidebar-collapsed:not(.hidden){grid-template-columns:72px minmax(0,1fr)}
#app-view>.community-bar{grid-column:1/-1}
#app-view>.app-sidebar{grid-column:1;grid-row:2;display:flex;position:sticky;top:1rem;flex-direction:column;gap:.55rem;margin:0;padding:.7rem;border:1px solid var(--line);border-radius:16px;background:#f5f4e9;overflow:visible}
#app-view>.app-sidebar~.card{grid-column:2;grid-row:2;min-width:0;margin:0}
.feedback-type-fieldset{margin:1.25rem 0;padding:0;border:0}
.feedback-type-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.feedback-type-options label{display:flex;align-items:flex-start;gap:.65rem;margin:0;padding:.85rem;border:1px solid var(--line);border-radius:12px;background:#fffdf8;cursor:pointer}
.feedback-type-options label:has(input:checked){border-color:var(--fern-700);box-shadow:0 0 0 2px rgb(47 105 76 / 14%)}
.feedback-type-options input{width:auto;margin-top:.2rem}
.feedback-type-options span{display:grid;gap:.2rem}.feedback-type-options small{color:var(--muted)}
.feedback-image-preview,.feedback-attachments{display:grid;grid-template-columns:repeat(3,minmax(0,180px));gap:.75rem;margin-top:.75rem}
.feedback-image-preview figure{margin:0}.feedback-image-preview img,.feedback-attachments img{display:block;width:100%;max-height:180px;object-fit:cover;border-radius:10px}
.feedback-image-preview figcaption{margin-top:.3rem;overflow-wrap:anywhere;color:var(--muted);font-size:.82rem}
.feedback-history{margin-top:2rem;padding-top:1.5rem;border-top:1px solid var(--line)}
.feedback-list{display:grid;gap:.8rem}.feedback-card{padding:1rem;border:1px solid var(--line);border-radius:12px;background:#fffdf8}
details.feedback-card>summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;cursor:pointer}
details.feedback-card>summary>span{display:grid;gap:.25rem}details.feedback-card>summary>span:last-child{justify-items:end}
.feedback-card small,.feedback-card time{color:var(--muted)}.feedback-detail{padding-top:1rem;border-top:1px dashed var(--line);margin-top:1rem}
.feedback-status{display:inline-flex;padding:.25rem .6rem;border-radius:999px;background:#ddd;color:#333;font-size:.82rem}
.feedback-status.pending{color:#8a2d20;background:#f7d5c8}.feedback-status.processing{color:#6b5200;background:#fff0ae}.feedback-status.completed{color:#205b35;background:#d7eadc}.feedback-status.rejected{color:#555;background:#e4e4e4}
.feedback-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.6rem;margin:1rem 0}
.feedback-stats span{display:grid;justify-items:center;padding:.7rem;border:1px solid var(--line);border-radius:10px;background:#fffdf8}.feedback-stats strong{font-size:1.35rem;color:var(--fern-900)}
.feedback-admin-heading{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.feedback-admin-heading h3,.feedback-admin-heading p{margin-top:0}.feedback-admin-save{min-height:44px}
.app-sidebar .tab{display:flex;flex:none;align-items:center;justify-content:flex-start;width:100%;min-width:0;padding:.8rem .75rem;text-align:left;white-space:nowrap}
.app-sidebar .tab::before{display:none}
.sidebar-icon{display:inline-grid;flex:0 0 28px;width:28px;height:28px;place-items:center;margin-right:.55rem;border-radius:8px;font-size:1.25rem;line-height:1}
.sidebar-toggle{display:flex;align-items:center;width:100%;min-height:40px;padding:.45rem .65rem;border:0;border-bottom:1px solid var(--line);color:var(--forest-800);background:transparent;font-weight:800;cursor:pointer}
.sidebar-toggle-icon{display:inline-grid;flex:0 0 28px;width:28px;place-items:center;margin-right:.55rem;font-size:1.6rem;line-height:1}
.app-sidebar.is-collapsed{align-items:center}
.app-sidebar.is-collapsed .sidebar-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-sidebar.is-collapsed .tab,.app-sidebar.is-collapsed .sidebar-toggle{justify-content:center;padding:.65rem .35rem}
.app-sidebar.is-collapsed .sidebar-icon,.app-sidebar.is-collapsed .sidebar-toggle-icon{margin-right:0}
.app-sidebar.is-collapsed .count-badge{position:absolute;margin:-24px 0 0 22px}
@media(max-width:760px){
  .brand-lockup{position:relative;padding-bottom:16px}
  .mobile-menu-button:not(.hidden){position:absolute;z-index:20;left:0;bottom:-3px;display:inline-flex;align-items:center;justify-content:center;min-width:68px;padding:.12rem .45rem;border:1px solid rgb(255 255 255 / 80%);border-radius:999px;color:var(--fern-950);background:#fffdf5;box-shadow:0 3px 10px rgb(0 0 0 / 16%);font-size:.7rem;font-weight:900;line-height:1.4;white-space:nowrap}
  .mobile-menu-button[aria-expanded="true"]{color:white;background:var(--fern-700)}
  #app-view:not(.hidden),#app-view.sidebar-collapsed:not(.hidden){grid-template-columns:minmax(0,1fr);gap:.55rem}
  #app-view>.community-bar{grid-column:1;grid-row:1}
  #app-view>.app-sidebar{position:fixed;z-index:1100;top:96px;left:.5rem;display:flex;width:min(260px,calc(100vw - 1rem));max-height:calc(100vh - 110px);padding:.55rem;overflow-y:auto;box-shadow:0 14px 38px rgb(18 59 42 / 28%);transform:translateX(calc(-100% - 1rem));transition:transform .2s ease}
  #app-view.mobile-sidebar-open>.app-sidebar{transform:translateX(0)}
  #app-view>.app-sidebar~.card{grid-column:1;grid-row:2;padding:1rem}
  .app-sidebar.is-collapsed{align-items:stretch}
  .app-sidebar.is-collapsed .sidebar-label{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:nowrap}
  .app-sidebar.is-collapsed .tab,.app-sidebar.is-collapsed .sidebar-toggle{justify-content:flex-start;padding:.65rem .55rem}
  .app-sidebar.is-collapsed .sidebar-icon,.app-sidebar.is-collapsed .sidebar-toggle-icon{margin-right:.55rem}
  .app-sidebar .tab{min-width:0}.sidebar-icon{flex-basis:26px;width:26px}
  .feedback-type-options{grid-template-columns:1fr}.feedback-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .feedback-image-preview,.feedback-attachments{grid-template-columns:repeat(2,minmax(0,1fr))}
  details.feedback-card>summary{grid-template-columns:1fr}details.feedback-card>summary>span:last-child{justify-items:start}
}
.word-match-panel {
  border: 1px solid #d8cdb8;
  border-radius: 14px;
  padding: 1rem;
  background: #fbf8ef;
}

.word-match-results {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.word-match-item {
  border-left: 4px solid #286443;
  border-radius: 10px;
  background: #fff;
  padding: 0.8rem 1rem;
}

.word-match-item p { margin: 0 0 0.45rem; }

.community-bar.community-bar-summary {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.community-bar.community-bar-summary > div:first-child {
  padding-right: 0;
  border-right: 0;
}

.community-bar.community-bar-summary > div:first-child::after { display: none; }

/* Week 1: simple public entry using the existing ngai palette and components. */
.brand-mark:disabled { cursor: default; opacity: 1; }
.public-home {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: center;
  min-height: min(620px, calc(100vh - 210px));
  padding: clamp(2rem, 6vw, 5.5rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 10%, rgb(213 42 41 / 8%), transparent 25%),
    linear-gradient(135deg, #fffdf8 0%, #f4f3e8 100%);
  box-shadow: 0 14px 40px rgb(39 70 50 / 8%);
}
.public-home h2 {
  max-width: 720px;
  margin: .4rem 0 1rem;
  color: var(--fern-950);
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.public-home-copy { grid-column: 1 / -1; }
.public-home-intro { max-width: 650px; margin: 0; color: #405748; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.85; }
.public-home-free { margin: 1rem 0 0; color: var(--fern-800); font-size: 1.1rem; font-weight: 900; }
.public-home-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.public-home-actions .button { min-width: 142px; min-height: 50px; }
.public-home-primary { padding-inline: 1.6rem; }
.public-home-features { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.public-home-features span {
  padding: 1rem 1.15rem;
  border: 1px solid #d4d8c4;
  border-radius: 14px;
  color: var(--fern-900);
  background: rgb(255 253 248 / 78%);
  font-weight: 900;
}
.public-home-features span::before { content: "•"; margin-right: .65rem; color: #cf3f36; }
.public-home-how-to { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px dashed #b8bea7; }
.public-home-how-to h3 { margin: 0 0 1rem; color: var(--fern-950); font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.public-home-how-to ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem 1.25rem; margin: 0; padding-left: 1.35rem; color: #405748; }
.public-home-how-to li { padding-left: .15rem; line-height: 1.55; }
.auth-back { margin: 0 0 1rem; }

.contribution-dashboard,
.announcements-section { grid-column: 1 / -1; }
.contribution-dashboard { padding: 1.5rem 0; border-top: 1px dashed #b8bea7; border-bottom: 1px dashed #b8bea7; }
.dashboard-heading { margin-bottom: 1rem; }
.dashboard-heading p,
.dashboard-heading h2,
.dashboard-heading h3 { margin-top: 0; }
.dashboard-heading h2,
.dashboard-heading h3 { margin-bottom: 0; color: var(--fern-950); }
.dashboard-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.metric-card { display: grid; min-width: 0; padding: 1.1rem .7rem; border: 1px solid #d4d8c4; border-radius: 14px; background: rgb(255 253 248 / 88%); text-align: center; }
.metric-card .metric-icon { font-size: 1.45rem; line-height: 1; }
.metric-card strong { margin: .45rem 0 .15rem; color: var(--fern-950); font-size: clamp(1.8rem, 4vw, 2.8rem); font-variant-numeric: tabular-nums; line-height: 1; }
.metric-card > span:last-child { color: #526257; font-size: .88rem; font-weight: 900; }
.contribution-dashboard.compact { margin: 0 0 1.25rem; padding: 0 0 1.25rem; border-top: 0; }
.contribution-dashboard.compact .dashboard-heading { margin-bottom: .7rem; }
.contribution-dashboard.compact .dashboard-heading h2,
.announcements-section.compact .dashboard-heading h2 { padding: 0; border: 0; font-size: 1.25rem; }
.contribution-dashboard.compact .metric-card { padding: .75rem .5rem; }
.contribution-dashboard.compact .metric-card strong { font-size: clamp(1.5rem, 3vw, 2rem); }

.announcements-section { padding-top: 1.5rem; border-top: 1px dashed #b8bea7; }
.announcements-section.compact { margin: 0 0 1.4rem; padding: 0 0 1.3rem; border-top: 0; border-bottom: 1px dashed #b8bea7; }
.announcement-list,
.announcement-admin-list { display: grid; gap: .75rem; }
.announcement-card { min-width: 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-left: 5px solid var(--sage-500); border-radius: 12px; background: #fffdf8; }
.announcement-card.feature { border-left-color: var(--marigold); }
.announcement-card.maintenance { border-left-color: var(--cockscomb); }
.announcement-card h3,
.announcement-card p { margin-top: 0; }
.announcement-card p:last-child { margin-bottom: 0; }
.announcement-card h3,
.announcement-card-body { overflow-wrap: anywhere; }
.announcement-card-body { white-space: pre-wrap; }
.announcement-meta { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; color: var(--muted); font-size: .82rem; }
.announcement-type { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; color: #fff; background: var(--sage-500); font-size: .78rem; font-weight: 900; }
.announcement-card.feature .announcement-type { color: #533d00; background: #f5cf68; }
.announcement-card.maintenance .announcement-type { background: var(--cockscomb); }
.announcement-form { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px dashed var(--line); }
.announcement-form .checkbox-label { align-self: end; min-height: 48px; }
.announcement-admin-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
.announcement-admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }

@media (max-width: 760px) {
  .public-home { grid-template-columns: 1fr; gap: 2rem; min-height: 0; padding: 2rem 1.25rem; border-radius: 16px; }
  .public-home h2 { font-size: clamp(2.3rem, 12vw, 3.5rem); }
  .public-home-intro { font-size: 1rem; line-height: 1.75; }
  .public-home-actions { display: grid; grid-template-columns: 1fr; }
  .public-home-actions .button { width: 100%; }
  .public-home-features { grid-template-columns: 1fr; gap: .55rem; }
  .public-home-features span { padding: .8rem 1rem; }
  .public-home-how-to ol { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card strong { font-size: 2rem; }
  .announcement-admin-card { grid-template-columns: 1fr; }
  .announcement-admin-actions { justify-content: flex-start; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .public-home-actions .button { position: static; box-shadow: none; }
}
