/* OpenWorld Web S02 R3 — inspired by old Flarum OpenWorld navigation.
 * Header only: does not change forum/chat storage or access control.
 */
:root[data-theme="dark"] { --ow-header: #2b415d; --ow-header-text: #e8f0fc; --ow-header-hover: rgba(255,255,255,.13); }
:root[data-theme="light"] { --ow-header: #4f6d93; --ow-header-text: #ffffff; --ow-header-hover: rgba(255,255,255,.18); }
:root[data-theme] .topbar { background: var(--ow-header); color:var(--ow-header-text);border-bottom-color:rgba(20,38,66,.23);height:70px;padding:0 4.2%;position:relative;z-index:12; }
.topbar-left {display:flex;align-items:center;gap:24px;min-width:0;}
.top-home-brand {white-space:nowrap;background:transparent;border:0;padding:5px 0;color:var(--ow-header-text);font-size:17px;letter-spacing:-.4px;font-weight:600;}
.top-home-brand span {font-weight:400;}
.top-home-brand:hover {opacity:.9;}
:root[data-theme] .breadcrumb {font-size:12px;color:#d3dfef;white-space:nowrap;}
:root[data-theme] .breadcrumb strong {color:#fff;}
:root[data-theme] .breadcrumb span {color:#b3c6dd;}
.top-actions {display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:nowrap;min-width:0;}
.header-control {position:relative;display:flex;align-items:center;flex:0 0 auto;}
.top-icon {border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ow-header-text);height:38px;min-width:38px;display:inline-flex;justify-content:center;align-items:center;gap:3px;padding:0 8px;cursor:pointer;}
.top-icon:hover,.top-icon[aria-expanded="true"] {background:var(--ow-header-hover);}
.top-icon svg {width:19px;height:19px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;}
.icon-locale {font-weight:800;font-size:9px;letter-spacing:.2px;}
:root[data-theme] .btn-header-auth {background:rgba(15,35,64,.35);border:1px solid rgba(255,255,255,.3);color:var(--ow-header-text);margin-left:10px;font-size:12px;}
:root[data-theme] .btn-header-auth:hover {background:var(--ow-header-hover);}
.account-trigger {border:0;background:transparent;color:var(--ow-header-text);padding:4px 6px;border-radius:9px;display:flex;align-items:center;gap:8px;cursor:pointer;max-width:250px;}
.account-trigger:hover,.account-trigger[aria-expanded="true"] {background:var(--ow-header-hover);}
.account-avatar {width:31px;height:31px;border-radius:50%;display:grid;place-items:center;background:#6688af;color:#fff;font-size:12px;font-weight:800;flex:0 0 auto;border:1px solid rgba(255,255,255,.3);}
.account-identity {display:flex;flex-direction:row;align-items:center;min-width:0;gap:7px;}
.account-name {max-width:175px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700;}
.account-role {font-size:10px;color:#e4f1ff;line-height:1;padding:4px 6px;border:1px solid rgba(255,255,255,.35);border-radius:6px;white-space:nowrap;background:rgba(7,26,51,.18);}
.account-chevron {stroke:currentColor;fill:none;stroke-width:2;width:15px;height:15px;flex-shrink:0;}
.header-popover {position:absolute;right:0;top:calc(100% + 12px);z-index:30;border:1px solid var(--ow-line);border-radius:12px;padding:13px;background:var(--ow-surface);color:var(--ow-text);box-shadow:0 16px 45px rgba(0,0,0,.2);min-width:200px;}
.header-popover[hidden] {display:none!important;}
.header-popover strong {font-size:13px;}
.search-popover {width:370px;max-width:min(370px,calc(100vw - 24px));}
.popover-title {display:block;font-weight:700;font-size:12px;margin-bottom:10px;color:var(--ow-text);}
#site-search {width:100%;border:1px solid var(--ow-line);background:var(--ow-field);color:var(--ow-text);border-radius:8px;font-size:13px;padding:11px 12px;outline:0;}
#site-search:focus {border-color:var(--ow-accent);}
.popover-note {font-size:11px;line-height:1.6;color:var(--ow-soft);margin:12px 0 0;}
.search-results {max-height:270px;overflow:auto;display:flex;flex-direction:column;gap:5px;margin-top:8px;}
.search-hit {display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:9px;border:0;border-radius:8px;background:transparent;color:var(--ow-text);}
.search-hit:hover,.search-hit:focus-visible {background:var(--ow-selected);}
.search-hit strong {font-size:12px;}.search-hit small {font-size:11px;color:var(--ow-soft);line-height:1.5;}
.mini-popover {padding:6px;min-width:170px;}
.popover-choice {color:var(--ow-text);border:0;width:100%;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:11px 12px;border-radius:8px;background:transparent;cursor:pointer;text-align:left;font-size:12px;}
.popover-choice:hover,.popover-choice.selected {background:var(--ow-selected);color:var(--ow-link);}
.choice-icon {font-size:18px;line-height:1;min-width:20px;}
.popover-choice[data-header-theme] {justify-content:flex-start;}
.notifications-popover {width:300px;max-width:min(300px,calc(100vw - 24px));}
.notifications-popover p {font-size:12px;line-height:1.7;color:var(--ow-soft);}
.account-popover {width:232px;padding:7px;}
.account-menu-summary {display:flex;flex-direction:column;gap:5px;padding:13px 10px;border-bottom:1px solid var(--ow-line);margin-bottom:5px;overflow-wrap:anywhere;}
.account-menu-summary small {font-size:11px;color:var(--ow-soft);}
.logout-choice {color:#b95a5a;}
:root[data-theme="dark"] .logout-choice {color:#ffb6b6;}
:root[data-theme] .footer-prototype {margin-left:auto;}
:root[data-theme="light"] .top-icon {color:#fff;}
@media (max-width:1050px) {
  :root[data-theme] .topbar {padding:0 2.4%;}
  .topbar-left {gap:12px;}
  .account-name {max-width:115px;}
  .top-home-brand {font-size:15px;}
}
@media (max-width:800px) {
  :root[data-theme] .topbar {height:auto;min-height:68px;padding:10px 14px;}
  .topbar-left {gap:8px;}
  .top-home-brand span {display:none;}
  .top-actions {gap:0;}
  .top-icon {min-width:34px;height:35px;padding:0 6px;}
  .account-trigger {gap:5px;padding:3px;}
  .account-name {max-width:86px;}
  .header-popover {position:fixed;top:68px;right:12px;max-width:calc(100vw - 24px);}
  .search-popover {width:360px;}
}
@media (max-width:520px) {
  .topbar-left {gap:5px;}
  .top-home-brand {font-size:12px;}
  .top-icon {min-width:31px;padding:0 4px;}
  .top-icon svg {width:17px;height:17px;}
  .account-identity {display:none;}
  .account-avatar {width:29px;height:29px;}
  .account-chevron {width:12px;}
  .icon-locale {display:none;}
  :root[data-theme] .btn-header-auth {padding:0 7px;margin-left:3px;font-size:10px;max-width:95px;line-height:1.15;}
  .breadcrumb {display:none;}
}

.theme-popover {display:flex;gap:6px;min-width:0;padding:7px;}
.theme-popover .popover-choice[data-header-theme] {width:43px;height:40px;padding:0;justify-content:center;}
.theme-popover .choice-icon {font-size:22px;text-align:center;}
