:root {
  color-scheme: dark;
  --bg: #060504;
  --panel: #0d0b08;
  --panel-2: #15110b;
  --panel-3: #1b150d;
  --line: rgba(232, 195, 116, 0.14);
  --line-strong: rgba(232, 195, 116, 0.3);
  --text: #f5efe4;
  --muted: #9f927d;
  --soft: #d6c7aa;
  --mint: #d7ad55;
  --mint-2: #2c2110;
  --amber: #f0c873;
  --amber-2: #34240d;
  --red: #ff6b6b;
  --red-2: #3a161b;
  --cyan: #84a9ff;
  --cyan-2: #131d38;
  --surface: rgba(12, 10, 7, 0.9);
  --surface-solid: #0c0a07;
  --surface-2: rgba(20, 16, 10, 0.92);
  --sticky-header-bg: #15110b;
  --sticky-cell-bg: #0d0b08;
  --sticky-cell-hover-bg: #17130d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --radius: 8px;
  --header-avatar-size: 38px;
  --app-header-height: 57px;
  --page-frame-space: 16px;
  --page-frame-gap: 18px;
  --motion-fast: 140ms;
  --motion-normal: 220ms;
  --motion-slow: 420ms;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-press: cubic-bezier(0.34, 1.56, 0.64, 1);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--mint) 18%, transparent);
  --focus-ring-soft: 0 0 0 2px color-mix(in srgb, var(--mint) 14%, transparent);
  --press-scale: 0.982;
  --motion-hover-duration: var(--motion-normal);
  --motion-hover-ease: var(--ease-premium);
  --motion-hover: var(--motion-hover-duration) var(--motion-hover-ease);
  --motion-accordion-duration: var(--motion-slow);
  --motion-accordion-ease: var(--ease-premium);
  --motion-accordion: var(--motion-accordion-duration) var(--motion-accordion-ease);
  --control-height-compact: 34px;
  --control-gap-compact: 10px;
  --field-background-duration: 260ms;
  --field-border-duration: 240ms;
  --field-color-duration: 200ms;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #f6f1e8;
    --panel: #fffaf1;
    --panel-2: #f0e6d5;
    --panel-3: #e6d8bf;
    --line: rgba(93, 68, 28, 0.16);
    --line-strong: rgba(93, 68, 28, 0.32);
    --text: #21190e;
    --muted: #7c6c55;
    --soft: #4b3b26;
    --mint: #9b6b16;
    --mint-2: #efe1c4;
    --amber: #b98218;
    --amber-2: #f4e3bd;
    --surface: rgba(255, 250, 241, 0.94);
    --surface-solid: #fffaf1;
    --surface-2: rgba(247, 239, 225, 0.96);
    --sticky-header-bg: #f0e6d5;
    --sticky-cell-bg: #fffaf1;
    --sticky-cell-hover-bg: #f7efe1;
    --shadow: 0 24px 70px rgba(74, 51, 14, 0.14);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e8;
  --panel: #fffaf1;
  --panel-2: #f0e6d5;
  --panel-3: #e6d8bf;
  --line: rgba(93, 68, 28, 0.16);
  --line-strong: rgba(93, 68, 28, 0.32);
  --text: #21190e;
  --muted: #7c6c55;
  --soft: #4b3b26;
  --mint: #9b6b16;
  --mint-2: #efe1c4;
  --amber: #b98218;
  --amber-2: #f4e3bd;
  --surface: rgba(255, 250, 241, 0.94);
  --surface-solid: #fffaf1;
  --surface-2: rgba(247, 239, 225, 0.96);
  --sticky-header-bg: #f0e6d5;
  --sticky-cell-bg: #fffaf1;
  --sticky-cell-hover-bg: #f7efe1;
  --shadow: 0 24px 70px rgba(74, 51, 14, 0.14);
}

* {
  box-sizing: border-box;
}

.omg-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

label:has(> .omg-dropdown) {
  pointer-events: none;
}

.omg-dropdown-trigger {
  width: 100%;
  min-width: 0;
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  pointer-events: auto;
  transition:
    background-color var(--field-background-duration) var(--ease-premium),
    border-color var(--field-border-duration) var(--ease-premium),
    box-shadow var(--field-border-duration) var(--ease-premium),
    color var(--field-color-duration) var(--ease-premium);
}

.omg-dropdown-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.omg-dropdown-trigger:hover:not(:disabled),
.omg-dropdown.is-open .omg-dropdown-trigger {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.omg-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.omg-dropdown-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.omg-chevron {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  transform: rotate(0deg);
  transform-origin: center;
  transition: transform 160ms var(--ease-standard), color var(--motion-hover);
}

.omg-dropdown.is-open .omg-chevron,
[aria-expanded="true"] > .omg-chevron,
.omg-chevron.is-open {
  transform: rotate(180deg);
}

.omg-dropdown-menu {
  position: fixed;
  z-index: 10020;
  display: grid;
  gap: 2px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

.omg-dropdown-menu [role="option"] {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  transition:
    background-color 160ms var(--ease-standard),
    color 160ms var(--ease-standard);
}

.omg-dropdown-menu [role="option"]:hover,
.omg-dropdown-menu [role="option"].is-active {
  background: var(--panel-2);
  color: var(--text);
}

.omg-dropdown-menu [role="option"][aria-selected="true"] {
  color: var(--mint);
  font-weight: 720;
}

.omg-dropdown-menu [role="option"]:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

html.modal-layer-open {
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(215, 173, 85, 0.08), transparent 260px),
    radial-gradient(circle at top right, rgba(232, 195, 116, 0.1), transparent 340px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-brand-logo {
  display: block;
  width: 136px;
  height: 64px;
  object-fit: contain;
}

.auth-panel h1,
.auth-panel p {
  margin: 0;
}

.auth-panel .auth-success {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--mint) 42%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--mint) 9%, var(--panel-2));
  color: var(--text);
}

.auth-panel h1 {
  font-size: 25px;
  line-height: 1.2;
}

.auth-panel p {
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-panel small,
.auth-loading {
  color: var(--muted);
  font-size: 12px;
}

.auth-primary {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  margin-top: 0;
  text-decoration: none;
}

.account-menu-wrap {
  position: relative;
}

.account-menu {
  position: absolute;
  z-index: 160;
  top: calc(100% + 9px);
  right: 0;
  width: 270px;
  display: grid;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top right;
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-premium), visibility var(--motion-fast);
}

.account-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.account-menu > button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  text-align: left;
  cursor: pointer;
}

.account-menu > button:hover,
.account-menu > button:focus-visible {
  background: var(--panel-2);
  color: var(--text);
}

.account-menu .account-menu-logout {
  color: var(--red);
}

.account-appearance-wrap {
  position: relative;
}

.account-appearance-toggle {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 18px minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  text-align: left;
  cursor: pointer;
}

.account-appearance-toggle:hover,
.account-appearance-toggle:focus-visible,
.account-appearance-toggle[aria-expanded="true"] {
  background: var(--panel-2);
  color: var(--text);
}

.account-appearance-icon,
.account-appearance-chevron {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.account-appearance-toggle small {
  color: var(--muted);
  font-size: 11px;
}

.account-appearance-submenu {
  display: none;
  margin: 3px 0 4px 25px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.account-appearance-submenu.open {
  display: grid;
}

.account-appearance-submenu button {
  display: grid;
  min-height: 32px;
  grid-template-columns: 1fr 18px;
  align-items: center;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--soft);
  text-align: left;
  cursor: pointer;
}

.account-appearance-submenu button:hover,
.account-appearance-submenu button:focus-visible,
.account-appearance-submenu button[aria-checked="true"] {
  background: var(--panel);
  color: var(--text);
}

.account-menu-identity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 9px 9px;
}

.account-menu-identity > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-menu-identity strong,
.account-menu-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-identity strong {
  font-size: 13px;
}

.account-menu-identity small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.account-menu-avatar,
.account-security-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 850;
}

.shared-admin-avatar {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  text-indent: 0;
}

.shared-admin-avatar > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.account-menu-avatar {
  width: 36px;
  height: 36px;
}

.account-menu-separator {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.account-security-page {
  display: grid;
  gap: 22px;
  max-width: 760px;
  padding: 24px;
  border-top: 1px solid var(--line);
}

.account-security-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-security-heading h2,
.account-security-heading p {
  margin: 0;
}

.account-security-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.account-security-avatar {
  width: 46px;
  height: 46px;
}

.account-security-list {
  display: grid;
  margin: 0;
}

@media (max-width: 640px) {
  .auth-shell { padding: 16px; }
  .auth-panel { padding: 30px 22px; }
  .account-menu { position: fixed; top: 58px; right: 12px; left: 12px; width: auto; }
}

button {
  font: inherit;
}

button,
input,
select,
textarea {
  transition:
    border-color var(--motion-hover),
    background-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select {
  transition:
    background-color var(--field-background-duration) var(--ease-premium),
    border-color var(--field-border-duration) var(--ease-premium),
    box-shadow var(--field-border-duration) var(--ease-premium),
    color var(--field-color-duration) var(--ease-premium);
}

.nav-item,
.topbar-tab,
.theme-quick-toggle,
.profile-button,
.theme-popover,
.theme-popover button,
.metric,
.finance-compact-card,
.finance-ledger-section,
.finance-ledger-summary,
.finance-history-toggle,
.reset-history-panel,
.reset-history-toggle,
.operation-row,
.summary-item,
.payout-item,
.members-row,
.account-cell,
.ops-table tbody tr,
.status-chip,
.modal-close-button,
.ghost-button,
.secondary-button,
.primary-button,
.compact-filters button,
.trade-control button,
.amount-field input,
.amount-field textarea,
.amount-field select {
  transition-duration: var(--motion-hover-duration);
  transition-timing-function: var(--ease-premium);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: var(--focus-ring);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(215, 173, 85, 0.22), rgba(255, 255, 255, 0.04));
  color: var(--mint);
  font-weight: 800;
}

.brand strong,
.mobile-brand strong {
  display: block;
  font-size: 15px;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.topbar-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-item {
  padding: 10px 11px;
}

.nav-item span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active,
.topbar-tab:hover,
.topbar-tab.active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar-stat {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 650;
}

.main-panel {
  min-width: 0;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
  overflow: visible;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 38px;
  padding: 0 10px 0 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.topbar-brand-logo {
  display: block;
  width: 72px;
  height: 34px;
  object-fit: contain;
}

.topbar-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  padding: 8px 8px;
  margin: -8px -8px;
  overflow: visible;
  overscroll-behavior-x: contain;
  isolation: isolate;
}

.topbar-tab {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
  isolation: isolate;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-hover);
}

.topbar-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in srgb, var(--mint) 9%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 32px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scaleX(0.96);
  transform-origin: center;
  transition:
    opacity var(--motion-hover),
    transform var(--motion-hover),
    box-shadow var(--motion-hover);
}

.topbar-tab:hover,
.topbar-tab.active {
  z-index: 3;
}

.topbar-tab:hover::before,
.topbar-tab.active::before {
  opacity: 1;
  transform: scaleX(1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
}

.theme-quick-toggle,
.profile-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 78%, transparent), color-mix(in srgb, var(--surface) 94%, transparent));
  color: var(--soft);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.12);
}

.theme-quick-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 88px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 760;
}

.theme-quick-toggle::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.72;
  transform: translateY(-1px) rotate(45deg);
}

.profile-button {
  display: grid;
  width: var(--header-avatar-size);
  height: var(--header-avatar-size);
  min-height: var(--header-avatar-size);
  padding: 0;
  overflow: hidden;
  place-items: center;
  box-sizing: border-box;
  color: var(--mint);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.profile-avatar-requirement {
  max-width: 112px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.topbar-tab:hover,
.topbar-tab.active,
.theme-quick-toggle:hover,
.profile-button:hover,
.matrix-tools button:hover,
.inspector-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 32px rgba(0, 0, 0, 0.18);
}

.theme-menu-wrap {
  position: relative;
}

.theme-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 60;
  width: 192px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 92%, white 8%), var(--surface));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity var(--motion-hover),
    transform var(--motion-hover);
}

.theme-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.theme-popover button {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  text-align: left;
}

.theme-popover button span {
  color: var(--text);
  font-weight: 780;
}

.theme-popover button small {
  color: var(--muted);
  font-size: 11px;
}

.theme-popover button:hover,
.theme-popover button.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 13%, transparent);
}

.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--page-frame-space);
}

.page-dashboard,
.page-members,
.page-history {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--page-frame-gap);
  height: calc(100dvh - var(--app-header-height));
  min-height: 0;
  overflow: hidden;
}

.page-dashboard > .page-header,
.page-members > .page-header,
.page-history > .page-header {
  margin-bottom: 0;
}

.page-agenda {
  height: calc(100dvh - var(--app-header-height));
  min-height: 0;
  overflow: hidden;
}

.page-finance {
  container-name: main-page-frame;
  container-type: inline-size;
}

.page-transition-in {
  animation: pageEnter var(--motion-normal) var(--ease-premium) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  margin: 0 0 18px;
}

.page-header-title {
  min-width: 0;
}

.page-eyebrow {
  margin: 0;
  color: var(--mint);
  font-family: inherit;
  font-size: 17px;
  font-weight: 820;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker {
  margin-bottom: 7px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  color: var(--text);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
}

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

.page-actions,
.page-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.page-header-actions {
  flex-wrap: nowrap;
}

.page-header-actions:empty {
  display: none;
}

.page-header-actions > button {
  flex: 0 0 auto;
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  align-self: center;
}

.page-header-actions .member-search-control {
  width: min(300px, 100%);
  min-width: 130px;
  max-width: 300px;
  flex: 1 1 300px;
}

.primary-button,
.ghost-button,
.text-button,
.icon-button,
.link-button,
.account-name {
  border: 0;
  cursor: pointer;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-fast) var(--ease-premium);
}

.primary-button {
  border-color: color-mix(in srgb, var(--mint) 56%, var(--line-strong));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 18%, rgba(255, 255, 255, 0.09)), rgba(255, 255, 255, 0.025)),
    color-mix(in srgb, var(--surface-2) 72%, var(--mint) 16%);
  color: var(--text);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  border-color: color-mix(in srgb, var(--mint) 72%, var(--line-strong));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 24%, rgba(255, 255, 255, 0.12)), rgba(255, 255, 255, 0.04)),
    color-mix(in srgb, var(--surface-2) 64%, var(--mint) 24%);
  color: color-mix(in srgb, var(--text) 88%, var(--mint));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
}

.primary-button:disabled,
.primary-button:disabled:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.ghost-button:hover {
  border-color: color-mix(in srgb, var(--mint) 34%, var(--line-strong));
  background: rgba(255, 255, 255, 0.075);
}

.danger-ghost {
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  color: color-mix(in srgb, var(--red) 72%, var(--soft));
}

.danger-ghost:hover {
  border-color: color-mix(in srgb, var(--red) 44%, var(--line-strong));
  background: color-mix(in srgb, var(--red) 8%, transparent);
  color: color-mix(in srgb, var(--red) 82%, var(--text));
}

.primary-button:active,
.ghost-button:active,
button:active {
  transform: translateY(0) scale(0.985);
}

button:disabled {
  cursor: not-allowed;
}

.text-button,
.link-button,
.account-name {
  padding: 0;
  background: transparent;
  color: var(--mint);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric,
.section-block,
.workflow-panel,
.detail-hero,
.account-toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 96%, white 4%), var(--surface));
  box-shadow: var(--shadow);
}

.metric {
  min-height: 128px;
  padding: 18px;
}

.metric-label,
.metric-detail {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin: 14px 0 8px;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: 0;
}

.metric.accent .metric-value {
  color: var(--mint);
}

.metric.danger .metric-value {
  color: var(--red);
}

.command-clock {
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  text-align: right;
}

.command-clock span,
.command-clock small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.command-clock strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
}

.command-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.command-signal {
  min-height: 86px;
  padding: 14px;
  background: var(--surface);
}

.command-signal span,
.command-signal small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.command-signal strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 28px;
  letter-spacing: 0;
}

.command-signal.hot strong {
  color: var(--amber);
}

.command-signal.money strong {
  color: var(--mint);
}

.daily-layout,
.command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.page-dashboard .daily-layout {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.operations-panel,
.attention-panel,
.waiting-panel,
.daily-summary-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.operations-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.page-dashboard .operations-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.page-dashboard .operations-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-toolbar p {
  margin-top: 4px;
  font-size: 13px;
}

.compact-filters {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.compact-filters button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
  transition:
    background-color var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-hover);
}

.compact-filters button:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.compact-filters button.active {
  background: color-mix(in srgb, var(--amber) 12%, rgba(255, 255, 255, 0.075));
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--amber) 22%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.compact-filters button strong {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 16%, rgba(255, 255, 255, 0.065));
  color: color-mix(in srgb, var(--amber) 78%, var(--text));
  font-size: 10px;
  font-weight: 760;
}

.operations-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  container-type: inline-size;
}

.operations-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  table-layout: fixed;
}

.operations-table.without-actions {
  min-width: 980px;
}

.operations-table .task-col-account {
  width: 14%;
}

.operations-table .task-col-task {
  width: 15%;
}

.operations-table .task-col-direction {
  width: 13%;
}

.operations-table .task-col-pair {
  width: 11%;
}

.operations-table .task-col-status {
  width: 10%;
}

.operations-table .task-col-actions {
  width: 24%;
}

.operations-table .task-col-notes {
  width: 13%;
}

.operations-table.without-actions .task-col-account {
  width: 17%;
}

.operations-table.without-actions .task-col-task {
  width: 20%;
}

.operations-table.without-actions .task-col-direction {
  width: 17%;
}

.operations-table.without-actions .task-col-pair {
  width: 13%;
}

.operations-table.without-actions .task-col-status {
  width: 13%;
}

.operations-table.without-actions .task-col-notes {
  width: 20%;
}

.operations-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.operations-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--soft);
  vertical-align: middle;
}

.operations-table tbody tr:hover {
  background: color-mix(in srgb, var(--mint) 4%, transparent);
}

.operations-table tbody tr.summary-linked {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 9%, transparent), transparent 72%),
    color-mix(in srgb, var(--mint) 5%, transparent);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--mint) 38%, transparent);
}

.operations-table tbody tr.dashboard-row-focus {
  animation: dashboardRowFocus 1900ms ease forwards;
}

@keyframes dashboardRowFocus {
  0%,
  64% {
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--mint) 9%, transparent), transparent 72%),
      color-mix(in srgb, var(--mint) 5%, transparent);
    box-shadow: inset 2px 0 0 color-mix(in srgb, var(--mint) 38%, transparent);
  }

  100% {
    background: transparent;
    box-shadow: inset 2px 0 0 transparent;
  }
}

.operations-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.priority-cell {
  width: 44px;
}

