:root {
  --font-main:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --color-primary: #4a6a88;
  --color-background: #4a6a88;
  --color-surface: #ffffff;
  --color-white: #ffffff;
  --color-white-rgb: 255, 255, 255;
  --color-text: #333333;
  --color-text-muted: #666666;
  --color-text-subtle: #555555;
  --color-border: #e0e0e0;
  --color-success: #1f7a4d;
  --color-danger: #b42318;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.2);
  --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-button: 0 6px 20px rgba(91, 124, 153, 0.4);
  --color-header-text: #ffffff;
  --color-header-rgb: 255, 255, 255;
  --color-hover-surface: rgba(var(--color-white-rgb), 0.6);
  --color-menu-hover-surface: var(--color-hover-surface);
  --color-input-bg: #ffffff;
  --color-sidebar-bg: #3f5f7b;
  --color-sidebar-border: #345066;
  --color-sidebar-text: #f1f5f9;
  --color-sidebar-muted: #c8d4df;
  --color-sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --color-toggle-bg: #e6e9ee;
  --color-toggle-border: #cbd2d9;
  --color-action-primary-bg: var(--color-primary);
  --color-action-primary-text: var(--color-white);
  --color-action-secondary-text: var(--color-primary);
  --color-action-secondary-border: var(--color-border);
  --color-action-secondary-hover-bg: var(--color-sidebar-active-bg);
  --color-action-danger-bg: var(--color-danger);
  --color-action-danger-text: var(--color-white);
  --color-action-danger-border: var(--color-danger);
  --ui-btn-height: 40px;
  --ui-btn-radius: 10px;
  --ui-btn-padding-x: 18px;
  --ui-btn-content-gap: 8px;
  --ui-btn-font-size: 14px;
  --ui-btn-font-weight: 600;
  --ui-btn-focus-width: 3px;
  --ui-btn-focus-offset: 3px;
  --ui-btn-primary-bg: var(--color-action-primary-bg);
  --ui-btn-primary-text: var(--color-action-primary-text);
  --ui-btn-primary-border: transparent;
  --ui-btn-primary-hover-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  --ui-btn-secondary-bg: var(--color-surface);
  --ui-btn-secondary-text: var(--color-action-secondary-text);
  --ui-btn-secondary-border: var(--color-action-secondary-border);
  --ui-btn-secondary-hover-bg: var(--color-action-secondary-hover-bg);
  --ui-btn-danger-border: var(--color-action-danger-border);
  --ui-btn-danger-text: var(--color-danger);
  --ui-btn-danger-hover-bg: var(--color-action-danger-bg);
  --ui-btn-danger-hover-text: var(--color-action-danger-text);
  --settings-control-height: 48px;
  --responsive-shell-max-width: 1440px;
  --responsive-shell-padding-x: clamp(14px, 2vw, 22px);
  --responsive-settings-sidebar-width: clamp(190px, 19vw, 232px);
  --responsive-docs-sidebar-width: clamp(220px, 21vw, 256px);
  --responsive-shell-padding-top: clamp(96px, 10vw, 120px);
  --responsive-shell-padding-bottom: clamp(56px, 7vw, 80px);
  --responsive-shell-gap: clamp(12px, 1.8vw, 24px);
  --responsive-card-padding: clamp(16px, 2vw, 24px);
  --responsive-surface-gap: clamp(8px, 1vw, 12px);
  --responsive-surface-padding: clamp(10px, 1.2vw, 13px);
  --responsive-sticky-top: clamp(84px, 9.4vw, 96px);
  --responsive-motion-fast: 140ms ease;
  --responsive-motion-medium: 180ms ease;
}

:root.theme-switching,
:root.theme-switching * {
  transition: none !important;
}

:root:not([data-theme]) {
  /* Default appearance needs a stronger dropdown hover fill than white-on-white. */
  --color-menu-hover-surface: rgba(74, 106, 136, 0.14);
}

