.savio-comment-account {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--appearance-muted,#686B70);
    font-size: 0.84rem;
    line-height: 1.5;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.savio-comment-account__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.savio-text-action,
.savio-auth-link {
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    color: var(--appearance-ink,#1D1D1F);
    background: transparent;
    font: 560 0.8rem/1 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    text-decoration: underline;
    text-decoration-color: rgba(29, 29, 31, 0.32);
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.savio-text-action {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.savio-text-action:active {
    opacity: 0.62;
}

.savio-text-action:hover,
.savio-auth-link:hover {
    text-decoration-color: currentColor;
}

.savio-text-action:focus-visible,
.savio-guest-dialog button:focus-visible,
.savio-guest-dialog input:focus-visible,
.savio-auth-link:focus-visible,
.savio-auth-close:focus-visible,
.savio-auth-primary:focus-visible,
.savio-auth-form input:focus-visible {
    outline: 2px solid var(--appearance-strong,#111214);
    outline-offset: 3px;
}

.savio-guest-dialog {
    width: min(100% - 32px, 420px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--appearance-rule,#D8DADD);
    border-radius: 12px;
    color: var(--appearance-ink,#1D1D1F);
    background: var(--appearance-paper,#FCFCFD);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.savio-guest-dialog::backdrop { background: rgba(16,17,18,.46); }
.savio-guest-shell { display: grid; gap: 16px; padding: 24px; }
.savio-guest-shell header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; }
.savio-guest-shell h3 { grid-column: 2; margin: 0; text-align: center; font-size: 1.2rem; }
.savio-guest-shell header button { grid-column: 3; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 1.5rem; cursor: pointer; }
.savio-guest-fields { display: grid; gap: 14px; }
.savio-guest-fields p { margin: 0; }
.savio-guest-fields label { display: block; margin-bottom: 6px; font-size: .86rem; }
.savio-guest-fields input[type="text"],
.savio-guest-fields input[type="email"] { box-sizing: border-box; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--appearance-input-rule,#C9CBD0); border-radius: 10px; background: var(--appearance-input,#fff); color: inherit; font: inherit; }
.savio-guest-fields .comment-form-cookies-consent { display: flex; align-items: center; min-height: 44px; }
.savio-guest-fields .comment-form-cookies-consent input { width: 20px; height: 20px; margin: 0 10px 0 0; accent-color: var(--appearance-strong,#252b35); }
.savio-guest-fields .comment-form-cookies-consent label { margin: 0; }
.savio-guest-shell > p { margin: 0; color: var(--appearance-muted,#686B70); font-size: .82rem; line-height: 1.6; }
.savio-guest-submit { min-height: 48px; border: 0; border-radius: 10px; background: var(--appearance-strong,#252b35); color: var(--appearance-button-text,#fff); font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.savio-guest-login { min-height: 44px; border: 0; background: transparent; color: var(--appearance-ink,#1D1D1F); font: inherit; font-size: .82rem; cursor: pointer; }

.savio-auth-dialog {
    width: min(100% - 32px, 440px);
    max-height: min(760px, calc(100dvh - 32px));
    margin: auto;
    padding: 0;
    border: 1px solid var(--appearance-rule,#D8DADD);
    border-radius: 10px;
    color: var(--appearance-ink,#1D1D1F);
    background: var(--appearance-paper,#FCFCFD);
    box-shadow: none;
    font-family: var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.savio-auth-dialog::backdrop {
    background: rgba(16, 17, 18, 0.46);
    backdrop-filter: blur(3px);
}

.savio-auth-dialog[open] {
    animation: savio-dialog-in 160ms cubic-bezier(.2, .8, .2, 1);
}

.savio-auth-shell {
    padding: 26px;
    overflow-y: auto;
}

.savio-auth-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.savio-auth-header > div { width: 100%; min-width: 0; }

.savio-auth-header h3 {
    margin: 0;
    padding-inline: 44px;
    text-align: center;
    font-size: clamp(30px, 8vw, 36px);
    font-weight: 650;
    line-height: 1.25;
}

.savio-auth-close {
    position: absolute;
    top: -4px;
    right: -9px;
    display: grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--appearance-muted,#686B70);
    background: transparent;
    font: 300 1.5rem/1 system-ui, sans-serif;
    cursor: pointer;
}

.savio-auth-close:hover {
    color: var(--appearance-ink,#1D1D1F);
    background: var(--appearance-hover,#EEF0F2);
}

.savio-auth-form {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.savio-auth-form[hidden],
.savio-auth-error[hidden] {
    display: none;
}

.comment-form .comment-form-cookies-consent[hidden] {
  display: none !important;
}

.savio-auth-copy {
    margin: 0;
    color: var(--appearance-muted,#686B70);
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.6;
}

.savio-auth-form input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--appearance-input-rule,#C9CCD1);
    border-radius: 6px;
    color: var(--appearance-ink,#1D1D1F);
    background: var(--appearance-input,#FFFFFF);
    font: 400 1rem/1.3 var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.savio-auth-form input:focus {
    border-color: var(--appearance-ink,#1D1D1F);
}

.savio-auth-form input:focus-visible {
    border-color: var(--appearance-strong,#111214);
    outline: 0;
    box-shadow: 0 0 0 1px var(--appearance-strong,#111214);
}

.savio-auth-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 62px;
    margin-top: 15px;
    padding: 0 18px;
    border: 1px solid var(--appearance-strong,#111214);
    border-radius: 9px;
    color: var(--appearance-button-text,#FFFFFF);
    background: #252a32;
    font: 620 17px/1 var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: opacity 140ms ease, transform 140ms ease;
}

.savio-auth-primary:hover {
    background: var(--appearance-button-hover,#292B2E);
}

.savio-auth-primary:active {
    transform: scale(0.985);
}

.savio-auth-primary:disabled {
    opacity: 0.52;
    cursor: wait;
}

.savio-auth-link {
    justify-self: center;
    font: 500 0.8rem/1.5 var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

html[data-color-mode="dark"] .savio-auth-primary { color: #222326; background: #e8e9eb; }

.savio-auth-error {
    margin: 18px 0 0;
    padding: 10px 12px;
    border-left: 2px solid var(--appearance-error-rule,#C63831);
    color: var(--appearance-error,#7B2420);
    background: var(--appearance-error-bg,#FAF0EF);
    font-size: 0.8rem;
    line-height: 1.55;
}

.savio-auth-subtitle {
    margin: 10px 0 0;
    color: var(--appearance-muted, #7d879a);
    font-size: 15px;
    line-height: 1.6;
}
.savio-auth-subtitle[hidden] { display: none; }
.savio-login-field {
    --login-field-fill: var(--appearance-input, #fff);
    display: flex;
    align-items: center;
    height: 58px;
    padding: 0 16px;
    border: 1px solid var(--appearance-input-rule, #d6deea);
    border-radius: 9px;
    color: var(--appearance-muted, #8390a3);
    background: var(--login-field-fill);
}
.savio-login-field:focus-within {
    --login-field-fill: var(--appearance-hover, #f3f7ff);
    border-color: #a6bff1;
    background: var(--login-field-fill);
    box-shadow: inset 0 0 0 1px rgba(100, 143, 230, .18);
}
.savio-login-field > svg { flex: none; width: 21px; height: 21px; }
.savio-login-field input {
    flex: 1;
    width: 0;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 0 0 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    outline: 0;
    box-shadow: none;
}
.savio-login-field input:focus,
.savio-login-field input:focus-visible { border: 0; outline: 0; box-shadow: none; }
.savio-login-field input::placeholder { color: var(--appearance-muted, #8390a3); }
/* Keep browser autofill enabled. Its forced input background must be painted
   over with the same light/dark and focus fill as the surrounding icon field. */
.savio-login-field input:is(:autofill, :-webkit-autofill) {
    -webkit-text-fill-color: var(--appearance-ink, #1D1D1F);
    caret-color: var(--appearance-ink, #1D1D1F);
    box-shadow: inset 0 0 0 1000px var(--login-field-fill);
}
.savio-auth-form .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.savio-password-toggle {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 8px;
    place-items: center;
    border: 0;
    color: var(--appearance-muted, #8390a3);
    background: transparent;
    cursor: pointer;
}
.savio-password-toggle svg { width: 21px; height: 21px; }
.savio-password-toggle[aria-pressed="true"] [data-savio-eye-slash] { display: none; }
.savio-password-toggle:focus-visible,
.savio-login-options input:focus-visible { outline: 2px solid var(--appearance-strong, #111214); outline-offset: 3px; }
.savio-login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.savio-login-options label { display: flex; align-items: center; gap: 9px; min-height: 44px; color: var(--appearance-muted, #7d879a); font-size: 14px; font-weight: 400; line-height: 1.5; cursor: pointer; }
.savio-login-options input { width: 21px; height: 21px; min-height: 0; margin: 0; padding: 0; accent-color: #252b35; }
.savio-login-options .savio-auth-link,
.savio-auth-footer .savio-auth-link { padding: 0; color: #306aff; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.5; text-decoration: none; }
.savio-auth-form[data-savio-view="login"] .savio-auth-primary { letter-spacing: .12em; }
.savio-auth-form[data-savio-view="login"] .savio-auth-primary span { font-size: 23px; font-weight: 300; letter-spacing: 0; }
.savio-auth-footer { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; color: var(--appearance-muted, #7d879a); font-size: 14px; line-height: 1.5; }
.savio-auth-footer::before,
.savio-auth-footer::after { content: ''; flex: 1; height: 1px; background: var(--appearance-rule, #d6deea); }
.savio-auth-footer::before { margin-right: 6px; }
.savio-auth-footer::after { margin-left: 6px; }

.discussion-author-mark--savio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--appearance-muted,#686B70);
    font-size: 0.72rem;
    font-weight: 560;
}

@keyframes savio-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .savio-comment-account {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .savio-comment-account__actions {
        margin-right: -8px;
    }

    .savio-guest-dialog { width: 100%; max-width: none; max-height: 88dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
    .savio-guest-shell { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }

    .savio-auth-dialog {
        width: 100%;
        max-width: none;
        max-height: min(88dvh, 760px);
        margin: auto 0 0;
        border-width: 1px 0 0;
        border-radius: 16px 16px 0 0;
    }

    .savio-auth-shell {
        padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    }

    .savio-auth-form { margin-top: 24px; }
    .savio-login-field { height: 56px; }
    .savio-auth-primary { min-height: 58px; margin-top: 10px; }
    .savio-auth-footer { gap: 8px; margin-top: 8px; white-space: nowrap; }
    .savio-auth-footer::before,
    .savio-auth-footer::after { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .savio-auth-dialog[open] {
        animation: none;
    }

    .savio-auth-primary {
        transition: none;
    }
}
