/* Account forms and compact workspace controls. */
.account-main { min-height: calc(100dvh - 190px); padding: 40px 0 64px; }
.account-main .panel, .plugin-main .panel { margin: 0; padding: 24px; border-color: var(--line); border-radius: 14px; background: var(--surface); }
:is(.account-main, .security-main, .security-password-dialog) button, .plugin-main button, .upload-dialog button { width: auto; min-height: 40px; padding: 9px 16px; font-size: 14px; line-height: 1.4; transition: background .16s ease, border-color .16s ease, color .16s ease; }
button.secondary { width: auto; background: #ffffff04; color: #d7dfdb; border: 1px solid #ffffff28; }
button.secondary:enabled:hover { background: #ffffff09; border-color: #ffffff45; }
button.secondary:disabled { color: #788580; border-color: #ffffff12; cursor: not-allowed; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: clamp(32px, 6vw, 80px); align-items: center; max-width: 1000px; margin: 36px auto; }
.auth-intro h1 { margin: 16px 0 20px; font-size: clamp(32px, 4vw, 48px); line-height: 1.3; letter-spacing: -.04em; }
.auth-intro p { max-width: 390px; color: var(--muted); font-size: 15px; }
.auth-intro>a { display: inline-flex; margin-top: 12px; color: var(--accent); font-size: 13px; }
.account-main .auth-card { padding: 28px; }
.auth-card h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.4; }
.auth-card form>p { margin: 0 0 24px; font-size: 14px; }
/* Login, recovery and the body-mounted password dialog share one field style. */
:is(.account-main, .security-main, .security-password-dialog) form label { display: grid; gap: 8px; margin: 18px 0; font-size: 14px; }
:is(.account-main, .security-main, .security-password-dialog) form input { display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; margin: 0; padding: 10px 12px; border: 1px solid #ffffff28; border-radius: 8px; background: #111617; color: var(--text); font: inherit; line-height: 1.4; }
.auth-card button[type=submit] { width: 100%; margin-top: 4px; }
.auth-card .auth-switch { margin: 20px 0 0; text-align: center; font-size: 13px; }
.auth-switch a { color: var(--accent); }
.account-main form label.check-row { display: flex; align-items: center; gap: 10px; margin: 18px 0; cursor: pointer; font-size: 13px; }
.account-main form label.check-row input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.password-field { position: relative; display: block; }
:is(.account-main, .security-main, .security-password-dialog) .password-field input { padding-right: 50px; }
/* Edge can otherwise display its own reveal button beside our toggle. */
.password-field input::-ms-reveal { display: none; }
.password-field input::-ms-clear { display: none; }
:is(.account-main, .security-main, .security-password-dialog) .password-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; margin: 0; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: #aeb8b5; opacity: 0; pointer-events: none; }
.password-field:hover .password-toggle, .password-field:focus-within .password-toggle { opacity: 1; pointer-events: auto; }
:is(.account-main, .security-main, .security-password-dialog) .password-toggle:hover { color: #fff; background: #ffffff0b; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle[aria-pressed=false] .eye-open, .password-toggle[aria-pressed=true] .eye-closed { display: none; }
.account-main small, .upload-dialog small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.field-error { display: block; color: #ff9185; font-size: 12px; font-weight: 500; line-height: 1.6; }
.field-error:empty { display: none; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: #ff8075 !important; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-row>div { min-width: 0; }
.section-row button { flex: 0 0 auto; }
.section-row h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.section-row .eyebrow { margin-bottom: 6px; }
.account-main dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; margin-bottom: 0; }
.account-main dt { color: var(--muted); }
.account-main dd { margin: 0; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin-top: 20px; scrollbar-width: thin; }
.table-scroll table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; }
.table-scroll th, .table-scroll td { padding: 12px; border-bottom: 1px solid var(--line); }
.table-scroll th { color: #aebdb5; font-size: 12px; font-weight: 500; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.device-row>div { min-width: 0; overflow-wrap: anywhere; }
.device-row:last-child { border-bottom: 0; padding-bottom: 0; }
.device-row p { margin: 0; font-size: 14px; }
.device-row small { display: block; margin-top: 4px; }
.device-row button { flex-shrink: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions button { width: auto; }
.account-main .hh-dialog { text-align: left; }
.account-main .hh-dialog h2 { font-size: 22px; line-height: 1.4; }
#notice:empty, #profile-message:empty { display: none; }

/* Authentication feedback stays with the form action across all sign-in methods. */
.auth-card form>#notice,
:is(.auth-card,.security-recovery,.phone-binding-dialog) .phone-notice,
.security-recovery #security-result:not([hidden]) {
  box-sizing: border-box;
  width: 100%;
  margin: 16px 0 12px;
  padding: 11px 13px;
  border: 1px solid #e8b47c55;
  border-radius: 8px;
  background: #e8b47c0b;
  color: #f5cda0;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.auth-card form>#notice:empty,
:is(.auth-card,.security-recovery,.phone-binding-dialog) .phone-notice:empty { display: none; }
.auth-card form>#notice[data-state=error] { border-color: #d891725e; background: #d891720c; color: #f1bda4; }
.auth-card form>#notice[data-state=pending] { border-color: #91b6c447; background: #91b6c409; color: #b6ced8; }
.auth-card form>#notice[data-state=success] { border-color: #85cbb650; background: #85cbb60a; color: #a3dbc9; }
.storage-warning { padding: 16px 20px; border: 1px solid #b67b49; border-left: 4px solid #efa65e; border-radius: 10px; background: #3b2c24; color: #ffd2a8; line-height: 1.7; overflow-wrap: anywhere; }
.storage-warning strong { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 700; }
.storage-warning span { display: block; font-size: 14px; }
.storage-warning a { display: inline-block; margin-top: 10px; color: #ffd2a8; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.account-main section[id] { scroll-margin-top: calc(var(--header-height) + 24px); }
@media (max-width: 750px) {
  .account-main { padding: 28px 0 48px; }
  .auth-layout { grid-template-columns: 1fr; max-width: 440px; gap: 24px; margin: 12px auto; }
  .auth-intro { display: none; }
  .account-main .auth-card { padding: 24px; }
  .account-main .panel, .plugin-main .panel { padding: 20px; }
  .device-row { gap: 12px; }
}