.priority-cell span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.account-cell {
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.account-cell strong {
  color: var(--text);
  font-weight: 800;
}

.trade-control {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.trade-control button {
  display: grid;
  width: 48px;
  height: 26px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
  box-sizing: border-box;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    transform var(--motion-hover);
}

.dashboard-direction-control {
  display: grid;
  width: 100%;
  max-width: 132px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
}

.dashboard-direction-control button {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
}

.dashboard-direction-control button span {
  flex: 0 0 auto;
}

.trade-control button:hover {
  border-color: color-mix(in srgb, var(--mint) 30%, transparent);
  background: color-mix(in srgb, var(--mint) 10%, transparent);
  color: var(--text);
}

.trade-control button.active {
  border-color: color-mix(in srgb, var(--mint) 46%, transparent);
  background: color-mix(in srgb, var(--mint) 18%, transparent);
  color: var(--mint);
}

.trade-control button:disabled,
.pair-select-wrap select:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pair-select-wrap {
  display: inline-flex;
}

.dashboard-pair-control {
  width: 100%;
}

.dashboard-pair-control select {
  width: 100%;
  min-width: 0;
}

.pair-select-wrap select {
  appearance: none;
  min-width: 104px;
  min-height: 30px;
  height: 30px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.pair-select-wrap select:hover,
.pair-select-wrap select:focus {
  border-color: color-mix(in srgb, var(--mint) 30%, transparent);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 5px 5px no-repeat,
    color-mix(in srgb, var(--mint) 10%, transparent);
  color: var(--text);
  outline: 0;
  box-shadow: none;
}

.pair-select-wrap select:disabled:hover {
  border-color: var(--line);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.035);
  color: var(--muted);
  box-shadow: none;
}

.contract-chip {
  display: inline-flex;
  min-width: 76px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.contract-chip.empty {
  color: var(--muted);
}

.dashboard-trade-readonly {
  display: inline-flex;
  width: 100%;
  max-width: 132px;
  min-height: 30px;
  align-items: center;
  box-sizing: border-box;
  color: var(--soft);
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
}

.dashboard-trade-readonly.direction {
  justify-content: center;
}

.dashboard-trade-readonly.pair {
  justify-content: flex-start;
  padding-inline: 10px;
}

.dashboard-trade-readonly.empty {
  color: var(--muted);
}

.due-cell {
  color: var(--muted);
  font-size: 13px;
}

.row-actions-cell {
  height: 100%;
  vertical-align: middle;
}

.row-actions-cell > .row-actions {
  display: flex;
  align-items: center;
  align-content: center;
  gap: 5px;
  height: 100%;
  min-width: 190px;
}

.row-actions button {
  align-self: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    transform var(--motion-hover);
}

.row-actions button:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--mint) 7%, rgba(255, 255, 255, 0.055));
  color: var(--text);
}

.row-actions button.danger {
  color: color-mix(in srgb, var(--red) 70%, var(--soft));
}

.row-actions button.partial-action,
.inspector-actions button.partial-action {
  font-size: 11px;
  color: color-mix(in srgb, var(--amber) 58%, var(--soft));
}

.row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.note-cell {
  min-width: 180px;
  padding: 0;
  cursor: pointer;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.note-cell span {
  display: block;
  max-width: 220px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.note-cell.empty-note span {
  color: var(--muted);
}

.note-cell:hover {
  background: color-mix(in srgb, var(--mint) 5%, transparent);
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--mint) 12%, transparent);
}

.note-cell:hover span {
  color: var(--text);
}

.empty-table-state {
  height: 72px;
  width: 100%;
  padding-inline: 10px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.operations-table .empty-table-state {
  padding-left: 0;
  padding-right: 0;
}

.empty-table-state > span {
  display: grid;
  width: 100cqw;
  min-height: 72px;
  place-items: center;
  position: sticky;
  left: 0;
}

.daily-summary-panel {
  --dashboard-sidebar-spacing: 14px;
  padding: 14px;
}

.summary-list {
  display: grid;
  gap: 6px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  cursor: default;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.summary-row:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 7%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.04);
}

.summary-row:active {
  border-color: color-mix(in srgb, var(--mint) 28%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 9%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.045);
}

.summary-row.empty {
  opacity: 0.62;
}

.summary-row.empty:hover {
  opacity: 0.78;
}

.summary-row span {
  color: var(--muted);
  font-size: 12px;
}

.summary-row strong {
  color: var(--text);
  font-size: 13px;
}

.requested-payouts-panel {
  margin-top: var(--dashboard-sidebar-spacing);
  padding-top: var(--dashboard-sidebar-spacing);
  border-top: 1px solid var(--line);
}

.dashboard-finance-actions {
  margin-top: var(--dashboard-sidebar-spacing);
  padding-top: var(--dashboard-sidebar-spacing);
  border-top: 1px solid var(--line);
}

.requested-payout-list {
  display: grid;
  gap: 7px;
}

.dashboard-amp-card,
.dashboard-finance-quick-actions button,
.requested-payout-list button,
.empty-panel-state {
  width: 100%;
  min-height: 46px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.dashboard-amp-card,
.dashboard-finance-quick-actions button,
.requested-payout-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.dashboard-finance-quick-actions button,
.dashboard-amp-card,
.requested-payout-list button {
  cursor: pointer;
}

.dashboard-amp-card {
  margin-bottom: 0;
}

.dashboard-amp-card.needs-update {
  border-color: color-mix(in srgb, var(--mint) 44%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 10%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 10%, transparent);
}

.dashboard-amp-card > span,
.dashboard-finance-quick-actions button span {
  display: grid;
  gap: 3px;
}

.dashboard-amp-card strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.dashboard-amp-card small {
  font-weight: 760;
}

.dashboard-amp-card.needs-update small {
  color: color-mix(in srgb, var(--gold) 72%, var(--soft));
}

.dashboard-amp-card.needs-update small.muted {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-finance-divider {
  height: 1px;
  margin: var(--dashboard-sidebar-spacing) 0;
  background: var(--line);
}

.dashboard-amp-card:hover,
.dashboard-finance-quick-actions button:hover,
.requested-payout-list button:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 7%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.04);
}

.dashboard-amp-card:active {
  transform: translateY(1px);
}

.dashboard-finance-quick-actions {
  display: grid;
  gap: 7px;
}

.requested-payout-list span {
  display: grid;
  gap: 3px;
}

.dashboard-amp-card small,
.dashboard-finance-quick-actions small,
.requested-payout-list small,
.requested-payout-list em,
.empty-panel-state {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.attention-panel {
  padding: 16px;
}

.attention-list,
.payout-stack {
  display: grid;
  gap: 8px;
}

.attention-row,
.payout-row,
.waiting-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  cursor: pointer;
  text-align: left;
}

.attention-row,
.payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
}

.attention-row strong,
.payout-row strong {
  display: block;
  color: var(--text);
}

.attention-row small,
.payout-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.payout-row em {
  color: var(--mint);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.rail-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.attention-panel > h2 {
  margin-bottom: 10px;
}

.command-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.waiting-panel {
  padding: 16px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.panel-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
}

.waiting-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin-top: 8px;
  padding: 9px 10px;
}

.waiting-row strong {
  color: var(--text);
}

.waiting-row span {
  color: var(--soft);
}

.note-grid {
  display: grid;
  gap: 8px;
}

.note-grid div {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.note-grid span {
  color: var(--muted);
}

.matrix-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.matrix-tools button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 82%, transparent), var(--surface));
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.agenda-page-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.simulation-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.simulation-panel > div {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

.simulation-panel > div span,
.simulation-panel label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.simulation-panel > div strong {
  font-size: 13px;
}

.simulation-panel label {
  display: grid;
  gap: 4px;
}

.simulation-panel input {
  height: 32px;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.agenda-toolbar {
  min-height: 36px;
  margin: 0 0 12px;
}

.agenda-toolbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agenda-toolbar-actions {
  gap: var(--control-gap-compact);
}

.agenda-toolbar-actions .member-search-control {
  min-width: 130px;
}

.agenda-start-purchase-button {
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--mint) 65%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--mint) 16%);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--field-background-duration) var(--ease-premium),
    border-color var(--field-border-duration) var(--ease-premium),
    box-shadow var(--field-border-duration) var(--ease-premium),
    color var(--field-color-duration) var(--ease-premium),
    filter var(--field-color-duration) var(--ease-premium);
}

.agenda-start-purchase-button:hover {
  filter: brightness(1.04);
}

.agenda-start-purchase-button:active {
  transform: none;
}

.agenda-reschedule-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin: 0 0 12px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--mint) 8%, var(--surface) 92%);
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.agenda-reschedule-banner button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--soft);
  cursor: pointer;
}

.agenda-reschedule-banner button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.agenda-context-banners {
  display: grid;
  min-height: 0;
}

.agenda-cycle-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin: 0 0 12px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--mint) 38%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--mint) 8%, var(--surface) 92%);
  color: var(--soft);
  font-size: 12px;
}

.agenda-cycle-focus-banner strong {
  color: var(--text);
  font-weight: 780;
}

.agenda-cycle-focus-banner button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 760;
}

.agenda-cycle-focus-banner button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.agenda-matrix-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.agenda-matrix-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  scroll-behavior: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-color: color-mix(in srgb, var(--mint) 34%, transparent) color-mix(in srgb, var(--surface-2) 82%, transparent);
  scrollbar-width: thin;
}

.agenda-history-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 92%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background-color var(--field-background-duration) var(--ease-premium),
    border-color var(--field-border-duration) var(--ease-premium),
    box-shadow var(--field-border-duration) var(--ease-premium),
    color var(--field-color-duration) var(--ease-premium);
}

.agenda-history-button:hover {
  border-color: color-mix(in srgb, var(--line-strong) 74%, transparent);
  background: color-mix(in srgb, var(--mint) 8%, var(--surface-2) 92%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.09);
}

.agenda-history-button:active {
  transform: none;
}

.agenda-history-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 54%, transparent);
  outline-offset: 2px;
}

.agenda-scroll-top {
  appearance: none;
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 70;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line-strong) 68%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.94);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    opacity 300ms var(--ease-premium),
    transform 300ms var(--ease-premium),
    border-color 160ms ease,
    background-color 160ms ease;
}

.agenda-scroll-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.agenda-scroll-top:hover {
  border-color: color-mix(in srgb, var(--mint) 36%, var(--line-strong) 64%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 9%, var(--surface) 91%), color-mix(in srgb, var(--surface-2) 94%, transparent));
}

.agenda-scroll-top:active {
  transform: translateY(1px) scale(0.95);
}

.agenda-scroll-top:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 54%, transparent);
  outline-offset: 2px;
}

.agenda-matrix-shell::-webkit-scrollbar,
.topbar-tabs::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.agenda-matrix-shell::-webkit-scrollbar-track,
.topbar-tabs::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.agenda-matrix-shell::-webkit-scrollbar-thumb,
.topbar-tabs::-webkit-scrollbar-thumb {
  border: 2px solid color-mix(in srgb, var(--surface-2) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 34%, var(--panel-3) 66%);
}

.agenda-matrix-shell::-webkit-scrollbar-thumb:hover,
.topbar-tabs::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--mint) 52%, var(--panel-3) 48%);
}

.agenda-matrix {
  position: relative;
  width: max-content;
}

.agenda-bottom-spacer {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--surface);
  pointer-events: none;
}

.agenda-matrix.agenda-search-focused::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--agenda-focus-left, 108px);
  z-index: 3;
  width: var(--agenda-focus-width, 190px);
  border-right: 1px solid color-mix(in srgb, var(--mint) 46%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--mint) 46%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 13%, transparent), transparent 34%),
    color-mix(in srgb, var(--mint) 6%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 18%, transparent),
    inset 0 0 36px color-mix(in srgb, var(--mint) 10%, transparent),
    0 0 28px color-mix(in srgb, var(--mint) 9%, transparent);
  pointer-events: none;
  transition:
    left 220ms ease,
    width 220ms ease,
    opacity 220ms ease;
}

.matrix-row {
  display: grid;
  min-height: 64px;
}

.matrix-head {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 54px;
}

.agenda-month-row {
  min-height: 42px;
}

.agenda-month-separator {
  grid-column: 1 / -1;
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: var(--agenda-viewport-width, 100%);
  box-sizing: border-box;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-2) 92%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.agenda-month-separator span {
  flex: 0 0 auto;
}

.agenda-month-separator::before,
.agenda-month-separator::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: color-mix(in srgb, var(--line-strong) 54%, transparent);
}

.date-cell,
.matrix-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.date-cell {
  padding: 10px 11px;
  background: var(--surface-2);
}

.sticky-date {
  position: sticky;
  left: 0;
  z-index: 3;
}

.matrix-head .sticky-date {
  display: flex;
  align-items: center;
  padding: 10px 11px;
  z-index: 5;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.date-cell strong,
.date-cell small {
  display: block;
}

.date-cell strong {
  font-size: 13px;
}

.date-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.account-head {
  appearance: none;
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  overflow: visible;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 760;
  letter-spacing: 0.01em;
  text-align: left;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.account-head:hover {
  background: color-mix(in srgb, var(--mint) 8%, var(--surface-2) 92%);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--mint) 26%, transparent);
  color: var(--text);
}

.agenda-search-focused .agenda-col-dim {
  opacity: 0.46;
  filter: saturate(0.72);
}

.agenda-search-focused .agenda-search-target {
  opacity: 1;
  filter: none;
}

.agenda-cycle-focus-active .agenda-cycle-dim {
  opacity: 0.34;
  filter: saturate(0.58);
}

.account-head.agenda-cycle-member {
  background: color-mix(in srgb, var(--mint) 11%, var(--surface-2) 89%);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--mint) 54%, transparent);
}

.account-head.agenda-search-target {
  background: color-mix(in srgb, var(--mint) 11%, var(--surface-2) 89%);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--mint) 38%, transparent);
}

.account-head:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--mint) 62%, transparent);
  outline-offset: -2px;
}

.matrix-cell {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%);
}

.day-today .date-cell,
.day-today .matrix-cell {
  background: color-mix(in srgb, var(--amber-2) 36%, var(--surface) 64%);
}

.day-weekend .date-cell,
.day-weekend .matrix-cell {
  background: color-mix(in srgb, var(--panel-3) 62%, var(--surface) 38%);
}

.agenda-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 130ms ease,
    background-color 130ms ease,
    color 130ms ease,
    box-shadow 130ms ease,
    transform 90ms ease;
}

.agenda-event.filled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  color: var(--text);
}

.agenda-event:hover {
  border-color: color-mix(in srgb, var(--line-strong) 72%, transparent);
  background: color-mix(in srgb, var(--mint) 8%, var(--panel-2) 92%);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.agenda-event:active {
  transform: translateY(1px);
  background: color-mix(in srgb, var(--mint) 18%, var(--panel-2) 82%);
}

.agenda-event.selected {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--mint) 14%, var(--panel-2) 86%);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 20%, transparent);
}

.agenda-event span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-event small {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
}

.agenda-event small.warn {
  color: var(--amber);
}

.agenda-event small.info {
  color: var(--cyan);
}

.agenda-event small.good {
  color: var(--mint);
}

.agenda-event small.won {
  color: #8fbc8f;
}

.agenda-event small.partial-won {
  color: #a7cda8;
}

.agenda-event small.lost {
  color: #d29a9d;
}

.agenda-event small.partial-lost {
  color: #ddb0b2;
}

.agenda-event small.pending {
  color: #d9bd86;
}

.agenda-event small.in-progress {
  color: #adbdd5;
}

.agenda-event small.requested {
  color: #c0b2e5;
}

.agenda-event small.activated {
  color: #b8c2c3;
}

.agenda-event small.purchased {
  color: #c1c3bd;
}

.agenda-event small.received {
  color: #8daf84;
}

.agenda-event.empty {
  opacity: 0.45;
}

.agenda-cycle-focus-active .agenda-event {
  cursor: default;
}

.agenda-cycle-focus-active .agenda-event.agenda-cycle-task-dim,
.agenda-cycle-focus-active .agenda-event.empty {
  opacity: 0.24;
  filter: saturate(0.58);
}

.agenda-cycle-focus-active .agenda-event.agenda-cycle-task {
  cursor: pointer;
  border-color: color-mix(in srgb, var(--mint) 58%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 15%, var(--panel-2) 85%);
  color: var(--text);
  opacity: 1;
  filter: none;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 18%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mint) 8%, transparent);
}

.agenda-cycle-focus-active .agenda-event:hover,
.agenda-cycle-focus-active .agenda-event:active {
  transform: none;
}

.agenda-cycle-focus-active .agenda-event.agenda-cycle-task:hover,
.agenda-cycle-focus-active .agenda-event.agenda-cycle-task:active {
  border-color: color-mix(in srgb, var(--mint) 58%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 15%, var(--panel-2) 85%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 18%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mint) 8%, transparent);
}

.agenda-event.reschedule-unavailable {
  cursor: default;
  opacity: 0.18;
  filter: saturate(0.45);
}

.agenda-event.reschedule-unavailable:hover,
.agenda-event.reschedule-unavailable:active {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

.agenda-event.reschedule-target {
  position: relative;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--mint) 38%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 6%, var(--panel-2) 94%);
  color: color-mix(in srgb, var(--muted) 34%, transparent);
  opacity: 1;
  filter: none;
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-event.reschedule-target:hover,
.agenda-event.reschedule-target:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--mint) 58%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 10%, var(--panel-2) 90%);
  color: transparent;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 8%, transparent);
  transform: none;
}

.agenda-event.reschedule-target > small {
  opacity: 0.24;
}

.agenda-event.reschedule-target > span,
.agenda-event.reschedule-target > small {
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-event.reschedule-target.empty > span,
.agenda-event.reschedule-target.empty > small {
  opacity: 0;
}

.agenda-event.reschedule-target:hover > span,
.agenda-event.reschedule-target:hover > small,
.agenda-event.reschedule-target:focus-visible > span,
.agenda-event.reschedule-target:focus-visible > small {
  opacity: 0.08;
}

.agenda-event.reschedule-target::after {
  content: attr(data-agenda-reschedule-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 7px;
  color: color-mix(in srgb, var(--text) 82%, var(--mint));
  font-size: 12px;
  font-weight: 760;
  line-height: normal;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1px);
  transition:
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-event.reschedule-target:hover::after,
.agenda-event.reschedule-target:focus-visible::after {
  opacity: 0.82;
  transform: translateY(0);
}

.agenda-matrix:has(.agenda-event.reschedule-target:hover) .agenda-event.reschedule-source,
.agenda-matrix:has(.agenda-event.reschedule-target:focus-visible) .agenda-event.reschedule-source {
  border-color: color-mix(in srgb, var(--mint) 26%, var(--line));
  background: color-mix(in srgb, var(--panel-2) 80%, transparent);
  color: transparent;
  opacity: 0.7;
  box-shadow: none;
}

.agenda-matrix:has(.agenda-event.reschedule-target:hover) .agenda-event.reschedule-source > *,
.agenda-matrix:has(.agenda-event.reschedule-target:focus-visible) .agenda-event.reschedule-source > * {
  opacity: 0;
}

.agenda-event.reschedule-source {
  position: relative;
  z-index: 3;
  border-color: color-mix(in srgb, var(--mint) 82%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 24%, var(--panel) 76%);
  color: var(--text);
  opacity: 1;
  filter: none;
  cursor: default;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 34%, transparent),
    0 0 0 3px color-mix(in srgb, var(--mint) 14%, transparent);
  transition:
    border-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-event.reschedule-source > * {
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-event.reschedule-source:hover,
.agenda-event.reschedule-source:active {
  border-color: color-mix(in srgb, var(--mint) 82%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 24%, var(--panel) 76%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 34%, transparent),
    0 0 0 3px color-mix(in srgb, var(--mint) 14%, transparent);
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .agenda-event.reschedule-target,
  .agenda-event.reschedule-target > span,
  .agenda-event.reschedule-target > small,
  .agenda-event.reschedule-target::after,
  .agenda-event.reschedule-source,
  .agenda-event.reschedule-source > * {
    transition-duration: 1ms !important;
  }
}

.account-head.agenda-col-highlight,
.matrix-cell.agenda-col-highlight {
  isolation: isolate;
}

.account-head.agenda-col-highlight::after,
.matrix-cell.agenda-col-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 20%, transparent), transparent 62%),
    color-mix(in srgb, var(--mint) 13%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 52%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--mint) 16%, transparent);
  opacity: 0;
  animation: columnFocusOverlay 2200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-head.agenda-col-highlight::after {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 28%, transparent), transparent 70%),
    color-mix(in srgb, var(--mint) 17%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mint) 60%, transparent),
    inset 0 0 26px color-mix(in srgb, var(--mint) 20%, transparent);
}

@keyframes columnFocusOverlay {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  68% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.cell-inspector,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cell-inspector {
  position: fixed;
  top: 64px;
  right: 12px;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 76px);
  overflow: auto;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform 180ms ease, opacity 180ms ease;
}

