:root {
    --ha-primary: #0b5cff;
    --ha-primary-strong: #0646c8;
    --ha-primary-soft: #eef4ff;
    --ha-success: #07885f;
    --ha-success-soft: #e9f8f2;
    --ha-warning: #b66a00;
    --ha-warning-soft: #fff6df;
    --ha-danger: #c73345;
    --ha-danger-soft: #fff0f2;
    --ha-ink: #14213d;
    --ha-muted: #64748b;
    --ha-border: #dfe7f1;
    --ha-surface: #ffffff;
    --ha-page: #f4f7fb;
    --ha-radius-sm: 10px;
    --ha-radius: 16px;
    --ha-radius-lg: 24px;
    --ha-shadow: 0 18px 48px rgba(15, 36, 74, .09);
}

/* The HTML hidden attribute must always win over component display rules. */
.ha-auth-page [hidden],
.ha-page [hidden],
.ha-alert[hidden] {
    display: none !important;
}

.ha-page,
.ha-auth-page {
    color: var(--ha-ink);
    font-family: inherit;
}

.ha-page *,
.ha-auth-page * {
    box-sizing: border-box;
}

.ha-page {
    padding: 2px 0 28px;
}

.ha-auth-page {
    min-height: min(760px, 88vh);
    display: grid;
    place-items: center;
    padding: 56px 18px;
    background:
        radial-gradient(circle at 8% 8%, rgba(11, 92, 255, .10), transparent 28%),
        radial-gradient(circle at 92% 92%, rgba(8, 136, 95, .09), transparent 25%),
        var(--ha-page);
}

.ha-auth-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(300px, .86fr) minmax(360px, 1.14fr);
    overflow: hidden;
    border: 1px solid rgba(210, 221, 235, .9);
    border-radius: 28px;
    background: var(--ha-surface);
    box-shadow: var(--ha-shadow);
}

.ha-auth-story {
    position: relative;
    min-height: 630px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 52px 46px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .16), transparent 28%),
        linear-gradient(145deg, #08235d 0%, #0b5cff 64%, #1675ff 100%);
}

.ha-auth-story::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -100px;
    width: 310px;
    height: 310px;
    border: 44px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
}

.ha-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.ha-brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
}

.ha-story-copy {
    position: relative;
    z-index: 1;
}

.ha-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    color: #cfe1ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ha-story-copy h1,
.ha-story-copy h2 {
    max-width: 430px;
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 850;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.ha-story-copy p {
    max-width: 430px;
    margin: 0;
    color: #d8e7ff;
    font-size: 15px;
    line-height: 1.75;
}

.ha-trust-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 11px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.ha-trust-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f4f8ff;
    font-size: 13px;
    font-weight: 650;
}

.ha-trust-list i {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    font-size: 11px;
}

.ha-auth-panel {
    display: flex;
    align-items: center;
    padding: 48px clamp(28px, 6vw, 70px);
}

.ha-auth-panel-inner {
    width: 100%;
    max-width: 470px;
    margin: auto;
}

.ha-heading {
    margin-bottom: 28px;
}

.ha-heading h1,
.ha-heading h2,
.ha-page-title {
    margin: 0;
    color: var(--ha-ink);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.ha-heading p,
.ha-page-subtitle {
    margin: 9px 0 0;
    color: var(--ha-muted);
    font-size: 14px;
    line-height: 1.65;
}

.ha-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 18px;
    padding: 13px 14px;
    border: 1px solid var(--ha-border);
    border-radius: 13px;
    background: #f8fafc;
    color: var(--ha-ink);
    font-size: 13px;
    line-height: 1.55;
}

.ha-alert--danger {
    border-color: #ffcbd2;
    background: var(--ha-danger-soft);
    color: #9f2534;
}

.ha-alert--success {
    border-color: #bcebd8;
    background: var(--ha-success-soft);
    color: #087451;
}

.ha-alert--warning {
    border-color: #f1d49e;
    background: var(--ha-warning-soft);
    color: #8a5200;
}

