/* =========================/
   HEADER
 ========================= */



.topbar{

    background:var(--surface);

    border-bottom:1px solid var(--border);

    position:sticky;

    top:0;

    z-index:1000;

    overflow:visible;

}

.topbar:has(details[open]){
    z-index:1400;
}



.topbar .container{

    position:relative;

    width:100%;

    max-width:none;

    margin:0;

    padding:18px 18px;

    display:flex;

    justify-content:space-between;

    align-items:center;

}



.logo{

    position:relative;

    left:auto;

    top:auto;

    transform:none;

    display:flex;

    align-items:center;

    gap:10px;

    flex-shrink:0;

    z-index:2;

    margin:0;

    font-size:18px;

    font-weight:700;

    color:var(--text);

    text-decoration:none;

}



.logo img{

    display:block;

    height:36px;

    width:auto;

    max-width:48px;

    max-height:36px;

    object-fit:contain;

    transform:none;

}

.logo .brand-name{
    font-size:18px;
    font-weight:700;
    letter-spacing:.01em;
    white-space:nowrap;
    color:var(--text);
}

.brand-d{
    color:var(--accent);
}



nav{

    display:flex;

    align-items:center;

    justify-content:space-between;

    flex:1;

    margin-left:35px;

    gap:20px;

}



nav a{

    color:var(--text);

    font-size:14px;

}



nav a:hover{

    color:var(--accent);

}



.nav-left,

.nav-right{

    display:flex;

    align-items:center;

    gap:18px;

}



.nav-right{

    margin-left:auto;

}



.nav-left a:first-child{

    transform:translateX(-12px);

}



.header-search{

    position:absolute;

    left:50%;

    top:50%;

    transform:translate(-50%,-50%);

    z-index:3;

    display:flex;

    align-items:center;

    gap:4px;

    width:300px;

}



.header-search input{

    width:100%;

    height:34px;

    padding:6px 10px;

    background:var(--bg);

    border:1px solid var(--border);

    border-radius:7px;

    font-size:13px;

}



.header-search button{

    width:36px;

    height:34px;

    padding:0;

    font-size:14px;

}



.sub-header{

    width:100%;

    min-height:38px;

    background:var(--surface);

    border-bottom:1px solid var(--border);

    padding:4px 1%;

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:20px;

    font-size:13px;

    position:sticky;

    top:68px;

    z-index:999;

}



.sub-header-rates,

.sub-header-user-links{

    display:flex;

    align-items:center;

    gap:16px;

    flex-wrap:wrap;

}



.sub-header-rates span{

    color:var(--muted);

}



.sub-header-user-links{

    margin-left:auto;

    justify-content:flex-end;

}



.sub-header-user-links a{

    color:var(--text);

}



.sub-header-user-links a:hover{

    color:var(--accent);

}



.sub-header-user-links > a,

.sub-header-user-links .user-menu{

    white-space:nowrap;

}



.sub-header-user-links .user-menu summary{

    color:var(--text);

    font-size:13px;

    padding:4px 8px;

}



.sub-header-user-links .user-menu summary:hover{

    color:var(--accent);

}



.settings-menu,

.user-menu,

.language-theme-menu,

.rate-dropdown,

.add-listing-menu{

    position:relative;

}



.settings-menu summary,

.user-menu summary{

    cursor:pointer;

    list-style:none;

}



.settings-menu summary{

    color:var(--text);

    font-size:14px;

}



.settings-menu summary::-webkit-details-marker,

.user-menu summary::-webkit-details-marker,

.language-trigger::-webkit-details-marker,

.currency-trigger::-webkit-details-marker,

.add-listing-menu summary::-webkit-details-marker{

    display:none;

}



.settings-menu summary:hover{

    color:var(--accent);

}



.settings-panel{

    position:absolute;

    right:0;

    top:32px;

    width:300px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:10px;

    padding:18px;

    box-shadow:0 12px 30px rgba(0,0,0,.35);

    z-index:1000;

}



.settings-section{

    padding-bottom:16px;

    margin-bottom:16px;

    border-bottom:1px solid var(--border);

}