.cell-inspector.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.inspector-scrim {
  position: fixed;
  inset: 54px 0 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.inspector-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.inspector-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  cursor: pointer;
}

.inspector-close::before,
.inspector-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.inspector-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.inspector-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.inspector-title {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inspector-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.inspector-title h2 {
  margin-top: 5px;
}

.inspector-account-link {
  display: block;
  width: fit-content;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 820;
  text-align: left;
}

.inspector-account-link:hover {
  color: var(--mint);
}

.cell-inspector dl {
  display: grid;
  gap: 0;
  margin: 12px 0;
}

.cell-inspector dl div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cell-inspector dt {
  color: var(--muted);
  font-size: 12px;
}

.cell-inspector dd {
  margin: 0;
  color: var(--soft);
}

.inspector-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.inspector-form label,
.status-edit {
  display: grid;
  gap: 7px;
}

.inspector-form label > span,
.status-edit > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.agenda-workflow-lock-message {
  margin: -2px 0 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.inspector-form select {
  appearance: none;
  min-height: 38px;
  width: 100%;
  padding: 0 40px 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 22px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 88%, transparent), var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.inspector-form select:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 16%, transparent);
}

.agenda-inspector-note-heading {
  display: flex;
  min-height: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agenda-inspector-note-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.agenda-inspector-note-heading small[data-state="saving"] {
  color: var(--amber);
}

.agenda-inspector-note-heading small[data-state="saved"] {
  color: var(--mint);
}

.agenda-inspector-note-heading small[data-state="not-saved"] {
  color: var(--danger);
}

.agenda-inspector-note textarea {
  width: 100%;
  min-height: 38px;
  max-height: 132px;
  resize: none;
  overflow-y: hidden;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.agenda-inspector-information {
  display: grid;
  gap: 7px;
}

.agenda-inspector-information > h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.cell-inspector .agenda-inspector-task-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.cell-inspector .agenda-inspector-task-details.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.cell-inspector .agenda-inspector-task-details > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  min-width: 0;
  min-height: 58px;
  gap: 4px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 0;
  background: transparent;
}

.cell-inspector .agenda-inspector-task-details.is-trade > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  gap: 3px;
  padding: 8px;
}

.cell-inspector .agenda-inspector-task-details.is-trade > div:nth-child(even),
.cell-inspector .agenda-inspector-task-details.is-non-trade:not(.is-single) > div + div {
  border-left: 1px solid var(--line);
}

.cell-inspector .agenda-inspector-task-details.is-trade > div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.cell-inspector .agenda-inspector-task-details dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 740;
  text-transform: uppercase;
}

.cell-inspector .agenda-inspector-task-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.agenda-inspector-note textarea::placeholder {
  color: var(--muted);
}

.agenda-inspector-note textarea:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 16%, transparent);
}

.agenda-inspector-note textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.inspector-actions button,
.theme-options button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--soft);
  cursor: pointer;
}

.inspector-actions button:hover,
.inspector-actions button.active,
.theme-options button:hover,
.theme-options button.active {
  border-color: var(--line-strong);
  color: var(--text);
}

.inspector-actions button.active {
  background: color-mix(in srgb, var(--mint) 17%, var(--surface-2) 83%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 14%, transparent);
}

.inspector-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sequence-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  align-items: stretch;
  gap: 8px;
  padding-top: 2px;
}

.sequence-actions button,
.delete-confirm button {
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  transition:
    border-color var(--motion-hover),
    background-color var(--motion-hover),
    color var(--motion-hover),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-press);
}

.sequence-actions button:hover,
.delete-confirm button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.sequence-actions button.danger,
.delete-confirm button.danger {
  border-color: color-mix(in srgb, var(--red) 34%, transparent);
  color: color-mix(in srgb, var(--red) 86%, var(--soft) 14%);
}

.sequence-actions button.danger:hover,
.delete-confirm button.danger:hover {
  background: color-mix(in srgb, var(--red-2) 70%, var(--surface) 30%);
  color: #ffd4d4;
}

.sequence-actions .sequence-delete-action {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.sequence-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sequence-actions button[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
}

.sequence-actions button[aria-disabled="true"]:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--soft);
  transform: none;
}

.agenda-action-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delete-confirm {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--red) 26%, var(--line) 74%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--red-2) 36%, var(--surface) 64%);
}

.delete-confirm strong {
  color: var(--text);
  font-size: 13px;
}

.delete-confirm p {
  margin: 0;
  font-size: 12px;
}

.delete-confirm div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.settings-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
}

.settings-panel p {
  margin-top: 6px;
}

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

.theme-options button.active {
  background: color-mix(in srgb, var(--mint) 18%, var(--surface-2) 82%);
}

.theme-options button {
  min-width: 120px;
  min-height: 46px;
  font-weight: 760;
}

.split-layout,
.detail-grid,
.queue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.section-block,
.workflow-panel {
  min-width: 0;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.task-list.compact {
  gap: 10px;
}

.task-card,
.account-card,
.ledger-row,
.client-card,
.mini-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 15, 21, 0.82);
}

.task-card {
  display: grid;
  gap: 14px;
  padding: 15px;
}

.task-head,
.task-meta,
.task-actions,
.account-top,
.client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-main p {
  margin-top: 4px;
  font-size: 13px;
}

.task-meta {
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
}

.task-actions {
  justify-content: flex-start;
}

.icon-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--soft);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.icon-button.danger:hover {
  background: rgba(255, 107, 107, 0.16);
  color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge.won,
.badge.good {
  border-color: rgba(113, 155, 113, 0.32);
  background: rgba(113, 155, 113, 0.12);
  color: #8fbc8f;
}

.badge.partial-won {
  border-color: rgba(139, 180, 140, 0.24);
  background: rgba(139, 180, 140, 0.085);
  color: #a7cda8;
}

.badge.lost,
.badge.bad {
  border-color: rgba(188, 105, 109, 0.25);
  background: rgba(188, 105, 109, 0.095);
  color: #d29a9d;
}

.badge.partial-lost {
  border-color: rgba(204, 132, 136, 0.2);
  background: rgba(204, 132, 136, 0.075);
  color: #ddb0b2;
}

.badge.pending,
.badge.warn {
  border-color: rgba(210, 171, 103, 0.24);
  background: rgba(210, 171, 103, 0.1);
  color: #d9bd86;
}

.badge.in-progress,
.badge.info {
  border-color: rgba(128, 153, 187, 0.22);
  background: rgba(128, 153, 187, 0.085);
  color: #adbdd5;
}

.badge.requested {
  border-color: rgba(159, 137, 213, 0.25);
  background: rgba(159, 137, 213, 0.11);
  color: #c0b2e5;
}

.badge.activated {
  border-color: rgba(151, 164, 166, 0.22);
  background: rgba(151, 164, 166, 0.085);
  color: #b8c2c3;
}

.badge.purchased {
  border-color: rgba(159, 163, 160, 0.22);
  background: rgba(159, 163, 160, 0.08);
  color: #c1c3bd;
}

.badge.received {
  border-color: rgba(111, 146, 101, 0.3);
  background: rgba(111, 146, 101, 0.105);
  color: #8daf84;
}

.account-mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  color: var(--soft);
  text-align: left;
  cursor: pointer;
}

.mini-row strong {
  color: var(--text);
  font-size: 13px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.workflow-panel {
  align-self: start;
}

.workflow-panel h2 {
  margin-bottom: 18px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 12px;
  row-gap: 3px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.workflow-step span {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
}

.workflow-step.done span {
  background: var(--mint);
}

.workflow-step.active span {
  background: var(--amber);
}

.workflow-step small {
  color: var(--muted);
}

.account-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px;
}

.account-toolbar span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  display: flex;
  align-items: center;
  min-width: 220px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

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

.account-card,
.client-card {
  padding: 16px;
}

.client-card[data-account-link] {
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.client-card[data-account-link]:hover {
  border-color: color-mix(in srgb, var(--mint) 30%, var(--line));
  background: color-mix(in srgb, var(--mint) 5%, rgba(10, 15, 21, 0.82));
  transform: translateY(-1px);
}

.members-directory {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  gap: 10px;
}

.members-directory-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--control-gap-compact) 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.member-lifecycle-tabs {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.member-lifecycle-tabs button {
  display: inline-flex;
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.member-lifecycle-tabs button strong {
  color: inherit;
  font-size: inherit;
  font-weight: 800;
  line-height: inherit;
}

.member-lifecycle-tabs button:hover,
.member-lifecycle-tabs button.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 7%, var(--surface-2));
  color: var(--text);
}

.members-directory-toolbar strong,
.members-directory-toolbar span {
  display: block;
}

.members-total-metric {
  display: flex;
  min-height: 34px;
  align-items: baseline;
  gap: 7px;
  padding: 8px 0;
  box-sizing: border-box;
}

.members-total-metric > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-transform: uppercase;
}

.members-directory-toolbar .members-total-metric > strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  line-height: 18px;
}

.members-total-metric > small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
}

.members-directory-toolbar strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.members-directory-toolbar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.members-search {
  width: min(300px, 40vw);
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

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

.member-search-control {
  position: relative;
  display: block;
  width: min(300px, 40vw);
}

.members-directory-toolbar > .members-search {
  flex: 1 1 220px;
  width: min(300px, 100%);
  min-width: min(220px, 100%);
}

.member-search-control .members-search {
  width: 100%;
  padding-right: 34px;
}

.member-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    opacity 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.member-search-control.has-value .member-search-clear {
  opacity: 1;
  pointer-events: auto;
}

.member-search-clear:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 8%, var(--surface-2) 92%);
  color: var(--text);
}

.members-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.page-members,
.page-members > .page-header {
  min-width: 0;
  max-width: 100%;
}

.badge.member-inactive {
  border-color: color-mix(in srgb, #c78c4a 35%, var(--line));
  background: color-mix(in srgb, #c78c4a 10%, transparent);
  color: color-mix(in srgb, #d7a05d 82%, var(--text));
}

.member-profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-profile-title-row h1 {
  margin: 0;
}

.member-inactive-action {
  border-color: color-mix(in srgb, #c78c4a 42%, var(--line));
  color: color-mix(in srgb, #d7a05d 82%, var(--text));
}

.member-inactive-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, #c78c4a 64%, var(--line));
  background: color-mix(in srgb, #c78c4a 9%, var(--surface-2));
}

.member-lifecycle-modal.deactivate [data-modal-primary] {
  border-color: color-mix(in srgb, #c78c4a 55%, var(--line));
  background: color-mix(in srgb, #c78c4a 72%, #80572d);
  color: #fff;
}

.result-modal.deleted-members-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: hidden;
}

.deleted-members-modal-body {
  display: grid;
  min-height: 0;
  gap: 12px;
  margin-top: 16px;
}

.deleted-members-modal-body .member-search-control {
  width: 100%;
}

.deleted-members-modal-body .members-search {
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
}

.deleted-members-table-wrap {
  max-height: min(480px, calc(100dvh - 280px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.deleted-members-table {
  width: 100%;
  min-width: 680px;
  table-layout: fixed;
}

.deleted-members-table th:nth-child(1),
.deleted-members-table td:nth-child(1) {
  width: 64px;
}

.deleted-members-table th:nth-child(2),
.deleted-members-table td:nth-child(2) {
  width: auto;
}

.deleted-members-table th:nth-child(3),
.deleted-members-table td:nth-child(3) {
  width: 210px;
}

.deleted-members-table th:nth-child(4),
.deleted-members-table td:nth-child(4) {
  width: 180px;
}

.deleted-members-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
}

.deleted-members-table tbody tr {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--red) 42%, transparent);
}

.account-purchase-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-purchase-edit-grid .amount-field {
  min-width: 0;
  margin-top: 0;
}

.account-purchase-edit-grid .amount-field input,
.account-purchase-edit-grid .amount-field select {
  height: 36px;
  min-height: 36px;
}

.finance-date-time {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.finance-date-time small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.agenda-active-cycle-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.agenda-active-cycle-notice button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--mint);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 720px) {
  .members-directory {
    height: auto;
    min-height: 0;
  }

  .members-directory-toolbar {
    align-items: center;
  }

  .member-lifecycle-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .members-directory-toolbar .member-search-control {
    flex: 1 1 220px;
    min-width: min(220px, 100%);
    width: 100%;
  }

  .members-directory-toolbar > .members-search {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }

  .members-table-wrap {
    max-height: min(62dvh, 560px);
  }
}

.members-table {
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.members-table th,
.members-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.members-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
  user-select: none;
}

.resizable-table {
  table-layout: fixed;
}

.resizable-header {
  position: relative;
  user-select: none;
}

.members-table.resizable-table th {
  position: sticky;
}

.members-table th span:first-child {
  display: inline-flex;
  align-items: center;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 3;
  width: 11px;
  cursor: col-resize;
  opacity: 0;
  touch-action: none;
  transition: opacity 140ms ease;
}

.column-resizer::after {
  position: absolute;
  top: 7px;
  right: 5px;
  bottom: 7px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  content: "";
  transition: background 140ms ease, box-shadow 140ms ease;
}

.resizable-header:hover .column-resizer,
.column-resizer:hover,
.column-resizer.is-active-resizer {
  opacity: 1;
}

.resizable-header:hover .column-resizer::after,
.column-resizer:hover::after,
.column-resizer.is-active-resizer::after {
  background: color-mix(in srgb, var(--mint) 48%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mint) 12%, transparent);
}

body.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

body.is-resizing-column .resizable-table,
body.is-resizing-column .resizable-grid-table,
.resizable-table.is-column-resizing,
.resizable-grid-table.is-column-resizing {
  cursor: col-resize;
}

body.is-resizing-column .resizable-table *,
body.is-resizing-column .resizable-grid-table * {
  user-select: none;
}

.members-table tbody tr {
  position: relative;
  cursor: pointer;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.members-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mint) 5%, transparent);
}

body.is-resizing-column .members-table tbody tr:hover td {
  background: transparent;
}

.members-table tbody tr:active td {
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}

.members-table td {
  color: var(--soft);
}

.members-table td:nth-child(2) strong {
  color: var(--text);
  font-weight: 800;
}

.members-table th:first-child,
.members-table td:first-child {
  padding-left: 16px;
  padding-right: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.members-table th:first-child {
  text-align: left;
}

.members-table td:first-child {
  text-align: left;
}

.members-table .members-empty-row td {
  height: 72px;
  color: var(--muted);
  text-align: center;
}

.members-table tbody tr.table-row-focus {
  overflow: hidden;
}

.members-table tbody tr.table-row-focus::after {
  position: absolute;
  inset: 3px 4px;
  z-index: 0;
  border-radius: 7px;
  pointer-events: none;
  content: "";
  animation: tableRowFocus 2200ms ease forwards;
}

.members-table tbody tr.table-row-focus td {
  position: relative;
  z-index: 1;
  background: transparent;
}

@keyframes tableRowFocus {
  0%,
  58% {
    background: color-mix(in srgb, var(--mint) 16%, transparent);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--mint) 22%, transparent),
      0 0 22px color-mix(in srgb, var(--mint) 10%, transparent);
  }

  100% {
    background: transparent;
    box-shadow:
      inset 0 0 0 1px transparent,
      0 0 0 transparent;
  }
}

.account-name {
  font-size: 18px;
}

.account-name.finance-member-link {
  font-size: inherit;
  text-align: left;
}

.account-balance {
  margin: 18px 0;
  font-size: 30px;
  font-weight: 850;
}

.account-grid,
.profile-list {
  display: grid;
  gap: 10px;
}

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

.account-grid span,
.profile-list dt {
  color: var(--muted);
}

.account-grid strong,
.profile-list dd {
  margin: 0;
  text-align: right;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
}

.detail-eyebrow {
  margin-bottom: 10px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 800;
}

.detail-hero h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.detail-hero p {
  margin-top: 10px;
}

.detail-balance {
  min-width: 210px;
  text-align: right;
}

.detail-balance span {
  color: var(--muted);
  font-size: 13px;
}

.detail-balance strong {
  display: block;
  margin-top: 8px;
  color: var(--mint);
  font-size: 34px;
}

.profile-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.account-page-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.account-page-header h1 {
  font-size: 34px;
}

.back-agenda-button {
  min-height: 34px;
  align-self: center;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.back-agenda-button:hover {
  border-color: color-mix(in srgb, var(--mint) 38%, var(--line-strong));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint) 8%, transparent), transparent),
    color-mix(in srgb, var(--surface-2) 92%, transparent);
  color: var(--text);
  transform: translateX(-1px);
}

.back-agenda-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 58%, transparent);
  outline-offset: 2px;
}

.account-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.65fr);
  gap: 8px;
}

.account-sheet-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1.4fr) minmax(330px, 0.6fr);
  gap: 12px;
  align-items: start;
}

.account-workspace,
.account-side-panel,
.account-sheet-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.account-workspace {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.account-state-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-2) 68%, var(--surface) 32%);
}

.account-state-strip div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.account-state-strip div:last-child {
  border-right: 0;
}

.account-state-strip span,
.payout-info-grid span,
.account-money-row span,
.mini-ledger span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.account-state-strip strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-sheet-section {
  padding: 10px;
}

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

.ops-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ops-table th,
.ops-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.ops-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.operations-table th,
.members-table th,
.ops-table th {
  min-height: 34px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.ops-table tr:last-child td {
  border-bottom: 0;
}

.ops-table tbody tr {
  transition: background 150ms ease;
}

.ops-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mint) 4%, transparent);
}

.ops-table td:first-child {
  color: var(--text);
  font-weight: 720;
}

.cost-structure-table tbody tr {
  height: 34px;
}

.cost-structure-table {
  min-width: 720px;
}

.cost-structure-table .cost-trade-detail {
  white-space: nowrap;
}

.cost-structure-table td {
  height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.2;
  vertical-align: middle;
}

.cost-structure-table .badge {
  min-height: 20px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 18px;
  vertical-align: middle;
}

.reset-history-panel {
  display: grid;
  gap: 0;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.reset-history-panel:not(.open) {
  min-height: 72px;
  align-content: start;
}

.reset-history-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.reset-history-toggle:hover,
.reset-history-panel.accordion-hover-lock .reset-history-toggle {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
  color: var(--text);
}

.reset-history-panel.open.accordion-hover-lock .reset-history-toggle {
  background: color-mix(in srgb, var(--mint) 5%, transparent);
}

.reset-history-toggle:active,
.reset-history-toggle:focus:active {
  width: 100%;
  padding: 9px 11px;
  margin: 0;
  transform: none;
}

.reset-history-toggle .chevron-icon {
  position: relative;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform var(--motion-accordion);
}

.reset-history-toggle .chevron-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform-origin: 50% 50%;
  transform: translate(-62%, -50%) rotate(-45deg);
}

.reset-history-toggle .chevron-icon.right::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.reset-history-toggle .chevron-icon.down {
  transform: rotate(90deg);
  animation: chevronRotateDown var(--motion-accordion) both;
}

.reset-history-toggle .chevron-icon.down::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.reset-history-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.reset-history-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 34px;
  margin-left: auto;
  flex-shrink: 0;
}

.reset-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line));
  border-radius: 999px;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  font-size: 10.5px;
  font-weight: 780;
}

.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition:
    grid-template-rows var(--motion-accordion),
    background var(--motion-hover);
}

.open > .accordion-content {
  grid-template-rows: 1fr;
  animation: accordionOpen var(--motion-accordion) both;
}

.expanded > .accordion-content {
  grid-template-rows: 1fr;
}

.finance-ledger-section.is-opening > .accordion-content {
  animation: accordionOpen var(--motion-accordion) both;
}

.is-closing > .accordion-content {
  grid-template-rows: 1fr;
  animation: accordionClose var(--motion-accordion) both;
}

.is-closing .chevron-icon.down {
  animation: chevronRotateUp var(--motion-accordion) both;
}

.accordion-content-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--motion-accordion),
    transform var(--motion-accordion),
    background var(--motion-hover);
}