.ha-social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ha-social-btn {
    --provider: var(--ha-primary);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid var(--ha-border);
    border-radius: 13px;
    background: #fff;
    color: var(--ha-ink);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none !important;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ha-social-btn:hover {
    color: var(--provider);
    border-color: color-mix(in srgb, var(--provider) 48%, #fff);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--provider) 12%, transparent);
    transform: translateY(-1px);
}

.ha-social-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--provider) 10%, #fff);
    color: var(--provider);
}

.ha-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 22px 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.ha-divider::before,
.ha-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ha-border);
}

.ha-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ha-field {
    margin-bottom: 17px;
}

.ha-field--full {
    grid-column: 1 / -1;
}

.ha-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.ha-field label,
.ha-field-head label {
    margin: 0;
    color: #34445d;
    font-size: 13px;
    font-weight: 750;
}

.ha-field a {
    color: var(--ha-primary);
    font-size: 12px;
    font-weight: 700;
}

.ha-input-wrap {
    position: relative;
}

.ha-input,
.ha-field .form-control {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--ha-border);
    border-radius: 12px;
    outline: 0;
    background: #fbfdff;
    color: var(--ha-ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.ha-input:focus,
.ha-field .form-control:focus {
    border-color: var(--ha-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 92, 255, .09);
}

.ha-input[aria-invalid="true"] {
    border-color: var(--ha-danger);
    box-shadow: 0 0 0 4px rgba(199, 51, 69, .08);
}

.ha-input-action {
    position: absolute;
    inset-inline-end: 9px;
    top: 50%;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #718096;
    transform: translateY(-50%);
    cursor: pointer;
}

.ha-input-action:hover {
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
}

.ha-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ha-muted);
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

.ha-check input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--ha-primary);
}

.ha-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: var(--ha-primary);
    color: #fff !important;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ha-btn:hover {
    background: var(--ha-primary-strong);
    box-shadow: 0 8px 20px rgba(11, 92, 255, .2);
    transform: translateY(-1px);
}

.ha-btn:disabled,
.ha-btn[aria-disabled="true"] {
    opacity: .58;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.ha-btn--block {
    width: 100%;
}

.ha-btn--soft {
    border-color: #cbdcff;
    background: var(--ha-primary-soft);
    color: var(--ha-primary) !important;
}

.ha-btn--soft:hover {
    background: #dfeaff;
    box-shadow: none;
}

.ha-btn--neutral {
    border-color: var(--ha-border);
    background: #fff;
    color: #34445d !important;
}

.ha-btn--neutral:hover {
    border-color: #c7d3e2;
    background: #f8fafc;
    box-shadow: none;
}

.ha-btn--danger {
    border-color: #ffc9d0;
    background: #fff;
    color: var(--ha-danger) !important;
}

.ha-btn--danger:hover {
    background: var(--ha-danger-soft);
    box-shadow: none;
}

.ha-auth-footer {
    margin-top: 24px;
    color: var(--ha-muted);
    font-size: 13px;
    text-align: center;
}

.ha-auth-footer a {
    color: var(--ha-primary);
    font-weight: 800;
}

.ha-card {
    overflow: hidden;
    border: 1px solid var(--ha-border);
    border-radius: var(--ha-radius);
    background: var(--ha-surface);
    box-shadow: 0 8px 28px rgba(15, 36, 74, .055);
}

.ha-card + .ha-card {
    margin-top: 18px;
}

.ha-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid #edf2f7;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.ha-card-head h2,
.ha-card-head h3 {
    margin: 0;
    color: var(--ha-ink);
    font-size: 17px;
    font-weight: 820;
}

.ha-card-head p {
    margin: 5px 0 0;
    color: var(--ha-muted);
    font-size: 12px;
    line-height: 1.55;
}

.ha-card-body {
    padding: 22px;
}

.ha-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.ha-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.ha-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 27px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #52647c;
    font-size: 11px;
    font-weight: 800;
}

