:root {
  --ink: #1d1812;
  --ink-soft: #5b4d3f;
  --paper: #f5eddf;
  --paper-strong: #fffaf0;
  --paper-warm: #ead9bb;
  --night: #17130e;
  --night-2: #2c241b;
  --red: #9a2b22;
  --gold: #be8d43;
  --green: #486f49;
  --blue: #365f91;
  --teal: #2f6d73;
  --purple: #7046a0;
  --orange: #b85b2c;
  --line: rgba(35, 28, 19, .18);
  --line-dark: rgba(255, 248, 232, .2);
  --shadow: 0 22px 70px rgba(24, 16, 8, .2);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 239, 225, .9), rgba(247, 239, 225, .95)),
    url("assets/background.png") center top / cover fixed;
  font-family: "Noto Serif TC", "Microsoft JhengHei", "PingFang TC", serif;
  line-height: 1.7;
}

body.modal-open {
  overflow: hidden;
}

img,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 10px clamp(18px, 4vw, 58px);
  color: #fff7e7;
  background: rgba(23, 19, 14, .9);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .34);
  object-fit: cover;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 15px;
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .06);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #fff7e7;
}

.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  align-items: start;
  gap: clamp(28px, 6vw, 86px);
  padding: clamp(76px, 12vh, 138px) clamp(20px, 5vw, 76px) 86px;
  color: #fff8e8;
  background:
    linear-gradient(100deg, rgba(13, 10, 7, .84) 0%, rgba(13, 10, 7, .5) 45%, rgba(13, 10, 7, .72) 100%),
    url("assets/background.png") center bottom / cover;
}

.hero-copy {
  width: min(760px, 100%);
  justify-self: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: #cfa158;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 118px);
  line-height: 1.04;
  letter-spacing: .08em;
  text-wrap: balance;
}

.hero-lede {
  margin: 14px 0 0;
  color: #f2d9a9;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
}

.hero-text {
  width: min(650px, 100%);
  margin: 20px 0 0;
  color: #eadfc8;
  font-size: clamp(17px, 1.8vw, 21px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid currentColor;
  font-weight: 900;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button.primary {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.button.ghost {
  color: #fff8e8;
  background: rgba(255, 255, 255, .08);
}

.admin-card .button.ghost {
  color: var(--ink);
  border-color: rgba(31, 24, 16, .42);
  background: rgba(255, 252, 246, .86);
}

.admin-card .button.ghost:hover,
.admin-card .button.ghost:focus-visible {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.button.text {
  color: #f2d9a9;
  border-color: transparent;
}

.button.compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.hero-mark {
  width: min(360px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  box-shadow: var(--shadow);
}

.hero-mark img {
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 18px 35px rgba(0, 0, 0, .32));
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  color: #e8d4a9;
  font-size: 14px;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
}

.section {
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 76px);
}

.section-head {
  width: min(1180px, 100%);
  margin: 0 auto 30px;
}

.section-head.compact {
  margin-bottom: 20px;
}

.section-head h2,
.section-head h1,
.discord-band h2 {
  margin: 0;
  font-size: clamp(30px, 4.3vw, 52px);
  line-height: 1.2;
  letter-spacing: .04em;
  text-wrap: balance;
}

.section-head p:not(.eyebrow),
.discord-band p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.page-hero {
  min-height: calc(100vh - 70px);
}

.video-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, .8fr);
  gap: 22px;
  align-items: stretch;
}

.video-frame {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(31, 24, 16, .28);
  background: var(--night);
  box-shadow: var(--shadow);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.quote-block,
.thread-panel,
.youtube-panel,
.notice-panel,
.division-card,
.member-card,
.faq-list details {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .78);
  box-shadow: 0 10px 34px rgba(29, 20, 10, .08);
}

.quote-block {
  display: grid;
  align-content: center;
  padding: 24px;
  font-size: 20px;
}

.quote-block p {
  margin: 0 0 12px;
}

.home-board {
  background: rgba(31, 24, 16, .88);
  color: #fff8e8;
}

.home-board .section-head p:not(.eyebrow) {
  color: #dfcba8;
}

.board-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: 24px;
  align-items: stretch;
}

.social-stack {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.embed-panel,
.notice-panel {
  min-width: 0;
  color: #fff8e8;
  background: rgba(255, 255, 255, .08);
  border-color: var(--line-dark);
  padding: 20px;
}

.embed-frame {
  width: 100%;
  min-width: 0;
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(11, 9, 7, .42);
}

.embed-frame iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-height: inherit;
  display: block;
  border: 0;
}

.youtube-channel-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: 240px;
}