.open > .accordion-content .accordion-content-inner,
.expanded > .accordion-content .accordion-content-inner {
  opacity: 1;
  transform: translateY(0);
}

.is-closing > .accordion-content .accordion-content-inner {
  opacity: 0;
  transform: translateY(-4px);
}

@keyframes accordionOpen {
  from {
    grid-template-rows: 0fr;
  }

  to {
    grid-template-rows: 1fr;
  }
}

@keyframes accordionClose {
  from {
    grid-template-rows: 1fr;
  }

  to {
    grid-template-rows: 0fr;
  }
}

@keyframes chevronRotateDown {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(90deg);
  }
}

@keyframes chevronRotateUp {
  from {
    transform: rotate(90deg);
  }

  to {
    transform: rotate(0deg);
  }
}

.reset-history-content .accordion-content-inner {
  padding: 0 9px;
}

.reset-history-list {
  display: grid;
  gap: 7px;
}

.reset-history-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2) 52%, transparent);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background var(--motion-normal) var(--ease-premium), border-color var(--motion-normal) var(--ease-premium), box-shadow var(--motion-normal) var(--ease-premium);
}

.reset-history-item:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 7%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.04);
}

.reset-history-item:active {
  transform: none;
}

.reset-history-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reset-history-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reset-history-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.reset-history-item .reset-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.reset-history-actions .compact-button {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  pointer-events: none;
}

.compact-button {
  min-height: 28px;
  padding: 6px 9px;
  font-size: 11px;
}

.compact-empty-state {
  padding: 10px;
  font-size: 11.5px;
}

.reset-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.reset-history-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2) 56%, transparent);
}

.reset-history-summary span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 760;
  text-transform: uppercase;
}

.reset-history-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reset-history-table {
  max-height: 320px;
}

.reset-history-table .loss-history-trigger-row td {
  background: color-mix(in srgb, var(--red) 4.5%, transparent);
}

.account-status-list {
  display: grid;
  gap: 0;
}

.account-status-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.account-status-list div:first-child {
  border-top: 0;
}

.account-status-list dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 720;
}

.account-status-list dd {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.account-money-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2) 58%, transparent);
}

.account-money-row strong {
  color: var(--text);
  font-size: 20px;
}

.account-money-row em,
.mini-ledger em {
  font-style: normal;
}

.mini-ledger,
.trade-block-grid {
  display: grid;
  gap: 7px;
}

.mini-ledger div,
.payout-info-grid div,
.trade-block {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2) 48%, transparent);
}

.mini-ledger strong {
  color: var(--soft);
  font-size: 12px;
}

.trade-block-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trade-block {
  grid-template-columns: 1fr;
  align-items: start;
  min-height: 58px;
}

.trade-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.trade-block strong {
  color: var(--text);
  font-size: 12px;
}

.trade-block em {
  color: var(--soft);
  font-style: normal;
  font-size: 12px;
}

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

.payout-info-grid div {
  grid-template-columns: 1fr;
  align-items: start;
}

.payout-info-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.account-side-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.profile-inner-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.profile-empty-card {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.member-profile-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.member-profile-header-actions > button {
  width: 160px;
  min-width: 160px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 34px;
}

.profile-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.profile-definition-field {
  position: relative;
  min-width: 0;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--surface-2) 84%, var(--surface));
}

.profile-definition-field.wide {
  grid-column: 1 / -1;
}

.profile-definition-field dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.profile-definition-field dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.profile-definition-field.is-copyable {
  cursor: copy;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.profile-definition-field.is-copyable:hover,
.profile-definition-field.is-copyable:focus-visible {
  background: color-mix(in srgb, var(--mint) 7%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 18%, transparent);
  outline: none;
}

.profile-definition-field.is-copyable:hover dd > span:first-child,
.profile-definition-field.is-copyable:focus-visible dd > span:first-child {
  color: var(--text);
  font-weight: 650;
}

.profile-copy-confirm {
  flex: 0 0 auto;
  color: var(--mint);
  font-size: 10px;
  font-weight: 760;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.profile-copy-confirm.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.profile-values-modal {
  width: min(620px, calc(100vw - 32px));
}

.profile-values-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profile-value-control {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.profile-value-control.wide {
  grid-column: 1 / -1;
}

.profile-value-control > span,
.profile-layout-modal label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.profile-phone-control {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-sizing: border-box;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.profile-phone-control:focus-within {
  border-color: color-mix(in srgb, var(--mint) 52%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 12%, transparent);
}

.profile-phone-control > span {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 0 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  white-space: pre;
}

.profile-phone-control input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding-left: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-phone-control input:focus {
  outline: none;
  box-shadow: none;
}

.profile-value-control.has-error input,
.profile-value-control.has-error textarea,
.profile-value-control.has-error .profile-phone-control {
  border-color: var(--danger);
}

.profile-value-error {
  color: var(--danger);
  font-size: 10px;
  line-height: 1.35;
}

.profile-secret-feedback {
  min-width: 0;
  color: var(--mint);
  font-size: 10px;
  font-weight: 720;
}

.profile-secret-feedback.is-error {
  color: var(--danger);
}

.profile-secret-input {
  position: relative;
  min-width: 0;
}

.profile-secret-input input {
  padding-right: 40px;
}

.profile-secret-mask-value {
  --profile-secret-mask-width: 105px;
  display: inline-block;
  flex: 0 0 var(--profile-secret-mask-width);
  inline-size: var(--profile-secret-mask-width);
  max-inline-size: var(--profile-secret-mask-width);
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 1.9px;
  box-sizing: border-box;
}

.profile-definition-field:has(.profile-secret-mask-value) .profile-copy-confirm {
  position: absolute;
  right: 11px;
  bottom: 10px;
}

.profile-secret-mask-overlay {
  position: absolute;
  top: 50%;
  left: 10px;
  display: none;
  pointer-events: none;
  transform: translateY(-50%);
}

.profile-secret-input.is-masked input {
  color: transparent;
  caret-color: transparent;
}

.profile-secret-input.is-masked .profile-secret-mask-overlay {
  display: inline-block;
}

.profile-secret-eye {
  position: absolute;
  top: 50%;
  right: 3px;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  opacity: 0.76;
  transform: translateY(-50%);
  transition: color 140ms ease, opacity 140ms ease;
}

.profile-secret-eye[hidden] {
  display: none;
}

button.profile-secret-eye:hover {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  opacity: 1;
}

button.profile-secret-eye:not(:disabled):active,
button.profile-secret-eye[aria-pressed="true"],
button.profile-secret-eye:focus,
button.profile-secret-eye:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.profile-secret-eye:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 70%, white);
  outline-offset: 0;
}

.profile-secret-eye svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-secret-eye-slash {
  opacity: 0;
  transition: opacity 140ms ease;
}

.profile-secret-eye[aria-pressed="true"] .profile-secret-eye-slash {
  opacity: 1;
}

.profile-value-control input,
.profile-value-control textarea,
.profile-layout-modal input,
.profile-layout-modal select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  box-sizing: border-box;
  font: inherit;
  font-size: 12px;
}

.profile-value-control .profile-phone-control input {
  height: 100%;
  min-height: 0;
  padding: 8px 10px 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.result-modal.profile-layout-modal {
  --profile-builder-inset: clamp(16px, 2vw, 32px);
  top: var(--profile-builder-inset);
  bottom: var(--profile-builder-inset);
  left: 50%;
  width: min(2200px, calc(100vw - (2 * var(--profile-builder-inset))));
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  opacity: 1;
  isolation: isolate;
  transform: translateX(-50%) scale(0.99);
}

.result-modal.profile-layout-modal.open {
  transform: translateX(-50%) scale(1);
  animation: profileLayoutModalEnter 220ms var(--ease-premium) both;
}

.result-modal.profile-layout-modal.open.is-local-update {
  animation: none;
}

.result-modal.profile-layout-modal.is-closing {
  transform: translateX(-50%) scale(0.992);
}

@keyframes profileLayoutModalEnter {
  from { opacity: 0; transform: translateX(-50%) scale(0.988); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.profile-layout-modal .result-modal-head {
  flex: 0 0 auto;
  padding: 20px 58px 16px 22px;
  border-bottom: 1px solid var(--line);
}

.profile-layout-modal .modal-close-button {
  top: 18px;
  right: 20px;
}

.profile-layout-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 18px 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.profile-layout-sections,
.profile-layout-fields {
  display: grid;
  gap: 8px;
}

.profile-layout-sections {
  gap: 14px;
}

.profile-layout-toolbar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-layout-toolbar .admin-form-error {
  margin: 0;
}

.profile-layout-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 160ms ease;
}

.profile-layout-section:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
}

.profile-layout-section > header,
.profile-layout-field {
  display: grid;
  align-items: center;
  gap: 10px;
}

.profile-layout-section > header {
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.profile-layout-field {
  position: relative;
  grid-template-columns: 36px minmax(180px, 1fr) minmax(150px, 220px) 36px;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 160ms ease;
}

.profile-layout-field:hover {
  border-color: color-mix(in srgb, var(--mint) 22%, var(--line));
  background: color-mix(in srgb, var(--mint) 4%, var(--surface));
}

.drag-handle {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-size: 17px;
  letter-spacing: -3px;
  user-select: none;
  touch-action: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 100ms ease;
}

.drag-handle:hover,
.drag-handle[aria-pressed="true"] {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
  color: var(--text);
}

.drag-handle:active,
.is-dragging .drag-handle {
  cursor: grabbing;
  transform: scale(0.96);
}

.drag-handle:focus-visible,
.layout-name-button:focus-visible,
.layout-remove-icon:focus-visible,
.layout-add-field-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 58%, transparent);
  outline-offset: 2px;
}

.layout-name-button {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: text;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

.layout-name-button:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 5%, transparent);
}

.layout-name-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-pencil {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  transition: opacity 150ms ease, color 150ms ease;
}

.layout-name-button:hover .layout-pencil,
.layout-name-button:focus-visible .layout-pencil {
  color: var(--soft);
  opacity: 1;
}

.layout-inline-name {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.layout-inline-name small {
  color: var(--red);
  font-size: 10px;
}

.layout-remove-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: color-mix(in srgb, var(--red) 72%, var(--text));
  cursor: pointer;
}

.layout-remove-icon::before,
.layout-remove-icon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.layout-remove-icon::before { transform: rotate(45deg); }
.layout-remove-icon::after { transform: rotate(-45deg); }

.layout-remove-icon:hover {
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
  background: color-mix(in srgb, var(--red) 11%, transparent);
  color: var(--red);
}

.layout-remove-icon:active {
  transform: scale(0.94);
}

.field-type-label {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.layout-field-type {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.layout-field-type > span {
  font-size: 9px !important;
}

.profile-layout-modal select {
  padding-right: 36px;
}

.profile-layout-empty {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
}

.profile-layout-fields {
  padding: 12px;
}

.profile-layout-add-section-row,
.profile-layout-add-field-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto 36px;
  align-items: end;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.profile-layout-add-section-row {
  grid-template-columns: minmax(220px, 1fr) auto 36px;
}

.profile-layout-add-section-row label,
.profile-layout-add-field-row label {
  display: grid;
  gap: 5px;
}

.profile-layout-section > .profile-layout-add-field-row {
  margin: 0 12px 12px;
}

.layout-add-field-button {
  min-height: 36px;
  margin: 0 12px 12px;
  padding: 0 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  text-align: left;
}

.layout-add-field-button:hover {
  border-color: color-mix(in srgb, var(--mint) 34%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 6%, transparent);
  color: var(--text);
}

.compact-button,
.layout-add-cancel {
  min-height: 36px;
  height: 36px;
}

.profile-layout-section.is-dragging,
.profile-layout-field.is-dragging {
  z-index: 2;
  opacity: 0.72;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.profile-layout-section.is-drop-before,
.profile-layout-field.is-drop-before {
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--mint) 72%, transparent);
}

.profile-layout-section.is-drop-after,
.profile-layout-field.is-drop-after {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--mint) 72%, transparent);
}

.profile-layout-archived {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-layout-archived summary {
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.profile-layout-conflict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
}

.profile-layout-conflict p {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
}

.profile-layout-modal .result-modal-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.layout-confirmation {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--red) 34%, var(--line));
  border-radius: 8px;
  background: var(--panel);
}

.layout-confirmation p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.delete-member-name strong {
  font-size: 14px;
  font-weight: 720;
  line-height: 1.35;
}

@media (max-width: 680px) {
  .profile-definition-grid,
  .profile-values-grid {
    grid-template-columns: 1fr;
  }
  .profile-definition-field.wide,
  .profile-value-control.wide {
    grid-column: 1;
  }
  .profile-layout-field {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }
  .profile-layout-field .field-type-label,
  .profile-layout-field .layout-field-type {
    grid-column: 2 / 4;
    width: 100%;
  }
  .profile-layout-add-section-row,
  .profile-layout-add-field-row {
    grid-template-columns: 1fr;
  }
  .profile-layout-add-cancel {
    width: 100%;
  }
  .profile-layout-modal .result-modal-head,
  .profile-layout-body,
  .profile-layout-modal .result-modal-actions {
    padding-right: 16px;
    padding-left: 16px;
  }
  .profile-layout-modal .modal-close-button {
    right: 12px;
  }
  .layout-confirmation {
    grid-template-columns: 1fr auto;
  }
  .layout-confirmation > div {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-layout-section,
  .profile-layout-field {
    transition: none;
  }
}

.profile-text-action {
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--soft);
  padding: 6px 9px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition:
    background var(--motion-normal) var(--ease-premium),
    border-color var(--motion-normal) var(--ease-premium),
    box-shadow var(--motion-normal) var(--ease-premium);
}

.profile-text-action:hover {
  border-color: color-mix(in srgb, var(--gold) 32%, var(--line));
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  box-shadow: var(--row-hover-shadow);
}

.account-side-panel .section-title {
  align-items: center;
  margin-bottom: 8px;
}

.account-side-panel .profile-list div {
  align-items: center;
  padding: 7px 0;
}

.account-side-panel .profile-list div.copyable-detail {
  margin: 0 -7px;
  padding: 7px;
  border-radius: 7px;
  cursor: copy;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.account-side-panel .profile-list div.copyable-detail:hover {
  background: color-mix(in srgb, var(--mint) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 12%, transparent);
}

.account-side-panel .profile-list dt {
  flex: 0 0 88px;
  font-size: 11.5px;
}

.account-side-panel .profile-list dd {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 11.5px;
  text-align: right;
}

.card-edit-button {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 120ms ease;
}

.card-edit-button::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 13px;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(42deg);
}

.card-edit-button::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 8px;
  width: 8px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-12deg);
}

.card-edit-button:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 7%, transparent);
  color: var(--text);
}

.member-edit-modal {
  width: min(560px, calc(100vw - 28px));
}

.member-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.member-edit-grid .amount-field:has(textarea) {
  grid-column: 1 / -1;
}

.member-edit-grid .wide-field {
  grid-column: 1 / -1;
}

.copy-value {
  min-width: 0;
}

.copy-icon {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  opacity: 0;
  transition:
    color 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.copy-icon::before {
  top: 3px;
  left: 2px;
  opacity: 0.62;
}

.copy-icon::after {
  top: 0;
  left: 5px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.copyable-detail:hover .copy-icon {
  color: var(--mint);
  opacity: 1;
  transform: translateX(-1px);
}

.copy-confirm {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--mint) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  color: var(--mint);
  font-size: 10px;
  font-weight: 820;
  vertical-align: middle;
}

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-normal) var(--ease-premium);
}

.modal-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-scrim.confirmation-scrim {
  z-index: 60;
}

.result-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 41;
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--surface);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -48%) scale(0.98);
  transition:
    opacity var(--motion-normal) var(--ease-premium),
    transform var(--motion-normal) var(--ease-premium);
}

.result-modal.confirmation-dialog {
  z-index: 61;
  background: var(--panel);
}

.modal-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover),
    transform var(--motion-fast) var(--ease-premium);
}

.modal-close-button::before,
.modal-close-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.modal-close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close-button:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 7%, transparent);
  color: var(--text);
}

.result-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  animation: modalEnter var(--motion-normal) var(--ease-premium) both;
}

.modal-scrim.open {
  animation: modalScrimEnter var(--motion-normal) var(--ease-premium) both;
}

.result-modal.is-closing {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -48%) scale(0.985);
}

.modal-scrim.is-closing {
  opacity: 0;
  pointer-events: none;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes modalScrimEnter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.result-modal-head span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.result-modal-head h2 {
  margin-top: 6px;
}

.result-modal-head p {
  margin-top: 8px;
  font-size: 13px;
}

.amount-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.start-trade-fields {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.start-cycle-modal-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.start-cycle-confirmation-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.start-cycle-confirmation-details > div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.start-cycle-confirmation-details dt,
.start-cycle-confirmation-details dd {
  margin: 0;
}

.start-cycle-confirmation-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.start-cycle-confirmation-details dd {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 720;
}

.start-cycle-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.start-cycle-mode legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.start-cycle-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 66px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 90ms ease;
}

.start-cycle-option:hover {
  border-color: var(--line-strong);
}

.start-cycle-option:active {
  transform: scale(0.99);
}

.start-cycle-option.is-selected {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 7%, var(--surface) 93%);
}

.start-cycle-option input {
  margin: 2px 0 0;
}

.start-cycle-option span {
  display: grid;
  gap: 4px;
}

.start-cycle-option strong {
  font-size: 12px;
}

.start-cycle-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .start-cycle-mode,
  .start-cycle-confirmation-details {
    grid-template-columns: 1fr;
  }
}

.start-trade-fields .amount-field {
  margin-top: 0;
}

.start-trade-direction-control {
  display: flex;
  width: 100%;
  height: 42px;
  padding: 3px;
}

.start-trade-direction-control button {
  width: auto;
  height: auto;
  flex: 1 1 50%;
  font-size: 12px;
}

.amount-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.amount-field input,
.amount-field textarea,
.amount-field select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 760;
  line-height: 1.35;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.amount-field select {
  appearance: none;
  padding-right: 40px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 22px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    color-mix(in srgb, var(--surface-2) 84%, transparent);
  cursor: pointer;
}

.amount-field input[type="date"] {
  padding-right: 14px;
}

.amount-field textarea {
  height: 42px;
  min-height: 42px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.45;
  overflow: hidden;
  field-sizing: content;
}

.waste-suggestion-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.waste-suggestion-list:empty {
  display: none;
}

.waste-suggestion-list button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  text-align: left;
}

.waste-suggestion-list button:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
  background: color-mix(in srgb, var(--mint) 7%, var(--surface-2));
  color: var(--text);
}

.amount-field input:focus,
.amount-field textarea:focus,
.amount-field select:focus {
  border-color: color-mix(in srgb, var(--mint) 48%, var(--line));
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 14%, transparent);
}

.money-input-wrap {
  position: relative;
}

.money-input-wrap > span {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.amount-field .money-input-wrap input {
  padding-left: 27px;
}

.amount-field .money-input-wrap.wide-prefix input {
  padding-left: 44px;
}

.money-input-wrap.negative > span,
.money-input-wrap.negative input {
  color: var(--red);
}

.modal-warning {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.modal-warning.danger {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, transparent);
  color: var(--red);
}

.modal-reference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.finance-action-input-section,
.finance-action-calculated-section {
  display: grid;
  gap: 10px;
}

.finance-action-calculated-section {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.finance-action-section-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.readonly-calculated-field .money-input-wrap input[readonly],
.bank-top-up-wallet-result .money-input-wrap input[readonly] {
  border-color: color-mix(in srgb, var(--gold) 16%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--text);
  cursor: default;
}

.readonly-calculated-field .money-input-wrap input[readonly]:focus,
.bank-top-up-wallet-result .money-input-wrap input[readonly]:focus {
  border-color: color-mix(in srgb, var(--gold) 22%, var(--line));
  box-shadow: none;
}

.bank-top-up-wallet-result {
  margin-bottom: 0;
}

.bank-top-up-wallet-result .money-input-wrap input[readonly] {
  height: 42px;
  font-size: 15px;
  font-weight: 860;
}

.finance-wallet-helper {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.3;
}

.finance-wallet-helper.danger {
  color: var(--red);
}

.finance-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--soft);
}

