@font-face {
  font-family: Montserrat;
  src: local(Montserrat), url("/static/montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: local(Inter), url("/static/inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --green: #00643d;
  --dark: #073d2e;
  --gold: #c8a646;
  --yellow: #f4c300;
  --red: #d71920;
  --mint: #009e60;
  --ink: #1f2937;
  --ivory: #f7f4ec;
  --paper: #fff;
  --line: #dfe5dc;
  --muted: #53665c;
  --title: Montserrat,Arial,sans-serif;
  color: var(--ink);
  background: #f7f8f4;
  font: 16px / 1.5 Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button, a {
  touch-action: manipulation;
}

button, .btn {
  cursor: pointer;
  min-height: 42px;
  color: var(--dark);
  background: #edf3ec;
  border: 1px solid #0000;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: .48rem;
  padding: .58rem .95rem;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
}

button:hover, .btn:hover {
  filter: brightness(.96);
}

button:disabled {
  cursor: wait;
  opacity: .55;
}

.primary {
  background: var(--green);
  color: #fff;
}

.gold {
  color: #2f2817;
  background: linear-gradient(105deg, #e4c476, #c8a646);
}

.outline {
  border-color: var(--line);
  background: #fff;
}

.danger {
  color: #963227;
  background: #fff1ee;
}

.iconbtn {
  min-width: 40px;
  padding: .5rem;
}

.ico {
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65px;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-block;
}

a {
  color: var(--green);
}

h1, h2, h3, h4 {
  font-family: var(--title);
  letter-spacing: -.035em;
  color: var(--dark);
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4.3vw, 3.6rem);
}

h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: .5rem 0 1rem;
}

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

small {
  font-size: .82rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .77rem;
  font-weight: 750;
}

.flag {
  height: 4px;
  display: flex;
}

.flag i {
  background: var(--red);
  width: 33.33%;
}

.flag i:nth-child(2) {
  background: var(--yellow);
}

.flag i:nth-child(3) {
  background: var(--mint);
}

input, textarea, select {
  color: var(--ink);
  background: #fff;
  border: 1px solid #bfcbbf;
  border-radius: 7px;
  min-width: 0;
  max-width: 100%;
  padding: .66rem .8rem;
}

input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline-offset: 2px;
  outline: 3px solid #c8a646;
}

input[type="checkbox"] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}

label {
  gap: .35rem;
  font-size: .9rem;
  font-weight: 600;
  display: grid;
}

.field {
  align-items: center;
  gap: .5rem;
  display: flex;
  position: relative;
}

.field input {
  width: 100%;
  padding-left: 2.65rem;
}

.field > .ico {
  color: #68776e;
  position: absolute;
  left: .9rem;
}

.field button {
  background: none;
  min-height: 32px;
  padding: .3rem;
  position: absolute;
  right: .4rem;
}

.field input[type="password"] {
  padding-right: 3rem;
}

.stack {
  gap: 1rem;
  display: grid;
}

.row, .tools, .actions, .sectionhead {
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
  display: flex;
}

.sectionhead {
  justify-content: space-between;
  margin: 1.8rem 0 1rem;
}

.skip {
  z-index: 1000;
  background: #fff;
  padding: .6rem;
  position: fixed;
  top: -100px;
  left: 10px;
}

.skip:focus {
  top: 10px;
}

.loading {
  color: var(--green);
  padding: 3rem;
}

.login {
  background: #fcfcf8;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  min-height: 100dvh;
  display: grid;
}