.ha-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ha-status--success {
    background: var(--ha-success-soft);
    color: var(--ha-success);
}

.ha-status--warning {
    background: var(--ha-warning-soft);
    color: var(--ha-warning);
}

.ha-status--danger {
    background: var(--ha-danger-soft);
    color: var(--ha-danger);
}

.ha-security-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr);
    gap: 26px;
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid #cfe0ff;
    border-radius: var(--ha-radius-lg);
    background:
        radial-gradient(circle at 90% 15%, rgba(11, 92, 255, .15), transparent 25%),
        linear-gradient(135deg, #fff 0%, #f2f7ff 100%);
}

.ha-security-hero h1 {
    margin: 0 0 10px;
    color: var(--ha-ink);
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 860;
    letter-spacing: -.04em;
}

.ha-security-hero p {
    max-width: 660px;
    margin: 0;
    color: var(--ha-muted);
    font-size: 14px;
    line-height: 1.7;
}

.ha-security-meter {
    align-self: center;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 12px 30px rgba(11, 92, 255, .08);
    backdrop-filter: blur(8px);
}

.ha-security-meter strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ha-ink);
    font-size: 13px;
}

.ha-meter-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5edf8;
}

.ha-meter-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ha-primary), #14a57a);
}

.ha-meter-label {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--ha-muted);
    font-size: 11px;
}

.ha-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.ha-stat {
    padding: 18px;
    border: 1px solid var(--ha-border);
    border-radius: 15px;
    background: #fff;
}

.ha-stat-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
}

.ha-stat strong {
    display: block;
    color: var(--ha-ink);
    font-size: 14px;
}

.ha-stat span {
    display: block;
    margin-top: 4px;
    color: var(--ha-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ha-account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    gap: 18px;
}

.ha-security-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 0;
    border-bottom: 1px solid #edf2f7;
    color: inherit;
    text-decoration: none !important;
}

.ha-security-link:last-child {
    border-bottom: 0;
}

.ha-security-link-copy {
    display: flex;
    align-items: center;
    gap: 13px;
}

.ha-security-link-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #40536d;
}

.ha-security-link strong {
    display: block;
    color: var(--ha-ink);
    font-size: 13px;
}

.ha-security-link small {
    display: block;
    margin-top: 3px;
    color: var(--ha-muted);
    font-size: 11px;
}

.ha-provider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #edf2f7;
}

.ha-provider:last-child {
    border-bottom: 0;
}

.ha-provider-id {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ha-provider-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border: 1px solid var(--ha-border);
    border-radius: 12px;
    background: #fff;
}

.ha-provider-name {
    display: block;
    color: var(--ha-ink);
    font-size: 13px;
    font-weight: 800;
}

.ha-provider-meta {
    display: block;
    max-width: 250px;
    overflow: hidden;
    margin-top: 3px;
    color: var(--ha-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ha-stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 22px;
}

.ha-step {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ha-border);
    border-radius: 13px;
    background: #fff;
    color: var(--ha-muted);
    font-size: 11px;
    font-weight: 750;
}

.ha-step-number {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    flex: 0 0 27px;
    border-radius: 50%;
    background: #edf2f7;
    color: #52647c;
}

.ha-step.is-active {
    border-color: #b8ceff;
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
}

.ha-step.is-active .ha-step-number,
.ha-step.is-complete .ha-step-number {
    background: var(--ha-primary);
    color: #fff;
}

.ha-step.is-complete {
    border-color: #bcebd8;
    background: var(--ha-success-soft);
    color: var(--ha-success);
}

.ha-setup-grid {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
    gap: 18px;
}

.ha-qr-box {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 22px;
    border: 1px solid var(--ha-border);
    border-radius: 18px;
    background:
        linear-gradient(45deg, #f8fbff 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, #f8fbff 25%, transparent 25%) 0 10px / 20px 20px,
        #fff;
}

.ha-qr-box img {
    width: min(230px, 100%);
    height: auto;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 36, 74, .12);
}

