.account-tools {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #d6e4ed;
}

.account-tools-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.account-tools-tabs button {
    min-height: 40px;
    border: 1px solid #bcd8e9;
    border-radius: 9px;
    background: #f3f9fd;
    color: #23617f;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-tools-tabs button.active {
    border-color: #168fd1;
    background: #e4f5ff;
    color: #006da9;
}

.account-tools-panel {
    margin-top: 18px;
}

.account-tools-panel h3 {
    margin: 0 0 14px;
}

#account-settings-form {
    display: grid;
    gap: 11px;
}

.account-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    border: 1px solid #d5e4ed;
    border-radius: 9px;
    background: white;
}

.account-check input {
    margin-top: 3px;
}

.account-check span {
    display: grid;
    gap: 2px;
}

.account-check small {
    color: #698296;
}

.account-check.disabled {
    opacity: 0.55;
}

.account-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-settings-grid label {
    display: grid;
    gap: 5px;
    color: #4d6c82;
    font-size: 12px;
    font-weight: 700;
}

.account-settings-grid input {
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #c5dae8;
    border-radius: 8px;
    background: white;
}

#account-settings-form > button {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: #008bd2;
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.account-tools-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #edf6fb;
    color: #42637a;
    font-size: 13px;
}

.account-tools-message[data-type="success"] {
    background: #ebf9f3;
    color: #087357;
}

.account-tools-message[data-type="error"] {
    background: #fff0f2;
    color: #b31f35;
}

.account-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d4e3ec;
    border-radius: 9px;
    background: white;
}

.account-user-card + .account-user-card {
    margin-top: 8px;
}

.account-user-card > div:first-child {
    display: grid;
    gap: 2px;
}

.account-user-card span,
.account-user-card small {
    color: #627f92;
    font-size: 12px;
}

.account-user-controls {
    display: flex;
    gap: 7px;
}

.account-user-controls select,
.account-user-controls button {
    min-height: 36px;
    border: 1px solid #bcd5e5;
    border-radius: 7px;
    background: #f5fafd;
    color: #175674;
}

.account-user-controls button {
    cursor: pointer;
}

.auth-dialog:has(.account-tools-panel:not([hidden])) {
    width: min(720px, calc(100vw - 28px));
}

@media (max-width: 600px) {
    .account-settings-grid {
        grid-template-columns: 1fr;
    }

    .account-user-card {
        align-items: stretch;
        flex-direction: column;
    }

    .account-user-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


/* SIGNAL ACCOUNT RULES 0.17.0 */

.account-rules-heading {
    margin-bottom: 14px;
}

.account-rules-heading h3 {
    margin-bottom: 3px;
}

.account-rules-heading small,
.account-rule-content span,
.account-rule-content small {
    color: #627f92;
}

#account-rule-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d4e3ec;
    border-radius: 11px;
    background: #f7fbfd;
}

.account-rule-grid,
.account-rule-channels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-rule-grid label {
    display: grid;
    gap: 5px;
    color: #4d6c82;
    font-size: 12px;
    font-weight: 700;
}

.account-rule-grid input,
.account-rule-grid select {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #c5dae8;
    border-radius: 8px;
    background: white;
}

#account-rule-form > button {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: #008bd2;
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.account-rules-list {
    display: grid;
    gap: 9px;
    margin-top: 15px;
}

.account-rule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d4e3ec;
    border-left: 4px solid #10a678;
    border-radius: 9px;
    background: white;
}

.account-rule-card.disabled {
    border-left-color: #9eb1bd;
    opacity: 0.67;
}

.account-rule-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-rule-controls {
    display: flex;
    gap: 7px;
}

.account-rule-controls button {
    min-height: 35px;
    padding: 6px 10px;
    border: 1px solid #bcd5e5;
    border-radius: 7px;
    background: #f5fafd;
    color: #175674;
    cursor: pointer;
}

.account-rule-controls button.danger {
    border-color: #efc1c6;
    background: #fff5f6;
    color: #ad2436;
}

.account-rules-empty {
    padding: 14px;
    border: 1px dashed #c9dce8;
    border-radius: 9px;
    color: #698296;
    text-align: center;
}

@media (max-width: 600px) {
    .account-tools-tabs,
    .account-rule-grid,
    .account-rule-channels {
        grid-template-columns: 1fr;
    }

    .account-rule-card {
        align-items: stretch;
        flex-direction: column;
    }

    .account-rule-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
