
@layer components {
  .svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .page-masthead {
    display: grid;
    min-height: 164px;
    align-items: end;
    gap: clamp(24px, 3.2vw, 54px);
    padding: 12px 0 24px;
    grid-template-columns: minmax(220px, 0.72fr) minmax(330px, 1.28fr) minmax(150px, 0.42fr);
    border-bottom: 1px solid var(--line);
  }

  .page-masthead::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    width: clamp(70px, 9vw, 140px);
    height: 1px;
    background: var(--accent);
    content: "";
    opacity: 0.72;
  }

  .page-masthead--sacred {
    min-height: 180px;
    padding-top: 20px;
  }

  .masthead-art {
    min-width: 0;
    align-self: end;
  }

  .hero-signature {
    display: block;
    width: min(100%, 310px);
    height: auto;
    overflow: visible;
  }

  .signature-line,
  .signature-guide {
    fill: none;
    vector-effect: non-scaling-stroke;
  }

  .signature-line {
    stroke: var(--text-2);
    stroke-width: 1.15;
    stroke-linecap: square;
    stroke-linejoin: round;
  }

  .signature-line--flourish {
    stroke: var(--accent);
    stroke-width: 0.85;
    opacity: 0.82;
  }

  .signature-line--flower {
    stroke: var(--accent);
    stroke-width: 1;
  }

  .signature-guide {
    stroke: var(--line-strong);
    stroke-width: 0.7;
    stroke-dasharray: 2 6;
  }

  .page-masthead--sacred .signature-line {
    stroke: var(--accent);
    stroke-linecap: round;
  }

  .page-masthead--sacred .signature-line--main {
    filter: drop-shadow(0 5px 8px rgba(var(--accent-rgb), 0.14));
  }

  .page-masthead--sacred .signature-line--flourish {
    stroke: var(--accent-secondary);
  }

  .signature-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -4px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
    letter-spacing: 0.16em;
  }

  .signature-caption b {
    color: var(--text-2);
    font-size: inherit;
    font-weight: 480;
  }

  .masthead-copy {
    min-width: 0;
    padding-left: clamp(18px, 2vw, 30px);
    border-left: 1px solid var(--line);
  }

  .masthead-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 9px;
  }

  .masthead-title > span {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
    letter-spacing: 0.16em;
    white-space: nowrap;
  }

  .page-masthead--sacred .masthead-title h1 {
    font-family: var(--font-sacred);
    font-size: clamp(30px, 2.4vw, 40px);
    font-weight: 520;
    letter-spacing: -0.035em;
  }

  .page-whisper {
    max-width: 610px;
    margin-top: 7px;
    color: var(--text-3);
    font-size: 10px;
    letter-spacing: 0.02em;
  }

  .page-masthead--sacred .page-whisper {
    font-family: var(--font-sacred);
  }

  .ambient-layer {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.13;
    mask-image: radial-gradient(circle at 75% 20%, #000 0, transparent 68%);
    transition: opacity 500ms ease;
  }

  html[data-skin="aletheia"] .ambient-grid {
    background-size: 96px 96px;
    opacity: 0.25;
    mask-image: radial-gradient(ellipse at 70% 10%, #000 0, transparent 72%);
  }

  .ambient-glow {
    position: absolute;
    top: -40vh;
    right: -18vw;
    width: 70vw;
    height: 90vh;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08), transparent 68%);
    filter: blur(20px);
    transition: background 600ms ease;
  }

  html[data-skin="aletheia"] .ambient-glow {
    top: -20vh;
    right: -5vw;
    background:
      radial-gradient(circle at 35% 55%, rgba(184, 218, 238, 0.5), transparent 30%),
      radial-gradient(circle at 70% 25%, rgba(209, 186, 220, 0.28), transparent 38%);
    filter: blur(42px);
  }

  .ambient-thread {
    position: absolute;
    width: 42vw;
    height: 42vw;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 45% 55% 60% 40%;
    opacity: 0;
    transform: rotate(18deg);
    transition: opacity 600ms ease;
  }

  html[data-skin="aletheia"] .ambient-thread {
    opacity: 0.8;
  }

  .ambient-thread--one {
    top: -18vw;
    right: -10vw;
  }

  .ambient-thread--two {
    right: 8vw;
    bottom: -34vw;
    transform: rotate(-28deg) scale(1.3);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
  }

  .brand__mark {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 1.6;
    transition: transform 500ms var(--ease-ceremonial), stroke 400ms ease;
  }

  .brand:hover .brand__mark {
    transform: rotate(7deg);
  }

  .brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
  }

  .brand__text b {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: 0.11em;
  }

  .brand__text small {
    margin-top: 5px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    letter-spacing: 0.22em;
  }

  .sidebar__index {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 46px 10px 13px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .sidebar__index b {
    font-size: 10px;
    font-weight: 500;
  }

  .primary-nav {
    display: grid;
    gap: 5px;
  }

  .nav-item {
    position: relative;
    display: grid;
    min-height: 62px;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    grid-template-columns: 28px 1fr auto;
    border: 1px solid transparent;
    color: var(--text-2);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
  }

  .nav-item::before {
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: -1px;
    width: 2px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: scaleY(0.25);
    transition: opacity 180ms ease, transform 240ms var(--ease-mechanical);
  }

  .nav-item:hover {
    background: rgba(var(--accent-rgb), 0.04);
    color: var(--text-1);
    transform: translateX(2px);
  }

  .nav-item.is-active {
    border-color: var(--line);
    background: rgba(var(--accent-rgb), 0.075);
    color: var(--text-1);
  }

  .nav-item.is-active::before {
    opacity: 1;
    transform: scaleY(1);
  }

  .nav-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 1.45;
  }

  .nav-item span {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
  }

  .nav-item span b {
    font-size: 13px;
    font-weight: 560;
    letter-spacing: 0.04em;
  }

  .nav-item span small,
  .nav-item > i {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
    font-style: normal;
    letter-spacing: 0.17em;
  }

  .nav-item span small {
    margin-top: 3px;
  }

  .nav-item > i {
    align-self: start;
    margin-top: 4px;
  }

  .sidebar__foot {
    display: grid;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 18px 8px 0;
    grid-template-columns: 28px 1fr auto;
    border-top: 1px solid var(--line);
  }

  .system-beacon {
    position: relative;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
  }

  .system-beacon::before {
    position: absolute;
    inset: 4px;
    border: 1px solid var(--line);
    border-radius: inherit;
    content: "";
  }

  .system-beacon span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--status-success);
    box-shadow: 0 0 10px var(--status-success);
  }

  .sidebar__foot p {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
  }

  .sidebar__foot p b {
    font-size: 10px;
    font-weight: 550;
  }

  .sidebar__foot p small {
    margin-top: 3px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.12em;
  }

  .sidebar__version {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
  }

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .breadcrumb i {
    color: var(--line-strong);
    font-style: normal;
  }

  .breadcrumb b {
    color: var(--text-1);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 520;
    letter-spacing: 0.06em;
  }

  .topbar__right {
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .command-button,
  .network-pill,
  .profile-chip,
  .icon-button {
    background: transparent;
  }

  .command-button {
    display: flex;
    min-width: 226px;
    height: 38px;
    align-items: center;
    gap: 9px;
    padding: 0 9px 0 12px;
    border: 1px solid var(--line);
    color: var(--text-3);
    cursor: pointer;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
  }

  .command-button:hover {
    border-color: var(--line-strong);
    background: rgba(var(--accent-rgb), 0.035);
    color: var(--text-1);
  }

  .command-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  .command-button span {
    margin-right: auto;
    font-size: 11px;
  }

  kbd {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    font-weight: 400;
    box-shadow: 0 1px 0 var(--line-strong);
  }

  .network-pill {
    display: flex;
    height: 38px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--line);
    font-family: var(--font-data);
  }

  .network-pill > span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--glow);
  }

  .network-pill.is-error > span {
    background: var(--status-danger);
    box-shadow: 0 0 8px rgba(227, 75, 87, 0.4);
  }

  .network-pill b {
    font-size: 10px;
    font-weight: 550;
  }

  .network-pill small {
    color: var(--text-3);
    font-size: 7px;
  }

  .profile-chip {
    display: flex;
    height: 44px;
    align-items: center;
    gap: 9px;
    padding: 3px 0 3px 8px;
    cursor: pointer;
  }

  .profile-chip__avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line-strong);
    background-image: linear-gradient(145deg, rgba(var(--accent-rgb), 0.16), transparent);
    font-family: var(--font-data);
    font-size: 10px;
    clip-path: polygon(0 0, 72% 0, 100% 28%, 100% 100%, 0 100%);
  }

  .profile-chip > span:not(.profile-chip__avatar) {
    display: flex;
    min-width: 72px;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
  }

  .profile-chip b {
    font-size: 11px;
    font-weight: 580;
  }

  .profile-chip small {
    margin-top: 3px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.08em;
  }

  .profile-chip svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: var(--text-3);
    stroke-width: 1.3;
  }

  .profile-menu {
    position: absolute;
    z-index: 12;
    top: calc(100% + 10px);
    right: var(--page-gutter);
    width: min(288px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--surface-1) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
  }

  .profile-menu::before {
    position: absolute;
    top: -1px;
    right: 0;
    width: 74px;
    height: 1px;
    background: var(--accent);
    content: "";
  }

  .profile-menu__identity {
    display: grid;
    align-items: center;
    gap: 11px;
    padding: 8px 8px 14px;
    grid-template-columns: 38px 1fr;
    border-bottom: 1px solid var(--line);
  }

  .profile-menu__identity > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line-strong);
    background-color: rgba(var(--accent-rgb), 0.08);
    font-family: var(--font-data);
    font-size: 10px;
  }

  .profile-menu__identity p {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.35;
  }

  .profile-menu__identity b {
    font-size: 12px;
    font-weight: 560;
  }

  .profile-menu__identity small {
    overflow: hidden;
    margin-top: 3px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-menu__meta {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: var(--text-3);
    font-size: 9px;
  }

  .profile-menu__meta b {
    color: var(--text-2);
    font-family: var(--font-data);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.1em;
  }

  .profile-menu > button {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    padding: 0 9px;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    font-size: 10px;
    cursor: pointer;
  }

  .profile-menu > button:hover {
    background: rgba(var(--accent-rgb), 0.06);
    color: var(--text-1);
  }

  .menu-button {
    display: none;
  }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 9px;
    letter-spacing: 0.2em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .eyebrow::after {
    width: 46px;
    height: 1px;
    background: var(--line-strong);
    content: "";
  }

  .eyebrow span {
    color: var(--accent);
  }

  .time-block {
    position: relative;
    display: grid;
    min-width: 180px;
    justify-items: end;
    padding: 7px 0 4px 30px;
    border-left: 1px solid var(--line);
  }

  .time-block::before,
  .time-block::after {
    position: absolute;
    left: -3px;
    width: 5px;
    height: 1px;
    background: var(--line-strong);
    content: "";
  }

  .time-block::before {
    top: 0;
  }

  .time-block::after {
    bottom: 0;
  }

  .time-block span,
  .time-block small {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
    letter-spacing: 0.18em;
  }

  .time-block b {
    margin: 3px 0;
    font-family: var(--font-data);
    font-size: 22px;
    font-weight: 420;
    letter-spacing: 0.06em;
  }

  .panel {
    position: relative;
    border: 1px solid var(--line);
    background:
      linear-gradient(135deg, rgba(var(--accent-rgb), 0.025), transparent 35%),
      var(--surface-glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    transition: border-color 220ms ease, background 500ms ease, box-shadow 500ms ease, transform 220ms var(--ease-mechanical);
  }

  .panel::before,
  .panel::after {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: var(--line-strong);
    content: "";
    pointer-events: none;
  }

  .panel::before {
    top: -1px;
    left: -1px;
    border-top: 1px solid;
    border-left: 1px solid;
  }

  .panel::after {
    right: -1px;
    bottom: -1px;
    border-right: 1px solid;
    border-bottom: 1px solid;
  }

  .panel:hover {
    border-color: var(--line-strong);
  }

  html[data-skin="aletheia"] .panel {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(var(--accent-rgb), 0.018)),
      var(--surface-glass);
    box-shadow: 0 16px 48px rgba(61, 81, 101, 0.09);
  }

  html[data-skin="aletheia"] .panel::before,
  html[data-skin="aletheia"] .panel::after {
    opacity: 0.34;
  }

  .panel-tag {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .panel-tag span {
    color: var(--accent);
  }

  .panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  .panel-heading h2 {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 540;
    letter-spacing: -0.02em;
  }

  .live-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 7px;
    letter-spacing: 0.14em;
  }

  .live-label i,
  .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--status-success);
    box-shadow: 0 0 9px var(--status-success);
  }

  .status-dot--cool {
    background: var(--scan);
    box-shadow: 0 0 9px var(--scan);
  }

  .copy-button,
  .text-action,
  .secondary-button,
  .danger-button,
  .primary-button {
    cursor: pointer;
  }

  .copy-button {
    min-width: 58px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    font-size: 10px;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
  }

  .copy-button:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
    color: var(--text-1);
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 42px;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 560;
    letter-spacing: 0.04em;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  }

  .primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: var(--accent);
    color: var(--accent-ink);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  }

  .primary-button:hover {
    transform: translateY(-2px);
  }

  .secondary-button,
  .danger-button {
    border: 1px solid var(--line);
    background: transparent;
  }

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

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

  .danger-button:hover {
    border-color: var(--status-danger);
    background: rgba(227, 75, 87, 0.06);
  }

  .filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .filter-group button {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
  }

  .filter-group button:hover {
    color: var(--text-1);
  }

  .filter-group button.is-active {
    border-color: var(--line);
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-1);
  }

  .search-field {
    display: flex;
    height: 44px;
    min-width: min(390px, 36vw);
    align-items: center;
    gap: 11px;
    padding: 0 14px;
    border-right: 1px solid var(--line);
  }

  .search-field svg,
  .compact-search svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-3);
    stroke-width: 1.5;
  }

  .search-field input,
  .compact-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-1);
    font-size: 12px;
  }

  .search-field input::placeholder,
  .compact-search input::placeholder {
    color: var(--text-3);
  }

  .empty-state {
    display: grid;
    min-height: 340px;
    place-items: center;
    align-content: center;
    text-align: center;
  }

  .empty-state h2 {
    margin-top: 24px;
    font-family: var(--font-sacred);
    font-size: 22px;
    font-weight: 500;
  }

  .empty-state p {
    margin-top: 8px;
    color: var(--text-2);
  }

  .flower-glyph {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
  }

  .flower-glyph i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 30px;
    border: 1px solid var(--accent);
    border-radius: 60% 40% 60% 40%;
    transform-origin: 0 0;
  }

  .flower-glyph i:nth-child(1) { transform: rotate(0deg) translate(1px, -14px); }
  .flower-glyph i:nth-child(2) { transform: rotate(90deg) translate(1px, -14px); }
  .flower-glyph i:nth-child(3) { transform: rotate(180deg) translate(1px, -14px); }
  .flower-glyph i:nth-child(4) { transform: rotate(270deg) translate(1px, -14px); }

  .command-palette,
  .modal {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: start center;
    padding: min(16vh, 150px) 20px 20px;
  }

  .palette-backdrop,
  .modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 8, 0.74);
    backdrop-filter: blur(12px);
    cursor: default;
  }

  .palette-dialog {
    position: relative;
    width: min(680px, 100%);
    border: 1px solid var(--line-strong);
    background: var(--surface-1);
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.45);
  }

  .palette-search {
    display: grid;
    min-height: 70px;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    grid-template-columns: 22px auto 1fr auto;
    border-bottom: 1px solid var(--line);
  }

  .palette-search svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--text-3);
    stroke-width: 1.5;
  }

  .palette-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .palette-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
  }

  .palette-results {
    max-height: 420px;
    overflow: auto;
    padding: 8px;
  }

  .palette-item {
    display: grid;
    width: 100%;
    min-height: 54px;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    grid-template-columns: 32px 1fr auto;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }

  .palette-item:hover,
  .palette-item.is-selected {
    background: rgba(var(--accent-rgb), 0.08);
  }

  .palette-item__icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--accent);
    font-family: var(--font-data);
    font-size: 8px;
  }

  .palette-item span:not(.palette-item__icon) {
    display: flex;
    flex-direction: column;
  }

  .palette-item b {
    font-size: 12px;
    font-weight: 560;
  }

  .palette-item small {
    color: var(--text-3);
    font-size: 9px;
  }

  .palette-item > em {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 8px;
    font-style: normal;
  }

  .palette-foot {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 0 14px;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 9px;
  }

  .palette-foot kbd {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    margin-right: 3px;
  }

  .modal {
    place-items: center;
    padding-top: 20px;
  }

  .modal__dialog {
    position: relative;
    width: min(520px, 100%);
    padding: 42px;
    border: 1px solid var(--line-strong);
    background: var(--surface-1);
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.45);
  }

  .modal__dialog::before {
    position: absolute;
    top: -1px;
    left: 0;
    width: 86px;
    height: 2px;
    background: var(--accent);
    content: "";
  }

  .modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-3);
    font-size: 22px;
    cursor: pointer;
  }

  .modal__index {
    color: var(--accent);
    font-family: var(--font-data);
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .modal__dialog h2 {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 550;
    line-height: 1.25;
  }

  .modal__dialog p {
    margin: 18px 0 28px;
    color: var(--text-2);
    font-size: 13px;
  }

  .toast-region {
    position: fixed;
    z-index: 300;
    right: 24px;
    bottom: 24px;
    display: grid;
    width: min(360px, calc(100vw - 48px));
    gap: 10px;
  }

  .toast {
    display: grid;
    min-height: 58px;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    grid-template-columns: 24px 1fr;
    border: 1px solid var(--line-strong);
    background: var(--surface-1);
    box-shadow: var(--shadow);
    animation: toast-in 300ms var(--ease-ceremonial) both;
  }

  .toast i {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--status-success);
    border-radius: 50%;
    color: var(--status-success);
    font-size: 10px;
    font-style: normal;
  }

  .toast.is-error {
    border-color: color-mix(in srgb, var(--status-danger) 44%, var(--line));
  }

  .toast.is-error i {
    border-color: var(--status-danger);
    color: var(--status-danger);
  }

  .toast b {
    font-size: 11px;
    font-weight: 550;
  }

  .toast p {
    color: var(--text-3);
    font-size: 9px;
  }

  /* 身份入口以缀合、折面和未闭合边界构成，避免落回居中的矩形登录卡片。 */
  body.identity-visible {
    overflow-x: hidden;
  }

  body.identity-visible .skip-link {
    display: none;
  }

  .identity-gate {
    position: relative;
    z-index: 3;
    isolation: isolate;
    display: grid;
    min-height: 100svh;
    overflow: hidden;
    padding: clamp(34px, 4vw, 66px) clamp(30px, 5.6vw, 90px) 78px clamp(58px, 7vw, 118px);
    column-gap: clamp(26px, 4vw, 72px);
    grid-template-columns: minmax(350px, 0.88fr) minmax(500px, 1.12fr);
    background:
      linear-gradient(104deg, rgba(255, 255, 255, 0.54) 0 31%, transparent 31.1%),
      var(--canvas);
  }

  .identity-gate::before {
    position: absolute;
    z-index: -3;
    top: -9vh;
    right: -5vw;
    width: min(61vw, 940px);
    height: 112vh;
    background: rgba(250, 252, 253, 0.48);
    clip-path: polygon(20% 0, 100% 0, 100% 88%, 82% 100%, 9% 91%, 0 26%);
    content: "";
  }

  .identity-gate::after {
    position: absolute;
    z-index: -2;
    right: -8vw;
    bottom: -19vh;
    width: min(56vw, 820px);
    aspect-ratio: 1.4;
    background:
      repeating-linear-gradient(90deg, transparent 0 37px, rgba(65, 83, 101, 0.055) 37px 38px),
      repeating-linear-gradient(0deg, transparent 0 37px, rgba(65, 83, 101, 0.055) 37px 38px);
    clip-path: polygon(4% 23%, 76% 0, 100% 38%, 84% 100%, 18% 91%);
    content: "";
    transform: rotate(-7deg);
  }

  .identity-gate__rail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 22px;
    display: flex;
    width: 18px;
    align-items: center;
    gap: 14px;
    flex-direction: column;
    padding: 34px 0;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.18em;
    writing-mode: vertical-rl;
  }

  .identity-gate__rail i {
    width: 1px;
    flex: 1;
    background: var(--line);
  }

  .identity-gate__rail b {
    color: var(--accent);
    font-weight: 500;
  }

  .identity-gate__art {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0 18px;
  }

  .identity-art__signature {
    position: relative;
    z-index: 2;
    width: min(100%, 346px);
  }

  .identity-art__signature::after {
    position: absolute;
    right: -28px;
    bottom: 8px;
    width: 54%;
    height: 1px;
    background: var(--line-strong);
    content: "";
  }

  .identity-art__signature > span {
    display: block;
    margin: 6px 0 0 11px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.2em;
  }

  .identity-signature {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .identity-signature .signature-line {
    stroke: var(--accent);
    stroke-linecap: round;
  }

  .identity-signature .signature-line--flourish,
  .identity-signature .signature-line--flower {
    stroke: var(--accent-secondary);
  }

  .identity-signature .signature-guide {
    stroke: var(--line-strong);
  }

  .identity-geometry {
    position: relative;
    left: clamp(-72px, -4.5vw, -28px);
    width: clamp(390px, 37vw, 610px);
    max-height: 62vh;
    margin-top: clamp(-8px, -1vh, 2px);
    overflow: visible;
  }

  .identity-geometry path {
    vector-effect: non-scaling-stroke;
  }

  .identity-geometry__plane {
    fill: rgba(250, 252, 253, 0.28);
    stroke: var(--line-strong);
  }

  .identity-geometry__fold,
  .identity-geometry__axis {
    fill: none;
    stroke: var(--line);
  }

  .identity-geometry__axis {
    stroke-dasharray: 2 13;
  }

  .identity-geometry__thread {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.25;
  }

  .identity-geometry__thread--fine {
    stroke: var(--accent-secondary);
    stroke-dasharray: 1 7;
  }

  .identity-geometry__stitch {
    fill: none;
    stroke: var(--text-3);
    stroke-dasharray: 2 5;
  }

  .identity-geometry__petal {
    fill: rgba(var(--accent-rgb), 0.055);
    stroke: var(--accent);
    stroke-width: 1.15;
  }

  .identity-geometry__petal--echo {
    fill: none;
    stroke: var(--accent-secondary);
  }

  .identity-geometry__nodes path {
    fill: var(--surface-1);
    stroke: var(--accent);
  }

  .identity-geometry text {
    color: var(--text-3);
    fill: currentColor;
    font-family: var(--font-data);
    font-size: 8px;
    letter-spacing: 0.16em;
  }

  .identity-art__note {
    position: absolute;
    z-index: 2;
    bottom: 5%;
    left: 8px;
    display: grid;
    align-items: start;
    gap: 11px 14px;
    grid-template-columns: 28px 1fr;
  }

  .identity-art__note i {
    width: 28px;
    height: 9px;
    margin-top: 4px;
    border-top: 1px solid var(--accent);
    border-left: 1px solid var(--accent);
    transform: skewX(-28deg);
  }

  .identity-art__note p,
  .identity-art__note span {
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.19em;
    line-height: 1.75;
  }

  .identity-art__note span {
    grid-column: 2;
    color: var(--accent);
  }

  .identity-gate__content {
    position: relative;
    display: grid;
    min-width: 0;
    align-items: center;
    justify-items: end;
  }

  .identity-card {
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: min(100%, 600px);
    padding: clamp(40px, 4.2vw, 58px) clamp(36px, 4vw, 58px) clamp(36px, 3.7vw, 50px) clamp(54px, 5vw, 76px);
  }

  .identity-card::before,
  .identity-card::after {
    position: absolute;
    z-index: -2;
    content: "";
    pointer-events: none;
  }

  .identity-card::before {
    inset: 24px -34px -22px 30px;
    background: rgba(168, 200, 228, 0.2);
    clip-path: polygon(7% 0, 94% 5%, 100% 81%, 88% 100%, 0 94%, 3% 19%);
  }

  .identity-card::after {
    z-index: -1;
    inset: 0;
    background: rgba(250, 252, 253, 0.8);
    backdrop-filter: blur(22px) saturate(0.94);
    clip-path: polygon(0 7%, 8% 0, 93% 0, 100% 12%, 97% 87%, 88% 100%, 5% 96%, 0 78%);
    box-shadow: 0 34px 90px rgba(75, 94, 112, 0.12);
  }

  .identity-card__scaffold {
    position: absolute;
    z-index: 3;
    inset: 0;
    pointer-events: none;
  }

  .identity-card__scaffold span,
  .identity-card__scaffold i {
    position: absolute;
    display: block;
  }

  .identity-card__scaffold span:nth-child(1) {
    top: 0;
    left: 8%;
    width: 39%;
    border-top: 1px solid var(--accent);
  }

  .identity-card__scaffold span:nth-child(2) {
    top: 12%;
    right: 0;
    height: 37%;
    border-right: 1px solid var(--line-strong);
  }

  .identity-card__scaffold span:nth-child(3) {
    bottom: 2%;
    left: 19%;
    width: 54%;
    border-bottom: 1px solid var(--line-strong);
  }

  .identity-card__scaffold i {
    top: -4px;
    left: 46%;
    width: 8px;
    height: 8px;
    border: 1px solid var(--accent);
    background: var(--surface-1);
    transform: rotate(45deg);
  }

  .identity-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }

  .identity-kicker,
  .identity-card__index {
    color: var(--accent);
    font-family: var(--font-data);
    font-size: 7px;
    letter-spacing: 0.2em;
  }

  .identity-card__head h1,
  .identity-status h1 {
    margin-top: 10px;
    font-family: var(--font-sacred);
    font-size: clamp(28px, 2.4vw, 34px);
    font-weight: 510;
    letter-spacing: -0.035em;
    line-height: 1.2;
  }

  .identity-card__index {
    position: relative;
    display: flex;
    min-width: 64px;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 6px;
    color: var(--text-3);
  }

  .identity-card__index i {
    width: 7px;
    height: 7px;
    border: 1px solid var(--accent);
    transform: rotate(45deg);
  }

  .identity-card__intro {
    max-width: 390px;
    margin-top: 14px;
    color: var(--text-2);
    font-family: var(--font-sacred);
    font-size: 12px;
    line-height: 1.8;
  }

  .identity-mode-switch {
    position: relative;
    display: flex;
    width: min(100%, 390px);
    align-items: flex-end;
    margin-top: 29px;
  }

  .identity-mode-switch::before {
    position: absolute;
    right: 7%;
    bottom: 0;
    left: 5px;
    height: 1px;
    background: var(--line);
    content: "";
  }

  .identity-mode-switch button {
    position: relative;
    min-height: 41px;
    padding: 0 18px 8px 24px;
    background: transparent;
    color: var(--text-3);
    font-size: 11px;
    text-align: left;
    cursor: pointer;
  }

  .identity-mode-switch button:first-child {
    width: 42%;
  }

  .identity-mode-switch button:last-child {
    width: 58%;
    transform: translateY(7px);
  }

  .identity-mode-switch button::before {
    position: absolute;
    bottom: 4px;
    left: 5px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--line-strong);
    background: var(--surface-1);
    content: "";
    transform: rotate(45deg);
    transition: border-color 180ms ease, background 180ms ease;
  }

  .identity-mode-switch button::after {
    position: absolute;
    right: 16px;
    bottom: 0;
    left: 5px;
    height: 1px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: scaleX(0.3);
    transition: opacity 180ms ease, transform 260ms var(--ease-ceremonial);
  }

  .identity-mode-switch button.is-active {
    color: var(--text-1);
  }

  .identity-mode-switch button.is-active::before {
    border-color: var(--accent);
    background: var(--accent);
  }

  .identity-mode-switch button.is-active::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .identity-form {
    display: grid;
    gap: 17px;
    margin-top: 28px;
  }

  .identity-field {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 4px;
    padding-left: 18px;
  }

  .identity-field::before,
  .identity-field::after {
    position: absolute;
    bottom: 0;
    content: "";
    pointer-events: none;
  }

  .identity-field::before {
    left: 4px;
    width: 9px;
    height: 13px;
    border-bottom: 1px solid var(--line-strong);
    border-left: 1px solid var(--line-strong);
    transform: skewX(-24deg);
  }

  .identity-field::after {
    right: 0;
    left: 18px;
    height: 1px;
    background: var(--accent);
    opacity: 0;
    transform: scaleX(0.18);
    transform-origin: left;
    transition: opacity 180ms ease, transform 320ms var(--ease-ceremonial);
  }

  .identity-field:focus-within::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .identity-field label {
    color: var(--text-1);
    font-size: 11px;
    font-weight: 560;
  }

  .identity-field > span {
    position: absolute;
    top: 2px;
    right: 0;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.13em;
  }

  .identity-field input {
    width: 100%;
    height: 43px;
    padding: 0 5px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--text-1);
    font-size: 13px;
    transition: border-color 180ms ease, background 180ms ease;
  }

  .identity-field input:hover {
    border-color: var(--line-strong);
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.035), transparent 72%);
  }

  .identity-field input:focus {
    border-color: transparent;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.055), transparent 72%);
    box-shadow: none;
  }

  .identity-field input[aria-invalid="true"] {
    border-color: color-mix(in srgb, var(--status-danger) 52%, var(--line));
  }

  .identity-field--password input {
    padding-right: 56px;
  }

  .password-toggle {
    position: absolute;
    right: 2px;
    bottom: 6px;
    height: 29px;
    padding: 0 5px;
    background: transparent;
    color: var(--text-3);
    font-size: 9px;
    cursor: pointer;
  }

  .identity-form-error {
    margin-left: 18px;
    padding: 8px 11px 8px 15px;
    border-left: 1px solid var(--status-danger);
    background: linear-gradient(90deg, color-mix(in srgb, var(--status-danger) 7%, transparent), transparent);
    color: #934851;
    font-size: 10px;
    line-height: 1.55;
  }

  .identity-submit {
    position: relative;
    display: flex;
    width: min(68%, 248px);
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    justify-self: end;
    margin-top: 4px;
    padding: 0 24px 0 27px;
    background: var(--accent);
    clip-path: polygon(9px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 0 10px);
    color: var(--accent-ink);
    font-size: 11px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: filter 180ms ease, transform 220ms var(--ease-ceremonial);
  }

  .identity-submit:hover:not(:disabled) {
    filter: saturate(0.86) brightness(0.96);
    transform: translateY(-1px);
  }

  .identity-submit:disabled,
  .identity-form[aria-busy="true"] input,
  .identity-form[aria-busy="true"] textarea,
  .identity-form[aria-busy="true"] .password-toggle {
    cursor: wait;
  }

  .identity-form[aria-busy="true"] .identity-submit i {
    width: 13px;
    height: 13px;
    border: 1px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    font-size: 0;
    animation: identity-spin 700ms linear infinite;
  }

  .identity-form-note {
    position: relative;
    max-width: 390px;
    padding-left: 18px;
    color: var(--text-3);
    font-size: 9px;
    line-height: 1.65;
  }

  .identity-form-note::before {
    position: absolute;
    top: 0.7em;
    left: 0;
    width: 10px;
    border-top: 1px dashed var(--line-strong);
    content: "";
  }

  .identity-form.is-discord-only > :not(.identity-form-note) {
    display: none;
  }

  .identity-form.is-discord-only {
    min-height: 92px;
    align-content: start;
  }

  .identity-status {
    text-align: left;
  }

  .identity-status__mark {
    position: relative;
    display: grid;
    width: 126px;
    height: 112px;
    margin: 32px 0 24px -18px;
    place-items: center;
  }

  .identity-status__mark::after {
    position: absolute;
    right: -74px;
    bottom: 9px;
    width: 88px;
    border-top: 1px solid var(--line);
    content: "";
  }

  .identity-status__mark svg {
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .identity-status__mark path {
    vector-effect: non-scaling-stroke;
  }

  .status-mark__outer,
  .status-mark__inner,
  .status-mark__axis,
  .status-mark__thread {
    fill: none;
  }

  .status-mark__outer { stroke: var(--line-strong); }
  .status-mark__inner { stroke: var(--accent); }
  .status-mark__axis { stroke: var(--line); stroke-dasharray: 2 8; }
  .status-mark__thread { stroke: var(--accent-secondary); }

  .identity-status__mark span {
    position: absolute;
    color: var(--accent);
    font-family: var(--font-sacred);
    font-size: 30px;
  }

  .identity-status > p:not(.identity-form-error) {
    max-width: 410px;
    margin-top: 14px;
    color: var(--text-2);
    font-family: var(--font-sacred);
    font-size: 12px;
    line-height: 1.85;
  }

  .identity-status__meta {
    display: grid;
    gap: 0;
    margin: 30px 0 25px;
    grid-template-columns: 0.8fr 1.45fr 0.85fr;
  }

  .identity-status__meta div {
    display: grid;
    min-width: 0;
    min-height: 50px;
    align-content: center;
    gap: 3px;
    padding: 4px 13px;
    border-left: 1px solid var(--line);
  }

  .identity-status__meta div:nth-child(2) { transform: translateY(8px); }
  .identity-status__meta div:nth-child(3) { transform: translateY(-4px); }

  .identity-status__meta dt {
    color: var(--text-3);
    font-size: 9px;
  }

  .identity-status__meta dd {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    color: var(--text-1);
    font-family: var(--font-data);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .identity-quiet-action {
    min-height: 38px;
    padding: 0 24px 0 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    font-size: 10px;
    cursor: pointer;
  }

  .identity-quiet-action:hover {
    border-color: var(--accent);
    color: var(--text-1);
  }

  .identity-gate__foot {
    position: absolute;
    right: clamp(24px, 5vw, 84px);
    bottom: 26px;
    left: clamp(48px, 6.4vw, 108px);
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-3);
    font-family: var(--font-data);
    font-size: 6px;
    letter-spacing: 0.16em;
  }

  .identity-gate__foot span {
    color: var(--accent);
  }

  .identity-gate__foot p {
    font-family: var(--font-ui);
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .identity-gate__foot b {
    margin-left: auto;
    font-weight: 500;
  }
}
