/* Local Cymatics fonts, shared by the theme and its comparison preview. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/cymatics/ibm-plex-mono-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/cymatics/ibm-plex-mono-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/cymatics/instrument-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/cymatics/instrument-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/cymatics/instrument-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/cymatics/marcellus-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Midas Ledger OS palette: blue slate, quiet gold, warm white, and sage. */
:root,
[data-theme-sample="dark"],
[data-theme-sample="void"],
[data-theme-sample="space"],
[data-theme-sample="charcoal"],
[data-theme-sample="cymatics"] {
  color-scheme: dark;
  --ink: #eef0ec;
  --ink-soft: #c2c7ca;
  --sidebar: #18242e;
  --sidebar-soft: #202c36;
  --canvas: #10171d;
  --surface: #18242e;
  --surface-soft: #23313b;
  --line: #34414a;
  --line-dark: #4c5c66;
  --muted: #a6b0b8;
  --brand-bronze: #c0a075;
  --brand-ink: #e3dccf;
  --brand-muted: #b8afa1;
  --brand-line: #655743;
  --accent: #b99a64;
  --accent-strong: #dfc18d;
  --accent-soft: #383a37;
  --on-accent: #18242e;
  --focus-ring: rgba(185, 154, 100, 0.18);
  --map-link: rgba(185, 154, 100, 0.6);
  --lime: #b0bca4;
  --lime-dark: #9fbea8;
  --good-soft: #24372d;
  --good-line: #405d49;
  --blue: #223744;
  --blue-dark: #aac0cf;
  --blue-line: #415c6c;
  --amber: #383326;
  --amber-dark: #dfc18d;
  --amber-line: #66573b;
  --bad: #d3a196;
  --bad-hover: #e3b5ab;
  --bad-soft: #3c2d2d;
  --bad-line: #654941;
  --violet: #beb1ce;
  --violet-soft: #302e3e;
  --violet-line: #514761;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 22px 70px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 248px;
  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* A neutral, true-black alternative with the same restrained gold accents. */
:root[data-theme="void"],
[data-theme-sample="void"] {
  --ink: #eeeee9;
  --ink-soft: #c3c2bc;
  --sidebar: #050505;
  --sidebar-soft: #101010;
  --canvas: #000000;
  --surface: #0b0b0b;
  --surface-soft: #131313;
  --line: #272727;
  --line-dark: #424242;
  --muted: #aaa9a5;
  --accent-soft: #242018;
  --on-accent: #090909;
  --good-soft: #151c16;
  --good-line: #354333;
  --blue: #161c20;
  --blue-line: #35434c;
  --amber: #221d14;
  --amber-line: #51432b;
  --bad-soft: #221817;
  --bad-line: #503832;
  --violet-soft: #1c1921;
  --violet-line: #403748;
}

/* Graphite with matte antique-copper accents inspired by the vaulted-ceiling reference. */
:root[data-theme="space"],
[data-theme-sample="space"] {
  --ink: #f1f1ee;
  --ink-soft: #d0d1d3;
  --sidebar: #202124;
  --sidebar-soft: #2b2d30;
  --canvas: #1a1a1d;
  --surface: #303135;
  --surface-soft: #35363a;
  --line: #47494e;
  --line-dark: #606268;
  --muted: #b6b8bd;
  --accent: #ca9668;
  --accent-strong: #e0ad7f;
  --accent-soft: #403126;
  --on-accent: #202124;
  --focus-ring: rgba(202, 150, 104, 0.22);
  --map-link: rgba(202, 150, 104, 0.65);
  --good-soft: #2b372f;
  --good-line: #506653;
  --blue: #2c3841;
  --blue-line: #536575;
  --amber: #3e3022;
  --amber-dark: #e0ad7f;
  --amber-line: #796044;
  --bad-soft: #3d3030;
  --bad-line: #75554d;
  --violet-soft: #35313f;
  --violet-line: #62576d;
}

/* A soft charcoal canvas with neutral panels and the familiar muted gold. */
:root[data-theme="charcoal"],
[data-theme-sample="charcoal"] {
  --ink: #f0f0ed;
  --ink-soft: #cccccd;
  --sidebar: #161619;
  --sidebar-soft: #222225;
  --canvas: #1a1a1d;
  --surface: #222226;
  --surface-soft: #2a2a2f;
  --line: #37373d;
  --line-dark: #56565e;
  --muted: #b1b1b9;
  --accent-soft: #343028;
  --on-accent: #1a1a1d;
  --good-soft: #252d26;
  --good-line: #405346;
  --blue: #252c32;
  --blue-line: #43515b;
  --amber: #322c21;
  --amber-line: #66543c;
  --bad-soft: #322526;
  --bad-line: #624347;
  --violet-soft: #2d2935;
  --violet-line: #4d425d;
}

/* Cymatics Lab: cream ink, golden copper, and a charcoal canvas. */
:root[data-theme="cymatics"],
[data-theme-sample="cymatics"] {
  --ink: #f1e5d4;
  --ink-soft: #dfd1bd;
  --sidebar: #18181b;
  --sidebar-soft: #242428;
  --canvas: #1a1a1d;
  --surface: #1d1d21;
  --surface-soft: #26262b;
  --line: #424248;
  --line-dark: #68646a;
  --muted: #beab96;
  --accent: #d49465;
  --accent-strong: #e2b970;
  --accent-soft: #33291f;
  --on-accent: #1d1d21;
  --focus-ring: rgba(212, 148, 101, 0.2);
  --map-link: rgba(212, 148, 101, 0.65);
  --lime: #5cc08a;
  --lime-dark: #5cc08a;
  --good-soft: #212e27;
  --good-line: #3b6d50;
  --blue: #212e33;
  --blue-dark: #7fc6dd;
  --blue-line: #3b6070;
  --amber: #332b20;
  --amber-dark: #e3a640;
  --amber-line: #806233;
  --bad: #ef6b6b;
  --bad-hover: #f78a86;
  --bad-soft: #352226;
  --bad-line: #7b4548;
  --violet: #c3add7;
  --violet-soft: #2b2434;
  --violet-line: #5d4b6c;
  --radius-md: 14px;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Marcellus", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #25313a;
  --ink-soft: #505d64;
  --sidebar: #eeefeb;
  --sidebar-soft: #e5e8e2;
  --canvas: #f6f6f3;
  --surface: #ffffff;
  --surface-soft: #f0f2ec;
  --line: #e6e7e3;
  --line-dark: #a5afa7;
  --muted: #5e696a;
  --brand-bronze: #80613e;
  --brand-ink: #2a2623;
  --brand-muted: #74634d;
  --brand-line: #c8b89f;
  /* Deepened gold and semantic colors keep small text legible on white. */
  --accent: #856a3c;
  --accent-strong: #735a31;
  --accent-soft: #f3eddf;
  --on-accent: #ffffff;
  --focus-ring: rgba(185, 154, 100, 0.2);
  --map-link: rgba(133, 106, 60, 0.55);
  --lime: #596d4e;
  --lime-dark: #4d735b;
  --good-soft: #f0f5ee;
  --good-line: #bfd0bc;
  --blue: #edf3f6;
  --blue-dark: #4e6b7d;
  --blue-line: #bfcfd8;
  --amber: #faf6e8;
  --amber-dark: #796237;
  --amber-line: #d8c79f;
  --bad: #9c584e;
  --bad-hover: #82483f;
  --bad-soft: #faf0eb;
  --bad-line: #ddbeb1;
  --violet: #746183;
  --violet-soft: #f1edf5;
  --violet-line: #cfc2dd;
  --shadow-sm: 0 2px 8px rgba(37, 49, 58, 0.04);
  --shadow-lg: 0 22px 70px rgba(24, 36, 46, 0.18);
}

* {
  box-sizing: border-box;
}

/* Quiet scrollbars follow each surface's theme without changing its overflow. */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink) 38%, transparent);
}