:root[data-theme="minimalist"] {
  --color-primary: #4a6a88;
  --color-background: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-text-muted: #52606d;
  --color-text-subtle: #3e4c59;
  --color-border: #d7dde3;
  --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 12px 24px rgba(15, 23, 42, 0.12);
  --shadow-button: 0 8px 20px rgba(74, 106, 136, 0.25);
  --color-header-text: #1f2933;
  --color-header-rgb: 31, 41, 51;
  --color-hover-surface: rgba(31, 41, 51, 0.08);
  --color-input-bg: #ffffff;
  --color-sidebar-bg: #ffffff;
  --color-sidebar-border: #d7dde3;
  --color-sidebar-text: #1f2933;
  --color-sidebar-muted: #52606d;
  --color-sidebar-active-bg: rgba(31, 41, 51, 0.08);
  --color-toggle-bg: #e6e9ee;
  --color-toggle-border: #cbd2d9;
}

:root[data-theme="dark"] {
  --color-primary: #8aa0b8;
  --color-background: #151a1f;
  --color-surface: #1f2730;
  --color-text: #f5f7fa;
  --color-text-muted: #c6d0db;
  --color-text-subtle: #d1d5db;
  --color-border: #3b4756;
  --color-success: #3dff8a;
  --color-danger: #ff4d4d;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 14px 28px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 10px 24px rgba(0, 0, 0, 0.45);
  --color-header-text: #f5f7fa;
  --color-header-rgb: 245, 247, 250;
  --color-hover-surface: rgba(255, 255, 255, 0.08);
  --color-input-bg: #222c36;
  --color-sidebar-bg: #1b222a;
  --color-sidebar-border: #2a3440;
  --color-sidebar-text: #f5f7fa;
  --color-sidebar-muted: #a0aec0;
  --color-sidebar-active-bg: rgba(255, 255, 255, 0.08);
  --color-toggle-bg: #2b343e;
  --color-toggle-border: #3a4652;
}

:root[data-theme="ocean"] {
  --color-primary: #22c1b4;
  --color-background: #0f2533;
  --color-surface: #163141;
  --color-text: #e8f5f8;
  --color-text-muted: #b9d5df;
  --color-text-subtle: #d9eef4;
  --color-border: #2f5e78;
  --color-success: #4dffda;
  --color-danger: #ff4d5a;
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.35);
  --shadow-button: 0 10px 24px rgba(34, 193, 180, 0.25);
  --color-header-text: #e8f5f8;
  --color-header-rgb: 232, 245, 248;
  --color-hover-surface: rgba(34, 193, 180, 0.18);
  --color-input-bg: #214457;
  --color-sidebar-bg: #112837;
  --color-sidebar-border: #0c1f2b;
  --color-sidebar-text: #e8f5f8;
  --color-sidebar-muted: #98b8c5;
  --color-sidebar-active-bg: rgba(34, 193, 180, 0.22);
  --color-toggle-bg: #1a3546;
  --color-toggle-border: #2b4d63;
}

:root[data-theme="evergreen"] {
  --color-primary: #2e5d4b;
  --color-background: #f5f7f4;
  --color-surface: #ffffff;
  --color-text: #1f2d26;
  --color-text-muted: #4a5a52;
  --color-text-subtle: #2f3f38;
  --color-border: #d9e0db;
  --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 12px 24px rgba(15, 23, 42, 0.12);
  --shadow-button: 0 8px 20px rgba(46, 93, 75, 0.25);
  --color-header-text: #1f2d26;
  --color-header-rgb: 31, 45, 38;
  --color-hover-surface: rgba(31, 45, 38, 0.08);
  --color-input-bg: #ffffff;
  --color-sidebar-bg: #274737;
  --color-sidebar-border: #213c2f;
  --color-sidebar-text: #f5f7f4;
  --color-sidebar-muted: #c7d2cc;
  --color-sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --color-toggle-bg: #e3e8e4;
  --color-toggle-border: #c7d2cc;
}

