/* Account button and sign-in dialog. */
.account-button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:var(--pill);background:var(--paper);color:var(--forest);font-size:14px;font-weight:600;white-space:nowrap;transition:background .16s,border-color .16s}
.account-button:hover{background:var(--linen);border-color:var(--forest)}
.account-button[hidden]{display:none}
.account-initial{display:none}
.account-icon{display:none;width:20px;height:20px}
.account-button.signed-in .account-icon{display:none!important}
.account-button.signed-in{padding:6px 14px 6px 6px}
.account-button.signed-in .account-initial{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--lime);color:var(--forest);font-size:13px;font-weight:800}
.account-panel{display:grid;gap:16px}
.account-intro{margin:0;color:var(--slate);line-height:1.6}
.account-google{justify-content:center;gap:12px}
.google-logo{flex:none;width:20px;height:20px}
.account-divider{display:flex;align-items:center;gap:12px;color:var(--pebble);font-size:13px}
.account-divider::before,.account-divider::after{content:"";flex:1;height:1px;background:var(--fog)}
.account-email-form{display:grid;gap:4px}
.account-email-form label{margin-bottom:0}
.account-email-form input{width:100%}
.account-email-form input[aria-invalid=true]{border-color:var(--danger)}
.account-email-form .field-error:empty{display:none}
.account-email-form .button{margin-top:12px;width:100%}
.account-identity{display:grid;gap:4px;margin:0}
.account-identity small{color:var(--slate);font-size:13px}
.account-identity strong{color:var(--forest);font-size:18px;overflow-wrap:anywhere}
.account-plan{display:flex;justify-content:space-between;align-items:center;margin:0;padding:16px;border-radius:var(--radius);background:var(--surface)}
.account-plan dt{color:var(--slate)}
.account-plan dd{margin:0;font-weight:700;color:var(--forest)}
@media(max-width:640px){
  .account-button{justify-content:center;width:36px;min-height:36px;padding:0;border-color:transparent}
  .account-button:not(.signed-in) .account-icon{display:block}
  .account-button [data-account-label]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .account-button.signed-in{padding:0}
}
/* Phones: keep brand and tools on one row by showing only the flags (labels stay in aria-label). */
@media(max-width:420px){
  .header-tools .language-button{padding:6px}
  .header-tools .language-button span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}

/* Header avatar */
.account-header-avatar{width:30px;height:30px;border-radius:50%;object-fit:cover}
.account-header-avatar[hidden]{display:none}
.account-button.signed-in:has(.account-header-avatar:not([hidden])) .account-initial{display:none}

/* My account page */
.account-page{display:grid;gap:20px;max-width:720px;margin:0 0 64px}
.account-card{display:grid;gap:16px;padding:28px;border-radius:24px;background:var(--paper);border:1px solid var(--fog)}
.account-card h2{margin:0;color:var(--forest);font-size:20px;letter-spacing:-.3px}
.account-card p{margin:0;line-height:1.6}
.account-photo-row{display:flex;gap:20px;align-items:center}
.account-avatar{flex:none;width:88px;height:88px;border-radius:50%;object-fit:cover;background:var(--linen)}
.account-avatar-initial{display:grid;place-items:center;color:var(--forest);font-size:34px;font-weight:800;background:var(--lime)}
.account-photo-actions{display:grid;gap:8px}
.account-buttons{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.account-hint{color:var(--slate);font-size:13px}
.account-value{color:var(--forest);font-size:18px;font-weight:700;overflow-wrap:anywhere}
.account-inline-form{display:grid;grid-template-columns:1fr auto;gap:4px 12px;align-items:end}
.account-inline-form label{margin:0}
.account-inline-form input{width:100%}
.account-inline-form .field-error{grid-column:1/-1;order:3}
.account-inline-form .field-error:empty{display:none}
.account-details summary{cursor:pointer;color:var(--forest);font-weight:600;min-height:44px;display:flex;align-items:center;gap:8px;text-decoration:underline;text-underline-offset:3px}.account-details summary::-webkit-details-marker{display:none}
.account-details[open] summary{margin-bottom:8px}
.account-list{list-style:none;margin:0;padding:0;display:grid}
.account-list li{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 0;border-top:1px solid var(--fog)}
.account-list li:first-child{border-top:0;padding-top:0}
.account-list li>div{display:grid;gap:2px;min-width:0}
.account-list strong{display:inline-flex;align-items:center;gap:8px;color:var(--forest)}
.account-list span{color:var(--slate);font-size:14px}
.account-status{padding:4px 10px;border-radius:var(--pill);background:var(--linen);color:var(--forest)!important;font-weight:600}
.account-list .google-logo{width:18px;height:18px}
.account-plan-card{grid-template-columns:1fr auto;align-items:center}
.account-plan-card .account-plan{background:none;padding:0;gap:12px;justify-content:flex-start}
.account-danger{border-color:#f0d3d5}
.account-danger h2{color:var(--danger)}
.button.danger{color:var(--danger);border-color:#e7b9bd}
.button.dark.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.account-confirm{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.sync-badge{display:inline-flex;align-items:center;gap:8px;margin:12px 0 0;color:var(--forest);font-size:14px;font-weight:600}
.sync-badge::before{content:"";width:8px;height:8px;border-radius:50%;background:#3fae5a}
.sync-badge.error::before{background:var(--danger)}
@media(max-width:640px){
  .account-card{padding:20px;border-radius:20px}
  .account-inline-form{grid-template-columns:1fr}
  .account-inline-form .button{width:100%}
  .account-photo-row{align-items:flex-start}
  .account-avatar{width:64px;height:64px}
  .account-plan-card{grid-template-columns:1fr}
  .account-list li{flex-wrap:wrap}
}
.account-card>.button{justify-self:start}
@media(max-width:640px){.account-card>.button{justify-self:stretch}}