.login-art {
  color: #fff;
  isolation: isolate;
  background: radial-gradient(at 90% 5%, #137356 0%, #0000 63%), linear-gradient(140deg, #004d34, #07392c 83%);
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  padding: clamp(2rem, 5.4vw, 6rem);
  display: flex;
  position: relative;
  overflow: hidden;
}

.login-art:after, .hero:after {
  content: "";
  pointer-events: none;
  opacity: .14;
  z-index: -1;
  background: repeating-linear-gradient(128deg, #0000 0 9px, #adc8a622 10px, #0000 11px);
  position: absolute;
  inset: 0;
}

.login-emblem {
  align-items: center;
  gap: 14px;
  display: flex;
  position: relative;
}

.logo-plate {
  background: #fffdf5;
  border-radius: 5px;
  place-items: center;
  width: 58px;
  height: 72px;
  padding: 7px;
  display: grid;
}

.logo-plate img, .brand img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.login-emblem strong {
  font: 700 .98rem var(--title);
  letter-spacing: .04em;
  display: block;
}

.login-emblem span {
  color: #c9ddcf;
  font-size: .78rem;
}

.login-title {
  z-index: 2;
  max-width: 640px;
  margin: 4rem 0 auto;
  padding-top: 8vh;
  position: relative;
}

.login-title .eyebrow {
  color: #e1c580;
}

.login-title h1 {
  color: #fff;
  letter-spacing: -.06em;
  margin: .75rem 0 1rem;
  font-size: clamp(2.6rem, 5.5vw, 5.6rem);
}

.login-title p {
  color: #e0eae1;
  max-width: 35ch;
  font-size: 1.1rem;
}

.architecture {
  object-fit: cover;
  object-position: center 65%;
  opacity: .76;
  mix-blend-mode: screen;
  z-index: -1;
  width: 112%;
  height: 38%;
  position: absolute;
  bottom: 20px;
  left: -6%;
}

.art-footer {
  letter-spacing: .055em;
  color: #e4eade;
  margin-top: 9rem;
  font-size: .75rem;
  position: relative;
}

.login-formarea {
  justify-content: center;
  align-items: center;
  padding: 3rem 8%;
  display: flex;
  position: relative;
}

.login-panel {
  width: 100%;
  max-width: 395px;
}

.login-panel h2 {
  margin: 1rem 0 .5rem;
  font-size: 2.5rem;
}

.login-panel > p {
  margin-bottom: 2rem;
}

.login-panel .gold {
  width: 100%;
  min-height: 48px;
  margin-top: .5rem;
}

.seal {
  width: 49px;
  height: 49px;
  color: var(--green);
  background: #e6eee5;
  border-radius: 14px;
  place-items: center;
  display: inline-grid;
}

.seal .ico {
  width: 25px;
  height: 25px;
}

.help {
  color: var(--green);
  background: none;
  padding: 0;
  font-size: .88rem;
}

.login-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  font-size: .83rem;
}

.login-foot .ico {
  width: 15px;
}

.brand {
  text-align: left;
  white-space: nowrap;
  background: none;
  align-items: center;
  gap: .65rem;
  padding: 0;
  display: flex;
}

.brand img {
  width: 37px;
  height: 46px;
}

.brand span {
  line-height: 1.1;
  font-family: var(--title);
  letter-spacing: .03em;
  display: grid;
}

.brand b {
  font-size: .76rem;
}

.brand strong {
  font-size: 1.05rem;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 4rem);
  display: flex;
}

.topnav {
  gap: .4rem;
  display: flex;
}

.topnav button, .sidetab {
  color: var(--muted);
  background: none;
  font-weight: 580;
}

.topnav .active, .sidetab.active {
  color: var(--green);
  background: #e9f2e9;
}

.account {
  color: #fff;
  background: #083f30;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
}

.container {
  max-width: 1500px;
  margin: auto;
  padding: clamp(1rem, 3.5vw, 3.4rem);
}