.bank-top-up-transfer-summary {
  margin: 16px 0 0;
}

.bank-top-up-transfer-summary + .bank-top-up-transfer-summary {
  margin-top: 10px;
}

.bank-top-up-confirm-summary {
  margin: 16px 0 0;
}

.bank-top-up-confirm-summary + .amount-field {
  margin-top: 12px;
}

.finance-summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 4px;
  line-height: 1;
}

.finance-summary-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.amp-deposit-planning-summary .finance-summary-label {
  min-height: 21px;
  overflow: visible;
  line-height: 1.05;
  white-space: normal;
}

.finance-summary-value {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.inline-stepper {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 18px 0 5px;
  overflow: hidden;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.inline-stepper:hover,
.inline-stepper:focus-within {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  outline: 0;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.inline-stepper:focus-within {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 18%, transparent);
}

.bank-top-up-inline-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.bank-top-up-inline-input:focus,
.bank-top-up-inline-input:focus-visible {
  border-color: transparent;
  outline: 0;
  box-shadow: none;
}

.bank-top-up-inline-input::selection {
  background: color-mix(in srgb, var(--amber) 30%, transparent);
}

.inline-stepper-controls {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  gap: 1px;
  width: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity var(--motion-hover);
}

.inline-stepper:hover .inline-stepper-controls,
.inline-stepper:focus-within .inline-stepper-controls {
  opacity: 1;
  pointer-events: auto;
}

.inline-stepper-button {
  position: relative;
  width: 12px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: color-mix(in srgb, var(--amber) 68%, var(--muted));
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.inline-stepper-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.inline-stepper-button.increase::before {
  border-right: 3.5px solid transparent;
  border-bottom: 4.5px solid currentColor;
  border-left: 3.5px solid transparent;
}

.inline-stepper-button.decrease::before {
  border-top: 4.5px solid currentColor;
  border-right: 3.5px solid transparent;
  border-left: 3.5px solid transparent;
}

.inline-stepper-button:hover {
  background: color-mix(in srgb, var(--amber) 15%, transparent);
  color: color-mix(in srgb, var(--amber) 86%, var(--text));
}

.amount-field .field-inline-stepper {
  display: flex;
  align-items: center;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  height: 42px;
  min-height: 42px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 760;
  line-height: 1.35;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.amount-field .field-inline-stepper:hover,
.amount-field .field-inline-stepper:focus-within {
  border-color: color-mix(in srgb, var(--mint) 48%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
}

.amount-field .field-inline-stepper:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 14%, transparent);
}

.amount-field .field-inline-stepper .bank-top-up-inline-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  appearance: none;
  font-size: inherit;
  font-weight: 760;
  line-height: 1.35;
  transition: none;
}

.amount-field .field-inline-stepper .bank-top-up-inline-input:hover,
.amount-field .field-inline-stepper .bank-top-up-inline-input:focus,
.amount-field .field-inline-stepper .bank-top-up-inline-input:focus-visible {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.amount-field .field-inline-stepper .inline-stepper-controls {
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 28px;
  height: 100%;
  border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.amount-field .field-inline-stepper .inline-stepper-button {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.amount-field .field-inline-stepper .inline-stepper-button:focus,
.amount-field .field-inline-stepper .inline-stepper-button:focus-visible {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}

.amount-field .field-inline-stepper .inline-stepper-button.increase {
  border-top-right-radius: 7px;
}

.amount-field .field-inline-stepper .inline-stepper-button.decrease {
  border-bottom-right-radius: 7px;
}

.form-section-divider,
.modal-field-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.form-section-divider + .amount-field,
.modal-field-divider + .amount-field {
  margin-top: 0;
}

.member-fee-confirm-tools {
  display: flex;
  justify-content: flex-end;
}

.member-fee-confirm-tools button {
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--motion-normal) var(--ease-premium),
    border-color var(--motion-normal) var(--ease-premium),
    box-shadow var(--motion-normal) var(--ease-premium);
}

.member-fee-confirm-tools button:hover {
  border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  box-shadow: var(--row-hover-shadow);
}

.member-fee-confirm-list {
  display: grid;
  gap: 6px;
  max-height: 310px;
  overflow: auto;
}

.member-fee-confirm-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  cursor: pointer;
  transition:
    background var(--motion-normal) var(--ease-premium),
    border-color var(--motion-normal) var(--ease-premium),
    box-shadow var(--motion-normal) var(--ease-premium);
}

.member-fee-confirm-row:hover {
  border-color: color-mix(in srgb, var(--gold) 28%, var(--line));
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
  box-shadow: var(--row-hover-shadow);
}

.member-fee-confirm-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-fee-confirm-row strong {
  font-size: 12px;
  color: var(--soft);
}

.result-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.modal-footer-left,
.modal-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-footer-right {
  margin-left: auto;
}

.primary-button.danger:not(:disabled) {
  background: var(--red);
  color: #170605;
}

.primary-button.danger:disabled,
.primary-button.danger:disabled:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.result-modal.workflow-impact-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
}

.workflow-impact-change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.workflow-impact-change > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.workflow-impact-change span,
.workflow-impact-trade-meta small,
.workflow-impact-summary span {
  color: var(--muted);
  font-size: 11px;
}

.workflow-impact-change strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.workflow-impact-arrow {
  text-align: center;
}

.workflow-impact-trade-meta {
  display: flex;
  gap: 24px;
  padding: 12px 2px 0;
}

.workflow-impact-trade-meta span {
  display: grid;
  gap: 3px;
}

.workflow-impact-trade-meta strong {
  font-size: 12px;
}

.workflow-impact-affected {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workflow-impact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
}

.workflow-impact-summary strong {
  font-size: 12px;
}

.workflow-impact-table {
  min-width: 560px;
  overflow-x: auto;
}

.workflow-impact-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) minmax(112px, 0.9fr) minmax(110px, 0.9fr) minmax(90px, 0.7fr);
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

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

.workflow-impact-row > * {
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.workflow-impact-row strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.workflow-impact-row strong i {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.workflow-impact-head {
  min-height: 32px;
  background: color-mix(in srgb, var(--surface-2) 64%, transparent);
  color: var(--muted);
  font-weight: 700;
}

.workflow-impact-error {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--red) 32%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--red-2) 45%, transparent);
  color: var(--red);
  font-size: 12px;
}

@media (max-width: 640px) {
  .workflow-impact-change {
    grid-template-columns: 1fr;
  }

  .workflow-impact-arrow {
    transform: rotate(90deg);
  }

  .workflow-impact-affected {
    overflow-x: auto;
  }
}

.side-task-list {
  display: grid;
  gap: 7px;
}

.side-task-list button {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  color: var(--soft);
  cursor: pointer;
  text-align: left;
}

.side-task-list button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.side-task-list strong,
.side-task-list span {
  display: block;
}

.side-task-list strong {
  color: var(--text);
  font-size: 13px;
}

.side-task-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ledger-list {
  display: grid;
  gap: 10px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
}

.ledger-row span,
.ledger-row div span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.finance-dashboard-grid {
  --finance-summary-height: 170px;
  display: grid;
  grid-template-columns: minmax(380px, 1.08fr) minmax(360px, 1fr) minmax(280px, 0.82fr);
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.finance-dashboard-grid .finance-compact-card {
  padding: 10px 10px;
}

.finance-compact-card {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.finance-compact-card.summary {
  height: var(--finance-summary-height);
  min-height: var(--finance-summary-height);
}

.finance-compact-card.summary.compact {
  min-height: 0;
  height: 100%;
}

.finance-dashboard-grid > .finance-compact-card.summary.compact {
  height: var(--finance-summary-height);
}

.finance-center-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: var(--finance-summary-height);
  gap: 7px;
  min-width: 0;
}

.finance-center-stack .finance-compact-card {
  height: 100%;
  min-height: 0;
}

.finance-compact-card .section-title {
  margin-bottom: 8px;
}

.finance-compact-card .section-title h2 {
  color: var(--soft);
  font-size: 12px;
  font-weight: 820;
}

.finance-summary-head {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.finance-summary-head > span,
.finance-summary-title-line > span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 820;
}

.finance-summary-title-line {
  position: relative;
  display: inline-block;
  width: fit-content;
  min-width: 0;
}

.finance-summary-title-line > span {
  display: block;
}

.total-investment-info {
  position: absolute;
  top: 50%;
  left: calc(100% - 1px);
  display: inline-flex;
  align-items: center;
  width: 22px;
  height: 22px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  transform: translateY(-50%);
}

.total-investment-info-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: color var(--motion-hover), transform var(--motion-fast) var(--ease-press);
}

.total-investment-info-button > span {
  display: grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  transition: background var(--motion-hover), box-shadow var(--motion-hover);
}

.total-investment-info-button:hover > span,
.total-investment-info-button:focus-visible > span,
.total-investment-info.is-open .total-investment-info-button > span {
  background: color-mix(in srgb, var(--surface-2) 84%, var(--mint) 16%);
}

.total-investment-info-button:hover,
.total-investment-info-button:focus-visible,
.total-investment-info.is-open .total-investment-info-button { color: var(--text); }

.total-investment-info-button:focus-visible {
  outline: none;
  box-shadow: none;
}

.total-investment-info-button:focus-visible > span { box-shadow: var(--focus-ring); }

.total-investment-info-button:active {
  transform: scale(0.96);
}

.total-investment-popover {
  --total-investment-arrow-top: 16px;
  --total-investment-arrow-left: 16px;
  position: absolute;
  z-index: 75;
  top: 0;
  left: 0;
  width: min(312px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-modal);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(4px) scale(0.985);
  transform-origin: left var(--total-investment-arrow-top);
  transition:
    opacity 150ms cubic-bezier(0.4, 0, 1, 1),
    transform 150ms cubic-bezier(0.4, 0, 1, 1),
    visibility 0s linear 150ms;
  will-change: opacity, transform;
}

.total-investment-popover[hidden] {
  display: none;
}

.total-investment-popover::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: var(--total-investment-arrow-top);
  left: -5px;
  width: 9px;
  height: 9px;
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--surface-solid);
  transform: translateY(-50%) rotate(45deg);
}

.total-investment-popover[data-placement="below"]::before {
  top: -5px;
  left: var(--total-investment-arrow-left);
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  transform: rotate(45deg);
}

.total-investment-info.is-visible .total-investment-popover {
  visibility: visible;
  transition:
    opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

.total-investment-info.is-open .total-investment-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.finance-summary-head .total-investment-popover > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
  line-height: 1.2;
  white-space: nowrap;
}

.total-investment-popover dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.total-investment-popover dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
}

.total-investment-popover dl > .total-investment-group-end {
  margin-bottom: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.total-investment-popover dt {
  color: var(--muted);
  font-weight: 650;
}

.total-investment-popover dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  text-align: right;
  white-space: nowrap;
}

.total-investment-popover dl > .total {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.total-investment-popover .total dt,
.total-investment-popover .total dd {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 880;
}

.total-investment-empty {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .total-investment-popover,
  .total-investment-info.is-visible .total-investment-popover {
    transition-duration: 1ms;
  }
}

.finance-summary-head strong {
  color: var(--text);
  font-size: 23px;
  font-weight: 860;
  line-height: 1.05;
}

.finance-compact-card.accent .finance-summary-head strong {
  color: var(--mint);
}

.finance-balance-stack {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  height: var(--finance-summary-height);
  gap: 6px;
  min-width: 0;
}

.finance-balance-stack .finance-compact-card {
  height: 100%;
  min-height: 0;
  align-content: center;
}

.finance-balance-stack .finance-summary-head {
  padding-bottom: 0;
  margin-bottom: 0;
}

.finance-balance-stack .finance-summary-head strong {
  font-size: 21px;
  line-height: 1;
}

.metric-card {
  align-content: stretch;
  padding-top: 6px;
  padding-bottom: 6px;
}

.metric-card .finance-summary-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  height: 100%;
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.metric-card.has-meta .finance-summary-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.metric-card .finance-summary-head em {
  color: var(--soft);
  font-style: normal;
  font-size: 12px;
  font-weight: 820;
}

.metric-card .finance-summary-head span {
  display: grid;
  gap: 2px;
}

.metric-card .finance-summary-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.finance-metric-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

@container main-page-frame (max-width: 1260px) {
  .finance-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-dashboard-grid > .finance-balance-stack {
    grid-column: 1 / -1;
  }
}

@container main-page-frame (max-width: 828px) {
  .finance-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-dashboard-grid > .finance-balance-stack {
    grid-column: auto;
  }
}

@container main-page-frame (max-width: 340px) {
  .metric-card .finance-summary-head small {
    white-space: normal;
  }
}

.finance-balance-edit {
  flex: 0 0 28px;
}

.finance-withdraw-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.finance-withdraw-button:hover,
.finance-withdraw-button:focus-visible {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
  color: var(--text);
}

.wallet-withdrawal-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
}

.wallet-withdrawal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 16px;
}

.wallet-withdrawal-fields .amount-field {
  min-width: 0;
  margin-top: 0;
}

.wallet-withdrawal-fields .amount-field input,
.wallet-withdrawal-fields .amount-field textarea,
.wallet-withdrawal-fields .amount-field select {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}

.wallet-withdrawal-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.wallet-withdrawal-preview > div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.wallet-withdrawal-preview > div:nth-child(odd) { border-right: 1px solid var(--line); }
.wallet-withdrawal-preview > div:nth-last-child(-n + 2) { border-bottom: 0; }
.wallet-withdrawal-preview dt { color: var(--muted); font-size: 10px; font-weight: 720; }
.wallet-withdrawal-preview dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 820; }

.wallet-withdrawal-table th:first-child,
.wallet-withdrawal-table td:first-child {
  min-width: 132px;
}

.finance-clickable-row {
  cursor: pointer;
}

.finance-clickable-row:focus-visible td {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}

.wallet-withdrawal-record-note {
  grid-column: 1 / -1;
}

.wallet-withdrawal-record-summary > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

@media (max-width: 720px) {
  .wallet-withdrawal-fields { grid-template-columns: 1fr; }
  .wallet-withdrawal-record-note { grid-column: auto; }
  .wallet-withdrawal-preview { grid-template-columns: 1fr; }
  .wallet-withdrawal-preview > div:nth-child(odd) { border-right: 0; }
  .wallet-withdrawal-preview > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}

.finance-balance-edit:hover,
.finance-balance-edit:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.manual-balance-modal .money-input-wrap,
.manual-balance-modal .money-input-wrap input,
.manual-balance-modal .result-modal-actions button {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}

.finance-compact-card.compact {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(150px, 1.22fr);
  column-gap: 10px;
  align-items: center;
  align-content: center;
  padding: 10px 10px;
}

.finance-compact-card.compact .finance-summary-head {
  padding: 0;
  margin: 0;
  border-bottom: 0;
}

.finance-compact-card.compact .finance-calc-list {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.finance-compact-card.compact .finance-calc-list div {
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 6px;
  background: transparent;
}

.finance-compact-card.single .finance-calc-list div {
  min-height: 42px;
}

.finance-compact-card.accent .finance-calc-list .total dd {
  color: var(--mint);
}

.finance-ledger-stack {
  display: grid;
  gap: 8px;
}

.finance-ledger-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.finance-audit-divider {
  height: 1px;
  margin: 12px 0;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      color-mix(in srgb, var(--red) 5%, var(--line-strong)) 7%,
      color-mix(in srgb, var(--red) 5%, var(--line-strong)) 93%,
      transparent 100%
    );
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 1.5%, transparent);
}

.finance-ledger-section:has([data-finance-section-toggle="deletedHistory"]) {
  border-color: color-mix(in srgb, var(--red) 18%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--red) 4%, transparent), transparent 72px),
    color-mix(in srgb, var(--surface) 92%, var(--panel-2));
}

.finance-ledger-section .ops-table-wrap {
  margin: 0 10px 10px;
  background: var(--surface);
  transition: background var(--motion-hover);
}

.finance-table-frame {
  position: relative;
}

.finance-table-frame.has-pagination .ops-table th:last-child {
  padding-right: 66px;
}

.finance-ledger-section .ops-table {
  background: var(--surface);
}

.finance-ledger-section .ops-table th {
  background: var(--surface-2);
}

.finance-ledger-section .ops-table td {
  background: var(--surface);
}

.finance-ledger-section .ops-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mint) 4%, transparent);
}

.finance-pagination {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 50px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, #000 12%, transparent);
}

.finance-pagination button,
.finance-pagination-current {
  display: inline-grid;
  width: 16px;
  min-width: 16px;
  height: 18px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.finance-pagination button {
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-hover);
}

.finance-pagination button:hover {
  background: color-mix(in srgb, var(--mint) 10%, transparent);
  color: var(--text);
}

.finance-pagination button:disabled {
  opacity: 0.34;
  cursor: default;
  pointer-events: none;
}

.finance-pagination-current {
  color: var(--soft);
  font-size: 10px;
  font-weight: 860;
}

.finance-ledger-section.expanded.accordion-hover-lock {
  --finance-ledger-hover-bg: color-mix(in srgb, var(--mint) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--mint) 20%, var(--line));
  background: var(--finance-ledger-hover-bg);
}

.finance-ledger-section.expanded.accordion-hover-lock .finance-ledger-content,
.finance-ledger-section.expanded.accordion-hover-lock .finance-ledger-content .accordion-content-inner,
.finance-ledger-section.expanded.accordion-hover-lock .ops-table-wrap {
  background: var(--finance-ledger-hover-bg) !important;
  transition: background var(--motion-hover);
}

.finance-ledger-section.expanded.accordion-hover-lock .finance-ledger-summary {
  background: var(--finance-ledger-hover-bg);
}

.finance-ledger-content .accordion-content-inner {
  padding-top: 0;
  transition: background var(--motion-hover);
}

.finance-ledger-content {
  transition: background var(--motion-hover);
}

.finance-ledger-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  text-align: left;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.finance-ledger-toggle {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.finance-ledger-summary:hover,
.finance-ledger-section.accordion-hover-lock .finance-ledger-summary {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
  color: var(--text);
}

.finance-ledger-summary:active {
  transform: none;
}

.finance-ledger-summary:active,
.finance-ledger-summary:focus:active {
  width: 100%;
  padding: 9px 11px;
  margin: 0;
  transform: none;
}

.finance-ledger-toggle:active,
.finance-ledger-toggle:focus:active {
  transform: none;
}

.finance-ledger-summary .chevron-icon {
  position: relative;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform var(--motion-accordion);
}

.finance-ledger-summary .chevron-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform-origin: 50% 50%;
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-ledger-summary .chevron-icon.right::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-ledger-summary .chevron-icon.down {
  transform: rotate(90deg);
}

.finance-ledger-summary .chevron-icon.down::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-ledger-section.is-opening .finance-ledger-summary .chevron-icon.down {
  animation: chevronRotateDown var(--motion-accordion) both;
}

.finance-ledger-title strong,
.finance-ledger-title small {
  display: block;
}

.finance-ledger-title {
  min-width: 0;
  margin-right: auto;
}

.finance-ledger-title strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 830;
}

.finance-ledger-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.finance-ledger-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.finance-new-slot {
  display: inline-flex;
  justify-content: center;
  width: 28px;
  min-width: 28px;
}

.finance-ledger-count,
.finance-ledger-amount,
.finance-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  font-size: 11px;
  font-weight: 820;
}

.finance-ledger-count {
  width: 44px;
  min-width: 44px;
  padding: 0 8px;
  color: var(--muted);
}

.finance-ledger-amount {
  width: 108px;
  min-width: 108px;
  padding: 0 10px;
  color: var(--soft);
}

