:root {
  --ink: #171715;
  --muted: #706f67;
  --paper: #f4efe4;
  --panel: #fbf8ef;
  --line: #d8d0c0;
  --olive: #173d31;
  --olive-2: #255746;
  --moss: #7d866f;
  --copper: #9d623c;
  --gold: #d6c193;
  --shadow: 0 24px 60px rgba(34, 30, 22, .12);
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 239, 228, .96), rgba(244, 239, 228, 1)),
    radial-gradient(circle at 20% 0%, rgba(157, 98, 60, .12), transparent 30%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.68;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.private-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  padding: 18px 5%;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid rgba(23, 61, 49, .14);
  background: rgba(244, 239, 228, .9);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  gap: 4px;
  min-width: 178px;
  line-height: 1.1;
}

.brand span:first-child {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand span:last-child {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.private-header nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--copper);
  font-size: 13px;
  font-weight: 800;
}

.private-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.eyebrow {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

.button,
.text-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
}

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

.button:hover {
  background: #34342e;
}

.button.secondary:hover {
  background: #ede5d8;
}

.text-button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--copper);
  padding: 7px 0;
}

.login-layout {
  min-height: calc(100vh - 210px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 34px;
  align-items: stretch;
}

.login-statement {
  padding: clamp(36px, 6vw, 74px);
  display: grid;
  align-content: space-between;
  gap: 34px;
  color: #f8f1df;
  background:
    linear-gradient(140deg, rgba(23, 61, 49, .94), rgba(16, 39, 32, .98)),
    url("../assets/hero-canopy.jpeg") center/cover;
  box-shadow: var(--shadow);
}

.login-statement h1,
.private-title h1,
.rules-feature h2 {
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: 0;
}

.login-statement h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 92px);
}

.login-statement p {
  max-width: 560px;
  color: rgba(248, 241, 223, .78);
}

.login-panel {
  align-self: center;
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h2 {
  margin-top: 8px;
  font-size: 28px;
}

.form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--copper);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfc6b7;
  background: #fffdf6;
  padding: 10px 12px;
  color: var(--ink);
}

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

.message {
  min-height: 22px;
  margin-top: 14px;
  color: var(--copper);
  font-size: 13px;
  font-weight: 700;
}

.message.error {
  color: #9d3f31;
}

.private-shell {
  display: grid;
  gap: 28px;
}

.private-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: stretch;
}

.private-title {
  padding: clamp(30px, 5vw, 62px) 0;
  display: grid;
  align-content: center;
  gap: 22px;
}

.private-title h1 {
  max-width: 760px;
  font-size: clamp(38px, 6vw, 78px);
}

.private-title p {
  max-width: 620px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-card {
  min-height: 430px;
  padding: 30px;
  display: grid;
  align-content: space-between;
  color: #f8f1df;
  background:
    linear-gradient(145deg, rgba(31, 76, 60, .96), rgba(12, 35, 29, 1)),
    url("../assets/hero-canopy.jpeg") center/cover;
  box-shadow: var(--shadow);
}

.card-top,
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.card-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 193, 147, .58);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.member-card small,
.member-card p {
  color: rgba(248, 241, 223, .72);
}

.member-card h2 {
  margin-top: 16px;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.05;
}

.member-card strong {
  display: block;
  margin-top: 8px;
  color: #fff7e2;
  font-size: 16px;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}

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

.panel-head h2 {
  font-size: 24px;
}

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

.service-card {
  min-height: 238px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  border: 1px solid var(--line);
  background: #fffdf6;
}

.service-card.locked {
  background: #efe8db;
}

.service-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
}

.service-card h3 {
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.18;
}

.service-card p {
  margin-top: 10px;
  color: var(--muted);
}

.service-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

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

.profile-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.profile-item small {
  display: block;
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
}

.profile-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

details.private-details {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

details.private-details summary {
  cursor: pointer;
  color: var(--copper);
  font-weight: 800;
}

.ledger {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.ledger-row,
.request-row,
.entitlement-row,
.scope-row {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ledger-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ledger-row small,
.request-row small,
.scope-row p {
  color: var(--muted);
}

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

.request-row {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffdf6;
}

.request-row header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  background: #eee6d8;
  color: #55594f;
  font-size: 12px;
  font-weight: 800;
}

.tag.ready {
  background: #dfe6dc;
  color: #304a38;
}

.tag.warning {
  background: #f0ded2;
  color: #8a4933;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.tier-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.tier-buttons button {
  min-height: 86px;
  border: 1px solid var(--line);
  background: #fffdf6;
  text-align: left;
  padding: 14px;
}

.tier-buttons button[aria-pressed="true"] {
  color: #f8f1df;
  border-color: var(--olive);
  background: var(--olive);
}

.tier-buttons strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.tier-buttons small {
  color: inherit;
}

.rules-feature {
  padding: 28px;
  color: #f8f1df;
  background: var(--olive);
}

.rules-feature h2 {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 64px);
}

.rules-feature p {
  color: rgba(248, 241, 223, .76);
}

.entitlements {
  margin-top: 24px;
}

.entitlement-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(248, 241, 223, .22);
}

.entitlement-row small {
  color: rgba(248, 241, 223, .72);
}

.matrix-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.matrix {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fffdf6;
}

.matrix th,
.matrix td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 12px;
  text-align: center;
  vertical-align: middle;
}

.matrix th:first-child {
  text-align: left;
  width: 220px;
}

.matrix-current {
  background: #e6eadf;
}

.yes {
  color: var(--olive);
  font-weight: 800;
}

.apply-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 23, 21, .54);
}

.apply-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.apply-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.empty {
  padding: 18px 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
}

@media (max-width: 980px) {
  .login-layout,
  .private-hero,
  .rules-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .private-header {
    position: static;
    padding: 16px 20px;
    align-items: flex-start;
  }

  .private-header nav {
    justify-content: flex-end;
    gap: 10px 14px;
    font-size: 12px;
  }

  .brand {
    min-width: 118px;
  }

  .private-page {
    width: calc(100% - 28px);
    padding: 26px 0 46px;
  }

  .login-statement {
    min-height: 360px;
    padding: 28px;
  }

  .login-panel,
  .panel,
  .rules-feature,
  .member-card {
    padding: 20px;
  }

  .service-grid,
  .profile-grid,
  .tier-buttons {
    grid-template-columns: 1fr;
  }

  .member-card {
    min-height: 360px;
  }

  .member-card h2 {
    font-size: 34px;
  }

  .panel-head,
  .card-top,
  .card-bottom,
  .service-footer,
  .request-row header {
    display: grid;
  }
}