:root[data-theme="charcoal"] {
  --color-primary: #b97745;
  --color-background: #f4f2ef;
  --color-surface: #ffffff;
  --color-text: #2a2a2a;
  --color-text-muted: #5a5a5a;
  --color-text-subtle: #3a3a3a;
  --color-border: #e2dcd6;
  --shadow-card: 0 12px 30px rgba(28, 25, 23, 0.1);
  --shadow-float: 0 12px 24px rgba(28, 25, 23, 0.16);
  --shadow-button: 0 8px 20px rgba(185, 119, 69, 0.25);
  --color-header-text: #2a2a2a;
  --color-header-rgb: 42, 42, 42;
  --color-hover-surface: rgba(42, 42, 42, 0.08);
  --color-input-bg: #ffffff;
  --color-sidebar-bg: #3c3f44;
  --color-sidebar-border: #32353a;
  --color-sidebar-text: #f4f2ef;
  --color-sidebar-muted: #c9bfb4;
  --color-sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --color-toggle-bg: #e7e1db;
  --color-toggle-border: #d2c8bf;
}

:root[data-theme="navy"] {
  --color-primary: #24446a;
  --color-background: #182535;
  --color-surface: #223349;
  --color-text: #f2f6fb;
  --color-text-muted: #d3ddea;
  --color-text-subtle: #e4edf7;
  --color-border: #3a587a;
  --color-success: #4dffb3;
  --color-danger: #ff5c5c;
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.32);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.28);
  --shadow-button: 0 10px 24px rgba(0, 0, 0, 0.25);
  --color-header-text: #f2f6fb;
  --color-header-rgb: 242, 246, 251;
  --color-hover-surface: rgba(255, 255, 255, 0.1);
  --color-input-bg: #2c4661;
  --color-sidebar-bg: #1d2f45;
  --color-sidebar-border: #16283b;
  --color-sidebar-text: #f2f6fb;
  --color-sidebar-muted: #c7d5e2;
  --color-sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --color-toggle-bg: #2a3f59;
  --color-toggle-border: #3a5270;
}

:root[data-theme="mint"] {
  --color-primary: #2ee6b6;
  --color-background: #21423a;
  --color-surface: #2b4f46;
  --color-text: #f4fffb;
  --color-text-muted: #def5ec;
  --color-text-subtle: #eefbf6;
  --color-border: #4f7f73;
  --color-success: #66ffd6;
  --color-danger: #ff5c5c;
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.22);
  --shadow-float: 0 10px 22px rgba(0, 0, 0, 0.2);
  --shadow-button: 0 10px 24px rgba(46, 230, 182, 0.25);
  --color-header-text: #f4fffb;
  --color-header-rgb: 244, 255, 251;
  --color-hover-surface: rgba(46, 230, 182, 0.18);
  --color-input-bg: #3a655b;
  --color-sidebar-bg: #22413a;
  --color-sidebar-border: #192f2a;
  --color-sidebar-text: #f4fffb;
  --color-sidebar-muted: #c4e4d7;
  --color-sidebar-active-bg: rgba(46, 230, 182, 0.2);
  --color-toggle-bg: #2f544b;
  --color-toggle-border: #3f6b61;
}

:root[data-theme="pinky"] {
  --color-primary: #ff6aa2;
  --color-background: #2b2b2b;
  --color-surface: #313335;
  --color-text: #e6e6e6;
  --color-text-muted: #c4c4c4;
  --color-text-subtle: #dcdcdc;
  --color-border: #4a4e51;
  --color-success: #a7ffbf;
  --color-danger: #ff57a8;
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 10px 24px rgba(0, 0, 0, 0.4);
  --color-header-text: #e6e6e6;
  --color-header-rgb: 230, 230, 230;
  --color-hover-surface: rgba(255, 106, 162, 0.15);
  --color-input-bg: #45494c;
  --color-sidebar-bg: #2f3133;
  --color-sidebar-border: #232526;
  --color-sidebar-text: #e6e6e6;
  --color-sidebar-muted: #a9b7c6;
  --color-sidebar-active-bg: rgba(255, 106, 162, 0.18);
  --color-toggle-bg: #3a3d40;
  --color-toggle-border: #4b4f52;
}