.finance-ledger-amount.empty {
  visibility: hidden;
}

.finance-new-badge {
  min-width: 22px;
  padding: 0 7px;
  border-color: color-mix(in srgb, var(--mint) 34%, var(--line));
  background: color-mix(in srgb, var(--mint) 13%, transparent);
  color: var(--mint);
}

.finance-sheet-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.finance-sheet-section.wide {
  grid-column: 1 / -1;
}

.finance-sheet-section tr[data-finance-edit] {
  position: relative;
  cursor: pointer;
}

.finance-sheet-section tr[data-finance-edit]:hover td {
  background: color-mix(in srgb, var(--mint) 7%, transparent);
}

.ops-table tr.finance-new-focus td {
  animation: finance-new-row-focus 2800ms ease forwards;
}

.ops-table tr.finance-new-focus td:first-child {
  box-shadow:
    inset 1px 0 0 color-mix(in srgb, var(--gold) 34%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--gold) 18%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--gold) 12%, transparent);
}

.ops-table tr.finance-new-focus td:last-child {
  box-shadow:
    inset -1px 0 0 color-mix(in srgb, var(--gold) 34%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--gold) 18%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--gold) 12%, transparent);
}

@keyframes finance-new-row-focus {
  0% {
    background: color-mix(in srgb, var(--gold) 13%, var(--surface));
  }
  62% {
    background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  }
  100% {
    background: transparent;
  }
}

.finance-edit-modal {
  width: min(620px, calc(100vw - 28px));
}

.finance-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.amp-deposit-edit-grid {
  gap: 12px;
}

.amp-deposit-edit-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.amp-deposit-edit-section .section-title {
  margin-bottom: 8px;
}

.amp-deposit-edit-section .section-title h2 {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}

.amp-deposit-edit-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.amp-deposit-confirm-fees {
  padding: 12px;
}

.amp-deposit-edit-rate-settings {
  margin-top: 0;
}

.amp-deposit-edit-summary .finance-summary-item {
  min-height: 54px;
}

.amp-deposit-edit-summary .finance-summary-item.wide-summary-item {
  grid-column: 1 / -1;
}

.amp-deposit-edit-summary .finance-summary-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.payout-cycle-snapshot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.finance-history {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.finance-history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.finance-history-toggle:hover:not(:disabled),
.finance-history.accordion-hover-lock .finance-history-toggle:not(:disabled) {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 6%, transparent);
  color: var(--text);
}

.finance-history-toggle:disabled {
  color: var(--muted);
  cursor: default;
}

.finance-history-toggle .chevron-icon {
  position: relative;
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: 0 0 14px;
  transition: transform var(--motion-accordion);
}

.finance-history-toggle .chevron-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform-origin: 50% 50%;
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-history-toggle .chevron-icon.right::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-history-toggle .chevron-icon.down {
  transform: rotate(90deg);
  animation: chevronRotateDown var(--motion-accordion) both;
}

.finance-history-toggle .chevron-icon.down::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}

.finance-history-content .accordion-content-inner {
  padding-top: 6px;
}

.is-closing .reset-history-toggle .chevron-icon.down,
.is-closing .finance-ledger-summary .chevron-icon.down,
.is-closing .finance-history-toggle .chevron-icon.down {
  animation: chevronRotateUp var(--motion-accordion) both;
}

.finance-history-toggle strong {
  color: inherit;
  font-size: 12px;
  font-weight: 760;
}

.finance-history-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.finance-history-list div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.finance-history-list strong,
.finance-history-list span,
.finance-history-list p {
  display: block;
}

.finance-history-list strong {
  color: var(--text);
  font-size: 12px;
}

.finance-history-list span,
.finance-history-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.delete-record-preview {
  display: grid;
  gap: 7px;
}

.delete-record-preview div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2) 52%, transparent);
}

.delete-record-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 730;
}

.delete-record-preview strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deleted-history-row td:nth-child(2) {
  max-width: 520px;
  white-space: normal;
}

.finance-calc-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.finance-compact-card.summary:not(.compact) .finance-calc-list {
  padding-bottom: 12px;
}

.finance-calc-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-hover);
}

.finance-breakdown-row {
  cursor: pointer;
}

.finance-breakdown-row:hover,
.finance-compact-card.compact .finance-calc-list .finance-breakdown-row:hover {
  border-color: color-mix(in srgb, var(--mint) 24%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 7%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.04);
}

.finance-breakdown-row:active,
.finance-compact-card.compact .finance-calc-list .finance-breakdown-row:active {
  border-color: color-mix(in srgb, var(--mint) 28%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mint) 9%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.045);
}

.finance-breakdown-row:hover dt,
.finance-breakdown-row:hover dd {
  color: var(--text);
}

.finance-breakdown-table {
  max-height: 360px;
  margin-top: 14px;
}

.finance-breakdown-table .ops-table th:last-child,
.finance-breakdown-table .ops-table td:last-child {
  text-align: right;
}

.finance-breakdown-table .ops-table td {
  padding: 9px 11px;
}

.finance-breakdown-total td {
  border-top: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 88%, #000 12%);
  color: var(--text);
  font-weight: 860;
  pointer-events: none;
}

.finance-breakdown-total,
.finance-breakdown-total:hover,
.finance-breakdown-total:active {
  cursor: default;
  pointer-events: none;
}

.finance-breakdown-table .ops-table tbody tr.finance-breakdown-total:hover td,
.finance-breakdown-table .ops-table tbody tr.finance-breakdown-total:active td {
  background: color-mix(in srgb, var(--surface-2) 88%, #000 12%);
  cursor: default;
  pointer-events: none;
}

.finance-calc-list div:last-child {
  border-bottom: 1px solid var(--line);
}

.finance-calc-list dt {
  color: var(--muted);
  font-size: 12px;
}

.finance-calc-list dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.positive {
  color: var(--mint);
}

.negative {
  color: var(--red);
}

.client-head {
  margin-bottom: 14px;
}

.compact-profile div {
  padding: 9px 0;
}

@media (max-width: 1180px) {
  .metric-grid,
  .account-grid-list,
  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-balance-stack {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1340px) {
  .command-layout {
    grid-template-columns: 1fr;
  }

  .attention-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 16px;
  }

  .attention-panel .section-title,
  .attention-list {
    grid-column: 1;
  }

  .attention-panel .rail-divider {
    display: none;
  }

  .attention-panel > h2,
  .attention-panel .payout-stack {
    grid-column: 2;
  }
}

@media (min-width: 861px) and (max-width: 900px) {
  .page-history .history-split {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 1080px) {
  .account-sheet-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  :root {
    --app-header-height: 55px;
    --page-frame-space: 12px;
  }

  .topbar {
    padding: 8px 10px;
  }

  .topbar-tabs {
    width: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .topbar-tabs::-webkit-scrollbar {
    display: none;
  }

  .topbar-brand span:not(.brand-mark) {
    display: none;
  }

  .page {
    padding: var(--page-frame-space);
  }

  .page-dashboard,
  .page-members,
  .page-history {
    display: block;
    height: auto;
    min-height: calc(100dvh - var(--app-header-height));
    overflow: visible;
  }

  .page-dashboard > .page-header,
  .page-members > .page-header,
  .page-history > .page-header {
    margin-bottom: var(--page-frame-gap);
  }

  .detail-hero,
  .account-toolbar,
  .account-page-header {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

  .metric-grid,
  .split-layout,
  .detail-grid,
  .queue-layout,
  .command-strip,
  .command-layout,
  .daily-layout,
  .command-bottom,
  .account-grid-list,
  .client-grid,
  .account-overview-grid,
  .account-subgrid,
  .trade-block-grid,
  .payout-info-grid,
  .account-state-strip,
  .account-side-panel {
    grid-template-columns: 1fr;
  }

  .finance-ledger-summary {
    grid-template-columns: 16px minmax(0, 1fr) auto;
  }

  .finance-ledger-amount {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .attention-panel {
    display: block;
  }

  .attention-panel > h2 {
    margin-top: 16px;
  }

  .attention-panel .rail-divider {
    display: block;
  }

  .command-clock {
    min-width: 0;
    text-align: left;
  }

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

  .compact-filters {
    max-width: 100%;
    overflow-x: auto;
  }

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

  .theme-options {
    flex-wrap: wrap;
  }

  .detail-balance {
    min-width: 0;
    text-align: left;
  }

  .ledger-row {
    grid-template-columns: 1fr;
  }

  .mini-row {
    grid-template-columns: 1fr;
  }

  .account-money-row,
  .mini-ledger div {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 520px) {
  .metric {
    min-height: 108px;
  }

  .metric-value,
  .account-balance,
  .detail-balance strong {
    font-size: 26px;
  }

  .task-head,
  .task-meta,
  .account-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 1ms;
    --motion-normal: 1ms;
    --motion-slow: 1ms;
    --motion-hover-duration: 1ms;
    --motion-accordion-duration: 1ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.database-save-status {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  transition: color var(--motion-normal) var(--ease-premium), border-color var(--motion-normal) var(--ease-premium), background var(--motion-normal) var(--ease-premium);
  white-space: nowrap;
}

.database-save-status.saving {
  background: rgba(202, 155, 92, 0.08);
  border-color: rgba(202, 155, 92, 0.35);
  color: var(--text);
}

.database-save-status.saved {
  background: rgba(114, 143, 112, 0.08);
  border-color: rgba(114, 143, 112, 0.32);
}

.database-save-status.failed {
  background: rgba(166, 91, 76, 0.1);
  border-color: rgba(166, 91, 76, 0.42);
  color: #a65b4c;
}

.app-toast {
  --toast-accent: var(--soft);
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 48%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--toast-accent) 10%, var(--panel));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--toast-accent) 12%, transparent);
  color: color-mix(in srgb, var(--toast-accent) 72%, var(--text));
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
  animation: toast-in var(--motion-normal) var(--ease-premium);
}

.app-toast.is-closing {
  animation: toast-out var(--motion-normal) var(--ease-premium) forwards;
}

.app-toast button {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 38%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--toast-accent) 7%, transparent);
  color: color-mix(in srgb, var(--toast-accent) 68%, var(--text));
  cursor: pointer;
}

.app-toast button::before,
.app-toast button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.app-toast button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.app-toast button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

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

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

.nav-item,
.topbar-tab,
.theme-quick-toggle,
.profile-button,
.primary-button,
.ghost-button,
.text-button,
.icon-button,
.link-button,
.account-name,
.compact-filters button,
.row-actions button,
.trade-control button,
.inspector-actions button,
.matrix-tools button,
.finance-pagination button,
.finance-ledger-summary,
.reset-history-toggle,
.finance-history-toggle,
.waste-suggestion-list button,
.member-fee-confirm-tools button,
.side-task-list button,
.back-agenda-button,
.profile-text-action,
.card-edit-button {
  transition:
    border-color var(--motion-hover),
    background-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-press);
}

button:not(:disabled):active,
.primary-button:not(:disabled):active,
.ghost-button:not(:disabled):active,
.row-actions button:not(:disabled):active,
.trade-control button:not(:disabled):active,
.finance-pagination button:not(:disabled):active,
.compact-filters button:not(:disabled):active {
  transform: translateY(0) scale(var(--press-scale));
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  filter: saturate(0.82);
}

.theme-popover {
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform 180ms var(--ease-premium),
    visibility 0s linear var(--motion-fast);
  visibility: hidden;
  will-change: opacity, transform;
}

.theme-popover.open {
  visibility: visible;
  transition-delay: 0s;
  animation: dropdownEnter 180ms var(--ease-premium) both;
}

@keyframes dropdownEnter {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-scrim {
  transition: opacity 240ms var(--ease-standard);
}

.result-modal {
  transform: translate(-50%, -48.5%) scale(0.972);
  transition:
    opacity 240ms var(--ease-standard),
    transform 260ms var(--ease-premium);
  will-change: opacity, transform;
}

.result-modal.open {
  animation: modalEnter 260ms var(--ease-premium) both;
}

.modal-scrim.open {
  animation: modalScrimEnter 240ms var(--ease-standard) both;
}

.result-modal.is-closing {
  transform: translate(-50%, -48.5%) scale(0.978);
  transition:
    opacity 170ms var(--ease-standard),
    transform 170ms var(--ease-standard);
}

.modal-close-button,
.app-toast button {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-fast) var(--ease-press);
}

.modal-close-button {
  top: 9px;
  right: 9px;
}

.modal-close-button:hover,
.app-toast button:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  transform: scale(1.035);
}

.modal-close-button:active,
.app-toast button:active {
  transform: scale(0.94);
}

.amount-field input,
.amount-field textarea,
.amount-field select,
.pair-select-wrap select,
.inspector-form select,
.bank-top-up-inline-input,
.field-inline-stepper {
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    transform var(--motion-fast) var(--ease-standard);
}

.amount-field input:focus,
.amount-field textarea:focus,
.amount-field select:focus,
.pair-select-wrap select:focus,
.inspector-form select:focus-visible {
  box-shadow: var(--focus-ring);
}

.operations-table tbody tr,
.ops-table tbody tr,
.members-table tbody tr,
.finance-sheet-section tr[data-finance-edit] {
  transition:
    background-color var(--motion-hover),
    background var(--motion-hover),
    box-shadow var(--motion-hover);
}

.operations-table tbody tr:hover,
.ops-table tbody tr:hover,
.members-table tbody tr:hover,
.finance-sheet-section tr[data-finance-edit]:hover {
  transition-duration: 180ms;
}

.database-save-status,
.metric,
.finance-compact-card,
.summary-item,
.operation-row,
.payout-item,
.reset-history-item,
.finance-breakdown-row {
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    opacity var(--motion-hover),
    transform var(--motion-fast) var(--ease-press);
}

.database-save-status.saving {
  animation: saveStatusBreath 1400ms var(--ease-standard) infinite;
}

@keyframes saveStatusBreath {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 0%, transparent);
  }

  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 8%, transparent);
  }
}

.app-toast-stack {
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  position: relative;
  top: auto;
  right: auto;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: none;
  overflow: hidden;
  pointer-events: auto;
  transform-origin: top right;
  gap: 12px;
  padding: 13px 12px 14px 15px;
  animation: toast-in 380ms var(--ease-premium) both;
  will-change: opacity, transform;
}

.app-toast.success {
  --toast-accent: var(--mint);
}

.app-toast.information,
.app-toast.info {
  --toast-accent: #6f95c8;
}

.app-toast.warning {
  --toast-accent: #c89a58;
}

.app-toast.error {
  --toast-accent: var(--red);
}

.app-toast-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 42%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--toast-accent) 10%, transparent);
  color: color-mix(in srgb, var(--toast-accent) 78%, var(--text));
}

.app-toast-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-toast.is-closing {
  animation: toast-out 240ms var(--ease-standard) forwards;
}

.app-toast-message {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-toast-code {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: currentColor;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 4px 7px;
}

.app-toast button {
  width: 34px;
  height: 34px;
  margin: -5px -4px -5px 0;
  align-self: center;
}

.app-toast button::before,
.app-toast button::after {
  width: 11px;
}

.app-toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.34;
  transform-origin: left center;
  animation: toastProgress var(--toast-duration, 4600ms) linear forwards;
}

.app-toast.is-paused .app-toast-progress {
  animation-play-state: paused;
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(14px, -8px, 0) scale(0.975);
  }

  70% {
    opacity: 1;
    transform: translate3d(0, 1px, 0) scale(1.002);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate3d(12px, -6px, 0) scale(0.982);
  }
}

.database-setup-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.database-setup-card span {
  color: var(--muted);
  font-size: 13px;
}

.summary-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inline-actions {
  margin-top: 4px;
}

/* Central application History */
.history-context-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.history-context-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-context-button:hover {
  border-color: color-mix(in srgb, var(--mint) 42%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 8%, var(--surface-2));
  color: var(--text);
}

.history-context-button:active {
  transform: scale(var(--press-scale));
}

.account-page-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.member-history-link {
  align-self: center;
}

.finance-record-history-link {
  width: 100%;
}

.finance-record-history-link {
  margin-top: 18px;
}

.history-page-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.history-filters {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.history-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  align-items: end;
  gap: 8px;
}

.history-filter-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.history-filter-grid input {
  width: 100%;
  min-width: 0;
  height: var(--control-height-compact);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.history-filter-grid .history-search-field {
  grid-column: span 2;
}

.history-split {
  display: grid;
  grid-template-columns: minmax(310px, 38%) minmax(0, 62%);
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.history-event-list,
.history-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.history-event-list {
  --history-event-row-height: 68px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
}

.history-event-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--history-event-row-height);
  min-height: var(--history-event-row-height);
  max-height: var(--history-event-row-height);
  box-sizing: border-box;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.history-event-item:hover {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}

.history-event-item.selected {
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--mint);
}

.history-actor-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  border: 1px solid hsl(var(--history-actor-hue, 160) 44% 45% / 0.42);
  border-radius: 7px;
  background: color-mix(in srgb, hsl(var(--history-actor-hue, 160) 55% 48%) 16%, var(--surface-2));
  color: hsl(var(--history-actor-hue, 160) 58% 72%);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.history-actor-avatar img,
.profile-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-actor-avatar.is-system,
.profile-button.is-system {
  --history-actor-hue: 210;
  color: var(--soft);
}

.history-actor-avatar .actor-avatar-system-icon,
.profile-button .actor-avatar-system-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shared-admin-avatar.requires-avatar {
  border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 20%, transparent);
}

.actor-avatar-text {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  line-height: 1;
  text-indent: 0;
  transform: none;
}

.history-event-copy,
.history-event-context,
.history-event-summary {
  min-width: 0;
}

.history-event-copy {
  display: grid;
  align-content: center;
  gap: 4px;
}

