:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #13171c;
  --surface-strong: #171c22;
  --surface-soft: #101318;
  --line: #2a313a;
  --line-strong: #3a4450;
  --text: #edf2f7;
  --muted: #98a2ad;
  --faint: #687381;
  --green: #7ddc9b;
  --cyan: #68d8f0;
  --amber: #f3c969;
  --danger: #ff7b86;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(125, 220, 155, .035), transparent 22rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), var(--cyan), transparent);
  opacity: .7;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent 76%);
  pointer-events: none;
  animation: gridDrift 18s linear infinite;
}

::selection {
  color: #07100b;
  background: var(--green);
}

/* Main page layout */
.container {
  width: min(1080px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.75rem) 0;
  display: grid;
  align-content: start;
  gap: 1.25rem;
}

.header {
  display: grid;
  gap: .45rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  animation: slideIn .55s ease both;
}

.header h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(2.25rem, 8vw, 4.75rem);
  font-weight: 750;
  line-height: .95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.header h1::before {
  content: "drsouthbound:~$";
  display: block;
  margin-bottom: .55rem;
  color: var(--green);
  font-size: clamp(.78rem, 2vw, .95rem);
  font-weight: 600;
}

.header h1::after {
  content: "_";
  color: var(--cyan);
  animation: caretBlink 1s steps(2, jump-none) infinite;
}

.header p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .92rem;
}

.header p::before {
  content: "// ";
  color: var(--faint);
}

.site-tabs {
  position: sticky;
  top: .75rem;
  z-index: 15;
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  width: fit-content;
  max-width: 100%;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 19, 24, .84);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .22);
  backdrop-filter: blur(12px);
  animation: slideIn .55s .06s ease both;
}

.site-tab {
  position: relative;
  min-height: 38px;
  padding: .55rem .95rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.site-tab:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
}

.site-tab.active {
  border-color: rgba(125, 220, 155, .5);
  background: linear-gradient(180deg, rgba(125, 220, 155, .13), rgba(104, 216, 240, .06));
  color: var(--green);
}

.site-tab:focus-visible,
.project-toggle:focus-visible {
  outline: 2px solid rgba(104, 216, 240, .35);
  outline-offset: 2px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panelEnter .28s ease both;
}

.panels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  position: relative;
  grid-column: span 6;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.45rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
  will-change: transform;
}

.panel:hover {
  border-color: rgba(104, 216, 240, .45);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, .34),
    0 0 24px rgba(104, 216, 240, .12);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
  opacity: .58;
}

#contact,
#ticket,
#admin-login,
#tickets-panel,
#users-panel {
  grid-column: 1 / -1;
}

.panel h2 {
  margin: 0 0 .85rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel h2::before {
  content: "./";
  color: var(--green);
  font-weight: 600;
}

.panel h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0;
}

.panel p,
.panel li {
  color: var(--muted);
}

.panel p {
  margin: .65rem 0 0;
  max-width: 78ch;
  overflow-wrap: break-word;
}

.application {
  display: grid;
  gap: .75rem;
}

.application h3 {
  color: var(--cyan);
}

.application p {
  margin: 0;
}

strong {
  color: var(--text);
  font-weight: 650;
}

ul {
  display: grid;
  gap: .5rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}

li {
  position: relative;
  padding-left: 1.15rem;
}

li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--green);
  font-family: var(--mono);
}

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

.hidden,
[hidden] {
  display: none !important;
}

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

.form-grid {
  display: grid;
  gap: .9rem;
  margin-top: 1rem;
}

label span,
.filter span,
.permission-grid legend {
  display: block;
  margin-bottom: .4rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  caret-color: var(--green);
  font: inherit;
  line-height: 1.4;
  transition: border-color .16s ease, background-color .16s ease, outline-color .16s ease;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(125, 220, 155, .25);
  outline-offset: 2px;
  border-color: var(--green);
  background: #0e1216;
}

.form-actions,
.button-row,
.admin-actions,
.ticket-actions,
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.form-note {
  min-height: 1.5rem;
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: .88rem;
}

.form-note.error {
  color: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  margin-top: .55rem;
  padding: .62rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #151a20;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--green);
  background: #1a2027;
  color: #ffffff;
}

.button:active,
.site-tab:active,
.project-toggle:active {
  transform: translateY(0);
}

.button:focus-visible {
  outline: 2px solid rgba(104, 216, 240, .35);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.button.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button.secondary:hover {
  border-color: var(--cyan);
  color: var(--text);
}

.button.danger {
  border-color: rgba(255, 123, 134, .45);
  background: rgba(255, 123, 134, .08);
  color: var(--danger);
}

.button.danger:hover {
  border-color: var(--danger);
  background: rgba(255, 123, 134, .12);
  color: #ffd8dc;
}

/* Home project tabs */
.project-stack {
  display: grid;
  gap: .8rem;
  align-items: start;
}

.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 28, 34, .94), rgba(14, 18, 23, .96)),
    var(--surface);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(125, 220, 155, .12), transparent 35%, rgba(243, 201, 105, .1));
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.project-card:hover,
.project-card.is-open {
  border-color: rgba(104, 216, 240, .42);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, .36),
    0 0 28px rgba(125, 220, 155, .1);
}