:root[data-theme="purple-neon"] {
  --color-primary: #00f0ff;
  --color-background: #17141f;
  --color-surface: #231b2e;
  --color-text: #f4f1ff;
  --color-text-muted: #c9bde0;
  --color-text-subtle: #e0d5f5;
  --color-border: #3f3255;
  --color-success: #5cffc9;
  --color-danger: #ff3bd1;
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.6);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.5);
  --shadow-button: 0 10px 28px rgba(0, 240, 255, 0.25);
  --color-header-text: #f4f1ff;
  --color-header-rgb: 244, 241, 255;
  --color-hover-surface: rgba(0, 240, 255, 0.14);
  --color-input-bg: #35294b;
  --color-sidebar-bg: #1b1526;
  --color-sidebar-border: #120f1b;
  --color-sidebar-text: #f4f1ff;
  --color-sidebar-muted: #bba9e5;
  --color-sidebar-active-bg: rgba(0, 240, 255, 0.2);
  --color-toggle-bg: #291f3b;
  --color-toggle-border: #3d2a5a;
}

:root[data-theme="ember"] {
  --color-primary: #ff8a3d;
  --color-background: #231d19;
  --color-surface: #2b2420;
  --color-text: #f5ece6;
  --color-text-muted: #d8c3b7;
  --color-text-subtle: #e7dad2;
  --color-border: #4a3d35;
  --color-success: #9bffbf;
  --color-danger: #ff5a4d;
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 10px 24px rgba(0, 0, 0, 0.4);
  --color-header-text: #f5ece6;
  --color-header-rgb: 245, 236, 230;
  --color-hover-surface: rgba(255, 255, 255, 0.08);
  --color-input-bg: #3d322d;
  --color-sidebar-bg: #241e1a;
  --color-sidebar-border: #1c1714;
  --color-sidebar-text: #f5ece6;
  --color-sidebar-muted: #bda79b;
  --color-sidebar-active-bg: rgba(255, 138, 61, 0.18);
  --color-toggle-bg: #2f2723;
  --color-toggle-border: #40352f;
}

:root[data-theme="aurora"] {
  --color-primary: #7ef2c7;
  --color-background: #1a2226;
  --color-surface: #222c31;
  --color-text: #eaf6f4;
  --color-text-muted: #b8d0ca;
  --color-text-subtle: #d4ebe7;
  --color-border: #3a4950;
  --color-success: #6dffd6;
  --color-danger: #ff5c5c;
  --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 10px 24px rgba(0, 0, 0, 0.4);
  --color-header-text: #eaf6f4;
  --color-header-rgb: 234, 246, 244;
  --color-hover-surface: rgba(255, 255, 255, 0.08);
  --color-input-bg: #32424a;
  --color-sidebar-bg: #1e2a30;
  --color-sidebar-border: #162026;
  --color-sidebar-text: #eaf6f4;
  --color-sidebar-muted: #98b7b1;
  --color-sidebar-active-bg: rgba(126, 242, 199, 0.18);
  --color-toggle-bg: #2a353b;
  --color-toggle-border: #3a4a52;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-main);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);

  background: var(--color-background);
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
  padding: 18px 24px 22px;
  border-top: 1px solid rgba(var(--color-header-rgb), 0.24);
  background: rgba(var(--color-header-rgb), 0.06);
  backdrop-filter: blur(4px);
}

.site-footer-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.site-footer-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(var(--color-header-rgb), 0.72);
  text-decoration: none;
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition:
    color 0.16s ease,
    background-color 0.18s ease;
}

.site-footer-link::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: rgba(var(--color-header-rgb), 0.86);
  transform: scaleX(0.35);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}