.settings-section:last-child{

    border-bottom:0;

    margin-bottom:0;

    padding-bottom:0;

}



.settings-title{

    color:var(--muted);

    font-size:13px;

    margin-bottom:10px;

}



.user-menu summary{

    padding:8px 12px;

    border-radius:6px;

}



.user-menu summary::before{

    content:"▾ ";

}



.user-menu-panel{

    position:absolute;

    right:0;

    top:calc(100% + 8px);

    min-width:180px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:8px;

    padding:6px 0;

    z-index:1000;

    box-shadow:0 10px 25px rgba(0,0,0,.35);

}



.user-menu-panel a{

    display:block;

    padding:10px 14px;

    color:var(--text);

}



.user-menu-panel a:hover{

    background:rgba(255,255,255,.06);

}

.add-listing-menu summary{
    display:flex;
    align-items:center;
    gap:6px;
    cursor:pointer;
    list-style:none;
    color:var(--text);
    font-size:14px;
    white-space:nowrap;
}

.add-listing-menu summary::marker{
    content:"";
}

.add-listing-menu summary:hover,
.add-listing-menu[open] summary{
    color:var(--accent);
}

.add-listing-panel{
    position:absolute;
    right:0;
    top:calc(100% + 8px);
    min-width:160px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:8px;
    padding:6px 0;
    z-index:1200;
    box-shadow:0 10px 25px rgba(0,0,0,.35);
}

.add-listing-panel a{
    display:block;
    padding:10px 14px;
    color:var(--text);
}

.add-listing-panel a:hover{
    background:rgba(255,255,255,.06);
    color:var(--accent);
}



.rate-dropdown{

    display:inline-flex;

    align-items:center;

}



.rate-main{

    cursor:pointer;

    color:var(--muted);

    white-space:nowrap;

}



.rate-main:hover{

    color:var(--text);

}



.rate-dropdown-panel{

    display:none;

    position:absolute;

    top:calc(100% + 8px);

    left:0;

    min-width:240px;

    max-height:320px;

    overflow-y:auto;

    padding:8px;

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:8px;

    box-shadow:0 10px 25px rgba(0,0,0,.35);

    z-index:2000;

}



.rate-dropdown[open] .rate-dropdown-panel{

    display:flex;

    flex-direction:column;

    gap:2px;

}



.rate-dropdown[open] .rate-dropdown-panel{

    display:flex;

    flex-direction:column;

    gap:6px;

}



.rate-dropdown summary{

    list-style:none;

    cursor:pointer;

}



.rate-dropdown summary::-webkit-details-marker{

    display:none;

}



.rate-dropdown-panel span,

.rate-dropdown-panel strong{

    padding:6px 8px;

    color:var(--text);

    font-size:12px;

    white-space:nowrap;

}



.rate-dropdown-panel strong{

    display:block;

    padding:8px;

    margin-top:6px;

    color:var(--text);

    font-weight:700;

    border-bottom:1px solid var(--border);

}



.rate-dropdown-panel .crypto-section-title{

    display:block;

    padding:8px;

    margin-top:6px;

    color:var(--accent);

    font-weight:700;

    border-bottom:1px solid var(--border);

}



.rate-dropdown[open] .rate-dropdown-panel{

    display:flex;

    flex-direction:column;

    gap:6px;

}



.rate-dropdown-panel span:hover{

    background:var(--card);

    border-radius:6px;

}



.rate-separator{

    color:var(--border);

}



.language-trigger{

    display:flex;

    align-items:center;

    gap:6px;

    cursor:pointer;

    list-style:none;

    color:var(--text);

    font-size:14px;

    padding:5px 7px;

}



.language-flag{

    font-size:18px;

    line-height:1;

}



.language-arrow{

    font-size:12px;

    color:var(--muted);

}



.language-theme-panel{

    width:360px;

    padding:14px;

}



.theme-toggle-row{

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding-bottom:14px;

    margin-bottom:14px;

    border-bottom:1px solid var(--border);

}



.theme-toggle-label{

    color:var(--muted);

    font-size:13px;

}



.theme-toggle{

    display:inline-flex;

    align-items:center;

}