.project-card:hover::before,
.project-card.is-open::before {
  opacity: 1;
}

.project-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 76px;
  padding: 1rem clamp(1rem, 2vw, 1.35rem);
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.project-toggle strong {
  display: block;
  margin-top: .12rem;
  font-family: var(--mono);
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  line-height: 1.12;
}

.project-kicker {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-toggle::after {
  content: "∨";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transition: border-color .22s ease, background-color .22s ease, color .22s ease;
}

.project-card.is-open .project-toggle::after {
  content: "∧";
  border-color: rgba(104, 216, 240, .5);
  background: rgba(104, 216, 240, .08);
  color: var(--cyan);
}

.project-details {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(280px, 1.15fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  max-height: 0;
  overflow: hidden;
  padding: 0 clamp(1rem, 2vw, 1.35rem);
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height .38s ease, padding .38s ease, opacity .24s ease, transform .32s ease;
}

.project-card.is-open .project-details {
  max-height: 760px;
  padding-bottom: clamp(1rem, 2vw, 1.35rem);
  opacity: 1;
  transform: translateY(0);
}

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

.project-points {
  margin-top: .9rem;
}

.project-empty {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--mono);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  min-width: 0;
}

.project-shot {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f13;
  color: inherit;
  cursor: pointer;
  isolation: isolate;
  padding: 0;
  transition: border-color .22s ease, box-shadow .22s ease, filter .22s ease;
}

.project-gallery .project-shot:nth-child(n+4) {
  display: none;
}

.project-shot:hover {
  border-color: rgba(243, 201, 105, .45);
  box-shadow:
    0 0 0 1px rgba(243, 201, 105, .1),
    0 0 22px rgba(243, 201, 105, .18);
  filter: brightness(1.08);
}

.project-shot:focus-visible {
  outline: 2px solid rgba(104, 216, 240, .35);
  outline-offset: 2px;
}

.project-shot::before,
.project-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.project-shot::before {
  background:
    radial-gradient(circle at 28% 24%, rgba(125, 220, 155, .38), transparent 22%),
    radial-gradient(circle at 72% 68%, rgba(104, 216, 240, .24), transparent 26%),
    linear-gradient(135deg, #121a21, #090c10 58%, #1b1710);
  background-image: var(--shot-image),
    radial-gradient(circle at 28% 24%, rgba(125, 220, 155, .38), transparent 22%),
    radial-gradient(circle at 72% 68%, rgba(104, 216, 240, .24), transparent 26%),
    linear-gradient(135deg, #121a21, #090c10 58%, #1b1710);
  background-position: center;
  background-size: cover;
}

.project-shot::after {
  opacity: .72;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 82%);
}

.project-shot span {
  position: absolute;
  right: .55rem;
  bottom: .45rem;
  padding: .16rem .38rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  background: rgba(7, 10, 13, .72);
  color: var(--text);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.shot-world::before,
.shot-panel::before,
.shot-effects::before {
  background:
    radial-gradient(circle at 18% 76%, rgba(243, 201, 105, .34), transparent 24%),
    radial-gradient(circle at 78% 28%, rgba(104, 216, 240, .26), transparent 24%),
    linear-gradient(135deg, #101922, #0a0d11 54%, #171b12);
}

.shot-debug::before,
.shot-data::before,
.shot-prototype::before {
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 123, 134, .22), transparent 22%),
    radial-gradient(circle at 24% 64%, rgba(125, 220, 155, .3), transparent 24%),
    linear-gradient(135deg, #15131b, #0a0d11 56%, #111a18);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(54px, 9vw) minmax(0, 1fr) minmax(54px, 9vw);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(5, 7, 10, .9);
  backdrop-filter: blur(10px);
}

.lightbox-frame {
  grid-column: 2;
  min-width: 0;
  display: grid;
  gap: .8rem;
  justify-items: center;
}

.lightbox-image {
  width: min(100%, 1180px);
  height: min(72vh, 760px);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background:
    var(--lightbox-image),
    radial-gradient(circle at 28% 24%, rgba(125, 220, 155, .38), transparent 22%),
    radial-gradient(circle at 72% 68%, rgba(104, 216, 240, .24), transparent 26%),
    linear-gradient(135deg, #121a21, #090c10 58%, #1b1710);
  background-position: center;
  background-size: cover;
  box-shadow:
    0 34px 80px rgba(0, 0, 0, .55),
    0 0 42px rgba(104, 216, 240, .14);
}

.lightbox-caption,
.lightbox-count {
  color: var(--text);
  font-family: var(--mono);
  font-size: .86rem;
  line-height: 1.2;
  text-align: center;
}

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

.lightbox-count {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 92px;
  padding: .4rem .62rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(13, 15, 18, .8);
}

.lightbox-nav {
  display: grid;
  place-items: center;
  width: clamp(44px, 6vw, 64px);
  height: clamp(44px, 6vw, 64px);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(19, 23, 28, .74);
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.lightbox-nav:hover {
  border-color: rgba(104, 216, 240, .45);
  background: rgba(23, 28, 34, .9);
  box-shadow: 0 0 24px rgba(104, 216, 240, .14);
}

.lightbox-nav:focus-visible {
  outline: 2px solid rgba(104, 216, 240, .35);
  outline-offset: 2px;
}

.lightbox-prev {
  grid-column: 1;
  justify-self: start;
}

.lightbox-next {
  grid-column: 3;
  justify-self: end;
}

.reveal-card {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .52s ease,
    transform .52s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    background-color .22s ease;
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 44px 44px, 44px 44px;
  }
}

@keyframes caretBlink {
  50% {
    opacity: .08;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Admin views */
.admin-header {
  position: relative;
}

.admin-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 1rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-tab {
  min-height: 36px;
  padding: .5rem .85rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.admin-tab.active,
.admin-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  color: var(--text);
}

.admin-tab.active {
  border-color: rgba(125, 220, 155, .42);
  color: var(--green);
}

.admin-user {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  z-index: 40;
}

.admin-user__email {
  max-width: min(45vw, 22rem);
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user__button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.admin-user__button:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: var(--surface-strong);
}

.admin-user__icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.admin-user__icon::before,
.admin-user__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
}

.admin-user__icon::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: 0;
}

.admin-user__icon::after {
  width: 16px;
  height: 8px;
  border-radius: 12px 12px 6px 6px;
  bottom: 0;
}

.admin-user__menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 190px;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151a;
  box-shadow: var(--shadow);
  display: grid;
  gap: .5rem;
  z-index: 20;
}

.admin-user__menu .button {
  width: 100%;
  margin-top: 0;
}

.admin-actions {
  margin-top: 1rem;
}

.filter-row {
  margin-top: 1rem;
}

.ticket-summary,
.user-summary {
  margin-top: .8rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .88rem;
}

.ticket-list,
.user-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.ticket,
.user-card,
.note-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.ticket[data-status="new"] {
  border-left-color: var(--green);
}

.ticket[data-status="read"] {
  border-left-color: var(--line-strong);
}

.ticket h3,
.user-card__header h3 {
  margin: 0;
  font-size: .98rem;
  overflow-wrap: anywhere;
}

.ticket p,
.user-card p {
  margin: .45rem 0;
  overflow-wrap: anywhere;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .8rem;
}

.ticket-actions {
  margin-top: .8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .05rem;
  width: fit-content;
  padding: .16rem .42rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.badge::before {
  content: "[";
  color: var(--faint);
}

.badge::after {
  content: "]";
  color: var(--faint);
}

.badge.new {
  color: var(--green);
  border-color: rgba(125, 220, 155, .45);
  background: rgba(125, 220, 155, .08);
}

.badge.read {
  color: var(--muted);
  border-color: var(--line);
}

.badge.active {
  color: var(--green);
  border-color: rgba(125, 220, 155, .45);
  background: rgba(125, 220, 155, .08);
}

.badge.inactive {
  color: var(--faint);
  border-color: var(--line);
}

.admin-subpanel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

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

.subpanel-header h3 {
  color: var(--cyan);
}

.user-card {
  display: grid;
  gap: .75rem;
}

.user-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}

.user-card__footer {
  display: flex;
  justify-content: flex-end;
}

.user-actions .button,
.note-actions .button {
  margin-top: 0;
}

.permission-grid {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-grid legend {
  width: auto;
  padding: 0 .35rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: .9rem;
}

.checkbox input {
  width: auto;
  min-height: 0;
  accent-color: var(--green);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, .72);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.modal .panel {
  animation: none;
}

.note-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
  max-height: 240px;
  overflow: auto;
  padding-right: .25rem;
}

.note-card {
  border-left-color: var(--cyan);
}

.note-card p {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .75rem;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .5rem;
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 1.5rem);
    padding: 1.25rem 0;
  }

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

  .panel,
  #contact,
  #ticket,
  #admin-login,
  #tickets-panel,
  #users-panel {
    grid-column: 1 / -1;
  }

  .form-actions,
  .button-row,
  .admin-actions,
  .ticket-actions,
  .user-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .admin-user {
    position: static;
    justify-content: flex-start;
    margin-top: .75rem;
  }

  .admin-user__email {
    max-width: calc(100vw - 5rem);
  }

  .admin-user__menu {
    right: auto;
    left: 0;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tab {
    flex: 1 1 auto;
  }

  .site-tabs {
    position: static;
    width: 100%;
  }

  .site-tab {
    flex: 1 1 auto;
  }

  .project-toggle {
    align-items: flex-start;
    gap: .65rem;
  }

  .project-details {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto auto;
  }

  .lightbox-frame {
    grid-column: 1 / -1;
  }

  .lightbox-image {
    height: min(62vh, 620px);
  }

  .lightbox-prev {
    grid-column: 1;
    grid-row: 2;
  }

  .lightbox-next {
    grid-column: 2;
    grid-row: 2;
  }

  .lightbox-count {
    grid-row: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .reveal-card,
  .reveal-card.is-visible {
    transform: none;
  }
}
