
      :root {
        color-scheme: light;
        --bg: #f3f5f8;
        --surface: #ffffff;
        --text: #213547;
        --muted: #84909f;
        --line: #edf0f3;
        --line-strong: #d9dfe7;
        --blue: #2f74ff;
        --blue-hover: #1f63e7;
        --green: #0f8f6b;
        --green-hover: #0b7658;
        --danger: #c14945;
        --ok: #157f55;
        --shadow: 0 18px 45px rgba(26, 36, 52, 0.12);
      }

      * { box-sizing: border-box; }

      body {
        margin: 0;
        min-height: 100vh;
        background: var(--bg);
        color: var(--text);
        font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
        letter-spacing: 0;
      }

      .web-auth-screen {
        min-height: 100vh;
        display: grid;
        grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
        background: #f3f6fa;
      }

      .web-auth-screen[hidden] { display: none; }

      .web-auth-brand {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 54px clamp(32px, 6vw, 86px);
        color: #e8eef8;
        background: #14253d;
      }

      .web-auth-brand-mark {
        display: flex;
        align-items: center;
        gap: 14px;
      }

      .web-auth-brand-mark span {
        width: 46px;
        height: 46px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        color: #fff;
        background: #4d73ef;
        font-size: 22px;
      }

      .web-auth-brand-mark strong,
      .web-auth-brand-mark small { display: block; }

      .web-auth-brand-mark strong { font-size: 19px; }

      .web-auth-brand-mark small {
        margin-top: 4px;
        color: #8fa3be;
        font-size: 10px;
      }

      .web-auth-brand-copy {
        max-width: 460px;
        padding: 48px 0;
      }

      .web-auth-brand-copy h1 {
        margin: 0 0 18px;
        color: #fff;
        font-size: 40px;
        line-height: 1.2;
      }

      .web-auth-brand-copy p {
        margin: 0;
        color: #aebdd1;
        font-size: 15px;
        line-height: 1.8;
      }

      .web-auth-brand-foot {
        color: #6f85a1;
        font-size: 12px;
      }

      .web-auth-workspace {
        min-height: 100vh;
        display: grid;
        place-items: center;
        padding: 32px;
      }

      .web-auth-panel {
        width: min(100%, 420px);
        padding: 34px;
        border: 1px solid #dce3ec;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 18px 46px rgba(28, 45, 72, 0.10);
      }

      .web-auth-panel h2 {
        margin: 0 0 7px;
        color: #192b43;
        font-size: 25px;
      }

      .web-auth-panel > p {
        margin: 0 0 25px;
        color: #7b8999;
        font-size: 13px;
      }

      .web-auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        margin-bottom: 23px;
        padding: 4px;
        border-radius: 6px;
        background: #edf1f6;
      }

      .web-auth-tabs button {
        min-height: 38px;
        border-radius: 4px;
        color: #708095;
        background: transparent;
      }

      .web-auth-tabs button.active {
        color: #244baf;
        background: #fff;
        box-shadow: 0 2px 7px rgba(36, 58, 92, 0.10);
      }

      .web-auth-form {
        display: grid;
        gap: 9px;
      }

      .web-auth-form label {
        margin-top: 5px;
        color: #394a5e;
        font-size: 13px;
        font-weight: 700;
      }

      .web-auth-form input {
        width: 100%;
        height: 44px;
        padding: 0 13px;
        border: 1px solid #cad4e0;
        border-radius: 5px;
        color: #17263a;
        background: #fff;
      }

      .web-auth-form input:focus {
        border-color: #5279ef;
        box-shadow: 0 0 0 3px rgba(82, 121, 239, 0.12);
        outline: 0;
      }

      .web-auth-captcha-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
      }

      .web-auth-captcha-image {
        width: 130px;
        height: 44px;
        border: 1px solid #cad4e0;
        border-radius: 5px;
        background: #f7f9fc;
        cursor: pointer;
        object-fit: contain;
      }

      .web-auth-captcha-refresh {
        justify-self: start;
        padding: 0;
        border: 0;
        color: #365fd1;
        background: transparent;
        font-size: 12px;
        cursor: pointer;
      }

      .web-auth-submit {
        height: 44px;
        margin-top: 13px;
        border-radius: 5px;
        color: #fff;
        background: #365fd1;
        font-weight: 700;
      }

      .web-auth-submit:hover:not(:disabled) { background: #2e54bd; }

      .web-auth-status {
        min-height: 22px;
        margin-top: 12px;
        color: #69798c;
        font-size: 13px;
      }

      .web-auth-status.error { color: #c13d4b; }
      .web-auth-status.success { color: #14805f; }

      .account-dashboard-user-tools {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .dashboard-user-name {
        max-width: 140px;
        overflow: hidden;
        color: #536478;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .dashboard-auth-button {
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid #d5dee9;
        border-radius: 5px;
        color: #42566d;
        background: #fff;
        font-size: 13px;
      }

      .dashboard-auth-button.admin {
        border-color: #cbd8ff;
        color: #2d58c7;
        background: #eef3ff;
      }

      .dashboard-bulk-controls {
        height: 38px;
        display: inline-flex;
        overflow: hidden;
        border: 1px solid #d5dee9;
        border-radius: 6px;
        background: #fff;
      }

      .dashboard-bulk-button {
        min-width: 92px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 11px;
        color: #42566d;
        background: #fff;
        font-size: 12px;
        font-weight: 700;
      }

      .dashboard-bulk-button + .dashboard-bulk-button {
        border-left: 1px solid #d5dee9;
      }

      .dashboard-bulk-button.start { color: #176b4d; }
      .dashboard-bulk-button.pause { color: #a73c35; }
      .dashboard-bulk-button.start:hover:not(:disabled) { background: #edf9f4; }
      .dashboard-bulk-button.pause:hover:not(:disabled) { background: #fff3f1; }

      .dashboard-auth-button.admin-start-all {
        border-color: #a9d8c5;
        color: #176b4d;
        background: #f2fbf7;
      }

      .dashboard-auth-button.admin-start-all:hover:not(:disabled) {
        border-color: #67b593;
        background: #e8f8f0;
      }

      .dashboard-auth-button.admin-pause-all {
        border-color: #e4b9b9;
        color: #b42318;
        background: #fff8f7;
      }

      .dashboard-auth-button.admin-pause-all:hover:not(:disabled) {
        border-color: #cf7770;
        background: #fff0ee;
      }

      .admin-modal-panel {
        position: relative;
        z-index: 1;
        width: min(1120px, calc(100vw - 32px));
        height: min(760px, calc(100vh - 32px));
        display: flex;
        flex-direction: column;
        /* Keep the code-management section reachable when its record list grows. */
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: 8px;
        background: #f5f7fa;
        box-shadow: 0 24px 70px rgba(8, 22, 42, 0.28);
      }

      .admin-code-modal { z-index: 205; }
      .admin-code-panel {
        position: relative;
        z-index: 1;
        width: min(1060px, calc(100vw - 32px));
        height: min(760px, calc(100vh - 32px));
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 10px;
        background: #f5f7fa;
        box-shadow: 0 24px 70px rgba(8, 22, 42, 0.28);
      }

      .admin-code-panel > .account-modal-head {
        flex: 0 0 auto;
        border-bottom: 1px solid #e1e7ee;
      }

      .admin-code-page-body {
        min-height: 0;
        flex: 1;
        overflow: auto;
        padding: 16px 20px 20px;
      }

      .admin-code-page-body .admin-code-section {
        min-height: 100%;
        margin: 0;
        border-radius: 8px;
      }

      .admin-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1px;
        margin: 16px 20px 0;
        border: 1px solid #dfe5ec;
        border-radius: 6px;
        overflow: hidden;
        background: #dfe5ec;
      }

      .admin-summary div {
        padding: 15px 18px;
        background: #fff;
      }

      .admin-summary small,
      .admin-summary strong { display: block; }

      .admin-summary small { color: #7c8998; font-size: 12px; }
      .admin-summary strong { margin-top: 5px; color: #1d3048; font-size: 23px; }

      .admin-content {
        min-height: 0;
        display: grid;
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 16px;
        flex: 1;
        padding: 16px 20px 12px;
      }

      .admin-users,
      .admin-accounts {
        min-height: 0;
        overflow: auto;
        border: 1px solid #dfe5ec;
        border-radius: 6px;
        background: #fff;
      }

      .admin-section-head {
        position: sticky;
        z-index: 2;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 46px;
        padding: 0 15px;
        border-bottom: 1px solid #e6ebf1;
        background: #fff;
      }

      .admin-section-head h3 { margin: 0; color: #263950; font-size: 14px; }

      .admin-section-actions { display: flex; align-items: center; gap: 7px; }

      .admin-user-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        border-bottom: 1px solid #edf0f4;
        border-radius: 0;
        color: #35485f;
        background: #fff;
        text-align: left;
      }

      .admin-user-row.active { background: #edf3ff; color: #2856be; }
      .admin-user-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
      .admin-user-row small { color: #8794a4; white-space: nowrap; }

      .admin-account-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
      }

      .admin-account-table th,
      .admin-account-table td {
        padding: 11px 12px;
        border-bottom: 1px solid #edf0f4;
        text-align: left;
        vertical-align: middle;
      }

      .admin-account-table th {
        position: sticky;
        z-index: 1;
        top: 46px;
        color: #708093;
        background: #f8fafc;
        font-size: 11px;
      }

      .admin-account-actions { display: flex; gap: 6px; }

      .admin-account-actions button,
      .admin-owner-select {
        min-height: 32px;
        border: 1px solid #d4dde8;
        border-radius: 4px;
        color: #40536a;
        background: #fff;
        font-size: 12px;
      }

      .admin-account-actions button { padding: 0 9px; }
      .admin-account-actions .danger {
        border-color: #e4b9b9;
        color: #b42318;
        background: #fff8f7;
      }
      .admin-account-actions .danger:hover:not(:disabled) {
        border-color: #cf7770;
        background: #fff0ee;
      }
      .admin-owner-select { width: 120px; padding: 0 7px; }

      .admin-state {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
      }

      .admin-state::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #a0aabb;
      }

      .admin-state.online::before { background: #1ea978; }
      .admin-empty { padding: 30px 18px; color: #8793a3; text-align: center; }

      .admin-window-grant {
        display: grid;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid #e8edf3;
        background: #f8fafc;
      }

      .admin-window-grant strong,
      .admin-window-grant small { display: block; }

      .admin-window-grant strong { color: #34475d; font-size: 12px; }
      .admin-window-grant small { color: #7f8d9e; font-size: 10px; }

      .admin-window-grant-controls,
      .admin-code-create,
      .window-code-form {
        display: flex;
        align-items: center;
        gap: 7px;
      }

      .admin-window-grant input,
      .admin-code-create input,
      .window-code-form input,
      .admin-code-output input {
        min-width: 0;
        height: 34px;
        border: 1px solid #d5dee9;
        border-radius: 5px;
        color: #263950;
        background: #fff;
        font: inherit;
      }

      .admin-window-grant input,
      .admin-code-create input {
        width: 74px;
        padding: 0 8px;
      }

      .admin-window-grant button,
      .admin-code-create button,
      .admin-code-output button,
      .window-code-form button {
        min-height: 34px;
        padding: 0 11px;
        border: 1px solid #cbd8ff;
        border-radius: 5px;
        color: #2d58c7;
        background: #eef3ff;
        font-size: 12px;
      }

      .admin-window-grant button.danger {
        border-color: #e4b9b9;
        color: #b42318;
        background: #fff8f7;
      }

      .admin-window-grant button.danger:hover:not(:disabled) {
        border-color: #cf7770;
        background: #fff0ee;
      }

      .admin-code-section {
        min-height: 0;
        display: flex;
        flex: 0 0 320px;
        flex-direction: column;
        gap: 10px;
        margin: 0 20px 20px;
        padding: 14px;
        border: 1px solid #dfe5ec;
        border-radius: 8px;
        background: #fff;
      }

      .admin-code-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 18px;
      }

      .admin-code-heading h3,
      .admin-code-list-head h3 { margin: 0; color: #263950; font-size: 14px; }
      .admin-code-heading p { margin: 5px 0 0; color: #7d8a9a; font-size: 11px; }
      .admin-code-create { align-items: flex-end; }
      .admin-code-create label { color: #6f7e91; font-size: 10px; }
      .admin-code-create label span { display: block; margin-bottom: 4px; }
      .admin-code-result-row { min-height: 0; display: flex; align-items: center; gap: 10px; }
      .admin-code-result-row:has(.admin-code-output:not([hidden])) { min-height: 34px; }
      .admin-code-output { min-width: 0; display: flex; flex: 0 1 390px; gap: 6px; }
      .admin-code-output input { min-width: 0; flex: 1; padding: 0 8px; font-size: 11px; }
      .admin-code-status { min-width: 0; min-height: 17px; color: #16805f; font-size: 10px; }
      .admin-code-status:empty { display: none; }
      .admin-code-list-wrap { min-width: 0; min-height: 0; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
      .admin-code-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
      .admin-code-list-head span { color: #7f8d9e; font-size: 10px; }
      .admin-code-table-head,
      .admin-code-row { display: grid; grid-template-columns: minmax(160px, 1fr) 90px minmax(120px, 180px) 58px; gap: 10px; align-items: center; }
      .admin-code-table-head { min-height: 26px; padding: 0 10px; border: 1px solid #e5eaf0; border-bottom: 0; border-radius: 5px 5px 0 0; color: #7b899a; background: #f7f9fc; font-size: 9px; }
      .admin-code-list {
        min-height: 120px;
        height: clamp(170px, 24vh, 260px);
        flex: none;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        border: 1px solid #e5eaf0;
        border-radius: 0 0 5px 5px;
      }
      .admin-code-row { min-height: 36px; padding: 5px 10px; border-bottom: 1px solid #edf0f4; color: #4b5d73; font-size: 10px; }
      .admin-code-row:last-child { border-bottom: 0; }
      .admin-code-row code { overflow: hidden; color: #2f435c; text-overflow: ellipsis; white-space: nowrap; }
      .admin-code-row button { min-height: 26px; padding: 0 8px; border: 1px solid #e4b9b9; border-radius: 4px; color: #b42318; background: #fff8f7; font-size: 10px; }
      .admin-code-row button:hover:not(:disabled) { border-color: #cf7770; background: #fff0ee; }
      .admin-code-row .used { color: #7f8b9b; }

      .window-code-modal { z-index: 190; }

      .window-code-panel {
        width: min(440px, calc(100vw - 28px));
        max-height: calc(100dvh - 28px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      .window-code-body { padding: 20px; overflow: auto; }
      .window-code-body > p { margin: 0 0 15px; color: #718096; font-size: 13px; line-height: 1.55; }
      .window-code-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
      .window-code-stats div { padding: 10px; border: 1px solid #e0e6ee; border-radius: 6px; background: #f8fafc; }
      .window-code-stats small, .window-code-stats strong { display: block; }
      .window-code-stats small { color: #8290a2; font-size: 10px; }
      .window-code-stats strong { margin-top: 4px; color: #263950; font-size: 18px; }
      .window-code-form input { flex: 1; padding: 0 10px; text-transform: uppercase; }
      .window-code-form button { color: #fff; border-color: #4f74df; background: #4f74df; }
      .window-code-status { min-height: 21px; margin-top: 10px; color: #65758a; font-size: 12px; }
      .window-code-status.ok { color: #16805f; }
      .window-code-status.error { color: #c13d4b; }

      .daily-config-modal {
        z-index: 180;
      }

      .daily-config-panel {
        width: min(620px, calc(100vw - 32px));
        max-height: min(720px, calc(100dvh - 32px));
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      .daily-config-intro {
        margin: 8px 0 0;
        color: #718096;
        font-size: 13px;
        line-height: 1.55;
      }

      .daily-config-list {
        min-height: 150px;
        display: grid;
        gap: 10px;
        margin-top: 18px;
        overflow: auto;
      }

      .daily-config-item {
        min-width: 0;
        min-height: 84px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 16px;
        padding: 14px 15px;
        border: 1px solid #dce4ee;
        border-radius: 7px;
        background: #fff;
      }

      .daily-config-item-copy {
        min-width: 0;
      }

      .daily-config-item-copy strong,
      .daily-config-item-copy span,
      .daily-config-item-copy small {
        display: block;
      }

      .daily-config-item-copy strong {
        color: #263b56;
        font-size: 15px;
      }

      .daily-config-item-copy span {
        margin-top: 4px;
        overflow: hidden;
        color: #4d6078;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .daily-config-item-copy small {
        margin-top: 5px;
        color: #8390a1;
        font-size: 12px;
      }

      .daily-config-apply {
        min-width: 72px;
        height: 36px;
        padding: 0 15px;
        color: #fff;
        background: var(--blue);
      }

      .daily-config-empty {
        display: grid;
        place-items: center;
        min-height: 150px;
        padding: 24px;
        border: 1px dashed #d5deea;
        border-radius: 7px;
        color: #7f8c9d;
        background: #f8fafc;
        text-align: center;
      }

      button,
      input,
      select {
        font: inherit;
      }

      button {
        border: 0;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 700;
        transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
      }

      button:active { transform: translateY(1px); }
      button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

      .login-screen {
        min-height: 100vh;
        display: grid;
        place-items: center;
        padding: 24px;
        background:
          linear-gradient(135deg, rgba(47, 116, 255, 0.12), rgba(15, 143, 107, 0.08)),
          var(--bg);
      }

      .login-screen[hidden],
      .app-shell[hidden] {
        display: none;
      }

      .login-panel {
        width: min(100%, 420px);
        padding: 26px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
      }

      .account-home {
        position: relative;
        min-height: 100vh;
        display: block;
        overflow: hidden;
        padding: 34px clamp(18px, 5vw, 64px) 64px;
        background:
          radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.42), transparent 25%),
          linear-gradient(155deg, #e7f5fb 0%, #c8e7f5 36%, #8fc7e2 100%);
      }

      .account-home::before,
      .account-home::after {
        content: "";
        position: absolute;
        left: -8%;
        right: -8%;
        pointer-events: none;
        border-radius: 50% 50% 0 0;
      }

      .account-home::before {
        top: 96px;
        height: 48%;
        background: rgba(36, 143, 194, 0.24);
        transform: rotate(-2deg);
      }

      .account-home::after {
        top: 190px;
        height: 62%;
        background: rgba(19, 111, 162, 0.22);
        transform: rotate(2deg);
      }

      .account-home-panel {
        position: relative;
        z-index: 1;
        width: min(100%, 1180px);
        margin: 0 auto;
      }

      .account-home-header {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 18px;
        margin-bottom: 20px;
      }

      .account-home-header > span {
        flex: 0 0 auto;
        padding-bottom: 2px;
        color: rgba(23, 59, 82, 0.72);
        font-size: 13px;
      }

      .account-home-header h1 {
        margin: 0 0 6px;
        color: #173b52;
        font-size: 26px;
      }

      .account-home-header p {
        margin: 0;
        color: rgba(23, 59, 82, 0.72);
        font-size: 14px;
      }

      .account-switcher {
        width: 100%;
        margin: 0 auto;
        padding: 20px max(20px, calc((100% - 1100px) / 2)) 22px;
        border-bottom: 1px solid #d9e7ef;
        background:
          radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.72), transparent 24%),
          linear-gradient(150deg, #edf8fc, #d8eef8);
      }

      .account-switcher-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 12px;
      }

      .account-switcher-head h2 {
        margin: 0;
        color: #33465a;
        font-size: 17px;
      }

      .account-switcher-head span {
        color: var(--muted);
        font-size: 13px;
      }

      .account-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
        gap: 16px;
        justify-content: start;
      }

      .account-card {
        min-height: 292px;
        display: flex;
        flex-direction: column;
        padding: 18px;
        border: 1px solid rgba(205, 217, 228, 0.95);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 12px 30px rgba(26, 64, 89, 0.10);
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
      }

      .account-card:hover {
        border-color: #9bbcff;
        box-shadow: 0 16px 34px rgba(26, 64, 89, 0.16);
      }

      .account-card.active {
        border-color: var(--blue);
        box-shadow: 0 0 0 2px rgba(47, 116, 255, 0.12), 0 16px 34px rgba(26, 64, 89, 0.14);
      }

      .account-card.needs-login {
        border-color: #e5b6b2;
      }

      .account-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
      }

      .account-card-title {
        min-width: 0;
      }

      .account-card-title h3 {
        margin: 0 0 4px;
        overflow: hidden;
        color: #223447;
        font-size: 17px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-card-title p {
        margin: 0;
        color: var(--muted);
        font-size: 13px;
      }

      .channel-badge,
      .account-state-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 24px;
        padding: 3px 9px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
      }

      .channel-badge {
        background: #e1f5ff;
        color: #1676a7;
      }

      .account-state-badge {
        margin-top: 12px;
        align-self: flex-start;
        background: #edf3f8;
        color: #6a7888;
      }

      .account-state-badge.online {
        background: #e5f7ef;
        color: #147254;
      }

      .account-state-badge.warning {
        background: #fff0ee;
        color: #b24b45;
      }

      .account-meta-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px 14px;
        margin: 11px 0 8px;
        color: #687789;
        font-size: 13px;
      }

      .account-meta-grid strong {
        color: #35485c;
        font-weight: 700;
      }

      .account-resource-line,
      .account-card-footnote,
      .account-automation-line {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        color: #687789;
        font-size: 12px;
        line-height: 1.45;
      }

      .account-resource-line {
        padding: 7px 0;
        border-top: 1px solid var(--line);
      }

      .account-resource-line strong,
      .account-card-footnote strong,
      .account-automation-line strong {
        color: #35485c;
      }

      .account-queue-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        margin: 0 0 7px;
      }

      .account-queue-cell {
        min-width: 0;
        padding: 5px 4px;
        border: 1px solid #e3e8ee;
        background: #f8fafc;
        color: #778493;
        font-size: 11px;
        text-align: center;
        white-space: nowrap;
      }

      .account-queue-cell strong {
        color: #415367;
        font-weight: 700;
      }

      .account-queue-cell.busy {
        border-color: #f0d6a6;
        background: #fff8e9;
        color: #9a650c;
      }

      .account-card-footnote {
        padding-bottom: 8px;
      }

      .account-automation-line {
        margin-bottom: 8px;
        padding: 7px 8px;
        border-radius: 5px;
        background: #f1f6ff;
        color: #55708f;
      }

      .account-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: auto;
        padding-top: 13px;
        border-top: 1px solid var(--line);
      }

      .account-card-button {
        min-height: 34px;
        padding: 0 13px;
        background: #edf3ff;
        color: #285db8;
        font-size: 13px;
      }

      .account-card-button.primary {
        background: var(--blue);
        color: #fff;
      }

      .account-card-button.danger {
        margin-left: auto;
        background: #fff0ee;
        color: var(--danger);
      }

      .add-account-card {
        min-height: 292px;
        display: grid;
        place-items: center;
        padding: 22px;
        border: 2px dashed rgba(77, 112, 137, 0.38);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.30);
        color: #537188;
        text-align: center;
      }

      .add-account-card:hover {
        border-color: var(--blue);
        background: rgba(255, 255, 255, 0.58);
        color: var(--blue);
      }

      .add-account-card .plus {
        display: block;
        margin-bottom: 7px;
        font-size: 44px;
        font-weight: 300;
        line-height: 1;
      }

      .add-account-card strong {
        display: block;
        font-size: 15px;
      }

      /* 多账号总览：桌面端固定 4 列 × 4 行，每页 16 个账号窗口。 */
      .login-screen.account-home {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        place-items: stretch;
        padding: 0;
        overflow: hidden;
        background:
          radial-gradient(circle at 82% -10%, rgba(93, 145, 255, 0.17), transparent 28%),
          radial-gradient(circle at 27% 110%, rgba(73, 201, 179, 0.12), transparent 30%),
          #f2f6fb;
      }

      .account-home::before,
      .account-home::after { display: none; }

      .account-dashboard-sidebar {
        position: relative;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 26px 18px 20px;
        color: #dce7f7;
        background:
          radial-gradient(circle at 0 0, rgba(92, 139, 255, 0.28), transparent 34%),
          linear-gradient(175deg, #172b49 0%, #102039 56%, #0d1a30 100%);
      }

      .account-dashboard-sidebar::before,
      .account-dashboard-sidebar::after {
        content: "";
        position: absolute;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 50%;
        pointer-events: none;
      }

      .account-dashboard-sidebar::before {
        width: 260px;
        height: 260px;
        left: -160px;
        bottom: 70px;
      }

      .account-dashboard-sidebar::after {
        width: 210px;
        height: 210px;
        right: -150px;
        top: 160px;
      }

      .account-dashboard-brand {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 0 8px 28px;
      }

      .account-dashboard-logo {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border-radius: 13px;
        color: #fff;
        background: linear-gradient(145deg, #6e9bff, #4b72f2);
        box-shadow: 0 10px 24px rgba(55, 98, 223, 0.4);
        font-size: 20px;
      }

      .account-dashboard-brand strong,
      .account-dashboard-brand small { display: block; }

      .account-dashboard-brand strong {
        color: #fff;
        font-size: 17px;
        letter-spacing: 0.4px;
      }

      .account-dashboard-brand small {
        margin-top: 3px;
        color: #8297b3;
        font-size: 9px;
        letter-spacing: 1.15px;
      }

      .account-dashboard-nav-title {
        position: relative;
        z-index: 1;
        padding: 0 12px 9px;
        color: #6f86a5;
        font-size: 10px;
        letter-spacing: 1.4px;
      }

      .account-dashboard-nav {
        position: relative;
        z-index: 1;
        display: grid;
        gap: 7px;
      }

      .account-dashboard-nav button {
        width: 100%;
        height: 46px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        border-radius: 12px;
        color: #9fb2cc;
        background: transparent;
        font-size: 13px;
        text-align: left;
      }

      .account-dashboard-nav button > span {
        width: 18px;
        color: currentColor;
        font-size: 17px;
        text-align: center;
      }

      .account-dashboard-nav button.active {
        color: #fff;
        background: linear-gradient(90deg, rgba(82, 123, 255, 0.9), rgba(87, 137, 255, 0.64));
        box-shadow: 0 11px 22px rgba(39, 77, 182, 0.24);
      }

      .account-dashboard-nav em {
        min-width: 21px;
        height: 21px;
        display: grid;
        place-items: center;
        margin-left: auto;
        padding: 0 6px;
        border-radius: 9px;
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
        font-size: 10px;
        font-style: normal;
      }

      .account-dashboard-service {
        position: relative;
        z-index: 1;
        margin-top: auto;
        padding: 15px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.045);
      }

      .account-dashboard-service > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #91a4bd;
        font-size: 10px;
      }

      .account-dashboard-service > div strong {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #8be0c5;
        font-size: 10px;
      }

      .account-dashboard-service i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #55d5ae;
        box-shadow: 0 0 0 4px rgba(85, 213, 174, 0.09);
      }

      .account-dashboard-service b,
      .account-dashboard-service small { display: block; }

      .account-dashboard-service b {
        margin-top: 10px;
        color: #e7effb;
        font-size: 11px;
      }

      .account-dashboard-service small {
        margin-top: 5px;
        color: #7086a3;
        font-size: 9px;
      }

      .account-home-panel {
        width: 100%;
        height: 100vh;
        margin: 0;
        padding: 0 26px 26px;
        overflow: auto;
      }

      .account-dashboard-topbar {
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
      }

      .account-dashboard-topbar h1 {
        margin: 0;
        color: #18283f;
        font-size: 23px;
      }

      .account-dashboard-topbar p {
        margin: 5px 0 0;
        color: #7c8a9e;
        font-size: 10px;
      }

      .account-dashboard-top-actions {
        display: flex;
        align-items: center;
        gap: 9px;
      }

      .account-dashboard-icon-button,
      .account-dashboard-user {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border: 1px solid #e2e8f0;
        border-radius: 11px;
        color: #758398;
        background: rgba(255, 255, 255, 0.88);
      }

      .account-dashboard-icon-button { font-size: 18px; }

      .account-dashboard-add-button {
        height: 39px;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 0 15px;
        border-radius: 11px;
        color: #fff;
        background: #4f7cff;
        box-shadow: 0 8px 16px rgba(79, 124, 255, 0.22);
        font-size: 11px;
      }

      .account-dashboard-add-button span { font-size: 16px; }

      .account-dashboard-user {
        color: #fff;
        border: 0;
        background: linear-gradient(145deg, #78a6ff, #5d7aeb);
        font-size: 12px;
        font-weight: 700;
      }

      .account-dashboard-overview {
        min-height: 112px;
        display: grid;
        grid-template-columns: 1.25fr 0.75fr;
        gap: 14px;
      }

      .account-dashboard-welcome {
        position: relative;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 20px 24px;
        border-radius: 18px;
        color: #fff;
        background: linear-gradient(118deg, #416fe9 0%, #597fff 50%, #64a7f8 100%);
        box-shadow: 0 14px 30px rgba(72, 112, 218, 0.2);
      }

      .account-dashboard-welcome::after {
        content: "";
        position: absolute;
        width: 310px;
        height: 160px;
        right: -65px;
        bottom: -115px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        box-shadow: -65px -25px 0 rgba(255, 255, 255, 0.055);
      }

      .account-dashboard-welcome > div,
      .account-dashboard-welcome button { position: relative; z-index: 1; }

      .account-dashboard-welcome h2 {
        margin: 0;
        font-size: 18px;
      }

      .account-dashboard-welcome p {
        margin: 8px 0 0;
        color: rgba(255, 255, 255, 0.78);
        font-size: 10px;
      }

      .account-dashboard-welcome button {
        flex: 0 0 auto;
        height: 35px;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 10px;
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
        font-size: 10px;
      }

      .account-dashboard-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
      }

      .account-dashboard-stats > div {
        min-width: 0;
        display: grid;
        grid-template-columns: 32px 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 0 11px;
        border: 1px solid #e3e9f1;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 7px 18px rgba(42, 66, 101, 0.04);
      }

      .account-dashboard-stats > div > span {
        width: 31px;
        height: 31px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        font-size: 12px;
      }

      .account-dashboard-stats span.blue { color: #4f7cff; background: #edf2ff; }
      .account-dashboard-stats span.green { color: #29a78f; background: #e9f9f5; }
      .account-dashboard-stats span.amber { color: #d68b2b; background: #fff5e7; }
      .account-dashboard-stats span.red { color: #d95862; background: #fff0f1; }

      .account-dashboard-stats small {
        overflow: hidden;
        color: #8b98aa;
        font-size: 8px;
        white-space: nowrap;
      }

      .account-dashboard-stats strong {
        color: #263851;
        font-size: 17px;
      }

      .account-home-header {
        min-height: 56px;
        display: flex;
        align-items: flex-end;
        margin: 0;
        padding: 0 0 10px;
      }

      .account-home-title {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .account-home-title h2 {
        margin: 0;
        color: #172b46;
        font-size: 18px;
      }

      .account-home-title > span {
        padding: 3px 8px;
        border-radius: 8px;
        color: #50627a;
        background: #e4ebf5;
        font-size: 11px;
        font-weight: 700;
      }

      .account-home-title small {
        color: #67778c;
        font-size: 10px;
      }

      .account-home-tools {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-left: auto;
      }

      .account-filter-list { display: flex; gap: 5px; }

      .account-filter-list button {
        height: 28px;
        padding: 0 11px;
        border: 1px solid transparent;
        border-radius: 8px;
        color: #5f6f84;
        background: transparent;
        font-size: 11px;
      }

      .account-filter-list button.active {
        color: #456de2;
        border-color: #dce5ff;
        background: #eef3ff;
        font-weight: 700;
      }

      .account-page-controls {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      .account-page-controls button {
        width: 27px;
        height: 27px;
        display: grid;
        place-items: center;
        border: 1px solid #e0e6ee;
        border-radius: 8px;
        color: #6e7e93;
        background: #fff;
        font-size: 16px;
      }

      .account-page-controls span {
        min-width: 38px;
        color: #5d6d82;
        font-size: 10px;
        text-align: center;
      }

      .account-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        justify-content: start;
      }

      .account-card,
      .add-account-card,
      .empty-account-slot {
        width: 100%;
        min-width: 0;
        min-height: 250px;
        border-radius: 12px;
      }

      .account-card {
        position: relative;
        padding: 9px;
        border: 1px solid #d9e1ec;
        background: #fff;
        box-shadow: 0 10px 25px rgba(42, 68, 103, 0.075);
      }

      .account-card:hover {
        border-color: #cbd8ff;
        box-shadow: 0 13px 30px rgba(65, 101, 194, 0.1);
      }

      .account-card.active {
        border-color: #cbd8ff;
        box-shadow: 0 0 0 1px rgba(79, 124, 255, 0.09), 0 13px 30px rgba(65, 101, 194, 0.1);
      }

      .account-card.active::before {
        content: "";
        position: absolute;
        left: 22px;
        right: 22px;
        top: -1px;
        height: 3px;
        border-radius: 0 0 4px 4px;
        background: linear-gradient(90deg, #4f7cff, #67a5ff);
      }

      .account-card.needs-login { border-color: #f0c9cc; }

      .account-card-head { align-items: center; }

      .account-game-avatar {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border-radius: 10px;
        color: #3158c5;
        background: linear-gradient(145deg, #edf3ff, #dfe9ff);
        font-size: 16px;
      }

      .account-card-title { flex: 1; }

      .account-card-title h3 {
        margin: 0 0 2px;
        color: #172b46;
        font-size: 14px;
      }

      .account-card-title p {
        color: #65758a;
        font-size: 10px;
      }

      .channel-badge {
        min-height: 22px;
        padding: 2px 7px;
        border-radius: 7px;
        color: #3978df;
        background: #edf4ff;
        font-size: 9px;
      }

      .account-state-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 7px;
      }

      .account-state-badge {
        min-height: 22px;
        margin: 0;
        padding: 2px 7px;
        border-radius: 8px;
        font-size: 9px;
      }

      .account-state-badge.online { color: #24927f; background: #e9f9f5; }
      .account-state-badge.warning { color: #c54f59; background: #fff0f1; }

      .account-automation-summary {
        color: #65758a;
        font-size: 8px;
        font-weight: 600;
      }

      .account-online-window-row {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 5px 0 1px;
        padding: 5px 7px;
        border: 1px solid #e3e9f2;
        border-radius: 7px;
        color: #54657b;
        background: #f7f9fc;
        font-size: 9px;
        font-weight: 700;
      }

      .account-online-window-row > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-online-window-row .toggle-switch {
        width: 34px;
        height: 20px;
        flex-basis: 34px;
      }

      .account-online-window-row .toggle-track {
        width: 34px;
        height: 20px;
        border-radius: 10px;
      }

      .account-online-window-row .toggle-track::after {
        width: 14px;
        height: 14px;
      }

      .account-online-window-row .toggle-switch input:checked + .toggle-track::after {
        transform: translateX(14px);
      }

      .account-meta-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        margin: 6px 0;
        color: inherit;
        font-size: inherit;
      }

      .account-meta-item {
        min-width: 0;
        padding: 5px 6px;
        border: 1px solid #e4eaf2;
        border-radius: 7px;
        background: #f6f8fb;
      }

      .account-meta-item.wide { grid-column: 1 / -1; }

      .account-meta-item small,
      .account-meta-item strong { display: block; }

      .account-meta-item small {
        color: #66768b;
        font-size: 9px;
      }

      .account-meta-item .account-meta-label {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 3px;
      }

      .account-meta-icon {
        position: relative;
        display: inline-grid;
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
        place-items: center;
      }

      .account-meta-icon.alliance { height: 16px; }

      .account-meta-icon img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
      }

      .account-meta-icon .alliance-flag-mark {
        position: absolute;
        inset: 4px 2px 2px;
        overflow: hidden;
        color: #fff;
        font-size: 5px;
        font-weight: 800;
        line-height: 8px;
        text-align: center;
        text-shadow: 0 1px 1px rgba(63, 23, 78, 0.45);
      }

      .account-meta-item strong {
        margin-top: 2px;
        overflow: hidden;
        color: #243a55;
        font-size: 10px;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-card-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 4px 0 3px;
        color: #40536d;
        font-size: 10px;
        font-weight: 700;
      }

      .account-card-section-head small {
        color: #6f7f92;
        font-size: 8px;
        font-weight: 400;
      }

      .account-resource-matrix {
        display: grid;
        grid-template-columns: 38px repeat(4, minmax(0, 1fr)) minmax(0, 1fr);
        gap: 4px;
      }

      .account-resource-row-label {
        min-width: 0;
        display: grid;
        place-items: center;
        border-radius: 6px;
        color: #61738b;
        background: #e9eef5;
        font-size: 8px;
        font-weight: 800;
      }

      .account-resource-item {
        min-width: 0;
        padding: 4px 2px 3px;
        border-radius: 6px;
        background: #f1f5fa;
        text-align: center;
      }

      .account-resource-icon {
        width: 18px;
        height: 18px;
        display: block;
        margin: 0 auto 2px;
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        transform: rotate(180deg);
        filter: drop-shadow(0 1px 1px rgba(23, 40, 61, 0.18));
      }

      .account-resource-icon::before,
      .account-resource-icon::after {
        content: none;
      }

      .account-resource-icon.stamina {
        display: grid;
        place-items: center;
        border-radius: 50%;
        color: #d48a16;
        background: #fff1d4;
        transform: none;
        filter: none;
        font-size: 12px;
      }

      .account-resource-icon.stamina::before { content: "⚡"; }

      .account-resource-icon.meat { background-image: url("/gather/static/icons/resource-meat-80f4278d9fd1.png"); }
      .account-resource-icon.wood { background-image: url("/gather/static/icons/resource-wood-ea52a548ebfc.png"); }
      .account-resource-icon.coal { background-image: url("/gather/static/icons/resource-coal-c5eac18aca84.png"); }
      .account-resource-icon.iron { background-image: url("/gather/static/icons/resource-iron-d3b5d80921de.png"); }
      .account-resource-icon.diamond { background-image: url("/gather/static/icons/resource-diamond-9e86727f0bf6.png"); }
      .account-resource-icon.protected-meat { background-image: url("/gather/static/icons/resource-protected-meat-6db75a0caaf3.png"); }
      .account-resource-icon.protected-wood { background-image: url("/gather/static/icons/resource-protected-wood-0066e04b3cf2.png"); }
      .account-resource-icon.protected-coal { background-image: url("/gather/static/icons/resource-protected-coal-ca2a10b2547d.png"); }
      .account-resource-icon.protected-iron { background-image: url("/gather/static/icons/resource-protected-iron-edbadb5d00ca.png"); }

      .account-resource-item b,
      .account-resource-item small { display: block; }

      .account-resource-item b {
        overflow: hidden;
        color: #263b56;
        font-size: 10px;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-resource-item small {
        margin-top: 1px;
        color: #69798d;
        font-size: 8px;
      }

      .account-queue-section { display: grid; gap: 3px; }

      .account-queue-row {
        min-width: 0;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 4px;
      }

      .account-queue-row > small {
        color: #586a81;
        font-size: 8px;
        font-weight: 700;
      }

      .account-queue-values {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(var(--account-queue-columns, 1), minmax(0, 1fr));
        gap: 3px;
      }

      .account-queue-cell {
        min-width: 0;
        padding: 2px 3px;
        overflow: hidden;
        border: 0;
        border-radius: 6px;
        color: #187764;
        background: #e5f6f1;
        font-size: 8px;
        font-weight: 700;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-queue-cell strong { color: inherit; }
      .account-queue-cell.busy { color: #466cce; border: 0; background: #edf2ff; }
      .account-queue-cell.off { color: #8d99aa; background: #f1f3f6; }
      .account-queue-cell.locked { color: #768398; background: #eef1f5; }
      .account-queue-cell.wait { color: #b17429; background: #fff5e7; }

      .account-card-footnote,
      .account-automation-line,
      .account-resource-line { display: none; }

      .account-card-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        margin-top: auto;
        padding-top: 8px;
      }

      .account-card-button {
        width: 100%;
        min-width: 0;
        min-height: 29px;
        flex: none;
        padding: 0 5px;
        border: 1px solid #dbe5f5;
        border-radius: 7px;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0;
        transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
      }

      .account-card-button:hover:not(:disabled) {
        transform: translateY(-1px);
        border-color: #c8d7f1;
        box-shadow: 0 5px 12px rgba(43, 76, 128, 0.10);
      }

      .account-card-button[data-action="start"] {
        border-color: #c9eee3;
        color: #168670;
        background: #e9f9f4;
      }

      .account-card-button[data-action="pause"] {
        color: #3d6098;
        background: #edf3ff;
      }

      .account-card-button[data-action="debug"] {
        color: #315fc4;
        background: #edf3ff;
      }

      .account-card-button.primary {
        border-color: var(--blue);
        box-shadow: 0 5px 12px rgba(47, 116, 255, 0.18);
      }

      .account-card-button.danger {
        max-width: none;
        margin-left: 0;
        border-color: #f4d7d4;
        background: #fff2f0;
      }

      .add-account-card,
      .empty-account-slot {
        display: grid;
        place-items: center;
        padding: 14px;
        border: 1.5px dashed #cbd5e3;
        background: rgba(255, 255, 255, 0.46);
        color: #8b99ad;
        text-align: center;
      }

      .add-account-card:hover {
        transform: none;
        border-color: #8eabff;
        background: rgba(255, 255, 255, 0.72);
      }

      .add-account-card .plus,
      .empty-account-slot .plus {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        margin: 0 auto 7px;
        border-radius: 10px;
        color: #587df0;
        background: #eaf0ff;
        font-size: 20px;
      }

      .add-account-card strong,
      .empty-account-slot strong {
        color: #31465f;
        font-size: 12px;
      }

      .empty-account-slot small {
        display: block;
        margin-top: 6px;
        color: #6e7d90;
        font-size: 10px;
      }

      .account-modal[hidden] { display: none; }

      .account-modal {
        position: fixed;
        inset: 0;
        z-index: 140;
        display: grid;
        place-items: center;
        padding: 20px;
      }

      .account-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(22, 35, 45, 0.52);
        backdrop-filter: blur(3px);
      }

      .account-modal-panel {
        position: relative;
        z-index: 1;
        width: min(100%, 700px);
        max-height: calc(100vh - 40px);
        overflow: auto;
        padding: 22px 24px 20px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 26px 70px rgba(15, 32, 44, 0.28);
      }

      .account-modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
      }

      .account-modal-head h1 {
        margin: 0;
        font-size: 19px;
      }

      .modal-close {
        width: 32px;
        height: 32px;
        background: #f1f3f5;
        color: #66717e;
        font-size: 24px;
        line-height: 1;
      }

      .login-stepper {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
        margin: 16px 0 20px;
        color: #7d8894;
        font-size: 13px;
      }

      .step-item {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .step-dot {
        width: 25px;
        height: 25px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #edf0f3;
      }

      .step-item.active {
        color: #30445a;
      }

      .step-item.active .step-dot {
        background: var(--blue);
        color: #fff;
      }

      .step-line {
        height: 1px;
        background: #e3e7eb;
      }

      .channel-step h2,
      .login-form-step h2 {
        margin: 0 0 18px;
        text-align: center;
        font-size: 20px;
        font-weight: 600;
      }

      .channel-grid {
        display: grid;
        grid-template-columns: repeat(3, 120px);
        justify-content: center;
        gap: 36px;
        margin: 8px 0 32px;
      }

      .channel-card {
        position: relative;
        height: 120px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 7px;
        border: 2px solid #e0e5eb;
        border-radius: 12px;
        background: #fff;
        color: #566575;
      }

      .channel-card.selected {
        border-color: #1794ff;
        background: #e8f6ff;
        box-shadow: 0 8px 18px rgba(23, 148, 255, 0.16);
      }

      .channel-card:disabled {
        opacity: 0.55;
      }

      .channel-icon {
        width: 58px;
        height: 58px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #25a9e8;
        color: #fff;
        font-size: 24px;
        font-weight: 800;
      }

      .channel-card.wechat .channel-icon { background: #55c72e; }
      .channel-card.id-token .channel-icon { background: #16101b; }

      .channel-note {
        position: absolute;
        right: 6px;
        bottom: 5px;
        color: #8a96a3;
        font-size: 10px;
      }

      .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
      }

      .modal-next {
        min-width: 80px;
        height: 40px;
        padding: 0 18px;
        background: var(--blue);
        color: #fff;
      }

      .login-form-step .login-panel {
        width: min(100%, 520px);
        margin: 0 auto;
        padding: 0;
        border: 0;
        box-shadow: none;
      }

      body.modal-open { overflow: hidden; }

      .runtime-log-modal[hidden] { display: none; }

      .runtime-log-modal {
        position: fixed;
        inset: 0;
        z-index: 160;
        display: grid;
        place-items: center;
        padding: 16px;
      }

      .runtime-log-backdrop {
        position: absolute;
        inset: 0;
        border-radius: 0;
        background: rgba(22, 35, 52, 0.48);
        backdrop-filter: blur(3px);
      }

      .runtime-log-panel {
        position: relative;
        z-index: 1;
        width: min(1220px, calc(100vw - 32px));
        height: min(88vh, 900px);
        min-height: min(580px, calc(100dvh - 32px));
        display: grid;
        grid-template-rows: 54px minmax(0, 1fr) 64px;
        overflow: hidden;
        border: 1px solid #dfe5ed;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 28px 80px rgba(17, 31, 49, 0.28);
      }

      .runtime-log-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 0 20px 0 24px;
        border-bottom: 1px solid #edf0f4;
      }

      .runtime-log-head h2 {
        min-width: 0;
        margin: 0;
        overflow: hidden;
        color: #202a38;
        font-size: 17px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .runtime-log-head h2::before {
        content: "▤";
        margin-right: 9px;
        color: #d79062;
        font-size: 16px;
      }

      .runtime-log-close-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 auto;
        color: #7c8794;
        background: transparent;
        font-size: 24px;
        font-weight: 400;
      }

      .runtime-log-body {
        min-height: 0;
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
      }

      .runtime-log-sidebar {
        min-height: 0;
        overflow: auto;
        padding: 18px 14px;
        border-right: 1px solid #dce3ec;
        background: #eaf0f7;
      }

      .runtime-log-categories {
        display: grid;
        gap: 8px;
      }

      .runtime-log-category {
        width: 100%;
        min-height: 36px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 4px 10px 4px 16px;
        border: 1px solid #e0e5eb;
        border-radius: 14px;
        color: #56677d;
        background: #fff;
        box-shadow: 0 3px 8px rgba(48, 68, 93, 0.10);
        font-size: 13px;
        font-weight: 500;
        text-align: left;
      }

      .runtime-log-category:hover,
      .runtime-log-category.active {
        border-color: #78869a;
        color: #24364d;
        box-shadow: 0 0 0 1px rgba(70, 87, 111, 0.12), 0 4px 11px rgba(48, 68, 93, 0.13);
      }

      .runtime-log-category span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .runtime-log-category b {
        min-width: 35px;
        height: 27px;
        display: grid;
        place-items: center;
        padding: 0 8px;
        border-radius: 14px;
        color: #fff;
        background: var(--log-color, #64748b);
        font-size: 12px;
      }

      .runtime-log-main {
        min-width: 0;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        background: #fff;
      }

      .runtime-log-toolbar {
        display: grid;
        gap: 10px;
        padding: 18px 24px 12px;
        border-bottom: 1px solid #dfe5ec;
        background: #fbfcfe;
      }

      .runtime-log-search {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border: 1px solid #cdd5df;
        border-radius: 8px;
        outline: none;
        color: #26384e;
        background: #fff;
        font-size: 14px;
      }

      .runtime-log-search:focus {
        border-color: #2f74ff;
        box-shadow: 0 0 0 3px rgba(47, 116, 255, 0.12);
      }

      .runtime-log-options {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        color: #313f52;
        font-size: 13px;
      }

      .runtime-log-option {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        color: inherit;
        cursor: pointer;
      }

      .runtime-log-option input {
        width: 16px;
        height: 16px;
        margin: 0;
        padding: 0;
        accent-color: #2176ff;
        box-shadow: none;
      }

      .runtime-log-limit {
        height: 28px;
        margin-left: auto;
        padding: 0 9px;
        border: 1px solid #2580ff;
        border-radius: 5px;
        color: #0868d8;
        background: #f2f8ff;
        font-size: 12px;
      }

      .runtime-log-list {
        min-height: 0;
        overflow: auto;
        background: #fff;
        scrollbar-gutter: stable;
      }

      .runtime-log-row {
        min-width: 760px;
        display: grid;
        grid-template-columns: 178px 62px minmax(92px, max-content) minmax(280px, 1fr);
        align-items: start;
        gap: 8px;
        padding: 9px 12px 9px 0;
        border-bottom: 1px solid #e4e8ee;
        color: #263447;
        font-size: 13px;
        line-height: 1.45;
      }

      .runtime-log-time {
        color: #10243e;
        font-family: Consolas, "SFMono-Regular", monospace;
        white-space: nowrap;
      }

      .runtime-log-level,
      .runtime-log-tag {
        display: inline-flex;
        width: max-content;
        min-height: 23px;
        align-items: center;
        justify-content: center;
        padding: 2px 7px;
        border-radius: 4px;
        color: #fff;
        font-family: Consolas, "SFMono-Regular", monospace;
        font-size: 11px;
        font-weight: 800;
        white-space: nowrap;
      }

      .runtime-log-level.info { color: #069e78; background: #ddf8ef; }
      .runtime-log-level.warn { color: #e58b00; background: #fff0d3; }
      .runtime-log-level.error { color: #d63d49; background: #ffe4e7; }
      .runtime-log-tag { background: var(--log-color, #3978df); }

      .runtime-log-message {
        min-width: 0;
        color: #253447;
        overflow-wrap: anywhere;
      }

      .runtime-log-empty {
        min-height: 220px;
        display: grid;
        place-items: center;
        padding: 32px;
        color: #8693a4;
        font-size: 14px;
        text-align: center;
      }

      .runtime-log-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 24px;
        border-top: 1px solid #edf0f4;
        background: #fff;
      }

      .runtime-log-close-button {
        min-width: 68px;
        height: 40px;
        padding: 0 18px;
        border-radius: 8px;
        color: #fff;
        background: #1677ff;
        font-size: 15px;
      }

      h1 {
        margin: 0 0 20px;
        font-size: 24px;
        line-height: 1.25;
      }

      label {
        display: block;
        margin: 14px 0 7px;
        color: var(--muted);
        font-size: 13px;
      }

      input {
        width: 100%;
        height: 46px;
        border: 1px solid var(--line-strong);
        border-radius: 6px;
        padding: 0 12px;
        outline: none;
        background: #fbfcfe;
        color: var(--text);
        font-size: 16px;
      }

      input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 4px rgba(47, 116, 255, 0.14);
      }

      .login-row {
        display: grid;
        grid-template-columns: 1fr 132px;
        gap: 10px;
        align-items: end;
      }

      .send,
      .login,
      .primary-action {
        height: 46px;
        padding: 0 16px;
        color: #fff;
      }

      .send {
        width: 100%;
        background: var(--blue);
      }

      .send:hover:not(:disabled) { background: var(--blue-hover); }

      .login {
        width: 100%;
        margin-top: 18px;
        background: var(--green);
      }

      .login:hover:not(:disabled),
      .primary-action:hover:not(:disabled) {
        background: var(--green-hover);
      }

      .login-actions {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: end;
      }

      .secondary-login {
        height: 46px;
        margin-top: 18px;
        padding: 0 18px;
        border: 1px solid var(--line-strong);
        background: #fff;
        color: #5f6b7b;
      }

      .toggle-switch {
        position: relative;
        display: inline-flex;
        width: 46px;
        height: 26px;
        flex: 0 0 46px;
        margin: 0;
        cursor: pointer;
      }

      .toggle-switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        border: 0;
        opacity: 0;
      }

      .toggle-track {
        width: 46px;
        height: 26px;
        border: 1px solid #c8d0db;
        border-radius: 13px;
        background: #dfe4ea;
        transition: background 0.15s ease, border-color 0.15s ease;
      }

      .toggle-track::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 3px rgba(32, 37, 45, 0.28);
        transition: transform 0.15s ease;
      }

      .toggle-switch input:checked + .toggle-track {
        border-color: var(--green);
        background: var(--green);
      }

      .toggle-switch input:checked + .toggle-track::after {
        transform: translateX(20px);
      }

      .toggle-switch input:focus-visible + .toggle-track {
        box-shadow: 0 0 0 4px rgba(15, 143, 107, 0.16);
      }

      .primary-action {
        min-width: 86px;
        height: 36px;
        background: var(--green);
        font-size: 14px;
      }

      .primary-action.danger-action {
        background: var(--danger);
      }

      .primary-action.danger-action:hover:not(:disabled) {
        background: #a83b38;
      }

      .daily-control {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        flex: 0 0 auto;
      }

      .daily-input-field {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #5d6c80;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
      }

      .daily-input-field > span {
        flex: 0 0 auto;
      }

      .bank-duration-options {
        display: flex;
        align-items: center;
        gap: 10px 24px;
        flex-wrap: wrap;
      }

      .bank-duration-field {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-top: 12px;
        color: #435064;
        font-size: 13px;
        font-weight: 400;
      }

      .bank-duration-option {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 22px;
        color: #435064;
        font-size: 13px;
        line-height: 22px;
        white-space: nowrap;
        cursor: pointer;
      }

      .bank-duration-option input {
        appearance: none;
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        margin: 0;
        padding: 0;
        border: 1px solid #aab5c5;
        border-radius: 2px;
        background: #fff;
        display: grid;
        place-content: center;
        cursor: pointer;
      }

      .bank-duration-option input:checked {
        border-color: #2e65df;
        background: #2e65df;
      }

      .bank-duration-option input:checked::after {
        content: "";
        width: 4px;
        height: 8px;
        margin-top: -2px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
      }

      .bank-duration-option input:focus-visible {
        outline: 2px solid #2e65df;
        outline-offset: 3px;
      }

      .bank-duration-option input:disabled {
        opacity: .5;
        cursor: not-allowed;
      }

      .war-research-direction-options {
        flex-wrap: nowrap;
      }

      .war-exchange-shortfall-field .bank-duration-option {
        align-items: flex-start;
        max-width: 100%;
        white-space: normal;
      }

      .war-exchange-shortfall-field input {
        margin-top: 3px;
      }

      .war-research-direction-hint {
        display: block;
        margin-top: 8px;
        color: #71809a;
        font-size: 12px;
        line-height: 1.6;
      }

      .war-research-direction-hint.needs-direction {
        color: #9a6500;
      }

      .daily-resource-level {
        width: 86px;
        height: 36px;
        padding: 0 9px;
        font-size: 14px;
        text-align: center;
      }

      .daily-resource-type {
        width: 92px;
        max-width: 100%;
        height: 36px;
        padding: 0 9px;
        font-size: 14px;
      }

      .daily-formation {
        width: 74px;
        height: 36px;
        padding: 0 8px;
        font-size: 14px;
        text-align: center;
      }

      .daily-formation-group {
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
      }

      .daily-formation-group .daily-formation {
        width: 84px;
        height: 34px;
        border: 0;
        background: transparent;
        color: #34445a;
        font-weight: 600;
      }

      .bear-formation-row .row-control {
        overflow: hidden;
      }

      .native-auto-join-options-row {
        min-height: 48px;
      }

      .native-auto-join-options-row .row-control {
        align-items: flex-start;
      }

      .native-auto-join-options {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
        gap: 10px 24px;
      }

      .native-auto-join-option {
        display: inline-flex;
        min-width: 138px;
        align-items: center;
        gap: 7px;
        color: #435064;
        cursor: pointer;
        font-size: 13px;
        line-height: 22px;
      }

      .native-auto-join-option input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: #2e65df;
      }

      .native-auto-join-option strong {
        color: #7a8798;
        font-size: 12px;
        font-weight: 600;
      }

      .native-auto-join-option.full strong {
        color: #b45309;
      }

      .lighthouse-types-row {
        min-height: 48px;
      }

      .lighthouse-type-counts {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
        gap: 8px;
      }

      .lighthouse-type-count {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 28px;
        padding: 3px 9px;
        border: 1px solid #dfe5ed;
        border-radius: 6px;
        background: #f7f9fc;
        color: #526070;
        font-size: 12px;
        line-height: 20px;
      }

      .lighthouse-type-count strong {
        color: #1f2937;
        font-size: 13px;
      }

      .bear-formation-item {
        height: 36px;
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        border: 1px solid #d8e0ea;
        border-radius: 6px;
        background: #f7f9fc;
      }

      .bear-formation-remove,
      .bear-formation-add {
        width: 34px;
        height: 34px;
        display: inline-grid;
        place-items: center;
        flex: 0 0 34px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #77869a;
        font-size: 20px;
        line-height: 1;
      }

      .bear-formation-remove {
        border-left: 1px solid #e0e6ee;
      }

      .bear-formation-remove:hover:not(:disabled) {
        color: #b84545;
        background: #fff1f1;
      }

      .bear-formation-add {
        border: 1px dashed #aebbc9;
        border-radius: 6px;
        color: #3572c6;
        background: #f8fbff;
      }

      .bear-formation-add:hover:not(:disabled) {
        border-color: #3572c6;
        background: #eef6ff;
      }

      .bear-formation-remove:disabled,
      .bear-formation-add:disabled {
        cursor: not-allowed;
        opacity: 0.35;
      }

      .resource-level-column-heading {
        min-height: 24px;
        display: flex;
        align-items: flex-end;
        justify-content: flex-end;
        gap: 8px;
        padding: 0 60px 2px;
        color: #5d6c80;
        font-size: 12px;
        font-weight: 600;
      }

      .resource-level-column-heading span {
        width: 86px;
        text-align: center;
        white-space: nowrap;
      }

      .resource-level-column-heading span:first-child {
        width: 92px;
      }

      .resource-level-column-heading span:last-child {
        margin-right: 54px;
      }

      .daily-count,
      .daily-level {
        width: 68px;
        height: 36px;
        padding: 0 8px;
        text-align: center;
        font-size: 14px;
      }

      .daily-level {
        width: 74px;
        text-align: left;
      }

      .enemy-troop-threshold {
        width: 112px;
      }

      .shield-duration-select {
        width: 130px;
      }

      .alliance-member-picker {
        width: min(360px, 100%);
        min-height: 44px;
        padding: 11px 12px;
        border: 1px solid #cbd3df;
        border-radius: 6px;
        background: #fff;
        color: #283548;
        font-size: 14px;
        line-height: 20px;
        text-align: left;
        cursor: pointer;
      }

      .alliance-member-picker:not(:disabled):hover {
        border-color: #5277a8;
      }

      .alliance-member-picker:disabled {
        color: #8793a4;
        background: #f3f5f8;
        cursor: default;
      }

      .alliance-member-dialog {
        width: min(760px, calc(100vw - 32px));
        height: min(740px, calc(100dvh - 48px));
        max-width: none;
        max-height: calc(100dvh - 24px);
        margin: auto;
        padding: 0;
        border: 1px solid #dce5f1;
        border-radius: 14px;
        background: #fff;
        color: #283548;
        box-shadow: 0 24px 80px rgba(27, 39, 57, 0.28);
        overflow: hidden;
      }

      .alliance-member-dialog[open] {
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
      }

      .alliance-member-dialog::backdrop {
        background: rgba(23, 39, 63, 0.48);
      }

      .alliance-member-dialog-head,
      .alliance-member-dialog-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 20px;
      }

      .alliance-member-dialog-head {
        border-bottom: 1px solid #e7edf5;
      }

      .alliance-member-dialog-head h2 {
        margin: 0;
        font-size: 18px;
      }

      .alliance-member-dialog-close {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        background: #f3f6fa;
        color: #52647d;
        font-size: 24px;
      }

      .alliance-member-dialog-search {
        padding: 14px 20px;
      }

      .alliance-member-dialog-search input {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        border: 1px solid #cbd3df;
        border-radius: 8px;
        font: inherit;
      }

      .alliance-member-options {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        padding: 0 16px 12px;
      }

      .alliance-member-option {
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 64px;
        padding: 12px;
        border-bottom: 1px solid #edf1f7;
        border-radius: 8px;
        color: #283548;
        font-size: 16px;
        cursor: pointer;
      }

      .alliance-member-option[hidden] { display: none; }

      .alliance-member-option:hover {
        background: #f3f6fa;
      }

      .alliance-member-option:has(input:checked) {
        background: #edf4ff;
      }

      .alliance-member-option input {
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        margin: 0;
        accent-color: #316bea;
      }

      .alliance-member-option span {
        min-width: 0;
        overflow-wrap: anywhere;
      }

      .alliance-member-option strong,
      .alliance-member-option small { display: block; }

      .alliance-member-option small {
        margin-top: 4px;
        color: #70819b;
        font-size: 13px;
      }

      .alliance-member-dialog-empty {
        padding: 24px 12px;
        color: #70819b;
        text-align: center;
      }

      .alliance-member-dialog-footer {
        border-top: 1px solid #e7edf5;
        font-size: 14px;
      }

      .alliance-member-dialog-footer small {
        display: block;
        margin-top: 4px;
        color: #70819b;
      }

      .alliance-member-dialog-done {
        min-width: 88px;
        min-height: 44px;
        border-radius: 8px;
        background: #316bea;
        color: #fff;
        font: inherit;
      }

      @media (max-width: 600px) {
        .alliance-member-dialog {
          width: calc(100vw - 20px);
          height: calc(100dvh - 32px);
        }
        .alliance-member-dialog-head,
        .alliance-member-dialog-footer { padding: 12px 14px; }
        .alliance-member-dialog-search { padding: 12px 14px; }
        .alliance-member-options { padding: 0 8px 10px; }
      }

      .alliance-member-row .row-control {
        min-width: 0;
      }

      .free-gift-inventory-button {
        display: block;
        max-width: 100%;
        min-height: 40px;
        margin-top: 10px;
        padding: 8px 12px;
        border: 1px solid #cbd8ed;
        border-radius: 7px;
        background: #f6f9ff;
        color: #285ba3;
        font: inherit;
        text-align: left;
        overflow-wrap: anywhere;
      }

      .free-gift-inventory-button:disabled {
        color: #8793a4;
        background: #f3f5f8;
        cursor: default;
      }

      .free-gift-activity-dialog {
        width: min(920px, calc(100vw - 32px));
        height: min(780px, calc(100dvh - 48px));
        max-width: none;
        max-height: calc(100dvh - 24px);
        margin: auto;
        padding: 0;
        border: 1px solid #dce5f1;
        border-radius: 14px;
        background: #fff;
        color: #283548;
        box-shadow: 0 24px 80px rgba(27, 39, 57, 0.28);
        overflow: hidden;
      }

      .free-gift-activity-dialog[open] {
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
      }

      .free-gift-activity-dialog::backdrop { background: rgba(23, 39, 63, 0.48); }

      .free-gift-activity-head,
      .free-gift-activity-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 20px;
      }

      .free-gift-activity-head { border-bottom: 1px solid #e7edf5; }
      .free-gift-activity-head h2 { margin: 0; font-size: 18px; }
      .free-gift-activity-summary { margin-top: 7px; color: #52647d; font-size: 13px; line-height: 1.6; }
      .free-gift-activity-close {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        background: #f3f6fa;
        color: #52647d;
        font-size: 24px;
      }

      .free-gift-activity-toolbar { padding: 12px 20px; }
      .free-gift-activity-controls { display: flex; gap: 10px; }
      .free-gift-activity-controls input,
      .free-gift-activity-controls select {
        min-height: 44px;
        min-width: 0;
        padding: 10px 12px;
        border: 1px solid #cbd3df;
        border-radius: 8px;
        background: #fff;
        color: #283548;
        font: inherit;
      }
      .free-gift-activity-controls input { flex: 1 1 260px; }
      .free-gift-activity-controls select { flex: 0 1 205px; }
      .free-gift-activity-hint { margin: 8px 0 0; color: #70819b; font-size: 12px; line-height: 1.6; }
      .free-gift-activity-list {
        min-height: 0;
        padding: 0 20px 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
      }
      .free-gift-activity-item { padding: 14px 0; border-bottom: 1px solid #e7edf5; overflow-wrap: anywhere; }
      .free-gift-activity-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
      .free-gift-activity-item h3 { margin: 0; font-size: 15px; line-height: 1.6; }
      .free-gift-activity-status { flex: 0 0 auto; max-width: 48%; padding: 4px 8px; border-radius: 6px; background: #eef3fa; color: #52647d; font-size: 12px; line-height: 1.6; }
      .free-gift-activity-status[data-status="claimable"] { background: #e7f7ef; color: #087558; }
      .free-gift-activity-status[data-status="blocked"],
      .free-gift-activity-status[data-status="unknown"],
      .free-gift-activity-status[data-status="unmapped"],
      .free-gift-activity-status[data-status="manual_required"],
      .free-gift-activity-status[data-status="choice_required"] { background: #fff4df; color: #986313; }
      .free-gift-activity-item p { margin: 6px 0 0; font-size: 13px; line-height: 1.7; }
      .free-gift-activity-identifiers { color: #70819b; }
      .free-gift-activity-rule { color: #70819b; }
      .free-gift-activity-empty { padding: 28px 12px; color: #70819b; text-align: center; }
      .free-gift-activity-footer { border-top: 1px solid #e7edf5; font-size: 13px; }
      .free-gift-activity-pagination { display: flex; align-items: center; gap: 8px; }
      .free-gift-activity-pagination button { min-width: 66px; min-height: 40px; padding: 8px 10px; border-radius: 6px; background: #eef3fa; color: #285ba3; font: inherit; }
      .free-gift-activity-pagination button:disabled { color: #98a4b4; cursor: default; }

      @media (max-width: 600px) {
        .free-gift-activity-dialog { width: calc(100vw - 20px); height: calc(100dvh - 32px); }
        .free-gift-activity-head, .free-gift-activity-footer { padding: 12px 14px; }
        .free-gift-activity-toolbar { padding: 10px 14px; }
        .free-gift-activity-controls { flex-wrap: wrap; }
        .free-gift-activity-controls input, .free-gift-activity-controls select { flex: 1 1 100%; width: 100%; }
        .free-gift-activity-list { padding: 0 14px 10px; }
        .free-gift-activity-footer { flex-wrap: wrap; gap: 8px; }
        .free-gift-activity-pagination { margin-left: auto; }
      }

      .daily-coordinate {
        width: 92px;
        height: 36px;
        padding: 0 8px;
        text-align: center;
        font-size: 14px;
      }

      .daily-target-config {
        width: 108px;
        height: 36px;
        padding: 0 8px;
        text-align: center;
        font-size: 14px;
      }

      .daily-hero-ids {
        width: 152px;
        height: 36px;
        padding: 0 8px;
        text-align: center;
        font-size: 14px;
      }

      .status {
        min-height: 22px;
        margin-top: 14px;
        font-size: 14px;
        line-height: 1.45;
        color: var(--muted);
      }

      .status.ok { color: var(--ok); }
      .status.err { color: var(--danger); }

      .app-shell {
        position: fixed;
        inset: 0;
        z-index: 100;
        display: grid;
        place-items: center;
        align-items: center;
        justify-items: center;
        min-height: 100vh;
        padding: 16px;
        background: transparent;
      }

      .config-modal-backdrop {
        position: absolute;
        inset: 0;
        border-radius: 0;
        background: rgba(22, 35, 52, 0.48);
        backdrop-filter: blur(3px);
      }

      .config-window {
        position: relative;
        z-index: 1;
        width: min(1040px, calc(100vw - 72px));
        height: min(88dvh, 880px);
        min-height: 0;
        display: grid;
        grid-template-rows: 56px 70px minmax(0, 1fr);
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
        border: 1px solid #dfe5ed;
        border-radius: 14px;
        background: var(--bg);
        box-shadow: 0 28px 80px rgba(17, 31, 49, 0.28);
      }

      .config-window > * {
        min-width: 0;
      }

      .topbar {
        height: 56px;
        display: grid;
        grid-template-columns: 56px 1fr auto;
        align-items: center;
        padding: 0 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        position: relative;
        top: auto;
        z-index: 10;
      }

      .back {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: transparent;
        color: #3d4654;
        font-size: 28px;
        line-height: 1;
      }

      .back:hover { background: #eef3f8; }

      .top-title {
        margin: 0;
        text-align: center;
        color: #244db3;
        font-size: 20px;
        font-weight: 800;
      }

      .top-actions {
        display: flex;
        gap: 8px;
        align-items: center;
      }

      .top-button {
        height: 34px;
        min-width: 66px;
        padding: 0 14px;
        border: 1px solid var(--line-strong);
        background: #fff;
        color: #5f6b7b;
        font-size: 14px;
      }

      .top-button:hover:not(:disabled) {
        color: var(--blue);
        border-color: #bdd0ff;
      }

      .config-template-button {
        min-width: 94px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: #315fc4;
        border-color: #c9d7f5;
        background: #f8faff;
        font-weight: 700;
      }

      .config-template-button.primary {
        color: #fff;
        border-color: var(--blue);
        background: var(--blue);
      }

      .config-template-button.primary:hover:not(:disabled) {
        color: #fff;
        border-color: #1f62e8;
        background: #1f62e8;
      }

      .config-template-button:disabled {
        opacity: 0.58;
        cursor: wait;
      }

      .config-template-button .button-icon {
        font-size: 15px;
        line-height: 1;
      }

      .account-select {
        width: min(220px, 28vw);
        height: 34px;
        padding: 0 30px 0 10px;
        border: 1px solid var(--line-strong);
        border-radius: 6px;
        background: #fff;
        color: #425166;
        outline: none;
      }

      .account-select:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(47, 116, 255, 0.12);
      }

      /* Account selection is already handled by the account dashboard. */
      .config-window .account-select {
        display: none;
      }

      .remove-account {
        color: var(--danger);
      }

      .tabs {
        width: 100%;
        height: 70px;
        margin: 0;
        display: flex;
        align-items: flex-start;
        gap: 32px;
        padding: 8px 20px 0;
        background: var(--surface);
      }

      .tab {
        height: 46px;
        padding: 0 0 12px;
        border-radius: 0;
        background: transparent;
        color: #858f9d;
        font-size: 15px;
        position: relative;
      }

      .tab.active {
        color: var(--blue);
      }

      .tab.active::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        border-radius: 2px;
        background: var(--blue);
      }

      .workspace {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0 20px 32px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scroll-behavior: smooth;
        scrollbar-color: #aebbd0 #edf2f8;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        background: var(--surface);
      }

      .workspace::-webkit-scrollbar {
        width: 9px;
      }

      .workspace::-webkit-scrollbar-track {
        border-radius: 999px;
        background: #edf2f8;
      }

      .workspace::-webkit-scrollbar-thumb {
        border: 2px solid #edf2f8;
        border-radius: 999px;
        background: #aebbd0;
      }

      .workspace::-webkit-scrollbar-thumb:hover {
        background: #8798b2;
      }

      .config-page {
        min-height: 680px;
        background: var(--surface);
      }

      .app-status {
        margin: 0;
        min-height: 46px;
        padding: 12px 60px;
        border-bottom: 1px solid var(--line);
      }

      .panel-title,
      .group-title {
        margin: 0;
        padding: 20px 0 12px;
        display: flex;
        align-items: center;
        gap: 14px;
        color: #667486;
        font-size: 16px;
        font-weight: 600;
      }

      .group-title {
        padding-top: 14px;
      }

      .panel-title::before,
      .group-title::before {
        content: "";
        width: 44px;
        height: 1px;
        background: var(--line);
      }

      .panel-title::after,
      .group-title::after {
        content: "";
        height: 1px;
        flex: 1;
        background: var(--line);
      }

      .config-section {
        display: none;
      }

      .config-section.active {
        display: block;
      }

      .config-row {
        display: grid;
        grid-template-columns: 1fr 2fr;
        min-height: 56px;
        align-items: center;
      }

      .row-label {
        padding: 10px 24px 10px 60px;
        color: #435064;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.45;
        text-align: right;
      }

      .row-control {
        min-width: 0;
        display: flex;
        gap: 12px;
        align-items: center;
        justify-content: flex-start;
        padding: 10px 60px 10px 0;
      }

      .row-copy {
        min-width: 0;
        flex: 1 1 auto;
      }

      .row-copy strong {
        display: block;
        overflow-wrap: anywhere;
        font-size: 14px;
        font-weight: 600;
      }

      .row-copy small {
        display: block;
        margin-top: 2px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.45;
      }

      .pill {
        display: inline-flex;
        min-width: 58px;
        height: 26px;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        padding: 0 10px;
        background: #edf3ff;
        color: #2e65df;
        font-size: 12px;
        font-weight: 800;
      }

      .pill.ok {
        background: #e8f7f0;
        color: var(--ok);
      }

      .pill.wait {
        background: #f1f3f6;
        color: #838d9b;
      }

      .pill.busy {
        background: #fff2d9;
        color: #9a5b00;
      }

      .debug-box {
        width: calc(100% - 120px);
        max-height: 520px;
        margin: 10px 60px 34px;
        padding: 14px;
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: #fbfcfe;
        color: var(--text);
        font-size: 12px;
        line-height: 1.55;
        white-space: pre-wrap;
        word-break: break-word;
      }

      .empty {
        color: var(--muted);
        font-size: 14px;
      }

      @media (max-width: 760px) {
        .web-auth-screen { grid-template-columns: 1fr; }
        .web-auth-brand { min-height: auto; padding: 24px; }
        .web-auth-brand-copy { padding: 42px 0 18px; }
        .web-auth-brand-copy h1 { font-size: 30px; }
        .web-auth-brand-foot { display: none; }
        .web-auth-workspace { min-height: auto; padding: 20px 16px 36px; }
        .web-auth-panel { padding: 25px 20px; }
        .dashboard-user-name { display: none; }
        .admin-modal-panel { display: block; overflow: auto; }
        .admin-modal-panel > .account-modal-head { position: sticky; z-index: 10; top: 0; }
        .admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px; }
        .admin-content { min-height: auto; grid-template-columns: 1fr; padding: 0 12px 12px; overflow: visible; }
        .admin-users { max-height: none; overflow: visible; }
        .admin-accounts { min-height: 250px; overflow: auto; }
        .admin-account-table { min-width: 760px; }
        .admin-code-section { min-height: 300px; flex: 0 0 auto; margin: 0 12px 14px; overflow: visible; }
        .admin-code-toolbar { grid-template-columns: minmax(0, 1fr); gap: 10px; }
        .admin-code-create { justify-content: flex-start; }
        .admin-code-result-row { align-items: stretch; flex-direction: column; }
        .admin-code-output { width: 100%; flex-basis: auto; }
        .admin-code-list { height: 180px; min-height: 120px; flex: none; }
        .admin-code-table-head,
        .admin-code-row { grid-template-columns: minmax(100px, 1fr) 58px 80px 50px; gap: 6px; }
        .window-code-form { align-items: stretch; flex-direction: column; }
        .window-code-form button { min-height: 38px; }
        .daily-config-panel { padding: 18px 16px 16px; }
        .daily-config-item { gap: 10px; padding: 12px; }
        .daily-config-apply { min-width: 64px; padding: 0 11px; }
        .app-shell {
          padding: 8px;
        }

        .config-window {
          width: calc(100vw - 32px);
          height: min(88dvh, 820px);
          max-height: none;
          grid-template-rows: 52px 60px minmax(0, 1fr);
          border-radius: 10px;
        }

        .config-window .topbar {
          grid-template-columns: 36px minmax(0, 1fr) minmax(0, auto);
          height: 52px;
          padding-left: 10px;
          padding-right: 10px;
        }

        .config-window .top-title {
          display: block;
          min-width: 0;
          overflow: hidden;
          font-size: 16px;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .config-window .top-actions {
          gap: 5px;
        }

        .config-window .config-template-button {
          min-width: 0;
          height: 32px;
          padding: 0 8px;
          gap: 4px;
          font-size: 12px;
        }

        .config-window .config-template-button .button-icon {
          font-size: 13px;
        }

        .config-window .tabs {
          height: 60px;
        }

        .config-window .workspace {
          padding: 0 12px 24px;
        }

        .account-home {
          padding: 22px 16px 40px;
        }

        .account-home-header h1 {
          font-size: 22px;
        }

        .account-switcher {
          padding: 16px;
        }

        .account-grid {
          grid-template-columns: minmax(0, 1fr);
        }

        .account-card,
        .add-account-card {
          width: 100%;
          min-height: 205px;
        }

        .account-modal {
          padding: 12px;
        }

        .account-modal-panel {
          max-height: calc(100dvh - 24px);
          padding: 18px 16px 16px;
        }

        .channel-grid {
          grid-template-columns: repeat(3, minmax(78px, 1fr));
          gap: 9px;
          margin-bottom: 24px;
        }

        .channel-card {
          height: 104px;
        }

        .channel-icon {
          width: 48px;
          height: 48px;
          font-size: 20px;
        }

        .topbar {
          grid-template-columns: 36px 1fr;
          height: 56px;
          gap: 4px;
          padding: 0 10px;
        }

        .top-title {
          display: none;
        }

        .top-actions {
          gap: 6px;
          justify-content: flex-end;
        }

        .account-select { width: 112px; }

        .top-button {
          min-width: 58px;
          height: 32px;
          padding: 0 9px;
          font-size: 13px;
        }

        .tabs {
          gap: 26px;
          padding-left: 16px;
          padding-right: 16px;
          overflow-x: auto;
          scrollbar-width: none;
        }

        .workspace {
          padding: 0 20px;
        }

        .config-row {
          grid-template-columns: minmax(96px, 1fr) minmax(0, 2fr);
          min-height: 52px;
        }

        .row-label {
          padding: 9px 14px 9px 0;
          text-align: left;
        }

        .row-control {
          padding: 9px 0;
          align-items: flex-start;
          flex-direction: column;
          gap: 7px;
        }

        .daily-control {
          width: 100%;
          justify-content: flex-start;
        }

        .resource-level-column-heading {
          justify-content: flex-end;
          padding: 6px 0 2px;
        }

        .resource-level-column-heading span {
          max-width: 100%;
        }

        .panel-title,
        .group-title {
          padding-top: 18px;
        }

        .panel-title::before,
        .group-title::before {
          width: 16px;
        }

        .app-status {
          padding-left: 0;
          padding-right: 0;
        }

        .debug-box {
          width: 100%;
          margin-left: 0;
          margin-right: 0;
        }

        .login-screen {
          padding: 16px;
        }

        .login-row {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 340px) {
        .config-window .account-select {
          width: 86px;
          min-width: 0;
        }

        .config-window .top-actions {
          gap: 4px;
        }

        .config-window .top-button {
          min-width: 50px;
          padding-left: 6px;
          padding-right: 6px;
        }
      }

      @media (max-width: 1100px) {
        .login-screen.account-home {
          grid-template-columns: 190px minmax(0, 1fr);
        }

        .account-home-panel {
          padding-left: 18px;
          padding-right: 18px;
        }

        .account-dashboard-overview {
          grid-template-columns: minmax(0, 1fr);
        }

        .account-dashboard-stats > div {
          min-height: 54px;
        }

        .account-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      @media (max-width: 760px) {
        .login-screen.account-home {
          min-height: 100dvh;
          display: block;
          overflow: auto;
          padding: 0;
        }

        .account-dashboard-sidebar {
          min-height: auto;
          padding: 14px 12px 12px;
        }

        .account-dashboard-brand {
          padding: 0 4px 12px;
        }

        .account-dashboard-nav-title,
        .account-dashboard-service {
          display: none;
        }

        .account-dashboard-nav {
          grid-template-columns: repeat(4, minmax(0, 1fr));
          gap: 5px;
        }

        .account-dashboard-nav button {
          height: 38px;
          justify-content: center;
          padding: 0;
          font-size: 0;
        }

        .account-dashboard-nav button > span {
          width: auto;
          font-size: 16px;
        }

        .account-dashboard-nav em {
          display: none;
        }

        .account-home-panel {
          width: 100%;
          height: auto;
          min-height: calc(100dvh - 116px);
          padding: 0 12px 22px;
          overflow: visible;
        }

        .account-dashboard-topbar {
          min-height: 66px;
          align-items: flex-start;
          flex-direction: column;
          padding: 12px 0;
        }

        .account-dashboard-topbar h1 {
          font-size: 18px;
        }

        .account-dashboard-topbar p,
        .account-dashboard-user {
          display: none;
        }

        .account-dashboard-top-actions {
          width: 100%;
          flex-wrap: wrap;
        }

        .account-dashboard-user-tools {
          margin-left: auto;
        }

        .dashboard-bulk-button {
          width: 36px;
          min-width: 36px;
          padding: 0;
          font-size: 14px;
        }

        .dashboard-bulk-button b { display: none; }

        .account-dashboard-add-button {
          padding: 0 11px;
        }

        .account-dashboard-overview {
          grid-template-columns: minmax(0, 1fr);
        }

        .account-dashboard-welcome {
          min-height: 104px;
          padding: 18px;
        }

        .account-dashboard-stats {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .account-home-header {
          min-height: auto;
          align-items: flex-start;
          flex-direction: column;
          gap: 10px;
          padding: 16px 0 10px;
        }

        .account-home-tools {
          width: 100%;
          margin-left: 0;
          justify-content: space-between;
        }

        .account-filter-list {
          max-width: calc(100% - 86px);
          overflow-x: auto;
        }

        .account-grid {
          grid-template-columns: minmax(0, 1fr);
        }

        .account-card,
        .add-account-card,
        .empty-account-slot {
          width: 100%;
          min-height: 320px;
        }

        .account-meta-grid,
        .account-card-actions {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .runtime-log-modal { padding: 8px; }

        .runtime-log-panel {
          width: calc(100vw - 16px);
          height: calc(100dvh - 16px);
          min-height: 0;
          grid-template-rows: 52px minmax(0, 1fr) 58px;
          border-radius: 10px;
        }

        .runtime-log-head { padding: 0 10px 0 14px; }
        .runtime-log-head h2 { font-size: 14px; }

        .runtime-log-body {
          grid-template-columns: minmax(0, 1fr);
          grid-template-rows: 128px minmax(0, 1fr);
        }

        .runtime-log-sidebar {
          padding: 10px;
          border-right: 0;
          border-bottom: 1px solid #dce3ec;
        }

        .runtime-log-categories {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 6px;
        }

        .runtime-log-category {
          min-height: 32px;
          padding-left: 10px;
          border-radius: 10px;
          font-size: 11px;
        }

        .runtime-log-category b {
          min-width: 29px;
          height: 23px;
          font-size: 10px;
        }

        .runtime-log-toolbar { padding: 10px; }
        .runtime-log-search { height: 38px; font-size: 13px; }
        .runtime-log-options { gap: 8px; font-size: 11px; }
        .runtime-log-limit { width: 100%; margin-left: 0; }

        .runtime-log-row {
          min-width: 0;
          grid-template-columns: 150px 52px minmax(72px, 1fr);
          padding-top: 7px;
          padding-bottom: 7px;
          font-size: 11px;
        }

        .runtime-log-message {
          grid-column: 1 / -1;
          padding-left: 4px;
          font-size: 12px;
        }

        .runtime-log-footer { padding: 0 12px; }
      }
      [hidden] { display: none !important; }
      .site-icp-footer {
        width: 100%;
        padding: 18px 16px 24px;
        box-sizing: border-box;
        text-align: center;
        color: #8a96a8;
        font-size: 12px;
        line-height: 1.5;
      }

      .site-icp-footer a {
        color: inherit;
        text-decoration: none;
      }

      .site-icp-footer a:hover,
      .site-icp-footer a:focus-visible {
        color: #52627a;
        text-decoration: underline;
      }
      /* Five-category configuration: presentation only, legacy action keys stay intact. */
      .config-window { width: min(1120px, calc(100vw - 48px)); grid-template-rows: 56px auto 64px minmax(0, 1fr); }
      .config-account-bar { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: #f7f9fd; border-bottom: 1px solid #e8edf5; }
      .account-run-button { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid #d8e2f2; color: #3f587c; background: #fff; font-size: 13px; font-weight: 700; }
      .account-run-button.active { color: #245fe0; border-color: #abc5fa; background: #edf4ff; }
      .config-account-label { flex: 0 0 auto; color: #718198; font-size: 12px; }
      .config-window .account-select { display: block; flex: 1; width: auto; max-width: 370px; min-width: 0; font-size: 13px; background: transparent; }
      .protection-shortcut { margin-left: auto; flex: 0 0 auto; background: transparent; color: #6c7a90; padding: 8px 0 8px 8px; font-size: 12px; }
      .protection-shortcut.is-enabled { color: #16836a; }
      .config-window .tabs { height: 64px; align-items: flex-start; gap: 32px; padding: 8px 26px 0; border-bottom: 1px solid #e7edf5; overflow-x: auto; }
      .config-window .tab { flex: 0 0 auto; height: 46px; padding: 0 0 12px; font-size: 16px; font-weight: 500; }
      .tab span { min-width: 21px; padding: 2px 5px; border-radius: 5px; background: #f0f3f8; color: #8793a6; font-size: 11px; font-weight: 600; }
      .tab.active span { background: #eaf1ff; color: #3873e8; }
      .config-window .workspace { background: #f7f9fc; padding: 0 22px 24px; }
      .config-page { min-height: 0; background: transparent; }
      .config-window .app-status { min-height: 0; padding: 9px 0; border: 0; font-size: 12px; }
      .config-window .app-status:empty { display: none; }
      .config-category-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 18px; }
      .config-category-heading h2 { margin: 0 0 5px; font-size: 22px; color: #223955; }
      .config-category-heading p, .config-section-note { margin: 0; color: #8290a4; font-size: 12px; line-height: 1.6; }
      #configCategoryCount { flex: 0 0 auto; color: #4a658b; font-size: 12px; padding: 7px 10px; background: #eaf0f8; border-radius: 7px; }
      .config-discovery { display: flex; gap: 12px; align-items: center; }
      .config-search-label { flex: 1; min-width: 0; margin: 0; }
      .config-search-label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
      #configTaskSearch { width: 100%; height: 38px; padding: 0 12px; font-size: 13px; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
      .config-task-filters { display: flex; flex: 0 0 auto; padding: 3px; gap: 2px; border-radius: 8px; background: #eaf0f7; }
      .config-task-filters button { padding: 7px 13px; background: transparent; color: #7a899e; font-size: 12px; }
      .config-task-filters button[aria-pressed="true"] { color: #2b68dc; background: #fff; box-shadow: 0 1px 4px #17345912; }
      .config-group-shortcuts { display: flex; gap: 7px; flex-wrap: wrap; padding: 12px 0 16px; }
      .config-group-shortcuts button { padding: 5px 9px; font-size: 11px; font-weight: 500; color: #687c98; background: #eef2f8; border: 1px solid #e5ebf3; border-radius: 6px; }
      .config-group-shortcuts button:hover { color: #2866db; border-color: #a7c5fa; background: #f4f8ff; }
      .config-task-group { margin-bottom: 13px; background: #fff; border: 1px solid #e0e7f1; border-radius: 10px; overflow: hidden; scroll-margin-top: 12px; }
      .config-task-group > summary { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; list-style: none; background: #fcfdff; }
      .config-task-group > summary::-webkit-details-marker { display: none; }
      .config-task-group > summary::before { content: ""; width: 6px; height: 6px; border: solid #8396b0; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
      .config-task-group[open] > summary::before { transform: rotate(45deg); margin-top: -3px; }
      .config-group-title { color: #354d70; font-size: 14px; font-weight: 700; }
      .config-group-count { margin-left: auto; color: #8493a7; font-size: 11px; white-space: nowrap; }
      .config-task { border-top: 1px solid #edf1f6; }
      .config-task > .config-row { grid-template-columns: 178px minmax(0, 1fr); }
      .config-task .row-label { padding: 16px 15px 16px 20px; text-align: left; font-weight: 600; color: #465a75; }
      .config-task-context { display: block; margin-top: 4px; font-size: 10px; font-weight: 400; color: #8a9bb1; }
      .config-task .row-control { padding: 14px 18px 14px 0; gap: 14px; }
      .config-task .row-copy strong { font-size: 12px; color: #617590; font-weight: 500; }
      .config-task .row-copy small { font-size: 11px; color: #94a1b4; }
      .config-task .daily-control { max-width: 100%; flex-shrink: 1; }
      .config-task .pill { min-width: 48px; height: 24px; font-size: 11px; }
      .config-task-path { padding: 12px 20px 0; color: #2f70da; font-size: 11px; }
      .config-search-summary { margin: 0 0 14px; color: #6c7f9a; font-size: 12px; }
      .config-tasks-empty { padding: 55px 20px; text-align: center; color: #8a98ab; font-size: 13px; background: #fff; border: 1px dashed #dce4ef; border-radius: 10px; }
      #accountRunPanel .config-row { border-bottom: 1px solid #edf1f6; background: #fff; }
      #accountRunPanel .config-section-note { margin-bottom: 16px; }
      .config-task-group[hidden], .config-task[hidden], .config-task-path[hidden], .config-tasks-empty[hidden], .config-search-summary[hidden] { display: none; }
      @media (max-width: 760px) {
        .config-window { width: calc(100vw - 20px); height: 94dvh; grid-template-rows: 52px auto 60px minmax(0, 1fr); }
        .config-window .topbar { grid-template-columns: 28px minmax(0, 1fr) auto; }
        .config-account-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
        .account-run-button { padding: 0 10px; font-size: 12px; }
        .config-window .account-select { max-width: none; font-size: 12px; }
        .protection-shortcut { width: 100%; text-align: right; padding: 0; font-size: 11px; }
        .config-window .tabs { height: 60px; padding: 8px 18px 0; gap: clamp(12px, 4vw, 24px); }
        .config-window .tab { flex-basis: auto; height: 46px; font-size: 15px; padding: 0 0 12px; }
        .config-window .workspace { padding: 0 12px 20px; }
        .config-category-heading { padding: 10px 0 13px; align-items: flex-start; }
        .config-category-heading h2 { font-size: 19px; }
        .config-category-heading p { max-width: 225px; font-size: 11px; }
        #configCategoryCount { padding: 5px 7px; font-size: 10px; }
        .config-discovery { flex-wrap: wrap; gap: 9px; }
        .config-search-label { flex-basis: 100%; }
        .config-task-filters { width: 100%; }
        .config-task-filters button { flex: 1; }
        .config-group-shortcuts { flex-wrap: nowrap; overflow-x: auto; padding: 11px 0 13px; }
        .config-group-shortcuts button { flex: 0 0 auto; }
        .config-task-group > summary { padding: 13px 12px; gap: 9px; }
        .config-group-title { font-size: 13px; }
        .config-task > .config-row { grid-template-columns: 1fr; padding: 12px; gap: 5px; }
        .config-task .row-label, .config-task .row-control { padding: 0; }
        .config-task .row-control { gap: 9px; }
        .config-task .daily-control { gap: 7px; }
        .config-task .row-copy { width: 100%; }
        .config-task-path { padding: 12px 12px 0; }
      }
      .zip-config-page .zip-gather-order-controls { flex-wrap: wrap; }
      .zip-config-page .zip-gather-safe-mine { flex-shrink: 0; white-space: nowrap; font-size: 13px; }
      .zip-config-page .native-join-choice-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; min-width: 0; }
      .zip-config-page .native-join-choice-name { overflow-wrap: anywhere; }
      .zip-config-page .native-join-count { font-variant-numeric: tabular-nums; white-space: nowrap; color: #426580; }
      .zip-config-page .native-join-count.is-full { color: #b26b24; font-weight: 600; }
      .zip-config-page .native-join-count.is-unknown { color: #8796aa; }
      .zip-config-page .native-join-count-status { padding-top: 8px; overflow-wrap: anywhere; }
      @media (max-width: 500px) {
        .zip-config-page [data-task-key=native_auto_join] [data-reference-group=activity_ids] .reference-choice-options { grid-template-columns: minmax(0, 1fr); }
      }