.ha-secret {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px dashed #b8c7db;
    border-radius: 11px;
    background: #f8fafc;
}

.ha-secret code {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    color: #26364c;
    font-size: 12px;
    letter-spacing: .08em;
}

.ha-icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border: 1px solid var(--ha-border);
    border-radius: 9px;
    background: #fff;
    color: var(--ha-primary);
    cursor: pointer;
}

.ha-guide {
    counter-reset: guide;
    display: grid;
    gap: 13px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ha-guide li {
    counter-increment: guide;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
}

.ha-guide li::before {
    content: counter(guide);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
    font-size: 12px;
    font-weight: 850;
}

.ha-guide strong {
    display: block;
    margin-top: 1px;
    color: var(--ha-ink);
    font-size: 13px;
}

.ha-guide p {
    margin: 4px 0 0;
    color: var(--ha-muted);
    font-size: 12px;
    line-height: 1.55;
}

.ha-otp {
    width: min(350px, 100%);
    display: grid;
    grid-template-columns: repeat(6, minmax(36px, 1fr));
    gap: 8px;
    direction: ltr;
}

.ha-otp input {
    min-width: 0;
    height: 52px;
    padding: 0;
    border: 1px solid var(--ha-border);
    border-radius: 11px;
    background: #fbfdff;
    color: var(--ha-ink);
    font-size: 23px;
    font-weight: 850;
    text-align: center;
    outline: 0;
}

.ha-otp input:focus {
    border-color: var(--ha-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 92, 255, .09);
}

.ha-session-list {
    display: grid;
    gap: 12px;
}

.ha-session {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--ha-border);
    border-radius: 14px;
    background: #fff;
}

.ha-session.is-current {
    border-color: #bcebd8;
    background: linear-gradient(90deg, #f2fbf7, #fff);
}

.ha-session-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef3f8;
    color: #40536d;
    font-size: 17px;
}

.ha-session-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--ha-ink);
    font-size: 13px;
    font-weight: 800;
}

.ha-session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin-top: 5px;
    color: var(--ha-muted);
    font-size: 11px;
}

.ha-empty {
    padding: 46px 24px;
    border: 1px dashed #cdd8e6;
    border-radius: 16px;
    background: #fafcff;
    text-align: center;
}

.ha-empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 13px;
    border-radius: 17px;
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
    font-size: 21px;
}

.ha-empty h3 {
    margin: 0;
    color: var(--ha-ink);
    font-size: 16px;
    font-weight: 820;
}

.ha-empty p {
    margin: 7px auto 18px;
    color: var(--ha-muted);
    font-size: 12px;
}

.ha-notification-list {
    display: grid;
    gap: 10px;
}

.ha-notification {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--ha-border);
    border-radius: 14px;
    background: #fff;
}

.ha-notification.is-unread {
    border-color: #bfd2ff;
    background: linear-gradient(90deg, #f3f7ff, #fff 55%);
}

.ha-notification-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
}

.ha-notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ha-notification h3 {
    margin: 0;
    color: var(--ha-ink);
    font-size: 13px;
    font-weight: 820;
}

.ha-notification time {
    color: var(--ha-muted);
    font-size: 10px;
}

.ha-notification p {
    margin: 5px 0 0;
    color: #52647c;
    font-size: 12px;
    line-height: 1.55;
}

.ha-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.ha-table th {
    padding: 12px 15px;
    border-bottom: 1px solid var(--ha-border);
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-align: start;
    text-transform: uppercase;
}

.ha-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #edf2f7;
    color: #40536d;
    font-size: 12px;
}

.ha-table tr:last-child td {
    border-bottom: 0;
}

.ha-dashboard-nav {
    overflow: hidden;
    border: 1px solid var(--ha-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 36, 74, .05);
}