.youtube-channel-frame iframe {
  min-height: 0;
}

.panel-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  color: #e7c887;
  font-size: 14px;
  font-weight: 900;
}

.notice-panel li {
  color: #e8dac0;
}

.notice-hero {
  width: 100%;
  display: block;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
}

.notice-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.org-section {
  background:
    linear-gradient(rgba(244, 236, 220, .78), rgba(244, 236, 220, .9)),
    url("assets/background.png") center / cover fixed;
}

.org-wrap {
  position: relative;
  width: min(1180px, 100%);
  min-height: 650px;
  margin: 0 auto;
  overflow: auto;
  border: 1px solid rgba(31, 24, 16, .25);
  background:
    linear-gradient(rgba(250, 244, 232, .45), rgba(250, 244, 232, .72)),
    url("assets/background.png") center / cover;
  box-shadow: var(--shadow);
}

.org-wordmark {
  position: absolute;
  left: 22px;
  top: 18px;
  width: 250px;
  max-width: 40%;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .22));
}

.org-chart {
  width: 1120px;
  min-height: 660px;
  display: grid;
  gap: 34px;
  padding: 58px 34px 40px;
  margin: 0 auto;
}

.org-topline {
  position: relative;
  display: grid;
  gap: 28px;
  justify-items: center;
}

.org-topline::before {
  content: "";
  position: absolute;
  top: 142px;
  left: 50%;
  bottom: -34px;
  width: 3px;
  background: rgba(18, 15, 13, .72);
  transform: translateX(-50%);
}

.org-row {
  display: flex;
  justify-content: center;
  gap: 38px;
  position: relative;
  z-index: 1;
}

.org-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 34px;
  align-items: start;
  padding-top: 34px;
}

.org-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 9%;
  right: 9%;
  height: 3px;
  background: rgba(18, 15, 13, .72);
}

.org-branch {
  position: relative;
  display: grid;
  gap: 24px;
  justify-items: center;
}

.org-branch::before {
  content: "";
  position: absolute;
  top: -34px;
  width: 3px;
  height: calc(100% - 40px);
  background: rgba(18, 15, 13, .64);
}

.org-node {
  position: relative;
  width: 150px;
  min-height: 142px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  padding: 15px 12px;
  color: var(--ink);
  border: 2px solid rgba(27, 22, 17, .72);
  background: rgba(255, 250, 240, .88);
  box-shadow: 0 8px 18px rgba(27, 18, 10, .16);
  cursor: pointer;
  z-index: 1;
}

.org-node::before {
  content: "";
  position: absolute;
  inset: -9px;
  background: url("assets/frame.png") center / 184% 184%;
  opacity: .48;
  pointer-events: none;
}

.org-node:hover,
.org-node:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

.node-role {
  z-index: 1;
  color: var(--role-color, var(--green));
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  text-orientation: upright;
  writing-mode: vertical-rl;
}

.node-avatar {
  z-index: 1;
  width: 82px;
  height: 74px;
  display: grid;
  place-items: center;
  color: #fff4dc;
  background: linear-gradient(135deg, #302d2b, #826048);
  font-size: 26px;
  font-weight: 900;
  overflow: hidden;
}

.node-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
}

.node-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.node-name {
  z-index: 1;
  grid-column: 2;
  color: var(--blue);
  font-weight: 900;
  text-align: center;
}

.org-subbranches {
  position: relative;
  display: grid;
  gap: 18px;
  width: 100%;
  padding-top: 22px;
}

.org-subbranches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 22px;
  background: rgba(18, 15, 13, .58);
  transform: translateX(-50%);
}

.org-subbranch {
  position: relative;
  display: grid;
  gap: 18px;
  justify-items: center;
  padding-top: 14px;
}

.org-subbranch h4 {
  margin: 0;
  padding: 5px 10px;
  color: #fff8e8;
  background: var(--branch-color, var(--gold));
  font-size: 15px;
  box-shadow: 0 5px 12px rgba(27, 18, 10, .16);
}

.division-grid {
  width: min(1180px, 100%);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.division-card {
  padding: 18px;
  border-left: 6px solid var(--division-color, var(--gold));
}

.division-card h3 {
  margin: 0 0 8px;
}

.division-card p {
  margin: 0;
  color: var(--ink-soft);
}

.gallery-filters {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 40px;
  padding: 8px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .66);
  cursor: pointer;
}

.chip.active,
.chip:hover,
.chip:focus-visible {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.gallery-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  columns: 3 260px;
  column-gap: 18px;
}

.gallery-card {
  break-inside: avoid;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .84);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(29, 20, 10, .08);
}

