.site-account { display: flex; align-items: center; gap: 14px; margin-left: 22px; font-family: var(--nav-font); }
.site-account a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.site-account .account-login { color: var(--heading-color); }
.site-account .account-register { padding: 9px 17px; border-radius: 999px; background: var(--accent-color); color: var(--contrast-color); }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; color: var(--heading-color); font-size: 14px; font-weight: 600; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; object-fit: cover; background: #e7f5eb; color: #348765; }
.account-initials { font-size: 14px; font-weight: 800; }
.account-label { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.account-dropdown { position: absolute; z-index: 1000; top: calc(100% + 12px); right: 0; display: grid; min-width: 225px; gap: 10px; padding: 16px; border: 1px solid #e8e8e8; border-radius: 13px; background: white; box-shadow: 0 12px 30px #00000018; }
.account-dropdown strong { color: var(--heading-color); font-size: 14px; }
.account-dropdown small { overflow: hidden; color: #777; text-overflow: ellipsis; }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: var(--default-color); font: inherit; text-align: left; }
.account-dropdown form { margin: 0; }
.auth-section { min-height: 65vh; padding: 70px 0; background: #f8faf8; }
.auth-card { max-width: 480px; margin: auto; padding: clamp(25px, 5vw, 40px); border: 1px solid #e8eee9; border-radius: 20px; background: white; box-shadow: 0 16px 45px #2337280b; }
.auth-card h1 { margin: 0 0 10px; font-size: 30px; }
.auth-card > p { margin-bottom: 24px; color: #686e69; line-height: 1.6; }
.auth-card label { display: block; margin-bottom: 7px; color: #37423b; font-size: 14px; font-weight: 600; }
.auth-card input { width: 100%; margin-bottom: 18px; padding: 12px 14px; border: 1px solid #dce4de; border-radius: 9px; font: inherit; }
.auth-card input:focus { outline: 2px solid #5fcf8055; border-color: var(--accent-color); }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-card .auth-switch { margin: 20px 0 0; text-align: center; font-size: 14px; }
.auth-message { margin-bottom: 16px; padding: 12px 14px; border-radius: 9px; background: #f1f8f2; color: #315e3d; font-size: 14px; }
.auth-message.error { background: #fff1f0; color: #963b34; }
.profile-card { max-width: 650px; margin: auto; padding: 32px; border: 1px solid #e8eee9; border-radius: 20px; background: white; }
.profile-heading { display: flex; align-items: center; gap: 18px; }
.profile-heading .account-avatar { width: 64px; height: 64px; font-size: 24px; }
.profile-heading h1 { margin: 0 0 4px; font-size: 25px; }
.profile-heading p { margin: 0; color: #686e69; }
.account-menu summary { min-height: 42px; padding: 4px 10px 4px 5px; border: 1px solid #e7e9e7; border-radius: 999px; background: #fff; }
.account-menu[open] summary, .account-menu summary:hover, .account-menu summary:focus-visible { border-color: #c8e6d0; box-shadow: 0 4px 14px #26422b12; }
.account-guest { background: #e9f6ed; color: #348765; font-size: 17px; }
.account-chevron { color: #7a817c; font-size: 11px; transition: transform .18s ease; }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.account-dropdown { gap: 0; padding: 7px; }
.account-dropdown-header { display: grid; gap: 5px; padding: 11px 10px 13px; border-bottom: 1px solid #eef0ee; }
.account-dropdown-header small { color: #777; font-size: 12px; line-height: 1.45; }
.account-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: #348765; font-size: 11px; font-weight: 700; }
.account-dropdown > a, .account-dropdown form button { width: 100%; padding: 10px; border-radius: 8px; color: #424943; font-size: 13px; }
.account-dropdown > a:hover { background: #f5f8f5; color: #348765; }
.account-dropdown .account-menu-login { color: #348765; font-weight: 700; }
.account-dropdown form { margin-top: 3px; padding-top: 3px; border-top: 1px solid #eef0ee; }
.account-dropdown form button { color: #a44842; }
.account-dropdown form button:hover { background: #fff4f2; }
.header-inner { gap: clamp(12px, 1.5vw, 24px); }
.header-logo { flex: 0 0 150px; margin: 0 !important; }
.header-logo img { width: 150px; max-width: 100%; height: auto; }
.header-inner .navmenu { flex: 0 1 auto; }
.header-inner .site-account { flex: 0 0 auto; margin: 0 0 0 auto; }
.admin-header-link { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 9px 13px; border: 1px solid #ddd8f2; border-radius: 999px; background: #f5f2ff; color: #5543a2; font: 700 13px var(--nav-font); text-decoration: none; white-space: nowrap; }
.admin-header-link:hover { border-color: #6b55c8; background: #6b55c8; color: #fff; }
.admin-header-link i { font-size: 15px; }
.header-inner .navmenu a { padding-right: clamp(8px, .9vw, 14px); padding-left: clamp(8px, .9vw, 14px); font-size: clamp(13px, 1vw, 15px); }
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-heading > div > .account-avatar { width: 82px; height: 82px; font-size: 27px; }
.avatar-upload-button { position: absolute; right: 0; bottom: 0; display: grid; width: 32px; height: 32px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--accent-color); color: #fff; cursor: pointer; }
.avatar-upload-button:hover { filter: brightness(.94); }
.profile-kicker { display: block; margin-bottom: 4px; color: #348765; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.profile-edit-form { margin-top: 30px; padding-top: 23px; border-top: 1px solid #edf0ed; }
.profile-edit-form label { display: block; margin-bottom: 8px; color: #37423b; font-size: 13px; font-weight: 700; }
.profile-name-control { display: flex; gap: 10px; }
.profile-name-control input { min-width: 0; flex: 1; padding: 11px 13px; border: 1px solid #dce4de; border-radius: 9px; font: inherit; }
.profile-name-control .btn { flex: 0 0 auto; margin: 0; }
.profile-help { margin: 13px 0 0; color: #777; font-size: 12px; line-height: 1.55; }
.profile-academy-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: #348765; font-weight: 700; }
.auth-dialog { width: min(440px, calc(100% - 28px)); max-width: none; padding: 0; overflow: visible; border: 0; border-radius: 20px; background: transparent; }
.auth-dialog::backdrop { background: #18221acc; backdrop-filter: blur(4px); }
.auth-dialog-card { position: relative; padding: clamp(25px, 6vw, 38px); border: 1px solid #e7eee8; border-radius: 20px; background: #fff; box-shadow: 0 28px 90px #15201b40; }
.auth-dialog-close { position: absolute; top: 14px; right: 14px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: #f3f5f3; color: #616862; }
.auth-dialog-card h2 { margin: 0 35px 8px 0; color: var(--heading-color); font-size: 27px; }
.auth-dialog-card > p { margin: 0 0 22px; color: #6b726c; font-size: 14px; line-height: 1.55; }
.auth-dialog-card label { display: block; margin-bottom: 7px; color: #37423b; font-size: 13px; font-weight: 700; }
.auth-dialog-card input:not([type="hidden"]) { width: 100%; margin-bottom: 16px; padding: 11px 13px; border: 1px solid #dce4de; border-radius: 9px; font: inherit; }
.auth-dialog-card .btn { width: 100%; margin-top: 3px; }
.auth-dialog-card .auth-modal-register { margin: 18px 0 0; text-align: center; font-size: 13px; }
.auth-modal-full-page { display: block; margin-top: 12px; color: #787e79; font-size: 12px; text-align: center; }
@media (max-width: 1199px) {
  .header-inner { gap: 8px; }
  .header-logo { order: 1; }
  .admin-header-link { order: 2; padding: 8px 10px; }
  .header-inner .site-account { order: 3; margin: 0 4px 0 0; }
  .header-inner .navmenu { order: 4; flex: 0 0 auto; }
  .account-label { display: inline; max-width: 110px; }
  .account-dropdown { max-width: min(280px, calc(100vw - 24px)); }
}
@media (max-width: 575px) {
  .header-logo { flex-basis: 120px; }
  .header-logo img { width: 120px; }
  .account-label { max-width: 95px; font-size: 12px; }
  .account-menu summary { gap: 6px; padding-right: 8px; }
  .account-avatar { width: 32px; height: 32px; }
  .profile-card { padding: 22px; }
  .profile-heading { align-items: flex-start; gap: 14px; }
  .profile-heading > div > .account-avatar { width: 66px; height: 66px; }
  .profile-heading h1 { font-size: 21px; }
  .profile-name-control { align-items: stretch; flex-direction: column; }
}
@media (max-width: 420px) {
  .admin-header-link { gap: 0; padding: 8px; }
  .admin-header-link span { display: none; }
  .site-account[data-authenticated="false"] .account-guest { display: none; }
  .site-account[data-authenticated="false"] .account-label { max-width: 82px; font-size: 11px; }
  .site-account[data-authenticated="true"] .account-label { display: none; }
  .account-menu summary { gap: 5px; }
}