.history-event-context {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-event-time {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.history-event-summary {
  overflow: hidden;
  font-size: 12px;
  font-weight: 670;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-context-unavailable {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.history-detail-panel {
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.history-detail-toolbar {
  position: sticky;
  top: -18px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: -18px -18px 0;
  padding: 18px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(12px);
}

.history-detail-title {
  min-width: 0;
}

.history-detail-title > span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.history-detail-title h2 {
  margin: 5px 0 0;
  font-size: 19px;
  line-height: 1.35;
}

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

.history-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.history-detail-actions .secondary-button,
.history-detail-actions .ghost-button {
  min-height: 34px;
}

.history-mobile-back {
  display: none;
}

.history-event-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.history-event-meta.has-task-count {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-event-meta div {
  min-width: 0;
}

.history-event-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.history-event-meta dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-event-meta div:nth-child(3) dd {
  text-overflow: clip;
  white-space: normal;
}

.history-change-list {
  display: grid;
  gap: 14px;
}

.history-change-group {
  min-width: 0;
  padding-top: 4px;
}

.history-change-group + .history-change-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-change-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 9px;
}

.history-change-heading span,
.history-change-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  text-transform: uppercase;
}

.history-operation-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--soft) !important;
  font-size: 9px !important;
  letter-spacing: 0;
}

.history-operation-badge.operation-create,
.history-operation-badge.operation-restore {
  border-color: color-mix(in srgb, var(--mint) 34%, var(--line));
  color: var(--mint) !important;
}

.history-operation-badge.operation-delete {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  color: var(--danger) !important;
}

.history-operation-badge.operation-update {
  border-color: color-mix(in srgb, var(--cyan) 30%, var(--line));
  color: var(--cyan) !important;
}

.history-operation-badge.operation-revert,
.history-operation-badge.operation-reschedule {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  color: var(--amber) !important;
}

.history-change-heading h3 {
  margin: 3px 0 0;
  font-size: 14px;
}

.history-sensitive-note {
  margin-bottom: 8px;
  color: var(--amber);
  font-size: 11px;
}

.history-comparison-table {
  min-width: 490px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.history-comparison-table.with-record {
  min-width: 640px;
}

.history-change-group {
  overflow-x: auto;
}

.history-comparison-head,
.history-comparison-row {
  display: grid;
  grid-template-columns: var(--resizable-grid-columns, minmax(130px, 0.8fr) repeat(2, minmax(145px, 1fr)));
}

.history-comparison-head.with-record,
.history-comparison-row.with-record {
  grid-template-columns: var(--resizable-grid-columns, minmax(150px, 1fr) minmax(120px, 0.75fr) repeat(2, minmax(145px, 1fr)));
}

.history-comparison-head {
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  text-transform: uppercase;
}

.history-comparison-head span,
.history-comparison-row > strong,
.history-comparison-row > span {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.history-comparison-head span:last-child,
.history-comparison-row > span:last-of-type {
  border-right: 0;
}

.history-comparison-row {
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
}

.history-comparison-row > strong {
  color: var(--text);
  font-weight: 720;
}

.history-comparison-row > .history-record-label {
  color: var(--soft);
}

.history-agenda-group,
.history-linked-section {
  min-width: 0;
}

.history-group-sticky-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
}

.history-group-sticky-heading span,
.history-group-sticky-heading small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 740;
  text-transform: uppercase;
}

.history-group-sticky-heading h3 {
  margin: 0;
  font-size: 14px;
}

.history-task-table {
  min-width: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.history-agenda-group {
  overflow-x: auto;
}

.history-task-table-head,
.history-task-row > summary,
.history-task-row-static {
  display: grid;
  grid-template-columns: var(--resizable-grid-columns, minmax(180px, 1.35fr) minmax(126px, 0.9fr) minmax(106px, 0.75fr) minmax(118px, 0.85fr));
  align-items: center;
}

.history-task-table-head {
  min-height: 32px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--muted);
  font-size: 9px;
  font-weight: 780;
  text-transform: uppercase;
}

.history-task-table-head span,
.history-task-row > summary > span,
.history-task-row-static > span {
  min-width: 0;
  padding: 7px 9px;
  overflow-wrap: anywhere;
}

.history-task-row {
  border-top: 1px solid var(--line);
}

.history-task-row > summary {
  min-height: 38px;
  cursor: pointer;
  color: var(--soft);
  font-size: 11px;
  list-style: none;
  transition: background 140ms ease;
}

.history-task-row-static {
  min-height: 38px;
  color: var(--soft);
  font-size: 11px;
}

.history-task-row > summary::-webkit-details-marker {
  display: none;
}

.history-task-row > summary:hover,
.history-task-row[open] > summary {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}

.history-task-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-task-name strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
}

.history-row-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
  font-family: inherit;
  line-height: 1.2;
}

button.history-row-badge {
  background: transparent;
  cursor: pointer;
}

button.history-row-badge:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.history-row-badge.deleted,
.history-row-badge.deleted-later {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  color: var(--danger);
}

.history-row-badge.changed-later {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
  color: var(--amber);
}

.history-row-badge.restored,
.history-row-badge.restored-later {
  border-color: color-mix(in srgb, var(--mint) 32%, var(--line));
  color: var(--mint);
}

.history-task-expanded {
  display: grid;
  gap: 9px;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}

.history-task-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
}

.history-task-facts div,
.history-task-current {
  display: grid;
  gap: 2px;
}

.history-task-facts span,
.history-task-current > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.history-task-facts strong,
.history-task-current strong {
  color: var(--soft);
  font-size: 11px;
}

.history-task-identity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-task-identity-strip > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.history-task-identity-strip span,
.history-record-technical dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.history-task-identity-strip code,
.history-record-technical code {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 10px;
}

.history-record-technical {
  color: var(--muted);
  font-size: 10px;
}

.history-record-technical.has-preceding-content {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.history-record-technical > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--soft);
  font-weight: 720;
}

.history-record-technical dl {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
}

.history-record-technical dl > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
}

.history-record-technical dt,
.history-record-technical dd {
  margin: 0;
}

.history-task-current {
  padding: 8px 9px;
  border-left: 2px solid var(--amber);
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
}

.history-task-current small {
  color: var(--muted);
  font-size: 10px;
}

.history-deletion-notice,
.history-lifecycle-notice {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--soft);
  font-size: 11px;
}

.history-notice-message {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.history-notice-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.history-deletion-notice {
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
  background: color-mix(in srgb, var(--red) 5%, transparent);
}

.history-lifecycle-notice {
  border: 1px solid color-mix(in srgb, var(--amber) 24%, var(--line));
  background: color-mix(in srgb, var(--amber) 6%, transparent);
}

.history-deletion-notice button,
.history-lifecycle-notice button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 760;
}

.history-deletion-notice button {
  border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line));
  color: var(--red);
}

.history-lifecycle-notice button {
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  color: var(--amber);
}

.history-deletion-notice button:hover {
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

.history-lifecycle-notice button:hover {
  background: color-mix(in srgb, var(--amber) 9%, transparent);
}

.history-note-state-unavailable {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.history-linked-section {
  display: grid;
  gap: 6px;
}

.history-linked-group {
  border-top: 1px solid var(--line);
}

.history-linked-group > summary,
.history-linked-group-static {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 5px 0;
}

.history-linked-group > summary {
  cursor: pointer;
  list-style: none;
}

.history-linked-group > summary::-webkit-details-marker {
  display: none;
}

.history-linked-group > summary strong,
.history-linked-group-static strong {
  color: var(--soft);
  font-size: 11px;
}

.history-linked-group > summary small,
.history-linked-group-static small {
  color: var(--muted);
  font-size: 9px;
}

.history-linked-details {
  display: grid;
  gap: 10px;
  padding: 0 0 10px 28px;
}

.history-linked-details .history-change-group + .history-change-group {
  padding-top: 10px;
}

.history-value-deleted {
  color: var(--muted);
  font-style: italic;
}

.history-note-change {
  overflow-x: visible;
}

.history-note-value {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.history-note-current {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 9px;
  border-left: 2px solid var(--amber);
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
}

.history-note-current span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.history-note-current strong {
  color: var(--soft);
  font-size: 11px;
}

.history-field-restore {
  grid-column: 2 / -1;
  justify-self: start;
  min-height: 28px;
  margin: 0 10px 9px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font-size: 10px;
  font-weight: 760;
}

.history-comparison-row.with-record .history-field-restore {
  grid-column: 3 / -1;
}

.history-field-restore:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}

.history-comparison-empty,
.history-list-empty,
.history-detail-empty {
  display: grid;
  place-content: center;
  gap: 5px;
  min-height: 160px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.history-list-empty span,
.history-detail-empty span {
  font-size: 12px;
}

.history-technical {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.history-event-technical {
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.history-technical summary {
  width: fit-content;
  cursor: pointer;
  color: var(--soft);
  font-weight: 720;
}

.history-technical-overview {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.history-technical-overview > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}

.history-technical code {
  overflow-wrap: anywhere;
  color: var(--text);
}

.history-technical-records {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.history-technical-record {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

.history-technical-record header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-technical-record header strong {
  color: var(--soft);
  font-size: 10px;
}

.history-technical-record header span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.history-technical-record dl {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
}

.history-technical-record dl div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
}

.history-technical-record dt,
.history-technical-record dd {
  margin: 0;
}

.history-action-unavailable {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.history-technical pre {
  max-height: 260px;
  margin: 9px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  color: var(--soft);
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.history-load-more {
  width: calc(100% - 20px);
  min-height: 34px;
  margin: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
}

.history-load-more:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--mint) 7%, transparent);
}

@media (max-width: 1260px) {
  .history-filter-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .history-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .account-page-header {
    grid-template-columns: 1fr;
  }

  .member-history-link {
    justify-self: start;
  }

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

  .history-search-field {
    grid-column: 1 / -1;
  }

  .history-split {
    display: block;
    height: calc(100vh - 330px);
    min-height: 500px;
  }

  .history-event-list,
  .history-detail-panel {
    height: 100%;
  }

  .history-event-list {
    border-right: 0;
  }

  .history-detail-panel {
    display: none;
  }

  .history-split.show-detail .history-event-list {
    display: none;
  }

  .history-split.show-detail .history-detail-panel {
    display: block;
  }

  .history-mobile-back {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
  }

  .history-detail-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-detail-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .history-event-meta,
  .history-event-meta.has-task-count {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .history-filter-grid {
    grid-template-columns: 1fr;
  }

  .history-search-field {
    grid-column: auto;
  }

  .history-split {
    height: calc(100vh - 420px);
    min-height: 460px;
  }

  .history-detail-panel {
    padding: 14px;
  }

  .history-event-meta,
  .history-event-meta.has-task-count {
    grid-template-columns: 1fr;
  }

}

/* Dashboard task table: shared control sizing and row rhythm. */
.operations-panel {
  --dashboard-content-inset: 14px;
  --dashboard-cell-padding-inline: 10px;
  --dashboard-trade-control-width: 132px;
  --dashboard-trade-column-min-width: 152px;
  --dashboard-control-height: 30px;
  --dashboard-status-height: 26px;
  --dashboard-table-body-size: 12px;
  --dashboard-table-line-height: 1.25;
  --dashboard-result-win: light-dark(#3f7448, #8fbc8f);
  --dashboard-result-loss: light-dark(#a63f4b, #df858b);
}

.operations-panel .panel-toolbar {
  padding-inline: var(--dashboard-content-inset);
}

.operations-panel .operations-table {
  font-size: var(--dashboard-table-body-size);
  line-height: var(--dashboard-table-line-height);
}

.operations-panel .operations-table th {
  padding: 9px var(--dashboard-cell-padding-inline);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: 0;
}

.operations-panel .operations-table td {
  padding: 8px var(--dashboard-cell-padding-inline);
  font-size: var(--dashboard-table-body-size);
  line-height: var(--dashboard-table-line-height);
  text-align: left;
  vertical-align: middle;
}

.operations-panel .operations-table th:first-child,
.operations-panel .operations-table td:first-child {
  padding-left: var(--dashboard-content-inset);
}

.operations-panel .operations-table th:nth-child(3),
.operations-panel .operations-table td:nth-child(3),
.operations-panel .operations-table th:nth-child(4),
.operations-panel .operations-table td:nth-child(4) {
  min-width: var(--dashboard-trade-column-min-width);
}

.operations-panel .operations-table td > strong {
  color: var(--text);
  font-size: var(--dashboard-table-body-size);
  font-weight: 680;
  line-height: var(--dashboard-table-line-height);
  letter-spacing: 0;
}

.operations-panel .operations-table small {
  margin-top: 3px;
  font-size: 11px;
  line-height: var(--dashboard-table-line-height);
  letter-spacing: 0;
}

.operations-panel .dashboard-direction-control,
.operations-panel .dashboard-pair-control,
.operations-panel .dashboard-trade-readonly {
  width: var(--dashboard-trade-control-width);
  min-width: var(--dashboard-trade-control-width);
  max-width: var(--dashboard-trade-control-width);
  margin: 0;
  box-sizing: border-box;
  justify-self: start;
  text-align: left;
}

.operations-panel .dashboard-direction-control {
  height: var(--dashboard-control-height);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operations-panel .dashboard-direction-control button {
  width: 100%;
  min-width: 0;
  height: 24px;
  gap: 4px;
  padding: 0 7px;
  border-width: 1px;
  box-sizing: border-box;
  font-size: var(--dashboard-table-body-size);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
}

.operations-panel .dashboard-pair-control {
  flex: 0 0 var(--dashboard-trade-control-width);
}

.operations-panel .dashboard-pair-control select,
.operations-panel .dashboard-trade-readonly {
  height: var(--dashboard-control-height);
  min-height: var(--dashboard-control-height);
  font-size: var(--dashboard-table-body-size);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
}

.operations-panel .dashboard-trade-readonly.direction,
.operations-panel .dashboard-trade-readonly.pair {
  justify-content: flex-start;
  padding-inline: 0;
  text-align: left;
}

.operations-panel .operations-table .badge {
  min-height: var(--dashboard-status-height);
  padding: 0 9px;
  border-radius: 6px;
  font-size: var(--dashboard-table-body-size);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
}

.operations-panel .row-actions-cell > .row-actions {
  min-height: var(--dashboard-control-height);
  justify-content: flex-start;
  margin: 0;
}

.operations-panel .row-actions button {
  height: var(--dashboard-status-height);
  min-height: var(--dashboard-status-height);
  padding: 0 8px;
  box-sizing: border-box;
  font-size: var(--dashboard-table-body-size);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.operations-panel .row-actions button.partial-action {
  font-size: var(--dashboard-table-body-size);
}

.operations-panel .row-actions button[data-result="Won"] {
  border-color: color-mix(in srgb, var(--dashboard-result-win) 56%, var(--line));
  background: color-mix(in srgb, var(--dashboard-result-win) 20%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-win) 84%, var(--text));
}

.operations-panel .row-actions button[data-result="Won"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--dashboard-result-win) 72%, var(--line-strong));
  background: color-mix(in srgb, var(--dashboard-result-win) 28%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-win) 74%, var(--text));
}

.operations-panel .row-actions button[data-result="Partially Won"] {
  border-color: color-mix(in srgb, var(--dashboard-result-win) 36%, var(--line));
  background: color-mix(in srgb, var(--dashboard-result-win) 10%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-win) 72%, var(--soft));
}

.operations-panel .row-actions button[data-result="Partially Won"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--dashboard-result-win) 50%, var(--line-strong));
  background: color-mix(in srgb, var(--dashboard-result-win) 16%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-win) 80%, var(--text));
}

.operations-panel .row-actions button[data-result="Lost"] {
  border-color: color-mix(in srgb, var(--dashboard-result-loss) 56%, var(--line));
  background: color-mix(in srgb, var(--dashboard-result-loss) 20%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-loss) 84%, var(--text));
}

.operations-panel .row-actions button[data-result="Lost"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--dashboard-result-loss) 72%, var(--line-strong));
  background: color-mix(in srgb, var(--dashboard-result-loss) 28%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-loss) 74%, var(--text));
}

.operations-panel .row-actions button[data-result="Partially Lost"] {
  border-color: color-mix(in srgb, var(--dashboard-result-loss) 36%, var(--line));
  background: color-mix(in srgb, var(--dashboard-result-loss) 10%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-loss) 72%, var(--soft));
}

.operations-panel .row-actions button[data-result="Partially Lost"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--dashboard-result-loss) 50%, var(--line-strong));
  background: color-mix(in srgb, var(--dashboard-result-loss) 16%, var(--surface-2));
  color: color-mix(in srgb, var(--dashboard-result-loss) 80%, var(--text));
}

.operations-panel .row-actions button:disabled,
.operations-panel .row-actions button:disabled:hover {
  cursor: not-allowed;
  filter: saturate(0.65);
  opacity: 0.44;
  transform: none;
}

.operations-panel .note-cell span {
  min-height: var(--dashboard-control-height);
  padding: 7px 0;
  font-size: var(--dashboard-table-body-size);
  line-height: var(--dashboard-table-line-height);
  letter-spacing: 0;
  text-align: left;
}

/* Phase 2 administration surfaces */
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.secondary-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--mint) 42%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 9%, var(--surface-2));
}

.danger-button {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  color: color-mix(in srgb, var(--red) 82%, var(--text));
}

.danger-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--red) 65%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, var(--surface-2));
}

.secondary-button.compact,
.danger-button.compact {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 11px;
}

.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.inline-link-button {
  width: fit-content;
  text-decoration: none;
}

.account-security-page {
  width: min(860px, 100%);
  max-width: 860px;
  padding: 22px 0;
}

.account-security-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.account-security-list > div {
  min-width: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.account-security-list > div:nth-child(odd) {
  padding-right: 20px;
}

.account-security-list > div:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.account-security-list dt,
.account-security-list dd,
.admin-detail-panel dt,
.admin-detail-panel dd {
  margin: 0;
}

.account-security-list dt,
.admin-detail-panel dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.account-security-list dd,
.admin-detail-panel dd {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-security-heading {
  min-height: 58px;
}

.account-security-heading > div:nth-child(2) {
  flex: 1;
}

.profile-avatar-editor {
  position: relative;
}

.profile-avatar-control {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.profile-avatar-control .profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

.profile-avatar-control::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, #000 25%, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.profile-avatar-control:hover::after,
.profile-avatar-control:focus-visible::after,
.profile-avatar-control[aria-expanded="true"]::after {
  opacity: 1;
}

.profile-avatar-control:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.profile-avatar-affordance {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-premium);
}

.profile-avatar-affordance i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}

.profile-avatar-control:hover .profile-avatar-affordance,
.profile-avatar-control:focus-visible .profile-avatar-affordance,
.profile-avatar-control[aria-expanded="true"] .profile-avatar-affordance {
  opacity: 1;
  transform: translateY(0);
}

.profile-avatar-manage {
  position: absolute;
  right: -8px;
  bottom: -8px;
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  box-sizing: border-box;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 90%, var(--text) 10%);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  color: var(--text);
  cursor: pointer;
}

.profile-avatar-manage:hover {
  border-color: color-mix(in srgb, var(--mint) 55%, var(--line-strong));
  background: color-mix(in srgb, var(--mint) 14%, var(--panel));
  color: var(--text);
}

.profile-avatar-manage:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 0 5px 14px rgba(0, 0, 0, 0.24);
}

.profile-avatar-manage svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-photo-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  display: grid;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(0.98);
  transform-origin: top left;
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-premium);
}

.profile-photo-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.profile-photo-menu button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.profile-photo-menu button:hover,
.profile-photo-menu button:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.profile-edit-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.profile-edit-row > label,
.admin-modal-field {
  display: grid;
  flex: 1;
  gap: 7px;
  min-width: 0;
}

.profile-edit-row label > span,
.admin-modal-field > span,
.admin-filter-bar label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.profile-edit-row input,
.admin-modal-field input,
.admin-modal-field select,
.admin-filter-bar input,
.admin-filter-bar select {
  width: 100%;
  height: var(--control-height-compact);
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}

.profile-edit-row input[readonly] {
  color: var(--soft);
  cursor: default;
}

.security-guidance {
  max-width: 680px;
  font-size: 12px;
  line-height: 1.55;
}

.session-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.session-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(360px, 2fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.session-row > div:first-child strong,
.session-row > div:first-child span {
  display: block;
}

.session-row > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.session-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.session-row dt,
.session-row dd {
  margin: 0;
}

.session-row dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.session-row dd {
  margin-top: 4px;
  font-size: 12px;
}

.admin-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-page-actions,
.admin-subsection-title,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-summary-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(125px, 1fr));
  gap: 9px;
}

.admin-summary-grid > div {
  display: grid;
  gap: 5px;
  min-height: 66px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.admin-summary-grid span {
  color: var(--muted);
  font-size: 11px;
}

.admin-summary-grid strong {
  font-size: 20px;
}

.admin-primary-actions,
.inline-actions,
.permission-module-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(140px, 0.75fr));
  gap: 10px;
  padding-block: 2px 10px;
}

.admin-filter-bar.without-mfa {
  grid-template-columns: minmax(230px, 1.5fr) repeat(2, minmax(140px, 0.75fr));
}

.admin-filter-bar label {
  display: grid;
  gap: 6px;
}

.security-event-filters {
  grid-template-columns: minmax(220px, 1.35fr) repeat(5, minmax(120px, 0.75fr)) repeat(2, minmax(118px, 0.65fr));
  min-width: 0;
}

.security-event-filters > label {
  min-width: 0;
}

.security-event-filters label > span {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.security-event-filters .active-admin-filter select {
  border-color: color-mix(in srgb, var(--mint) 64%, var(--line-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 13%, transparent);
}

.active-admin-filter [data-clear-security-target] {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  color: var(--mint);
  cursor: pointer;
}

.admin-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-size: 12px;
}

.admin-table-wrap th,
.admin-table-wrap td {
  height: 48px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table-wrap th {
  height: 40px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table-wrap tbody tr {
  cursor: pointer;
  transition: background var(--motion-hover);
}

.admin-table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}

.admin-table-wrap tbody tr.selected {
  background: color-mix(in srgb, var(--mint) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--mint);
}

.admin-invite-table td:first-child strong,
.admin-invite-table td:first-child small {
  display: block;
}

.admin-invite-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
}

.admin-identity-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.admin-identity-cell > .actor-avatar,
.admin-identity-cell > .account-security-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
}

