.header-language { grid-column: 1; grid-row: 1; justify-self: start; position: relative; z-index: 90; }
.top-header .burger-menu-wrap { display: none; }
.top-header .top-actions { grid-column: 3; grid-row: 1; justify-self: end; margin-top: 0; }
.top-header .plan-ui { display: none; }
.header-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: #1a1b1f; color: #c7c7cf; font: inherit; line-height: 1.2; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.header-control { font-family: inherit; font-size: 12px; }
.header-control:hover { background: #2b2c32; color: #fff; }
#header-language-button { border: 0; background: transparent; padding: 7px 2px; gap: 6px; color: #a5a6ad; }
#header-language-button:hover { color: #f1f1f5; }
#header-language-button > svg { display: none; }
#header-language-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.top-header .top-actions { gap: 8px; }
.header-premium-badge { display: inline-flex; align-items: center; min-height: 24px; box-sizing: border-box; padding: 4px 8px; border-radius: 9px; background: rgba(220,200,136,.07); color: #cdbb88; font-size: 10px; font-weight: 500; letter-spacing: .025em; line-height: 1.2; white-space: nowrap; }
.header-premium-badge[hidden] { display: none; }
.header-control svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.header-control:focus-visible, .header-language-menu button:focus-visible, .account-panel a:focus-visible, .account-panel button:focus-visible { outline: 2px solid #a5a6ad; outline-offset: 3px; }
.header-chevron { display: block; flex: 0 0 6px; width: 6px; height: 6px; border-right: 1.5px solid #92929d; border-bottom: 1.5px solid #92929d; transform: translateY(-2px) rotate(45deg); }
.header-language-menu { position: absolute; top: calc(100% + 4px); left: 0; width: 56px; padding: 4px; border: 0; border-radius: 10px; background: #1a1b1f; box-shadow: 0 8px 20px rgba(0,0,0,.2); animation: header-menu-in 150ms ease-out; }
.header-language-menu[hidden] { display: none; }
.header-language-menu button { display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: #c7c7cf; font: inherit; font-size: 11px; cursor: pointer; }
.header-language-menu button span { color: #898994; font-size: 10px; width: 20px; }
.header-language-menu button:hover, .header-language-menu button.active { background: #303138; color: #fff; }
.account-panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(390px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; box-sizing: border-box; padding: 26px; border: 1px solid rgba(255,255,255,.1); border-right: 0; border-radius: 22px 0 0 22px; background: #1a1b1f; color: #d1d1d8; font: inherit; overflow-y: auto; overscroll-behavior: contain; }
.account-panel[open] { animation: account-panel-in 180ms ease-out; }
.account-panel::backdrop { background: rgba(5,6,10,.48); }
body.account-panel-open { overflow: hidden; }
.account-panel-heading, .account-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-eyebrow { color: #85858f; letter-spacing: .13em; font-size: 10px; }
.account-panel h2 { font-size: 22px; font-weight: 600; margin: 7px 0 0; }
.account-close { padding: 8px; border-color: transparent; background: transparent; }
.account-section { padding: 23px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.account-section h3 { margin: 0; font-size: 14px; font-weight: 600; color: #e5e5eb; }
.account-panel dl { margin: 16px 0; font-size: 13px; }
.account-panel dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 12px; }
.account-panel dl > div[hidden] { display: none; }
.account-panel dt { color: #92929d; flex-shrink: 0; }
.account-panel dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
.account-panel p { font-size: 12px; line-height: 1.6; color: #a5a6ad; }
.account-plan { padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.13); color: #b8b8c3; font-size: 11px; }
.account-plan.is-premium { color: #dcc888; border-color: rgba(220,200,136,.3); background: rgba(220,200,136,.05); }
.account-primary, .account-secondary { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; min-height: 40px; padding: 10px 14px; border-radius: 12px; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; transition: background-color 150ms ease; }
.account-primary { background: #d0d0d1; border: 1px solid #d0d0d1; color: #1a1b1f; font-weight: 600; }
.account-primary:hover { background: #e2e2e3; }
.account-secondary { background: #222327; border: 1px solid rgba(255,255,255,.12); color: #c7c7cf; }
.account-secondary:hover { background: #303138; }
.account-secondary:disabled { opacity: .55; cursor: default; }
.account-secondary[hidden] { display: none; }
.account-logout { margin-top: 24px; }
.account-message:empty { display: none; }
.account-message[data-state="success"] { color: #97b8a4; }
.account-message[data-state="error"] { color: #d3a3a3; }
@keyframes account-panel-in { from { opacity: .6; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes header-menu-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .header-language { display: block; }
  .top-header { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; min-height: 48px; }
  #header-language-button { min-width: 44px; min-height: 44px; }
  .top-header .title-block { grid-row: 1; min-width: 0; }
  .top-header .title { font-size: clamp(17px, 5.3vw, 25px); white-space: nowrap; }
  .top-header .market-strip { font-size: 8px; letter-spacing: .1em; }
  .top-header .top-actions { position: relative; width: 44px; }
  #account-button { width: 44px; min-height: 44px; padding: 9px; }
  #account-button > span { display: none; }
  .header-premium-badge {
    position: absolute; z-index: 1; left: 50%; bottom: -4px; transform: translateX(-50%);
    min-height: 14px; padding: 2px 4px; border-radius: 5px;
    border: 1px solid rgba(220,200,136,.4);
    background: linear-gradient(135deg, #39301e, #25231c);
    box-shadow: 0 1px 5px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,232,171,.1);
    color: #ead49c; font-size: 7px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase;
    pointer-events: none;
  }
  .top-actions:has(.header-premium-badge:not([hidden])) #account-button {
    border-color: rgba(220,200,136,.35); color: #dcc888;
    background: linear-gradient(145deg, #28251d, #1a1b1f);
  }
  .account-panel { padding: 22px; border-radius: 18px 0 0 18px; }
}
@media (prefers-reduced-motion: reduce) { .account-panel[open], .header-language-menu { animation: none; } .header-control, .account-primary, .account-secondary { transition: none; } }
@media (max-width: 360px) {
  .top-header .title { font-size: 15px; letter-spacing: .09em; white-space: nowrap; }
  .top-header .market-strip { font-size: 7px; letter-spacing: .04em; }
}