.gallery-card img,
.gallery-card video {
  width: 100%;
  display: block;
  aspect-ratio: var(--ratio, 4 / 3);
  object-fit: cover;
}

.gallery-card {
  position: relative;
}

.media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  color: #fff8e8;
  background: rgba(23, 19, 14, .82);
  font-size: 13px;
  font-weight: 900;
}

.gallery-card-body {
  padding: 14px;
}

.gallery-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.gallery-card p {
  margin: 0;
  color: var(--ink-soft);
}

.gallery-tag {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.member-tools {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, .7fr) minmax(160px, .7fr);
  gap: 12px;
}

.member-tools label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 900;
}

.member-tools input,
.member-tools select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .84);
}

.member-list {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.member-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 132px;
  padding: 18px;
}

.member-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff4dc;
  background: var(--night-2);
  border: 1px solid rgba(23, 19, 14, .18);
  border-radius: 999px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.card-center {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 18px 58px 18px 0;
  text-align: left;
}

.card-line {
  display: block;
  min-height: 1.25em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card-line-main {
  font-size: 22px;
}

.card-corner {
  position: absolute;
  max-width: 42%;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-top-left {
  left: 14px;
  top: 12px;
  text-align: left;
}

.card-top-right {
  right: 14px;
  top: 12px;
  text-align: right;
}

.card-bottom-left {
  left: 14px;
  bottom: 12px;
  text-align: left;
}

.card-bottom-right {
  right: 14px;
  bottom: 12px;
  text-align: right;
}

.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .78);
}

.about-section {
  color: #fff8e8;
  background:
    linear-gradient(rgba(23, 19, 14, .9), rgba(23, 19, 14, .94)),
    url("assets/background.png") center / cover fixed;
}

.about-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .75fr);
  gap: 28px;
}

.about-section .section-head {
  margin: 0;
}

.about-section .section-head p:not(.eyebrow) {
  color: #e4d5bb;
}

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

.faq-list details {
  color: var(--ink);
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.faq-list p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.discord-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(36px, 6vw, 70px) clamp(20px, 5vw, 76px);
  color: #fff8e8;
  background: var(--red);
}

.discord-band p {
  color: #f5ddbd;
}

.discord-band .eyebrow {
  color: #f7cf83;
}

.discord-band .button {
  flex: 0 0 auto;
  background: #fff8e8;
  color: var(--red);
  border-color: #fff8e8;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(12, 9, 6, .72);
  backdrop-filter: blur(8px);
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  color: #fff8e8;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(23, 19, 14, .85);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.person-card,
.lightbox-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .28);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.person-banner {
  min-height: 130px;
  padding: 28px;
  color: #fff8e8;
  background:
    linear-gradient(100deg, rgba(23, 19, 14, .88), rgba(23, 19, 14, .4)),
    url("assets/background.png") center / cover;
  display: flex;
  align-items: center;
  gap: 18px;
}

.person-banner-avatar {
  width: 96px;
  height: 96px;
  display: block;
  overflow: hidden;
  border: 2px solid rgba(255, 248, 232, .72);
}

.person-banner-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
  transform-origin: center;
}

.person-banner h3 {
  margin: 0;
  font-size: 34px;
}

.person-banner p {
  margin: 4px 0 0;
  color: #e8cd96;
  font-weight: 900;
}

.person-body {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.person-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fact {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(234, 217, 187, .32);
}

.fact span {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
}

.fact strong {
  display: block;
  margin-top: 2px;
}

.color-chip-text {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.color-chip-text i {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1px solid rgba(23, 19, 14, .2);
  border-radius: 999px;
}

.lightbox {
  width: min(920px, calc(100vw - 32px));
}

.lightbox-card img,
.lightbox-card video {
  width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
  background: #120e0a;
}

.lightbox-copy {
  padding: 18px 20px;
}

.lightbox-copy h3,
.lightbox-copy p {
  margin: 0;
}

.lightbox-copy p {
  margin-top: 6px;
  color: var(--ink-soft);
}

.is-hidden {
  display: none !important;
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 19, 14, .82), rgba(23, 19, 14, .88)),
    url("assets/background.png") center / cover fixed;
}

.admin-shell {
  min-height: 100vh;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.admin-card {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .93);
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-card {
  width: min(420px, 100%);
}

.login-card h1,
.admin-head h1,
.admin-card h2 {
  margin: 0;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-card-head h2 {
  margin-bottom: 6px;
}

.admin-card-head p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .92);
  padding: 11px 12px;
  font: inherit;
  font-weight: 600;
}

.admin-form textarea {
  resize: vertical;
  line-height: 1.7;
}