.site-footer-link:hover {
  background: rgba(var(--color-header-rgb), 0.07);
  color: rgba(var(--color-header-rgb), 0.9);
}

.site-footer-link:hover::after {
  transform: scaleX(1);
  opacity: 0.66;
}

.site-footer-link:focus-visible {
  outline: 3px solid rgba(var(--color-header-rgb), 0.9);
  outline-offset: 3px;
}

.site-footer-copy {
  max-width: 1200px;
  margin: 10px auto 0;
  color: rgba(var(--color-header-rgb), 0.76);
  font-size: 12px;
}

.site-footer-copy code {
  color: inherit;
}

input,
select,
textarea,
button {
  font-family: var(--font-main);
}

.logo {
  position: absolute;
  top: 30px;
  left: 30px;
  color: var(--color-header-text);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.logo:hover {
  opacity: 0.8;
}

.logo:focus-visible {
  outline: 3px solid var(--color-header-text);
  outline-offset: 4px;
}

.dashboard-header-nav {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: calc(100vw - 240px);
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dashboard-header-nav::-webkit-scrollbar {
  display: none;
}

.dashboard-header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(var(--color-header-rgb), 0.76);
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  letter-spacing: 0.015em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.16s ease,
    background-color 0.18s ease;
}

.dashboard-header-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-header-text);
  transform: scaleX(0.35);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}

.dashboard-header-link-has-badge {
  margin-right: 30px;
}

.dashboard-header-link:hover {
  background: transparent;
  color: var(--color-header-text);
}

.dashboard-header-link:hover::after {
  transform: scaleX(1);
  opacity: 0.72;
}

.dashboard-header-link.is-active {
  background: transparent;
  border-color: transparent;
  color: var(--color-header-text);
  font-weight: 550;
  transform: none;
}

.dashboard-header-link.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}

.dashboard-header-link.is-active:hover {
  background: transparent;
  transform: none;
}

.dashboard-header-link:focus-visible {
  outline: 3px solid rgba(var(--color-header-rgb), 0.9);
  outline-offset: 2px;
}

.communication-nav-badge {
  position: absolute;
  left: calc(100% - 4px);
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b42318;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.account-menu {
  position: absolute;
  top: 30px;
  right: 30px;
}

.account-menu summary {
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-trigger {
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  line-height: 0;
  vertical-align: top;
  cursor: pointer;
}

.account-trigger::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  background-image: url("https://img.icons8.com/?size=100&id=26141&format=png&color=FFFFFF");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 2;
}

.account-trigger::before {
  content: none;
}

.account-menu[open] .account-trigger::after {
  background-image: url("https://img.icons8.com/?size=100&id=26140&format=png&color=FFFFFF");
}

.account-trigger:focus-visible {
  outline: 3px solid var(--color-header-text);
  outline-offset: 4px;
}

.account-avatar {
  --account-avatar-rgb: 74, 106, 136;
  --account-avatar-initials-color: #ffffff;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.account-avatar-trigger {
  --account-avatar-offset-scale: 0.3548387097;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(var(--color-header-rgb), 0.45);
  color: var(--color-header-text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.account-trigger:hover .account-avatar-trigger {
  transform: translateY(-1px);
  border-color: rgba(var(--color-header-rgb), 0.7);
}

.account-avatar-menu {
  --account-avatar-offset-scale: 0.2741935484;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.account-avatar-gradient {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.24) 0%,
      rgba(255, 255, 255, 0.05) 42%,
      rgba(255, 255, 255, 0) 64%
    ),
    linear-gradient(
      135deg,
      rgba(var(--account-avatar-rgb), 0.06) 0%,
      rgba(var(--account-avatar-rgb), 0.32) 42%,
      rgba(var(--account-avatar-rgb), 0.72) 100%
    );
}

.account-avatar-gradient.account-avatar-trigger,
.account-avatar-gradient.account-avatar-menu {
  border-color: rgba(var(--account-avatar-rgb), 0.2);
}

.account-avatar-solid {
  background: rgba(var(--account-avatar-rgb), 0.95);
}

.account-avatar-solid.account-avatar-trigger,
.account-avatar-solid.account-avatar-menu {
  border-color: rgba(var(--account-avatar-rgb), 0.55);
}

.account-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: translate(
      calc(
        var(--account-avatar-offset-x, 0px) *
          var(--account-avatar-offset-scale, 1)
      ),
      calc(
        var(--account-avatar-offset-y, 0px) *
          var(--account-avatar-offset-scale, 1)
      )
    )
    scale(var(--account-avatar-zoom, 1));
  transform-origin: center;
}

.account-avatar-initials {
  font-size: 14px;
  font-weight: 700;
  color: var(--account-avatar-initials-color);
  letter-spacing: 0.2px;
  line-height: 1;
  text-transform: uppercase;
}

.account-avatar-menu .account-avatar-initials {
  font-size: 12px;
}

.account-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px;
}