.theme-toggle-track{

    width:50px;

    height:28px;

    padding:3px;

    display:flex;

    align-items:center;

    border-radius:20px;

    background:var(--card);

    border:1px solid var(--border);

}



.theme-toggle-thumb{

    width:20px;

    height:20px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:50%;

    background:var(--accent);

    font-size:12px;

    transition:.2s;

}



.language-list{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:4px;

    max-height:430px;

    overflow-y:auto;

}



.language-list a{

    display:flex;

    align-items:center;

    gap:8px;

    min-height:36px;

    padding:7px 8px;

    color:var(--text);

    border-radius:6px;

    font-size:13px;

}



.language-list a:hover,

.language-list a.active{

    background:var(--card);

    color:var(--accent);

}



.language-option-flag{

    width:22px;

    flex:none;

    font-size:17px;

}



.language-check{

    margin-left:auto;

    color:#0ea5e9;

    font-weight:700;

}



.theme-links{

    display:flex;

    gap:10px;

}



.theme-links a{

    display:flex;

    align-items:center;

    justify-content:center;

    width:42px;

    height:36px;

    background:var(--card);

    border:1px solid var(--border);

    border-radius:7px;

}



.standalone-theme-toggle{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    width:32px;

    height:32px;

    font-size:18px;

    text-decoration:none;

}



.standalone-theme-toggle:hover{

    transform:scale(1.08);

}

.currency-menu .language-list{
    grid-template-columns:1fr;
    max-height:none;
}

/* =========================/
  icon-box
========================= */

.sub-header-user-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub-header-user-links > a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #303746;
    border-radius: 9px;
    background: #202b3d;
    text-decoration: none;
    font-size: 20px;
    transition: background .2s ease, transform .2s ease;
}

.sub-header-user-links > a:hover {
    background: #2b3a52;
    transform: translateY(-1px);
}

.sub-header-user-links > a[href="/pgp/login"] {
    width: auto;
    height: auto;
    padding: 4px 6px;
    border: none;
    background: transparent;
    font-size: 14px;
}

.sub-header-user-links > a[href="/pgp/login"]:hover {
    background: transparent;
    transform: none;
}

