/* Unified Chapter Portal v2 */
.cp2-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--page, #f5f1e8);
  color: var(--ink, #1b1915);
}

.cp2-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--sidebar, #171612);
  color: #f8f2e7;
  border-right: 1px solid rgba(213, 174, 96, 0.2);
  overflow-y: auto;
  z-index: 30;
}

.cp2-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  padding: 6px 8px 22px;
}

.cp2-brand img { width: 44px; height: 44px; }
.cp2-brand strong,
.cp2-brand small { display: block; }
.cp2-brand strong { font-family: Georgia, serif; font-size: 1.12rem; }
.cp2-brand small { margin-top: 2px; color: #d5ae60; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }

.cp2-current {
  padding: 16px;
  border: 1px solid rgba(213, 174, 96, 0.22);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  margin-bottom: 18px;
}
.cp2-current strong,
.cp2-current span { display: block; }
.cp2-current strong { font-size: .95rem; }
.cp2-current span { margin-top: 5px; color: #bdb4a6; font-size: .78rem; }

.cp2-nav { display: grid; gap: 4px; }
.cp2-nav > span {
  padding: 17px 12px 7px;
  color: #d5ae60;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.cp2-nav a,
.cp2-nav button {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #d8d1c6;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cp2-nav a:hover,
.cp2-nav button:hover,
.cp2-nav a.active { background: rgba(213,174,96,.12); color: #fffaf0; }
.cp2-nav a.active { box-shadow: inset 3px 0 #d5ae60; }
.cp2-nav em {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #d5ae60;
  color: #171612;
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
}

.cp2-icon { width: 20px; height: 20px; }
.cp2-main { min-width: 0; }
.cp2-topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(20px, 4vw, 54px);
  border-bottom: 1px solid var(--line, rgba(0,0,0,.1));
  background: color-mix(in srgb, var(--paper, #fffdf8) 94%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.cp2-topbar > div { display: flex; align-items: center; gap: 12px; }
.cp2-topbar > div:first-of-type { display: block; }
.cp2-topbar span { display: block; color: var(--muted, #746d62); font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; }
.cp2-topbar strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-size: 1.45rem; }
.cp2-role { padding: 8px 11px; border-radius: 999px; background: rgba(213,174,96,.14); color: var(--ink, #1b1915) !important; font-weight: 800; letter-spacing: 0 !important; text-transform: none !important; }
.cp2-menu,
.cp2-theme {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line, rgba(0,0,0,.12));
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.cp2-menu { display: none; }
.cp2-content { padding: clamp(28px, 5vw, 62px); max-width: 1440px; margin: 0 auto; }

.cp2-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.cp2-heading p { margin: 0 0 10px; color: #b98b39; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; }
.cp2-heading h1 { margin: 0; max-width: 820px; font-family: Georgia, serif; font-size: clamp(2.1rem, 5vw, 4.6rem); line-height: .98; }
.cp2-heading span { display: block; max-width: 760px; margin-top: 15px; color: var(--muted, #746d62); line-height: 1.7; }

.cp2-actions,
.cp2-metrics,
.cp2-grid,
.cp2-people { display: grid; gap: 16px; }
.cp2-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.cp2-actions a {
  min-height: 175px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  border-radius: 20px;
  background: var(--paper, #fffdf8);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
}
.cp2-actions a:hover { transform: translateY(-2px); border-color: #d5ae60; }
.cp2-actions a > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(213,174,96,.14); color: #b98b39; }
.cp2-actions strong { font-size: 1.03rem; }
.cp2-actions small { color: var(--muted, #746d62); line-height: 1.55; }

.cp2-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.cp2-metrics article,
.cp2-card,
.cp2-list > article,
.cp2-documents > article,
.cp2-notices > article,
.cp2-people > article {
  border: 1px solid var(--line, rgba(0,0,0,.1));
  border-radius: 20px;
  background: var(--paper, #fffdf8);
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
}
.cp2-metrics article { padding: 20px; }
.cp2-metrics article > span { color: var(--muted, #746d62); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.cp2-metrics strong { display: block; margin: 9px 0; font-size: 1.3rem; }
.cp2-metrics small { color: var(--muted, #746d62); }
.cp2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp2-card { padding: 24px; }
.cp2-card h2 { margin: 0 0 18px; font-family: Georgia, serif; font-size: 1.55rem; }
.cp2-card dl { margin: 0; }
.cp2-card dl > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.cp2-card dl > div:last-child { border-bottom: 0; }
.cp2-card dt { color: var(--muted, #746d62); }
.cp2-card dd { margin: 0; text-align: right; font-weight: 700; }

.cp2-badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.cp2-success { background: rgba(36,132,83,.13); color: #1f7a4c; }
.cp2-warning { background: rgba(196,137,37,.15); color: #a66d13; }
.cp2-danger { background: rgba(177,54,54,.14); color: #a93636; }

.cp2-warning,
.cp2-info,
.cp2-status {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.cp2-warning { margin-bottom: 20px; padding: 18px; border: 1px dashed #d5ae60; border-radius: 16px; background: rgba(213,174,96,.08); }
.cp2-warning strong,
.cp2-warning span { display: block; }
.cp2-warning span { margin-top: 5px; color: var(--muted, #746d62); }
.cp2-status { margin-bottom: 20px; }
.cp2-status > div:first-child,
.cp2-info > div:first-child { color: #b98b39; }
.cp2-status h2 { margin: 6px 0; }
.cp2-status p { margin: 0; color: var(--muted, #746d62); line-height: 1.6; }

.cp2-list,
.cp2-documents,
.cp2-notices { display: grid; gap: 14px; }
.cp2-list > article,
.cp2-documents > article { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; }
.cp2-list header { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.cp2-list h3,
.cp2-documents h3 { margin: 0; }
.cp2-list p,
.cp2-documents p { margin: 7px 0; color: var(--muted, #746d62); line-height: 1.55; }
.cp2-list small,
.cp2-documents small { color: var(--muted, #746d62); }

.cp2-people { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.cp2-people > article { padding: 24px; text-align: center; }
.cp2-people > article > div { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: #d5ae60; color: #171612; font-weight: 900; }
.cp2-people h3 { margin: 0; }
.cp2-people p { color: var(--muted, #746d62); }

.cp2-notices > article { padding: 24px; }
.cp2-notices header { display: flex; justify-content: space-between; gap: 20px; color: var(--muted, #746d62); font-size: .8rem; }
.cp2-notices h2 { margin: 14px 0 8px; }
.cp2-notices p { color: var(--muted, #746d62); line-height: 1.65; }
.cp2-ack { display: inline-flex; align-items: center; gap: 8px; color: #1f7a4c; font-weight: 800; }

.cp2-form { display: grid; gap: 15px; }
.cp2-form label > span { display: block; margin-bottom: 7px; font-weight: 800; }
.cp2-form input,
.cp2-form select,
.cp2-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line, rgba(0,0,0,.13)); border-radius: 12px; background: transparent; color: inherit; font: inherit; }
.cp2-checkins { display: grid; gap: 12px; }
.cp2-checkins article { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 13px; }
.cp2-checkins span { color: var(--muted, #746d62); }
.cp2-inline-alert { margin-bottom: 12px; padding: 12px; border-radius: 10px; background: rgba(177,54,54,.12); color: #a93636; }

.cp2-empty { padding: 34px; border: 1px dashed var(--line, rgba(0,0,0,.16)); border-radius: 18px; text-align: center; }
.cp2-empty strong,
.cp2-empty span { display: block; }
.cp2-empty span { margin-top: 7px; color: var(--muted, #746d62); }

.cp2-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page, #f5f1e8); }
.cp2-gate > section { width: min(680px, 100%); padding: clamp(28px, 6vw, 54px); border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 26px; background: var(--paper, #fffdf8); text-align: center; }
.cp2-gate img { width: 64px; height: 64px; }
.cp2-gate p { color: #b98b39; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.cp2-gate h1 { margin: 12px 0; font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 3.8rem); }
.cp2-gate > section > span { display: block; color: var(--muted, #746d62); line-height: 1.7; }
.cp2-gate > section > div:last-child { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.cp2-toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; }
.cp2-toast { min-width: 280px; padding: 16px; border-radius: 14px; background: #171612; color: #fffaf0; box-shadow: 0 16px 44px rgba(0,0,0,.28); }
.cp2-toast strong,
.cp2-toast span { display: block; }
.cp2-toast span { margin-top: 5px; color: #cfc6b8; }

[data-theme="dark"] .cp2-shell,
[data-theme="dark"] .cp2-gate { --page: #0f0e0b; --paper: #191814; --ink: #f5efe4; --muted: #b6ada0; --line: rgba(255,255,255,.1); }
[data-theme="dark"] .cp2-role { color: #f5efe4 !important; }

@media (max-width: 1180px) {
  .cp2-actions,
  .cp2-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp2-people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .cp2-shell { grid-template-columns: 1fr; }
  .cp2-sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 18px 0 50px rgba(0,0,0,.25); }
  .cp2-sidebar.open { transform: translateX(0); }
  .cp2-menu { display: grid; }
  .cp2-topbar { padding-inline: 16px; }
  .cp2-role { display: none !important; }
  .cp2-content { padding: 26px 18px 46px; }
  .cp2-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .cp2-actions,
  .cp2-metrics,
  .cp2-people { grid-template-columns: 1fr; }
  .cp2-actions a { min-height: 0; }
  .cp2-heading { display: grid; }
  .cp2-heading h1 { font-size: 2.45rem; }
  .cp2-list > article,
  .cp2-documents > article { grid-template-columns: 38px minmax(0, 1fr); }
  .cp2-list > article > :last-child,
  .cp2-documents > article > :last-child { grid-column: 2; justify-self: start; }
  .cp2-card dl > div { display: grid; gap: 4px; }
  .cp2-card dd { text-align: left; }
}