@media (forced-colors: active) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  *::-webkit-scrollbar,
  *::-webkit-scrollbar-track,
  *::-webkit-scrollbar-corner,
  *::-webkit-scrollbar-thumb,
  *::-webkit-scrollbar-thumb:hover {
    all: revert;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  color: inherit;
}

svg {
  display: block;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

:root:not([data-theme]) .theme-toggle,
:root:not([data-theme]) [data-theme-choice],
.theme-icon-dark {
  display: none;
}

:root[data-theme] .theme-toggle {
  display: inline-grid;
}

:root[data-theme="light"] .theme-icon-light {
  display: none;
}

:root[data-theme="light"] .theme-icon-dark {
  display: block;
}

.theme-tools {
  position: absolute;
  top: 16px;
  right: 16px;
}

.theme-tools .theme-toggle {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
}

img {
  max-width: 100%;
  height: auto;
}

input,
textarea,
select {
  min-width: 0;
  color: var(--ink);
  background-color: var(--surface);
  accent-color: var(--accent);
  line-height: 1.5;
  transition: border-color 120ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

select:not([multiple]):is(:not([size]), [size="1"]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 40%, var(--muted) 40%, var(--muted) 60%, transparent 60%),
    linear-gradient(135deg, transparent 40%, var(--muted) 40%, var(--muted) 60%, transparent 60%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), textarea, select):focus {
  border-color: var(--accent-strong);
  outline: none;
  box-shadow: none;
}

@media (forced-colors: active) {
  select:not([multiple]):is(:not([size]), [size="1"]) {
    appearance: auto;
    -webkit-appearance: auto;
    padding-right: 12px;
    background-image: none;
  }
}

::selection {
  color: var(--ink);
  background: var(--line-dark);
}

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

.sidebar {
  /* Keep Midas's slate navigation in both modes. These local tokens do not
     change light-mode person cards, code blocks, or network-map nodes. */
  color-scheme: dark;
  --ink: #eef0ec;
  --muted: #a6b0b8;
  --brand-bronze: #c0a075;
  --brand-ink: #e3dccf;
  --brand-muted: #b8afa1;
  --brand-line: #655743;
  --sidebar: #18242e;
  --sidebar-soft: #202c36;
  --surface: #25313b;
  --line: #34414a;
  --line-dark: #4c5c66;
  --accent: #b99a64;
  --accent-strong: #dfc18d;
  --accent-soft: #383a37;
  --on-accent: #18242e;
  --lime: #b0bca4;
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  color: var(--ink);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

:root[data-theme="void"] .sidebar,
:root[data-theme="space"] .sidebar,
:root[data-theme="charcoal"] .sidebar,
:root[data-theme="cymatics"] .sidebar {
  --ink: inherit;
  --muted: inherit;
  --sidebar: inherit;
  --sidebar-soft: inherit;
  --surface: inherit;
  --line: inherit;
  --line-dark: inherit;
  --accent: inherit;
  --accent-strong: inherit;
  --accent-soft: inherit;
  --on-accent: inherit;
  --lime: inherit;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 24px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  flex: none;
  width: 38px;
  height: 38px;
  background-color: var(--brand-bronze);
  -webkit-mask: url("icons/gather.svg") center / contain no-repeat;
  mask: url("icons/gather.svg") center / contain no-repeat;
}

.auth-brand .brand-mark {
  width: 48px;
  height: 48px;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-ink);
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-os {
  display: inline-block;
  padding: 3px 0 3px 9px;
  border-left: 1px solid var(--brand-line);
  color: var(--brand-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
}

.primary-nav {
  padding: 0 14px;
}

.nav-label {
  margin: 6px 10px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.nav-item {
  position: relative;
  display: flex;
  height: 45px;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface);
}

.nav-item.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-item.active::before {
  position: absolute;
  left: -14px;
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  content: "";
}

.nav-icon {
  display: grid;
  width: 20px;
  place-items: center;
}

.nav-icon svg,
.icon-btn svg,
.button svg,
.inline-icon svg,
.topbar svg,
.modal-note svg {
  width: 17px;
  height: 17px;
}

.nav-count {
  display: inline-grid;
  min-width: 23px;
  height: 22px;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  color: var(--ink);
  background: var(--line-dark);
  border-radius: 12px;
  font-size: 10px;
}

.sidebar-card {
  margin: auto 18px 22px;
  padding: 16px;
  background: var(--sidebar-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sidebar-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.sidebar-card-top span {
  color: var(--muted);
  font-weight: 600;
}

.sidebar-card-top strong {
  color: var(--lime);
  font-size: 13px;
}

.sidebar-card p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
  background: var(--line);
  border-radius: 20px;
}

/* Percentage utility classes set the fill width. */
.progress-track :where(span) {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 500ms ease;
}

.progress-track-dark {
  background: var(--line-dark);
}

.progress-track-dark span {
  background: var(--lime);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.sidebar-profile strong,
.sidebar-profile span {
  display: block;
}

.sidebar-profile strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.sidebar-profile span {
  color: var(--muted);
  font-size: 9px;
}

.profile-menu {
  margin-left: auto;
  padding: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 52px);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-actions,
.breadcrumb {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 9px;
}

.breadcrumb {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.topbar .icon-btn {
  color: var(--muted);
}

.topbar .icon-btn:hover {
  background: var(--surface);
  border-color: var(--line);
}

.notification-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border: 2px solid var(--canvas);
  border-radius: 50%;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: var(--on-accent);
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-strong);
}

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

.button-secondary:hover {
  border-color: var(--line-dark);
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.button-ghost:hover {
  background: var(--line);
}

.button-small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 10px;
}

.mobile-menu,
.sidebar-close {
  display: none;
}

.view-container {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 40px clamp(22px, 4vw, 52px) 64px;
  outline: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.page-head h1,
.hero-title {
  margin: 4px 0 8px;
  max-width: 760px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.page-head p:last-child,
.hero-subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.date-chip::before {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  content: "";
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  position: relative;
  min-height: 112px;
  padding: 21px 24px;
  border-right: 1px solid var(--line);
}

.stat-card:last-child {
  border-right: 0;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-label .inline-icon {
  color: var(--accent);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 31px;
  line-height: 1;
}

.stat-note {
  color: var(--muted);
  font-size: 10px;
}

.stat-trend {
  color: var(--lime-dark);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.card-header h2,
.section-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.card-header p,
.section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.text-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  color: var(--accent-strong);
  background: none;
  border: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  text-transform: uppercase;
}

.text-link svg {
  width: 14px;
  height: 14px;
}

.moves-list {
  padding: 5px 24px 8px;
}

.move-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.move-item:last-child {
  border-bottom: 0;
}

.move-item.completed .move-copy {
  opacity: 0.52;
}

.move-item.completed .move-copy strong {
  text-decoration: line-through;
}

.check-button {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: transparent;
  background: var(--surface);
  border: 1.5px solid var(--line-dark);
  border-radius: 50%;
  cursor: pointer;
}

.check-button:hover {
  border-color: var(--accent);
}

.check-button.checked {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.check-button svg {
  width: 13px;
  height: 13px;
}

.move-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-type {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rhythm-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.rhythm-body {
  padding: 22px 24px 16px;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 23px;
}

.score-ring {
  --score: 0;
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  flex: none;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--line) 0);
  border-radius: 50%;
}

.score-ring::after {
  position: absolute;
  width: 68px;
  height: 68px;
  background: var(--surface);
  border-radius: 50%;
  content: "";
}

.score-ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
}

.score-copy strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.score-copy span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.rhythm-row {
  margin-bottom: 17px;
}

.rhythm-row:last-child {
  margin-bottom: 0;
}

.rhythm-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.rhythm-labels span:last-child {
  color: var(--muted);
  font-weight: 500;
}

.rhythm-footer {
  margin: auto 24px 23px;
  padding: 13px 14px;
  color: var(--lime-dark);
  background: var(--good-soft);
  border: 1px solid var(--good-line);
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.45;
}

.rhythm-footer strong {
  color: var(--lime-dark);
}

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 22px;
  margin-top: 22px;
}

.people-strip {
  padding-bottom: 6px;
}

.people-list-compact {
  padding: 4px 24px 5px;
}

.person-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.person-compact:last-child {
  border-bottom: 0;
}

.person-compact:hover .person-name {
  color: var(--accent-strong);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.avatar-user {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
}

.avatar-tone-1 { background: var(--blue); color: var(--blue-dark); }
.avatar-tone-2 { background: var(--accent-soft); color: var(--accent-strong); }
.avatar-tone-3 { background: var(--good-soft); color: var(--lime-dark); }
.avatar-tone-4 { background: var(--violet-soft); color: var(--violet); }
.avatar-tone-5 { background: var(--amber); color: var(--amber-dark); }

.person-name,
.person-meta {
  display: block;
}

.person-name {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  transition: color 120ms ease;
}

.person-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-pill::before {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
  content: "";
}

.stage-engaging::before { background: var(--accent); }
.stage-connected::before { background: var(--lime-dark); }
.stage-nurturing::before { background: var(--blue-dark); }

.principle-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  color: var(--ink);
  background: var(--sidebar);
  border-color: var(--sidebar);
}

.principle-card::after {
  position: absolute;
  right: -34px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  content: "";
}

.principle-card .eyebrow {
  color: var(--lime);
}

.principle-card blockquote {
  position: relative;
  z-index: 1;
  margin: 21px 0 17px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.principle-card p:last-child {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* Target list */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  width: min(360px, 100%);
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 9px;
}

.filter-tab {
  position: relative;
  display: inline-flex;
  height: 32px;
  align-items: center;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.filter-tab input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-tab:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-tab:has(input:checked) {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.target-table-card {
  overflow: hidden;
}

.table-head,
.target-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) minmax(220px, 1.45fr) minmax(110px, 0.65fr) minmax(190px, 1fr) 32px;
  gap: 18px;
  align-items: center;
}

.table-head {
  min-height: 46px;
  padding: 0 22px;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.target-row {
  min-height: 79px;
  padding: 13px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 120ms ease;
}

.target-row:last-child {
  border-bottom: 0;
}

.target-row:hover {
  background: var(--surface);
}

.target-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.target-person .avatar {
  width: 40px;
  height: 40px;
}

.cell-copy {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.next-move-cell strong,
.next-move-cell span {
  display: block;
}

.next-move-cell strong {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-move-cell span {
  color: var(--muted);
  font-size: 9px;
}

.row-menu {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.row-menu:hover {
  color: var(--ink);
  background: var(--line);
}

.empty-state {
  padding: 70px 24px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 auto 15px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

/* Actions */
.action-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
}

.action-group {
  margin-bottom: 22px;
}

.action-group:last-child {
  margin-bottom: 0;
}

.action-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.action-group-title span {
  color: var(--muted);
  font-weight: 600;
}

.action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  padding: 16px 18px;
}

.action-card.completed {
  opacity: 0.62;
}

.action-card.completed h3 {
  text-decoration: line-through;
}

.action-card h3 {
  margin: 0 0 5px;
  font-size: 12px;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.action-date {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.action-guide {
  position: sticky;
  top: 94px;
  align-self: start;
  overflow: hidden;
}

.guide-top {
  padding: 23px;
  color: var(--ink);
  background: var(--sidebar);
}

.guide-top .eyebrow {
  color: var(--lime);
}

.guide-top h2 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
}

.guide-top p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.guide-list {
  padding: 10px 22px 15px;
}

.guide-item {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.guide-item:last-child {
  border-bottom: 0;
}

.guide-number {
  display: grid;
  width: 21px;
  height: 21px;
  flex: none;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.guide-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
}

.guide-item span:last-child {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

/* Outreach */
.outreach-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(390px, 1.08fr);
  gap: 22px;
}

.composer-card,
.message-preview-card {
  overflow: hidden;
}

.composer-body {
  padding: 22px 24px 25px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.field-label small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.composer-field {
  margin-bottom: 19px;
}

.composer-field input:where(:not([type="checkbox"], [type="radio"])),
.composer-field textarea,
.composer-field select,
.modal-form input:where(:not([type="checkbox"], [type="radio"])),
.modal-form textarea,
.modal-form select {
  width: 100%;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  outline: none;
}

.composer-field input:where(:not([type="checkbox"], [type="radio"])),
.composer-field select,
.modal-form input:where(:not([type="checkbox"], [type="radio"])),
.modal-form select {
  height: 42px;
  padding: 8px 12px;
}

.composer-field textarea,
.modal-form textarea {
  min-height: 91px;
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

.micro-tip {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.micro-tip::before {
  width: 4px;
  height: 4px;
  flex: none;
  margin-top: 5px;
  background: var(--accent);
  border-radius: 50%;
  content: "";
}

.message-window {
  margin: 24px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.message-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 6px;
  height: 6px;
  background: var(--line);
  border-radius: 50%;
}

.message-content {
  min-height: 258px;
  padding: 27px 26px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

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

.message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px 24px;
}

.message-quality {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.quality-dot {
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
}

.quality-good .quality-dot { background: var(--lime-dark); }
.quality-warn .quality-dot { background: var(--amber-dark); }

.coach-card {
  grid-column: 1 / -1;
  padding: 21px 24px;
}

.coach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.coach-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
}

.coach-checks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.coach-check {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.coach-check-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 50%;
}

.coach-check.pass .coach-check-icon {
  color: var(--lime-dark);
  background: var(--good-soft);
}

.coach-check.warn .coach-check-icon {
  color: var(--amber-dark);
  background: var(--amber);
}

.coach-check-icon svg {
  width: 13px;
  height: 13px;
}

.coach-check strong {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
}

.coach-check span:last-child {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

/* Playbook */
.tribe-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  overflow: hidden;
  margin-bottom: 22px;
  color: var(--ink);
  background: var(--sidebar);
  border-radius: var(--radius-lg);
}

.tribe-hero-copy {
  padding: 42px 44px;
}

.tribe-hero .eyebrow {
  color: var(--lime);
}

.tribe-hero h1 {
  max-width: 620px;
  margin: 7px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.tribe-hero p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.tribe-monogram {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-left: 1px solid var(--line);
}

.tribe-monogram span {
  display: grid;
  place-items: center;
  color: var(--ink);
  border-right: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 29px;
}

.tribe-monogram span:nth-child(1) { background: var(--sidebar-soft); }
.tribe-monogram span:nth-child(2) { background: var(--line-dark); }
.tribe-monogram span:nth-child(3) { background: var(--line); }
.tribe-monogram span:nth-child(4) { background: var(--line-dark); }
.tribe-monogram span:nth-child(5) { color: var(--sidebar); background: var(--lime); }

.tribe-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.tribe-card {
  position: relative;
  min-height: 244px;
  overflow: hidden;
  padding: 22px 20px;
}

.tribe-letter {
  display: block;
  margin-bottom: 32px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
}

.tribe-card h2 {
  margin: 0 0 9px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
}

.tribe-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.tribe-card::after {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 20px;
  height: 1px;
  background: var(--line-dark);
  content: "";
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.rules-card {
  padding: 24px;
}

.rules-card h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

.rule-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rule-row:last-child {
  border-bottom: 0;
}

.rule-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 7px;
}

.rule-icon svg {
  width: 14px;
  height: 14px;
}

.rule-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.rule-row p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

/* Modals */
body:has(#modal-root .modal-layer) {
  overflow: hidden;
}

.modal-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-layer.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 27px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
}

.modal-form {
  padding: 23px 27px 26px;
}

.modal-form > label:not(.check-row) {
  display: block;
}

.modal-form > label,
.form-grid {
  margin-bottom: 18px;
}

.modal-form label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  align-items: end;
  gap: 14px;
}

.form-grid > * {
  min-width: 0;
}

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

.form-error {
  margin: 0;
  padding: 11px 14px;
  color: var(--bad);
  background: var(--accent-soft);
  border: 1px solid var(--bad-line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
}

.modal-note {
  display: flex;
  gap: 11px;
  margin-top: 4px;
  padding: 13px 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--amber-line);
  border-radius: 9px;
}

.modal-note svg {
  flex: none;
  color: var(--accent);
}

.modal-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.detail-modal {
  width: min(680px, 100%);
}

.floating-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  color: var(--muted);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 30px 30px 24px;
  color: var(--ink);
  background: var(--sidebar);
}

.detail-hero .avatar {
  width: 56px;
  height: 56px;
  font-size: 14px;
  border: 3px solid var(--line-dark);
}

.detail-hero h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-body {
  padding: 25px 30px 29px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-bottom: 20px;
}

.detail-block {
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.detail-block > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.detail-actions > div {
  display: flex;
  gap: 8px;
}

.danger-button {
  color: var(--bad);
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(340px, calc(100vw - 44px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  color: var(--ink);
  background: var(--sidebar-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-size: 10px;
  animation: toast-in 180ms ease-out, toast-out 200ms ease-in 3s forwards;
}

.toast::before {
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--lime);
  border-radius: 50%;
  content: "";
}

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

@keyframes toast-out {
  to { opacity: 0; transform: translateY(4px); }
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1100px) {
  .tribe-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tribe-card:nth-child(4),
  .tribe-card:nth-child(5) {
    min-height: 210px;
  }

  .coach-checks {
    grid-template-columns: 1fr 1fr;
  }

  .table-head,
  .target-row {
    grid-template-columns: minmax(190px, 1.2fr) minmax(190px, 1.4fr) 110px 32px;
  }

  .table-head > *:nth-child(4),
  .target-row > *:nth-child(4) {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 250px;
  }

  .sidebar {
    transform: translateX(-101%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim.open {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, 0.65);
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
  }

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

  .main-shell {
    margin-left: 0;
  }

  .mobile-menu {
    margin-right: 8px;
  }

  .dashboard-grid,
  .dashboard-lower,
  .action-layout,
  .outreach-layout {
    grid-template-columns: 1fr;
  }

  .action-guide {
    position: static;
  }

  .tribe-hero {
    grid-template-columns: 1fr;
  }

  .tribe-monogram {
    min-height: 100px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .breadcrumb,
  .notification-btn {
    display: none;
  }

  .topbar .button-primary {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .view-container {
    padding: 28px 16px 48px;
  }

  .page-head {
    display: block;
    margin-bottom: 23px;
  }

  .page-head .button {
    margin-top: 16px;
  }

  .page-head h1,
  .hero-title {
    font-size: 36px;
  }

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

  .stat-card {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

  .stat-value-row {
    margin: 0;
  }

  .stat-note {
    display: none;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    overflow-x: auto;
  }

  .table-head {
    display: none;
  }

  .target-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 17px;
  }

  .target-row > *:nth-child(2),
  .target-row > *:nth-child(4),
  .target-row > *:nth-child(5) {
    display: none;
  }

  .target-row .stage-pill {
    display: inline-flex;
  }

  .tribe-grid,
  .rules-grid,
  .coach-checks {
    grid-template-columns: 1fr;
  }

  .tribe-card {
    min-height: auto;
  }

  .tribe-letter {
    margin-bottom: 20px;
  }

  .tribe-hero-copy {
    padding: 32px 25px;
  }

  .tribe-hero h1 {
    font-size: 36px;
  }

  .tribe-monogram span {
    font-size: 23px;
  }

  .form-grid.two-col,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-layer {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-header,
  .modal-form {
    padding-right: 20px;
    padding-left: 20px;
  }

  .message-content {
    min-height: 220px;
  }
}

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