@media (max-width: 600px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        overflow: visible;
    }

    .topbar .container {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding: 10px 12px;
        overflow: visible;
    }

    .logo {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: auto;
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .logo img {
        height: 28px;
        max-width: 36px;
        transform: none;
    }

    .logo .brand-name {
        font-size: 16px;
    }

    .header-search {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        order: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .header-search input {
        min-width: 0;
        flex: 1;
        width: auto;
        height: 34px;
        font-size: 13px;
    }

    .header-search button {
        width: 36px;
        height: 34px;
        flex: 0 0 36px;
    }

    nav {
        display: flex;
        flex: none;
        width: 100%;
        margin-left: 0;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }

    nav a {
        font-size: 13px;
        white-space: nowrap;
    }

    .nav-left {
        width: auto;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .nav-right {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .nav-left a:first-child {
        transform: none;
    }

    .standalone-theme-toggle {
        width: 28px;
        height: 28px;
        font-size: 16px;
        flex: 0 0 auto;
    }

    .language-theme-menu {
        position: relative;
        z-index: 1100;
        overflow: visible;
    }

    .language-theme-menu[open] {
        z-index: 1300;
    }

    .language-trigger {
        padding: 4px 5px;
        font-size: 12px;
    }

    .language-theme-panel {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        left: auto;
        width: min(360px, calc(100vw - 16px));
        max-height: 70vh;
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 1400;
    }

    .sub-header {
        position: sticky;
        top: 128px;
        z-index: 999;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 6px 10px;
        overflow: visible;
    }

    .sub-header-rates {
        width: auto;
        flex: 0 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .rate-main {
        font-size: 11px;
        white-space: nowrap;
    }

    .sub-header-user-links {
        width: auto;
        min-width: 0;
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .sub-header-user-links > a {
        flex: none;
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-radius: 7px;
    }

    .sub-header-user-links .user-menu {
        flex: 0 0 auto;
        width: auto;
        height: auto;
        margin-left: 2px;
        border: none;
        background: transparent;
    }

    .sub-header-user-links .user-menu summary {
        display: flex;
        align-items: center;
        width: auto;
        height: auto;
        max-width: none;
        padding: 0 2px;
        border: none;
        background: transparent;
        white-space: nowrap;
        font-size: 12px;
    }

    .sub-header-user-links .user-menu-name {
        display: inline-block;
        max-width: 5ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }
}

.account-hub {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.account-hub-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.account-hub-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 10px;
    border-right: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

.account-hub-tabs a:last-child {
    border-right: 0;
}

.account-hub-tabs a:hover {
    color: var(--text);
    background: var(--card);
}

.account-hub-tabs a.active {
    color: var(--text);
    background: var(--surface);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.account-hub-body {
    padding: 28px 24px 32px;
}

.account-hub-body h1 {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.2;
}

.account-hub-empty,
.account-hub .my-listings-empty {
    margin-top: 20px;
    padding: 28px 20px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
}

.account-hub .my-listings-grid {
    margin-top: 20px;
}

.claim-listing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.claim-listing h3 {
    margin: 0;
    font-size: 16px;
}

.claim-listing button {
    padding: 10px 16px;
    font-size: 13px;
}

@media (max-width: 700px) {
    .account-hub-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .account-hub-tabs a {
        min-height: 44px;
        border-bottom: 1px solid var(--border);
    }

    .account-hub-tabs a:nth-child(2n) {
        border-right: 0;
    }

    .account-hub-body {
        padding: 22px 16px 26px;
    }
}

html[dir="rtl"] nav {
    margin-left: 0;
    margin-right: 35px;
}

html[dir="rtl"] .nav-right {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .nav-left a:first-child {
    transform: translateX(12px);
}

html[dir="rtl"] .header-search {
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
}

html[dir="rtl"] .settings-panel,
html[dir="rtl"] .user-menu-panel,
html[dir="rtl"] .add-listing-panel,
html[dir="rtl"] .language-theme-panel {
    right: auto;
    left: 0;
}

html[dir="rtl"] .rate-dropdown-panel {
    left: auto;
    right: 0;
}

html[dir="rtl"] .account-hub-tabs a {
    border-right: 0;
    border-left: 1px solid var(--border);
}

html[dir="rtl"] .account-hub-tabs a:last-child {
    border-left: 0;
}

@media (max-width: 900px) {
    html[dir="rtl"] nav {
        margin-right: 0;
    }

    html[dir="rtl"] .header-search {
        right: auto;
    }

    html[dir="rtl"] .language-theme-panel {
        left: auto;
        right: 0;
    }
}

.topbar{
    background:rgba(24,26,33,.9);
    border-bottom-color:rgba(217,70,143,.28);
    box-shadow:
        0 1px 0 rgba(217,70,143,.18),
        0 12px 28px rgba(0,0,0,.22);
    backdrop-filter:saturate(1.15) blur(16px);
    -webkit-backdrop-filter:saturate(1.15) blur(16px);
}

html[data-theme="light"] .topbar{
    background:rgba(236,238,232,.92);
    border-bottom-color:rgba(184,50,128,.22);
    box-shadow:
        0 1px 0 rgba(184,50,128,.14),
        0 10px 24px rgba(26,29,34,.08);
}

.topbar .container{
    padding:12px 22px;
    min-height:64px;
}

.logo{
    gap:9px;
}

.logo img{
    height:32px;
    max-height:32px;
    filter:drop-shadow(0 0 10px rgba(217,70,143,.32));
}

.logo .brand-name{
    font-size:17px;
    letter-spacing:.02em;
}

.logo:hover .brand-d{
    text-shadow:0 0 12px rgba(217,70,143,.55);
}

.nav-left a:first-child{
    transform:none;
}

html[dir="rtl"] .nav-left a:first-child{
    transform:none;
}

html[dir="rtl"] .nav-left{
    padding-right:0;
    padding-left:170px;
}

html[dir="rtl"] .nav-right{
    padding-left:0;
    padding-right:170px;
}

.nav-left{
    gap:14px;
    padding-right:140px;
}

.nav-right{
    padding-left:170px;
}

.nav-left a{
    position:relative;
    padding:6px 0;
    color:#c8ccd4;
    font-size:13px;
    font-weight:600;
    letter-spacing:.02em;
}

.nav-left a::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:2px;
    border-radius:2px;
    background:var(--accent);
    transform:scaleX(0);
    transition:transform .16s ease;
}

.nav-left a:hover,
.nav-left a.is-active{
    color:var(--text);
}

.nav-left a:hover::after,
.nav-left a.is-active::after{
    transform:scaleX(1);
}

.header-search{
    width:280px;
    padding:3px 3px 3px 12px;
    background:var(--bg);
    border:1px solid var(--border);
    border-radius:999px;
    gap:6px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

.header-search:focus-within{
    border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(217,70,143,.18);
}

.header-search input{
    height:30px;
    padding:0;
    border:0;
    background:transparent;
    border-radius:0;
    color:var(--text);
}

.header-search input:focus{
    outline:0;
}

.header-search button{
    width:34px;
    height:30px;
    flex:0 0 34px;
    border-radius:999px;
    background:var(--accent);
    box-shadow:0 0 12px rgba(217,70,143,.28);
}

.header-search button:hover{
    filter:brightness(1.08);
}

.nav-right{
    gap:10px;
}

.add-listing-menu summary,
.language-trigger,
.standalone-theme-toggle{
    border:1px solid var(--border);
    background:var(--bg);
    transition:border-color .15s ease, color .15s ease, background .15s ease;
}

.add-listing-menu summary{
    padding:6px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:600;
}

.language-trigger{
    padding:5px 10px;
    border-radius:999px;
    font-size:13px;
}

.standalone-theme-toggle{
    width:34px;
    height:34px;
    border-radius:999px;
    font-size:16px;
}

.add-listing-menu summary:hover,
.add-listing-menu[open] summary,
.language-trigger:hover,
.language-theme-menu[open] .language-trigger,
.standalone-theme-toggle:hover{
    border-color:var(--accent);
    color:var(--accent);
    background:rgba(217,70,143,.08);
}

.sub-header{
    top:64px;
    min-height:40px;
    padding:6px 22px;
    background:rgba(15,16,20,.92);
    border-bottom-color:rgba(48,52,65,.9);
}

html[data-theme="light"] .sub-header{
    background:rgba(228,230,234,.94);
}

.rate-main{
    font-size:12px;
    font-weight:600;
    letter-spacing:.04em;
    text-transform:uppercase;
}

.sub-header-user-links > a{
    width:36px;
    height:36px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--card);
    font-size:16px;
    color:var(--text);
}

.sub-header-user-links > a:hover{
    border-color:var(--accent);
    background:rgba(217,70,143,.1);
    color:var(--accent);
}

.sub-header-user-links > a[href="/pgp/login"]{
    width:auto;
    height:auto;
    padding:6px 14px;
    border:1px solid var(--accent);
    border-radius:999px;
    background:transparent;
    color:var(--accent);
    font-size:13px;
    font-weight:700;
    letter-spacing:.03em;
}

.sub-header-user-links > a[href="/pgp/login"]:hover{
    background:var(--accent);
    color:#fff;
    transform:none;
}

.settings-panel,
.user-menu-panel,
.add-listing-panel,
.rate-dropdown-panel{
    border-color:rgba(217,70,143,.22);
    box-shadow:0 16px 40px rgba(0,0,0,.4);
}

@media (max-width:600px){
    .topbar .container{
        padding:10px 12px;
        min-height:0;
    }

    .header-search{
        width:100%;
        padding:3px 3px 3px 10px;
    }

    .header-search button{
        width:34px;
        height:30px;
        flex:0 0 34px;
    }

    .nav-left,
    .nav-right{
        gap:12px;
        padding-left:0;
        padding-right:0;
    }

    html[dir="rtl"] .nav-left,
    html[dir="rtl"] .nav-right{
        padding-left:0;
        padding-right:0;
    }

    .sub-header{
        padding:6px 12px;
    }
}