.admin-form input:disabled,
.admin-form textarea:disabled,
.admin-actions .button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.form-message {
  min-height: 1.4em;
  margin: 0;
  padding: 6px 10px;
  color: #fff8e8;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(23, 19, 14, .45);
  font-weight: 900;
}

.form-message:empty {
  display: none;
}

.form-message[data-type="error"] {
  color: #fff8e8;
  background: var(--red);
}

.form-message[data-type="success"] {
  color: #fff8e8;
  background: #2f6d49;
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 18px;
  color: #fff8e8;
  border: 1px solid rgba(255, 255, 255, .22);
  background: #2f6d49;
  box-shadow: 0 18px 44px rgba(23, 19, 14, .34);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .18s ease, transform .18s ease;
}

.admin-toast[data-type="error"] {
  background: var(--red);
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  color: #fff8e8;
  background: rgba(23, 19, 14, .96);
  border-right: 1px solid rgba(255, 255, 255, .14);
}

.admin-brand {
  padding: 0;
}

.admin-user {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
}

.admin-user span {
  color: #e7c887;
  font-weight: 900;
}

.admin-menu {
  display: grid;
  gap: 8px;
}

.admin-menu button {
  padding: 12px 14px;
  color: #fff8e8;
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 900;
}

.admin-menu button.active {
  background: rgba(255, 255, 255, .12);
}

.admin-menu button:disabled {
  opacity: .45;
}

.admin-workspace {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 34px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  color: #fff8e8;
}

.editor-form {
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.permission-note {
  margin: 0;
  padding: 12px 14px;
  color: #fff4dc;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(154, 43, 34, .78);
  font-weight: 900;
}

.connection-help {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(234, 217, 187, .22);
}

.connection-help p,
.connection-help ol {
  margin: 0;
}

.connection-help ol {
  padding-left: 1.3em;
}

.connection-help li {
  margin-top: 6px;
}

.org-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(23, 19, 14, .36);
}

.org-editor-tabs button {
  min-height: 42px;
  padding: 9px 16px;
  color: #fff8e8;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.org-editor-tabs button.active {
  color: var(--ink);
  border-color: var(--gold);
  background: #f1d69a;
}

.inline-actions {
  position: static;
  align-items: center;
  padding: 10px 0 0;
  background: none;
}

.html-preview {
  min-height: 120px;
  padding: 14px;
  border: 1px dashed var(--line);
  background: rgba(234, 217, 187, .2);
}

.html-preview ul {
  margin: 0;
  padding-left: 1.2em;
}

.stack-editor {
  display: grid;
  gap: 14px;
}

.edit-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(234, 217, 187, .18);
}

.division-layout-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 24, 16, .18);
  background: rgba(255, 252, 246, .4);
}

.division-layout-block > .edit-block {
  background: rgba(255, 250, 240, .82);
}

.subdivision-list {
  display: grid;
  gap: 10px;
  margin-left: 28px;
  padding-left: 18px;
  border-left: 3px solid rgba(31, 24, 16, .18);
}

.subdivision-edit {
  background: rgba(234, 217, 187, .28);
}

.division-layout-actions {
  display: flex;
  justify-content: flex-end;
}

.org-live-preview-block {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.org-live-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .5);
}

.org-preview-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.org-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.org-preview-branch {
  min-width: 150px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 2px solid color-mix(in srgb, var(--branch-color, var(--gold)) 58%, rgba(31, 24, 16, .2));
  background: rgba(255, 250, 240, .82);
  transition: border-color .15s ease, background .15s ease;
}

.org-preview-branch.drag-over {
  border-color: var(--red);
  background: rgba(242, 214, 154, .5);
}

.org-preview-branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
}

.org-preview-branch-head strong {
  color: var(--branch-color, var(--red));
  font-size: 17px;
}

.org-preview-branch-head small,
.org-preview-person small,
.org-preview-empty {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.org-preview-people,
.org-preview-children {
  display: grid;
  gap: 8px;
}

.org-preview-children {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 3px solid rgba(31, 24, 16, .16);
}

.org-preview-branch.is-child {
  min-width: 0;
  padding: 10px;
  border-style: dashed;
}

.org-preview-person {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  color: var(--ink);
  border: 1px solid rgba(31, 24, 16, .2);
  background: rgba(255, 252, 246, .9);
  cursor: grab;
  text-align: left;
  font: inherit;
}

.org-preview-person:active {
  cursor: grabbing;
}

.org-preview-person strong {
  display: block;
  color: var(--role-color, var(--red));
  line-height: 1.2;
}

.org-preview-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff4dc;
  background: var(--night-2);
  border-radius: 999px;
  font-weight: 900;
}