.account-dropdown-identity {
  min-width: 0;
}

.account-dropdown-username {
  margin: 0;
  transform: translateY(4px);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-name {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-divider {
  border-top: 1px solid var(--color-border);
  margin: 0 0 4px;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--color-border);
  padding: 10px 0;
  max-height: min(calc(100vh - 96px), 760px);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 20;
}

.account-menu[open] .account-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.account-link {
  display: block;
  padding: 10px 16px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.account-link:hover {
  background: var(--color-menu-hover-surface);
}

@media (max-width: 560px) {
  .dashboard-header-nav {
    top: 20px;
    max-width: calc(100vw - 160px);
    gap: 1px;
    padding: 0;
  }

  .dashboard-header-link {
    min-height: 28px;
    padding: 0 11px;
    font-size: 12px;
  }

  .dashboard-header-link::after {
    left: 8px;
    right: 8px;
    bottom: 0px;
  }

  .dashboard-header-link-has-badge {
    margin-right: 26px;
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--color-surface);
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-float);
}

.skip-link:focus {
  left: 20px;
  z-index: 10;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: var(--color-surface);
  padding: 50px 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
}

h1 {
  font-size: 28px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 600;
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
  margin-top: -15px;
  margin-bottom: 20px;
}

.auth-invite-copy {
  margin-top: -8px;
  line-height: 1.5;
}

.auth-invite-roles {
  display: block;
  margin: 8px 0;
  color: var(--color-text-subtle);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.signup-step.is-hidden {
  display: none;
}

.signup-step-one-copy.is-hidden {
  display: none;
}

.signup-step-actions {
  margin-top: 6px;
}

.signup-step-actions .link-button {
  margin-top: 0;
}

.signup-step-top-nav {
  text-align: left;
  margin: 0;
}

.signup-step-back-link {
  margin-top: 0;
}

.signup-auth-box {
  position: relative;
}

.signup-auth-box .signup-step-top-nav {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  color: var(--color-text-subtle);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-help {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.form-help-inline {
  margin-top: 8px;
}

.form-help p {
  margin-bottom: 6px;
  font-weight: 600;
}

.form-help ul {
  margin: 0;
  padding-left: 18px;
}

.form-help li {
  margin-bottom: 4px;
  line-height: 1.4;
}

.rule-list {
  list-style: disc;
}

.rule-item {
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.rule-item.is-valid {
  color: var(--color-success);
}

.rule-item.is-invalid {
  color: var(--color-danger);
}

.form-error {
  margin-top: 8px;
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 600;
}

.form-error-centered {
  text-align: center;
  width: 100%;
  display: block;
  margin: -6px 0 16px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s;
  font-family: inherit;
  background: var(--color-input-bg);
  color: var(--color-text);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 46px;
  cursor: pointer;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.password-wrapper input {
  padding-right: 60px;
}

:is(input, textarea)::placeholder {
  color: var(--color-text-muted);
  opacity: 0.5;
}

:is(
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea
):focus {
  outline: none;
  border-color: var(--color-primary);
}

.checkbox-group {
  margin-bottom: 20px;
}

.forgot-link {
  text-align: right;
  margin: -6px 0 10px;
}

.text-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.forgot-link .text-link {
  font-size: 13px;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.status-message {
  position: fixed;
  top: calc(92px + (var(--status-toast-index, 0) * 70px));
  right: 20px;
  z-index: 48;
  width: min(420px, calc(100vw - 40px));
  margin: 0;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid
    color-mix(in srgb, var(--color-success) 45%, var(--color-border) 55%);
  background: color-mix(
    in srgb,
    var(--color-success) 14%,
    var(--color-surface) 86%
  );
  box-shadow: var(--shadow-float);
  color: var(--color-success);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.status-message[hidden] {
  display: none;
}

.status-message.is-error {
  border-color: color-mix(
    in srgb,
    var(--color-danger) 50%,
    var(--color-border) 50%
  );
  background: color-mix(
    in srgb,
    var(--color-danger) 12%,
    var(--color-surface) 88%
  );
  color: var(--color-danger);
  pointer-events: auto;
}

.status-message.is-dismissing {
  opacity: 0;
  transform: translateY(-6px);
}

@media (max-width: 560px) {
  .status-message {
    top: calc(84px + (var(--status-toast-index, 0) * 76px));
    right: 12px;
    width: calc(100vw - 24px);
  }
}

.resend-form {
  display: flex;
  justify-content: center;
  margin: 6px 0 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-subtle);
  font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  background: transparent;
  border: none;
  box-shadow: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  line-height: 0;
  padding: 0;
  margin: 0;
  width: 40px;
  height: 38px;
  display: grid;
  place-items: center;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toggle-password:hover,
.toggle-password:active {
  opacity: 1;
  transform: translateY(-50%);
  box-shadow: none;
}

.toggle-password-icon {
  width: 40px;
  height: 40px;
  display: block;
  pointer-events: none;
  object-fit: contain;
}

.btn {
  width: 100%;
  min-height: var(--ui-btn-height);
  background: var(--ui-btn-primary-bg);
  color: var(--ui-btn-primary-text);
  border: 1px solid var(--ui-btn-primary-border);
  padding: 0 var(--ui-btn-padding-x);
  border-radius: var(--ui-btn-radius);
  font-size: var(--ui-btn-font-size);
  font-weight: var(--ui-btn-font-weight);
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ui-btn-content-gap);
  text-decoration: none;
  line-height: 1.2;
}

.btn:hover {
  box-shadow: var(--ui-btn-primary-hover-shadow);
}

.btn:active {
  transform: none;
}

.btn:focus-visible {
  outline: var(--ui-btn-focus-width) solid var(--color-primary);
  outline-offset: var(--ui-btn-focus-offset);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: transparent;
}

.btn--secondary {
  background: var(--ui-btn-secondary-bg);
  color: var(--ui-btn-secondary-text);
  border-color: var(--ui-btn-secondary-border);
  box-shadow: none;
}

.btn--secondary:hover,
.btn--secondary:active {
  transform: none;
  box-shadow: none;
  background: var(--ui-btn-secondary-hover-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--danger {
  background: var(--ui-btn-secondary-bg);
  color: var(--ui-btn-danger-text);
  border-color: var(--ui-btn-danger-border);
}

.btn--danger:hover,
.btn--danger:active {
  background: var(--ui-btn-danger-hover-bg);
  color: var(--ui-btn-danger-hover-text);
  border-color: var(--ui-btn-danger-border);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.link-button:hover {
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.link-button:active {
  transform: none;
}

.link-button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
}

@media (max-width: 760px) {
  .site-footer {
    padding: 16px 16px 20px;
  }

  .site-footer-nav {
    gap: 8px;
  }

  .site-footer-link {
    font-size: 12px;
    min-height: 28px;
    padding: 0 9px;
  }
}