.ha-dashboard-nav-head {
    padding: 16px 17px 10px;
    color: #8796aa;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ha-dashboard-nav ul {
    margin: 0;
    padding: 5px 8px 10px;
    list-style: none;
}

.ha-dashboard-nav .nav-link {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 2px 0;
    padding: 9px 11px;
    border: 0 !important;
    border-radius: 11px;
    color: #52647c;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ha-dashboard-nav .nav-link:hover,
.ha-dashboard-nav .nav-link.is-active {
    background: var(--ha-primary-soft);
    color: var(--ha-primary);
}

.ha-dashboard-nav .nav-link > i:first-child {
    width: 20px;
    text-align: center;
}

.ha-dashboard-nav .ha-nav-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: start;
    cursor: pointer;
}

.ha-dashboard-nav .ha-nav-chevron {
    margin-inline-start: auto;
    transition: transform .16s ease;
}

.ha-dashboard-nav .is-open > .ha-nav-toggle .ha-nav-chevron {
    transform: rotate(180deg);
}

.ha-dashboard-nav .nav-treeview {
    display: none;
    margin: 1px 0 5px 21px;
    padding: 2px 0 2px 9px;
    border-inline-start: 1px solid #dce5ef;
}

.ha-dashboard-nav .is-open > .nav-treeview {
    display: block;
}

.ha-dashboard-nav .nav-treeview .nav-link {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
}

.ha-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: #e8eef6;
}

.ha-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ha-primary), #18a97d);
}

.ha-password-score {
    margin-top: 8px;
}

.ha-password-score small {
    display: block;
    margin-top: 5px;
    color: var(--ha-muted);
    font-size: 10px;
}

.ha-inline-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.ha-loader {
    width: 15px;
    height: 15px;
    display: none;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ha-spin .75s linear infinite;
}

[data-busy="true"] .ha-loader {
    display: inline-block;
}

@keyframes ha-spin {
    to { transform: rotate(360deg); }
}

[dir="rtl"] .ha-dashboard-nav .nav-treeview {
    margin: 1px 21px 5px 0;
}

[dir="rtl"] .ha-auth-story::after {
    right: auto;
    left: -90px;
}

@media (max-width: 991px) {
    .ha-security-hero,
    .ha-account-layout,
    .ha-setup-grid {
        grid-template-columns: 1fr;
    }

    .ha-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .ha-auth-shell {
        max-width: 560px;
        grid-template-columns: 1fr;
    }

    .ha-auth-story {
        min-height: auto;
        padding: 28px;
    }

    .ha-story-copy h1,
    .ha-story-copy h2 {
        font-size: 28px;
    }

    .ha-trust-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 22px;
    }

    .ha-auth-panel {
        padding: 36px 28px 40px;
    }
}

@media (max-width: 575px) {
    .ha-auth-page {
        min-height: 0;
        padding: 20px 12px;
    }

    .ha-auth-shell {
        border-radius: 21px;
    }

    .ha-auth-story {
        padding: 23px 20px;
    }

    .ha-brand {
        margin-bottom: 22px;
    }

    .ha-trust-list {
        grid-template-columns: 1fr;
    }

    .ha-auth-panel {
        padding: 29px 20px 32px;
    }

    .ha-social-grid,
    .ha-form-grid,
    .ha-stepper {
        grid-template-columns: 1fr;
    }

    .ha-topbar,
    .ha-card-head,
    .ha-provider {
        align-items: stretch;
        flex-direction: column;
    }

    .ha-card-body,
    .ha-card-head,
    .ha-security-hero {
        padding: 18px;
    }

    .ha-card-actions .ha-btn,
    .ha-provider .ha-btn {
        width: 100%;
    }

    .ha-session {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .ha-session-actions {
        grid-column: 1 / -1;
    }

    .ha-session-actions .ha-btn {
        width: 100%;
    }

    .ha-otp {
        gap: 5px;
    }

    .ha-otp input {
        height: 46px;
        border-radius: 9px;
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ha-page *,
    .ha-auth-page * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}