.org-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.edit-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-block-head strong {
  color: var(--red);
  font-size: 18px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .78);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.person-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-pick-list label {
  width: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .68);
}

.person-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.person-field-grid {
  align-content: start;
}

.avatar-editor {
  display: grid;
  gap: 10px;
  align-content: start;
}

.avatar-editor p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.avatar-preview {
  width: min(180px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff4dc;
  background: var(--night-2);
  border: 1px solid rgba(23, 19, 14, .16);
  border-radius: 999px;
  font-size: 34px;
  font-weight: 900;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.upload-button {
  min-height: 38px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .8);
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.visual-layout-editor {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: stretch;
}

.card-canvas {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(23, 19, 14, .05) 1px, transparent 1px),
    linear-gradient(rgba(23, 19, 14, .05) 1px, transparent 1px),
    rgba(234, 217, 187, .16);
  background-size: 28px 28px;
}

.layout-builder {
  min-width: 0;
}

.layout-inspector {
  height: 100%;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .78);
}

.layout-inspector-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.layout-inspector-head span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.layout-inspector-head strong {
  color: var(--red);
  font-size: 22px;
}

.format-toolbar {
  display: flex;
  gap: 8px;
}

.format-button {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .92);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
}

.format-button:hover,
.format-button.active {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.underline-icon {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.layout-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 6px;
}

.layout-actions .button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.layout-actions .button.ghost {
  color: var(--ink);
  background: rgba(255, 252, 246, .72);
}

.layout-actions .danger {
  margin-left: auto;
  color: var(--red);
}

.layout-actions .danger:hover,
.layout-actions .danger:focus-visible {
  color: #fff8e8;
  border-color: var(--red);
  background: var(--red);
}

.member-card-preview {
  width: min(100%, 560px);
}

.layout-preview-card {
  width: 100%;
  min-height: 210px;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  padding: 34px 28px;
  background: rgba(255, 250, 240, .92);
  box-shadow: 0 18px 46px rgba(23, 19, 14, .22);
}

  .layout-preview-card .member-avatar {
    width: 92px;
    height: 92px;
    color: #fff4dc;
    background: var(--night-2);
    font-size: 40px;
  }

.layout-preview-card .card-center {
  min-height: 110px;
  gap: 8px;
  padding: 26px 92px 26px 0;
}

.card-slot-button {
  font: inherit;
  border: 1px dashed rgba(119, 43, 43, .38);
  background: rgba(255, 252, 246, .46);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.card-slot-button:hover,
.card-slot-button.selected {
  border-color: var(--red);
  background: rgba(255, 252, 246, .92);
  box-shadow: 0 0 0 3px rgba(119, 43, 43, .16);
}

.layout-preview-card .card-corner {
  min-width: 86px;
  padding: 4px 6px;
}

.layout-preview-card .card-line {
  width: 100%;
  min-height: 30px;
  padding: 3px 7px;
  text-align: left;
}

.leader-line {
  position: absolute;
  pointer-events: none;
  opacity: .38;
}

.leader-top-left,
.leader-bottom-left {
  left: -24px;
  width: 28px;
  border-top: 1px solid var(--line);
}

.leader-top-right,
.leader-bottom-right {
  right: -24px;
  width: 28px;
  border-top: 1px solid var(--line);
}

.leader-top-left,
.leader-top-right {
  top: 25px;
}

.leader-bottom-left,
.leader-bottom-right {
  bottom: 25px;
}

.admin-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0 2px;
  background: linear-gradient(transparent, rgba(49, 40, 31, .94) 28%);
}

@media (max-width: 980px) {
  .hero,
  .video-layout,
  .board-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    justify-self: start;
  }

  .hero-mark {
    width: min(280px, 70vw);
  }

  .division-grid,
  .member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-tools {
    grid-template-columns: 1fr;
  }

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

  .admin-sidebar {
    position: relative;
    height: auto;
  }

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

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

  .card-canvas {
    min-height: 320px;
    padding: 20px;
  }

  .person-edit-grid {
    grid-template-columns: 1fr;
  }

  .org-preview-grid {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
  }

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

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 70px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 18px;
    background: rgba(23, 19, 14, .98);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .scroll-cue {
    display: none;
  }

  .org-wordmark {
    position: relative;
    left: 16px;
    top: 16px;
    max-width: 260px;
  }

  .org-chart {
    padding-top: 32px;
  }

  .org-branches {
    grid-template-columns: repeat(5, 180px);
  }

  .division-grid,
  .member-list {
    grid-template-columns: 1fr;
  }

  .discord-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .person-facts {
    grid-template-columns: 1fr;
  }
}