.admin-identity-cell span,
.admin-identity-cell strong,
.admin-identity-cell small {
  min-width: 0;
}

.admin-identity-cell strong,
.admin-identity-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-identity-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.admin-status,
.permission-risk {
  display: inline-grid;
  width: max-content;
  height: 24px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.admin-status.success {
  border-color: color-mix(in srgb, #8fbc8f 48%, var(--line));
  background: color-mix(in srgb, #8fbc8f 10%, var(--panel-2));
  color: #8fbc8f;
}

.admin-status.warning {
  border-color: color-mix(in srgb, var(--amber) 48%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--panel-2));
  color: var(--amber);
}

.admin-status.danger,
.permission-risk.destructive {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--panel-2));
  color: color-mix(in srgb, var(--red) 76%, #d29a9d);
}

.admin-loading,
.admin-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.admin-subsection-title {
  margin-top: 8px;
}

.admin-invitations-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-invitations-title .secondary-button {
  flex: 0 0 auto;
}

.invite-validity {
  color: var(--soft);
  white-space: nowrap;
}

.invite-validity.expired {
  color: var(--red);
}

.admin-invite-actions {
  flex-wrap: nowrap;
}

.admin-subsection-title p,
.section-title p {
  margin-top: 4px;
  font-size: 12px;
}

.admin-panel-scrim {
  position: fixed;
  z-index: 165;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
  animation: modalScrimIn var(--motion-fast) var(--ease-standard) both;
}

.admin-detail-panel {
  --admin-drawer-section-gap: 10px;
  --admin-drawer-row-gap: 8px;
  --admin-drawer-control-gap: 8px;
  position: fixed;
  z-index: 166;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: -20px 0 55px rgba(0, 0, 0, 0.35);
  animation: adminPanelIn var(--motion-normal) var(--ease-premium) both;
}

@keyframes adminPanelIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.admin-detail-panel > header,
.admin-detail-panel > nav,
.admin-detail-panel > section,
.admin-detail-panel > footer {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-detail-panel > section {
  display: grid;
  align-content: start;
  gap: var(--admin-drawer-section-gap);
}

.admin-detail-tabs {
  display: flex;
  gap: 6px;
  padding-block: 10px !important;
}

.admin-detail-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.admin-detail-tabs button:hover,
.admin-detail-tabs button.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--mint) 8%, var(--panel-2));
  color: var(--text);
}

.admin-panel-event-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.admin-panel-event-list > button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-panel-event-list > button:first-child {
  border-top: 0;
}

.admin-panel-event-list > button:hover,
.admin-panel-event-list > button.selected {
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}

.admin-panel-event-list strong,
.admin-panel-event-list small {
  display: block;
}

.admin-panel-event-list small,
.admin-panel-event-list em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.admin-panel-event-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-detail-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-detail-panel > header > div > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.admin-detail-panel > header h2 {
  margin-top: 4px;
  font-size: 17px;
}

.admin-detail-identity .admin-identity-cell {
  margin-bottom: 16px;
}

.admin-identity-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.admin-identity-header .account-security-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.admin-identity-header .admin-status {
  align-self: center;
  justify-self: end;
}

.admin-identity-header > div > strong,
.admin-identity-header > div > span,
.admin-identity-header > div > small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-identity-header > div > span,
.admin-identity-header > div > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-section-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--admin-drawer-control-gap);
  margin-top: 0;
}

.admin-detail-panel > section .admin-section-actions > button,
.admin-detail-panel > section > button {
  width: 100%;
  justify-content: center;
}

.admin-detail-panel > section > .secondary-button,
.admin-detail-panel > section > .danger-button {
  margin-top: 0;
}

.admin-action-help {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.admin-lifecycle-actions {
  display: grid;
  gap: var(--admin-drawer-control-gap);
  margin-top: 0;
}

.admin-action-pause {
  border-color: color-mix(in srgb, #d6a343 42%, var(--line)) !important;
  color: #d6a343 !important;
}

.admin-action-reactivate {
  border-color: color-mix(in srgb, #8fbc8f 48%, var(--line)) !important;
  color: #8fbc8f !important;
}

.admin-lifecycle-actions h3,
.admin-lifecycle-actions .admin-action-help {
  margin-bottom: 0;
}

.admin-detail-panel > section h3 {
  margin: 0;
  font-size: 13px;
}

.admin-detail-panel > section dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--admin-drawer-row-gap);
  margin: 0;
}

.admin-detail-panel > footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-bottom: 0;
}

.admin-session-list {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-permission-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.admin-permission-summary-list > span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft);
  font-size: 9px;
}

.admin-permission-summary-list small {
  color: var(--muted);
  font-size: 8px;
}

.admin-permission-summary-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.admin-session-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-session-list strong,
.admin-session-list small {
  display: block;
}

.admin-session-list small {
  margin-top: 3px;
  color: var(--muted);
}

.danger-text {
  color: var(--red);
}

.admin-management-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.invitation-history-modal {
  width: min(1060px, calc(100vw - 32px));
}

.invitation-history-body {
  display: grid;
  gap: 14px;
}

.invitation-history-filters {
  grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(140px, 1fr));
  padding-block: 0;
}

.invitation-history-filters input,
.invitation-history-filters select {
  width: 100%;
  min-width: 0;
  height: var(--control-height-compact);
}

.invitation-history-table-wrap {
  max-height: min(52vh, 520px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.invitation-history-table-wrap table {
  min-width: 900px;
}

.invitation-history-table-wrap thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}

@media (max-width: 1050px) {
  .invitation-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-invitations-title {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .invitation-history-filters {
    grid-template-columns: 1fr;
  }
}

.admin-management-modal .result-modal-head,
.admin-management-modal .result-modal-actions {
  flex: 0 0 auto;
}

.admin-modal-body {
  min-height: 0;
  margin: 16px -4px 0;
  padding: 0 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.add-member-modal-body {
  margin-top: 16px;
}

.add-member-field .admin-validation-message:empty {
  display: none;
}

.add-member-button {
  min-height: var(--control-height-compact);
}

.page-members > .page-header .page-actions > .primary-button,
.page-members > .page-header .page-actions > .secondary-button {
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  align-self: center;
}

.delete-member-modal-body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.delete-member-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.delete-member-name span {
  color: var(--muted);
  font-size: 12px;
}

.delete-member-blockers {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--text);
}

.delete-member-blockers strong {
  color: var(--danger);
}

.delete-member-blockers ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.delete-member-blockers li + li {
  margin-top: 5px;
}

@media (max-width: 760px) {
  .member-profile-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.admin-access-modal-body {
  scrollbar-gutter: stable;
}

.admin-management-modal .result-modal-actions {
  position: relative;
  z-index: 1;
  margin: 16px -16px -16px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.admin-access-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.admin-access-overview > div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--panel);
}

.admin-access-overview span,
.admin-access-overview strong {
  display: block;
}

.admin-access-overview span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.admin-access-overview strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-events-context {
  display: flex;
  align-items: center;
  gap: 12px;
}

.security-events-context p {
  color: var(--muted);
  font-size: 12px;
}

.security-events-context strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .admin-access-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.admin-identity-form {
  align-items: start;
}

.admin-inline-error {
  color: var(--red) !important;
}

.admin-modal-field.has-error input,
.profile-field-editor input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--red) 76%, var(--line-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 12%, transparent);
}

.admin-validation-message {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.admin-validation-message.error {
  color: var(--red);
}

.admin-validation-message.available {
  color: #68d69c;
}

.admin-validation-message.pending {
  color: var(--soft);
}

.profile-identity-grid {
  align-items: stretch;
  grid-auto-rows: auto;
}

.profile-management-page .profile-identity-grid > .profile-grid-cell {
  position: relative;
  display: grid;
  min-height: 76px;
  align-content: center;
  padding: 14px 16px;
  box-sizing: border-box;
  transition: min-height var(--motion-hover), background var(--motion-hover);
}

.profile-management-page .profile-identity-grid > .profile-grid-cell:nth-child(odd),
.profile-management-page .profile-identity-grid > .profile-grid-cell:nth-child(even) {
  padding: 14px 16px;
}

.profile-management-page .profile-identity-grid > .profile-grid-cell:nth-child(even) {
  border-left: 1px solid var(--line);
}

.profile-identity-row dd,
.profile-readonly-cell dd {
  display: flex;
  min-height: 24px;
  align-items: center;
  margin-top: 4px;
}

.profile-identity-row dt,
.profile-readonly-cell dt {
  line-height: 16px;
}

.profile-identity-row:not(.editing) dd {
  padding-right: 38px;
}

.profile-identity-row .card-edit-button {
  position: absolute;
  top: 50%;
  right: 16px;
  flex: 0 0 28px;
  transform: translateY(-50%);
}

.profile-identity-row .card-edit-button:hover,
.profile-identity-row .card-edit-button:focus-visible {
  transform: translateY(-50%);
}

.profile-identity-row.editing dd {
  display: block;
}

.profile-field-editor {
  display: grid;
  gap: 7px;
}

.profile-editor-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.profile-field-editor input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  box-sizing: border-box;
}

.profile-field-editor .inline-actions {
  flex: 0 0 auto;
  margin-top: 0;
}

.profile-field-editor .inline-actions button {
  min-width: 68px;
  height: 36px;
  min-height: 36px;
  padding-block: 0;
  box-sizing: border-box;
}

.profile-field-editor .admin-validation-message,
.profile-field-editor .admin-inline-error {
  min-height: 0;
  margin: 0;
}

.profile-field-editor .admin-validation-message:empty,
.profile-field-editor .admin-inline-error:empty {
  display: none;
}

.admin-validation-message.current {
  color: var(--muted);
}

.admin-password-policy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.admin-password-policy li::before {
  content: "○";
  display: inline-block;
  width: 16px;
  color: var(--muted);
}

.admin-password-policy li.met {
  color: #8fbc8f;
}

.admin-password-policy li.met::before {
  content: "✓";
  color: #8fbc8f;
}

.admin-setup-method {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.admin-setup-method legend {
  grid-column: 1 / -1;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.admin-setup-method label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.admin-setup-method label:has(input:checked) {
  border-color: color-mix(in srgb, var(--mint) 52%, var(--line));
  background: color-mix(in srgb, var(--mint) 8%, var(--panel-2));
}

.admin-custom-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.admin-custom-access-row strong,
.admin-custom-access-row span {
  display: block;
}

.admin-custom-access-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.admin-modal-grid .admin-modal-field:last-child {
  grid-column: 1 / -1;
}

.admin-modal-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.permission-editor {
  display: grid;
  gap: 12px;
  margin-top: 17px;
}

.permission-module {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.permission-module > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 12px;
  background: var(--panel-2);
}

.permission-module-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition:
    background-color 180ms var(--ease-standard),
    color 160ms var(--ease-standard),
    box-shadow 180ms var(--ease-standard);
}

.permission-module-toggle:hover {
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}

.permission-module-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-soft);
}

.permission-module-toggle > span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.permission-module-toggle strong,
.permission-module-toggle small {
  display: block;
}

.permission-module-toggle small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.permission-module h3 {
  font-size: 12px;
}

.permission-module header span {
  color: var(--muted);
  font-size: 10px;
}

.permission-module-actions .text-button {
  font-size: 10px;
}

.permission-list {
  display: grid;
}

.permission-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.permission-row:first-child {
  border-top: 0;
}

.permission-row input {
  position: absolute;
  opacity: 0;
}

.permission-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.permission-row input:checked + .permission-check {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 25%, var(--panel));
}

.permission-row input:checked + .permission-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
  transform: translateY(-1px) rotate(-45deg);
}

.permission-row input:focus-visible + .permission-check {
  box-shadow: var(--focus-ring);
}

.permission-copy strong,
.permission-copy small {
  display: block;
}

.permission-copy strong {
  font-size: 11px;
  font-weight: 720;
}

.permission-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.permission-risk {
  min-height: 21px;
  color: var(--amber);
  font-size: 9px;
}

.permission-change-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.permission-change-summary > div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--panel);
}

.permission-change-summary span,
.permission-change-summary strong,
.permission-change-summary small {
  display: block;
}

.permission-change-summary span {
  color: var(--muted);
  font-size: 10px;
}

.permission-change-summary strong {
  margin-top: 4px;
  font-size: 12px;
}

.permission-change-summary small {
  min-height: 14px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-change-summary p {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: var(--panel);
  font-size: 11px;
}

.admin-sensitive-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 8%, var(--panel));
}

.admin-sensitive-warning strong {
  font-size: 11px;
}

.admin-sensitive-warning span {
  color: var(--muted);
  font-size: 10px;
}

.admin-sensitive-warning.is-placeholder {
  visibility: hidden;
}

.admin-form-error {
  margin-top: 12px;
  color: var(--red);
  font-size: 11px;
}

.copy-once-link {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.copy-once-link span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.copy-once-link code {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.5;
}

.security-events-table tbody tr {
  cursor: pointer;
}

.security-events-workspace {
  height: calc(100dvh - 148px);
  min-height: 440px;
  grid-template-rows: auto minmax(0, 1fr);
}

.security-events-table-shell {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.security-events-table-shell table {
  min-width: 980px;
}

.security-events-table-shell thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}

.security-event-metadata {
  max-height: 330px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--soft);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Opaque sticky data surfaces prevent scrolled content from bleeding through. */
.page-dashboard .operations-table th,
.members-table th,
.ops-table th,
.deleted-members-table thead th,
.invitation-history-table-wrap thead th,
.security-events-table-shell thead th,
.account-head,
.date-cell,
.matrix-head .sticky-date {
  background: var(--sticky-header-bg);
  background-image: none;
}

table.resizable-table thead th.resizable-header {
  background-color: var(--sticky-header-bg);
  background-image: none;
}

.agenda-month-separator,
.history-detail-toolbar,
.layout-confirmation {
  background: var(--sticky-cell-bg);
  background-image: none;
}

.page-dashboard .operations-table th:first-child,
.page-dashboard .operations-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--sticky-cell-bg);
  background-image: none;
}

.page-dashboard .operations-table th:first-child {
  z-index: 4;
  background: var(--sticky-header-bg);
}

.page-dashboard .operations-table td:first-child {
  z-index: 1;
}

.page-dashboard .operations-table tbody tr:hover td:first-child {
  background: color-mix(in srgb, var(--mint) 4%, var(--sticky-cell-bg));
}

.page-dashboard .operations-table tbody tr.summary-linked,
.page-dashboard .operations-table tbody tr.dashboard-row-focus {
  background: none;
  box-shadow: none;
}

.page-dashboard .operations-table tbody tr.summary-linked > td,
.page-dashboard .operations-table tbody tr.dashboard-row-focus > td {
  background: color-mix(in srgb, var(--mint) 7%, var(--sticky-cell-bg));
  background-image: none;
  box-shadow: none;
}

.page-dashboard .operations-table tbody tr.summary-linked > td.account-cell,
.page-dashboard .operations-table tbody tr.dashboard-row-focus > td.account-cell {
  border-bottom-color: color-mix(in srgb, var(--mint) 7%, var(--sticky-cell-bg));
}

.page-dashboard .account-cell {
  cursor: pointer;
  transition:
    background-color 200ms var(--ease-premium),
    color 180ms var(--ease-premium);
}

.page-dashboard .operations-table tbody tr td.account-cell:hover {
  background: color-mix(in srgb, var(--mint) 12%, var(--sticky-cell-bg));
}

.page-dashboard .operations-table tbody tr.summary-linked > td.account-cell:hover,
.page-dashboard .operations-table tbody tr.dashboard-row-focus > td.account-cell:hover {
  border-bottom-color: color-mix(in srgb, var(--mint) 12%, var(--sticky-cell-bg));
}

.page-dashboard .account-cell .record-account-link,
.page-dashboard .account-cell .record-account-link:hover,
.page-dashboard .account-cell .record-account-link:focus-visible {
  margin: 0;
  padding: 0;
  background: transparent;
}

.page-dashboard .account-cell:hover .record-account-link {
  color: color-mix(in srgb, var(--text) 84%, var(--mint));
}

.pair-select-wrap .omg-dropdown,
.pair-select-wrap .omg-dropdown-trigger {
  width: 100%;
  min-width: 0;
}

.record-account-link {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  margin: -2px -4px;
  padding: 2px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  text-align: left;
  transition:
    background-color var(--field-background-duration) var(--ease-premium),
    color var(--field-color-duration) var(--ease-premium),
    box-shadow var(--field-border-duration) var(--ease-premium);
}

.record-account-link:hover {
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  color: color-mix(in srgb, var(--text) 84%, var(--mint));
}

.record-account-link:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  box-shadow: var(--focus-ring-soft);
}

.omg-dropdown-trigger:not(:disabled):active,
.permission-module-toggle:not(:disabled):active,
.reset-history-toggle:not(:disabled):active,
.finance-ledger-summary:not(:disabled):active,
.finance-ledger-toggle:not(:disabled):active,
.finance-history-toggle:not(:disabled):active {
  transform: none;
}

.operations-table tbody tr,
.ops-table tbody tr,
.members-table tbody tr,
.admin-table-wrap tbody tr,
.finance-sheet-section tr[data-finance-edit] {
  transition-duration: 170ms;
  transition-timing-function: var(--ease-standard);
}

.permission-module-toggle > .omg-chevron {
  align-self: center;
  color: var(--muted);
}

.reset-history-toggle > .omg-chevron,
.finance-ledger-summary .omg-chevron,
.finance-history-toggle > .omg-chevron {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  transform: rotate(0deg);
}

.reset-history-toggle > .omg-chevron.is-open,
.finance-ledger-summary .omg-chevron.is-open,
.finance-history-toggle > .omg-chevron.is-open {
  transform: rotate(180deg);
}

.reset-history-toggle > .omg-chevron::before,
.finance-ledger-summary .omg-chevron::before,
.finance-history-toggle > .omg-chevron::before {
  display: none;
}

@media (max-width: 1400px) {
  .security-event-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .admin-page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-primary-actions {
    justify-content: flex-end;
  }

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

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

  .security-event-filters .admin-search {
    grid-column: 1 / -1;
  }

  .security-event-filters .security-target-filter {
    grid-column: 1 / -1;
  }

  .session-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .admin-summary-grid,
  .admin-filter-bar,
  .security-event-filters,
  .admin-modal-grid,
  .account-security-list,
  .permission-change-summary,
  .session-row dl {
    grid-template-columns: 1fr;
  }

  .security-event-filters .admin-search,
  .security-event-filters .security-target-filter {
    grid-column: auto;
  }

  .security-events-workspace {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
  }

  .security-events-table-shell {
    max-height: none;
  }

  .admin-management-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

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

  .admin-custom-access-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-security-list:not(.profile-identity-grid) > div:nth-child(odd),
  .account-security-list:not(.profile-identity-grid) > div:nth-child(even) {
    padding-inline: 0;
    border-left: 0;
  }

  .profile-management-page .profile-identity-grid > .profile-grid-cell:nth-child(even) {
    border-left: 0;
  }

  .profile-edit-row,
  .permission-module > header,
  .admin-sensitive-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-editor-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .profile-editor-controls input {
    flex-basis: 100%;
  }

  .profile-field-editor .inline-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .admin-primary-actions,
  .permission-module-actions {
    flex-wrap: wrap;
  }

  .permission-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .permission-risk {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 640px) {
  .page-header {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 10px;
  }

  .page-header-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .page-header-actions .member-search-control {
    width: min(300px, 100%);
    max-width: 300px;
  }

  .agenda-toolbar-actions .member-search-control {
    flex-basis: 130px;
  }
}