.hero {
  isolation: isolate;
  color: #fff;
  background: linear-gradient(110deg, #063f30, #00643d);
  border-radius: 17px;
  min-height: 240px;
  padding: clamp(1.5rem, 4.2vw, 4rem);
  position: relative;
  overflow: hidden;
}

.hero h1, .hero h2 {
  color: #fff;
  max-width: 700px;
}

.hero .eyebrow {
  color: #ead497;
}

.hero p {
  color: #e3efe5;
}

.hero > .cover {
  object-fit: cover;
  z-index: -2;
  width: 55%;
  height: 100%;
  position: absolute;
  inset: 0 0 0 auto;
}

.hero.hascover:before {
  content: "";
  z-index: -1;
  background: linear-gradient(90deg, #063f30 30%, #063f30dd 55%, #063f3022);
  position: absolute;
  inset: 0;
}

.hero .architecture {
  opacity: .58;
  width: 56%;
  height: 95%;
  bottom: -5%;
  left: auto;
  right: 0;
}

.stats, .cards, .photogrid, .admin-grid {
  gap: 1rem;
  display: grid;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
  margin: 1rem 0;
}

.stat, .card, .panel, .person, .empty {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}

.stat {
  align-items: center;
  gap: .8rem;
  padding: 1.1rem;
  display: flex;
}

.stat b {
  font: 750 1.55rem var(--title);
  color: var(--dark);
  display: block;
}

.stat .ico {
  color: var(--green);
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card, .person {
  text-align: left;
  color: var(--ink);
  padding: 0;
  display: block;
  overflow: hidden;
}

.card img, .card .placeholder {
  object-fit: cover;
  width: 100%;
  height: 155px;
}

.placeholder {
  color: #487357;
  background: linear-gradient(130deg, #dce9df, #edf1de);
  place-items: center;
  display: grid;
}

.placeholder .ico {
  width: 38px;
  height: 38px;
}

.cardbody {
  padding: 1rem;
}

.badge {
  color: #24553e;
  background: #e7efe7;
  border-radius: 5px;
  padding: .15rem .45rem;
  font-size: .78rem;
  display: inline-block;
}

.empty, .panel {
  padding: clamp(1rem, 2.3vw, 1.9rem);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
}

.empty h3 {
  margin: .7rem;
}

.empty .ico {
  color: var(--green);
  width: 28px;
  height: 28px;
}

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

.person {
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  display: flex;
}

.avatar {
  width: 47px;
  height: 47px;
  color: var(--green);
  background: #e5eee2;
  border-radius: 50%;
  flex: none;
  place-items: center;
  font-weight: 700;
  display: grid;
}

.phead {
  margin: 1rem 0 1.4rem;
}

.phead .eyebrow {
  color: var(--green);
}

.phead h1 {
  margin: .45rem 0;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
}

.tools {
  margin: 1rem 0;
}

.tools > * {
  max-width: 100%;
}

.tools input {
  flex: 1;
  min-width: min(200px, 100%);
}

.photogrid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.photo {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.photo.selected {
  outline: 3px solid var(--green);
  outline-offset: -3px;
}

.photo > button:first-child {
  background: #edf0e9;
  border-radius: 0;
  width: 100%;
  padding: 0;
  display: block;
}

.photo img {
  aspect-ratio: 1.55;
  object-fit: cover;
  width: 100%;
  display: block;
}

.photo-footer {
  gap: .15rem;
  padding: .7rem .8rem;
  display: grid;
}

.photo-footer b {
  overflow-wrap: anywhere;
  font-size: .91rem;
}

.photo .check, .photo .heart {
  background: #fffef4ea;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  position: absolute;
  top: 8px;
}

.photo .check {
  left: 8px;
}

.photo .heart {
  right: 8px;
}

.selected .check, .heart.on {
  background: var(--green);
  color: #fff;
}

.selection {
  background: #e8efe6;
  border-radius: 8px;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin: 1rem 0;
  padding: .7rem .9rem;
  display: flex;
}

.pagebuttons {
  justify-content: center;
  gap: .5rem;
  margin: 1.5rem;
  display: flex;
}

.admin-layout {
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.5rem;
  display: grid;
}

.sidebar {
  flex-direction: column;
  align-items: stretch;
  gap: .3rem;
  display: flex;
}

.sidetab {
  justify-content: flex-start;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

.panel h2, .panel h3 {
  margin-bottom: .8rem;
}

.tbl {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .9rem;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: .7rem .8rem;
}

th {
  color: var(--muted);
  background: #edf2eb;
}

.dropzone {
  background: #f6faf4;
  border: 2px dashed #9bb59c;
  border-radius: 10px;
  padding: 1.5rem;
}

.drag {
  border-color: var(--green);
  background: #e1f1e6;
}

progress {
  width: 100%;
  accent-color: var(--green);
}

.err {
  color: #9c251e;
  font-size: .9rem;
}

.err:empty {
  display: none;
}

dialog {
  width: min(600px, 94vw);
  max-height: 90dvh;
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 25px 100px #012b2655;
}

dialog::backdrop {
  background: #09291f9c;
}

#dialog-body {
  padding: 1.45rem;
}

.modalhead {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  display: flex;
}

.modalhead h2 {
  font-size: 1.45rem;
}

.viewer {
  color: #fff;
  background: #12251e;
  width: min(1200px, 97vw);
}

.viewer #dialog-body {
  padding: .8rem;
}

.viewer h2, .viewer small {
  color: #fff;
}

.viewer .viewstage {
  justify-content: center;
  align-items: center;
  gap: .6rem;
  display: flex;
}

.viewstage img {
  object-fit: contain;
  max-width: calc(100% - 95px);
  max-height: 62dvh;
}

.viewer .actions {
  justify-content: center;
  margin-top: .8rem;
}

.viewer .modalhead h2 {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.viewer button {
  color: #fff;
  background: #ffffff19;
}

.viewer a {
  color: #fff;
}

.notice {
  border-left: 3px solid var(--gold);
  background: #f7f3e7;
  margin: 1rem 0;
  padding: .8rem 1rem;
}

.foot {
  border-top: 1px solid var(--line);
  max-width: 1500px;
  color: var(--muted);
  margin: 1rem auto 0;
  padding: 1.1rem clamp(1rem, 3.5vw, 3.4rem);
  font-size: .8rem;
}

.foot .flag, .login-art .flag {
  width: 48px;
  margin-bottom: .55rem;
}

.face-preview {
  display: inline-block;
  position: relative;
}

.face-preview img {
  width: 130px;
  height: auto;
  display: block;
}

.face-preview svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.face-preview rect {
  fill: #0000;
  stroke: #f4c300;
  stroke-width: 1.5px;
}

.reviewrow {
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: .7rem;
  padding: .7rem;
  display: flex;
}

#toast {
  color: #fff;
  z-index: 8;
  background: #163c2e;
  border-radius: 8px;
  max-width: 90vw;
  padding: .7rem 1rem;
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 3px 20px #0002;
}

#toast:empty, .adminnav-mobile {
  display: none;
}

.subtle {
  font-size: .85rem;
}

.long {
  overflow-wrap: anywhere;
}

details summary {
  cursor: pointer;
  font-weight: 650;
}

.two {
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  display: grid;
}

@media (width <= 900px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topnav {
    order: 3;
    width: 100%;
    overflow: auto;
  }

  .topnav button {
    white-space: nowrap;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    overflow: auto;
  }

  .sidetab {
    white-space: nowrap;
  }

  .login-art {
    padding: 2.2rem;
  }

  .login-title h1 {
    font-size: 3.2rem;
  }
}

@media (width <= 650px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 0;
    padding: 1.2rem 1.4rem 1.5rem;
  }

  .login-title {
    margin: 1.7rem 0 0;
    padding: 0;
  }

  .login-title h1 {
    margin: .3rem 0;
    font-size: 2.05rem;
  }

  .login-title p, .art-footer {
    display: none;
  }

  .login-emblem .logo-plate {
    width: 40px;
    height: 49px;
  }

  .login-art .architecture {
    opacity: .4;
    width: 70%;
    height: 85%;
    left: 45%;
  }

  .login-formarea {
    padding: 1.8rem 1.4rem 3rem;
  }

  .login-panel h2 {
    font-size: 1.9rem;
  }

  .login-panel > p {
    margin-bottom: 1.2rem;
  }

  .seal {
    display: none;
  }

  .topbar {
    gap: .4rem;
    padding: .6rem 1rem;
  }

  .topnav button {
    padding: .45rem .6rem;
    font-size: .9rem;
  }

  .stat {
    gap: .6rem;
    padding: .7rem;
  }

  .stat b {
    font-size: 1.35rem;
  }

  .stats {
    gap: .6rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .photogrid {
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
  }

  .photo-footer {
    padding: .45rem;
  }

  .photo-footer small {
    font-size: .75rem;
  }

  .hero {
    min-height: 190px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .cover {
    opacity: .65;
    width: 100%;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .tools > * {
    flex-grow: 1;
  }

  .admin-layout {
    gap: .7rem;
  }

  .viewstage img {
    max-width: calc(100% - 64px);
  }

  .viewstage button {
    min-width: 24px;
    padding: .2rem;
  }

  .viewer .viewstage {
    gap: .2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.charts {
  margin-top: 1rem;
}

.metric-line {
  grid-template-columns: minmax(65px, 1fr) 2fr 36px;
  align-items: center;
  gap: .8rem;
  padding: .3rem 0;
  font-size: .86rem;
  display: grid;
}

.metric-line meter {
  width: 100%;
  height: .85rem;
  accent-color: var(--green);
}

.metric-line b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.viewer a.btn {
  color: #fff;
  background: #ffffff19;
  border-color: #ffffff36;
}

.filmstrip {
  justify-content: center;
  gap: 5px;
  margin: .75rem auto 0;
  display: flex;
  overflow: auto;
}

.filmstrip button {
  border-radius: 4px;
  flex: 0 0 45px;
  min-height: 30px;
  padding: 2px;
}

.filmstrip button[aria-current="true"] {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.filmstrip img {
  object-fit: cover;
  border-radius: 2px;
  width: 41px;
  height: 28px;
}
