    .modal-shell[hidden] {
      display: none;
    }
    .modal-shell {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      padding: 18px;
    }
    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(8px);
    }
    .modal-card {
      position: relative;
      width: min(920px, calc(100vw - 24px));
      max-height: min(82vh, 920px);
      overflow: auto;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
      border: 1px solid rgba(255, 255, 255, 0.58);
      border-radius: 28px;
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
      padding: 22px;
    }
    .modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }
    .modal-kicker {
      font-size: 11px;
      color: var(--accent-strong);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .modal-title {
      margin: 0;
      font-size: clamp(24px, 3vw, 32px);
      line-height: 1.1;
    }
    .modal-meta {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
      margin-bottom: 16px;
    }
    .history-list {
      display: grid;
      align-content: start;
      gap: 4px;
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 2px 0 8px;
      scrollbar-width: thin;
      scrollbar-color: rgba(31, 122, 90, 0.26) transparent;
    }
    .history-list::-webkit-scrollbar {
      width: 8px;
    }
    .history-list::-webkit-scrollbar-thumb {
      background: rgba(31, 122, 90, 0.22);
      border-radius: 999px;
    }
    .history-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      min-height: 50px;
      border: 1px solid transparent;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.50);
      position: relative;
      overflow: hidden;
      transition: background 120ms ease, border-color 120ms ease;
    }
    .history-item:hover {
      background: rgba(255, 255, 255, 0.92);
      border-color: rgba(31, 122, 90, 0.10);
    }
    .history-item.is-active {
      background: rgba(31, 122, 90, 0.08);
      border-color: rgba(31, 122, 90, 0.12);
    }
    .history-item.is-active::before {
      content: "";
      position: absolute;
      left: 0;
      top: 8px;
      bottom: 8px;
      width: 3px;
      border-radius: 999px;
      background: var(--accent);
    }
    .history-item-main {
      border: 0;
      background: transparent;
      width: 100%;
      min-width: 0;
      min-height: 50px;
      padding: 7px 8px 7px 12px;
      text-align: left;
      cursor: pointer;
      color: inherit;
      font: inherit;
      display: grid;
      align-content: center;
      gap: 2px;
    }
    .history-item-delete {
      border: 0;
      background: transparent;
      color: #667085;
      width: 28px;
      height: 28px;
      margin-right: 6px;
      border-radius: 8px;
      font-size: 16px;
      line-height: 1;
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
    }
    .history-item:hover .history-item-delete,
    .history-item:focus-within .history-item-delete {
      opacity: 1;
      pointer-events: auto;
    }
    .history-item-delete:hover {
      background: rgba(180, 35, 24, 0.08);
      color: #b42318;
    }
    .history-item-title {
      font-size: 13px;
      font-weight: 600;
      color: #1f2a24;
      line-height: 1.35;
      margin-bottom: 0;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
    .history-item-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
      opacity: 0;
      max-height: 0;
      overflow: hidden;
      transition: opacity 120ms ease, max-height 120ms ease;
    }
    .history-item:hover .history-item-meta,
    .history-item:focus-within .history-item-meta {
      opacity: 1;
      max-height: 16px;
    }
    .history-item-preview {
      display: none;
    }
    .history-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 10px;
    }
    .history-title {
      font-size: 15px;
      font-weight: 780;
      color: #102018;
      margin-bottom: 4px;
    }
    .history-meta-line {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .history-preview {
      color: #344054;
      font-size: 13px;
      line-height: 1.7;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
    .history-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .history-action-btn {
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 13px;
    }
    .history-action-danger {
      color: #b42318;
      border-color: rgba(180, 35, 24, 0.18);
      background: rgba(180, 35, 24, 0.04);
    }
    .history-empty {
      border: 1px dashed var(--line);
      border-radius: 18px;
      padding: 18px;
      background: rgba(255, 255, 255, 0.72);
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
      text-align: center;
    }
    .membership-toolbar {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 16px;
    }
    .auth-panel {
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 16px;
      background: rgba(255, 255, 255, 0.88);
      box-shadow: var(--shadow);
      margin-bottom: 16px;
      display: grid;
      gap: 12px;
    }
    .auth-modal-card {
      width: min(520px, calc(100vw - 24px));
    }
    .auth-modal-card .auth-panel {
      margin-bottom: 0;
      border-radius: 18px;
      box-shadow: none;
    }
    .auth-mode-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
      padding: 4px;
      border: 1px solid rgba(31, 122, 90, 0.12);
      border-radius: 16px;
      background: rgba(246, 250, 247, 0.92);
    }
    .auth-mode-tab {
      border: 0;
      border-radius: 12px;
      padding: 9px 12px;
      color: #426154;
      background: transparent;
      font: inherit;
      font-size: 13px;
      font-weight: 780;
      cursor: pointer;
    }
    .auth-mode-tab.is-active {
      color: #ffffff;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: 0 8px 18px rgba(31, 122, 90, 0.16);
    }
    .auth-modal-card .auth-login-form,
    .auth-modal-card .auth-register-form {
      grid-template-columns: 1fr;
      padding: 12px;
      border: 1px solid rgba(31, 122, 90, 0.10);
      border-radius: 18px;
      background: rgba(248, 252, 250, 0.78);
    }
    .auth-modal-card .auth-actions {
      gap: 10px;
      flex-wrap: wrap;
    }
    #auth-request-code {
      transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
    }
    #auth-request-code.is-loading,
    #auth-request-code.is-sent {
      border-color: rgba(31, 122, 90, 0.34);
      background: rgba(31, 122, 90, 0.08);
      box-shadow: 0 0 0 4px rgba(31, 122, 90, 0.10), 0 12px 26px rgba(31, 122, 90, 0.18);
      color: var(--accent-strong);
      transform: translateY(-1px);
      opacity: 1;
    }
    #auth-request-code.is-loading::after {
      content: "";
      display: inline-block;
      width: 7px;
      height: 7px;
      margin-left: 8px;
      border-radius: 999px;
      background: currentColor;
      animation: auth-code-pulse 820ms ease-in-out infinite;
      vertical-align: middle;
    }
    @keyframes auth-code-pulse {
      0%, 100% {
        opacity: 0.35;
        transform: scale(0.8);
      }
      50% {
        opacity: 1;
        transform: scale(1.25);
      }
    }
    .auth-step-label {
      color: var(--accent-strong);
      font-size: 12px;
      font-weight: 820;
      letter-spacing: 0.04em;
    }
    .auth-divider {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--muted);
      font-size: 12px;
      margin: 2px 0;
    }
    .auth-divider::before,
    .auth-divider::after {
      content: "";
      height: 1px;
      flex: 1;
      background: var(--line);
    }
    .auth-note {
      margin-top: 12px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.7;
      text-align: center;
    }
    .account-modal-card {
      width: min(640px, calc(100vw - 24px));
    }
    .account-panel-head {
      display: flex;
      align-items: center;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: rgba(255,255,255,0.78);
      margin-bottom: 14px;
    }
    .account-panel-avatar {
      width: 54px;
      height: 54px;
      border: 0;
      border-radius: 18px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      color: white;
      font-size: 20px;
      font-weight: 850;
      background-color: var(--accent);
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      background-repeat: no-repeat;
      cursor: pointer;
      transition: transform 140ms ease, box-shadow 140ms ease;
    }
    .account-panel-avatar:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(15,23,42,0.16);
    }
    .account-panel-email {
      color: var(--ink);
      font-size: 15px;
      font-weight: 780;
      word-break: break-all;
    }
    .account-panel-status {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .account-avatar-change {
      margin-top: 6px;
      border: 0;
      padding: 0;
      background: transparent;
      color: var(--accent-strong);
      font: inherit;
      font-size: 12px;
      font-weight: 760;
      cursor: pointer;
    }
    .account-avatar-change:hover {
      text-decoration: underline;
    }
    .account-settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 14px;
    }
    .account-field {
      display: grid;
      gap: 6px;
    }
    .account-field-wide {
      grid-column: 1 / -1;
    }
    .account-field-label {
      color: #344054;
      font-size: 13px;
      font-weight: 680;
    }
    .account-plan-card {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(246,250,247,0.86));
      margin-bottom: 14px;
    }
    .account-plan-card-label {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .account-plan-card-value {
      color: var(--ink);
      font-size: 14px;
      font-weight: 760;
      line-height: 1.5;
      word-break: break-word;
    }
    .account-device-card {
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: rgba(255,255,255,0.82);
      margin-bottom: 14px;
    }
    .account-device-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 10px;
    }
    .account-device-title {
      color: var(--ink);
      font-size: 14px;
      font-weight: 780;
      line-height: 1.5;
    }
    .account-device-note,
    .account-device-empty,
    .account-device-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }
    .account-device-refresh {
      padding: 7px 10px;
      font-size: 12px;
    }
    .account-device-list {
      display: grid;
      gap: 8px;
    }
    .account-device-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid rgba(31,122,90,0.12);
      border-radius: 16px;
      padding: 10px;
      background: linear-gradient(180deg, rgba(247,250,248,0.92), rgba(255,255,255,0.86));
    }
    .account-device-name {
      color: var(--ink);
      font-size: 13px;
      font-weight: 760;
      line-height: 1.5;
    }
    .account-device-pill {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      padding: 2px 8px;
      border-radius: 999px;
      color: var(--accent-strong);
      background: rgba(31,122,90,0.08);
      font-size: 11px;
      font-weight: 760;
    }
    .account-device-remove {
      flex: 0 0 auto;
      border-color: rgba(180,35,24,0.18);
      color: #b42318;
      background: rgba(180,35,24,0.04);
      padding: 7px 10px;
      font-size: 12px;
    }
    .account-panel-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }
    .account-logout-btn {
      color: #b42318;
      border-color: rgba(180,35,24,0.18);
      background: rgba(180,35,24,0.04);
    }
    .auth-head {
      display: grid;
      gap: 4px;
    }
    .auth-title {
      font-size: 15px;
      font-weight: 700;
    }
    .auth-subtitle {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .auth-subtitle.is-error {
      color: #a33a2a;
      font-weight: 700;
    }
    .auth-form {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
    }
    .auth-input {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 11px 12px;
      font: inherit;
      color: var(--ink);
      background: white;
      outline: none;
    }
    .auth-input:focus {
      border-color: rgba(31, 122, 90, 0.35);
      box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.12);
    }
    .auth-input:disabled {
      color: #98a2b3;
      background: rgba(248, 250, 252, 0.92);
    }
    .auth-panel .ghost-btn:disabled,
    .auth-panel .send-btn:disabled {
      cursor: not-allowed;
      opacity: 0.58;
    }
    .auth-panel .send-btn.is-loading {
      box-shadow: 0 0 0 4px rgba(31, 122, 90, 0.10), 0 12px 26px rgba(31, 122, 90, 0.22);
    }
    .auth-actions {
      display: flex;
      align-items: center;
    }
    .auth-dev-code {
      border-radius: 14px;
      padding: 10px 12px;
      background: rgba(31, 122, 90, 0.08);
      color: var(--accent-strong);
      font-size: 13px;
      line-height: 1.6;
    }
