.modern {
    --modern-ink: #18181b;
    --modern-muted: #5d5d68;
    --modern-line: #e4e4e7;
    --modern-accent: #5244a1;
}
body.modern { background: white; font: 14px/1.55 Inter, system-ui, 'Segoe UI', sans-serif; }
.modern :focus-visible { outline: 2px solid #7564cc; outline-offset: 3px; }
.portal-icon-defs { position: absolute; overflow: hidden; }
.portal-icon { display: inline-block; width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.modern .modern-layout { display: grid; max-width: none; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; scrollbar-width: thin; background: #fafafa; border-right: 1px solid var(--modern-line); }
.portal-sidebar > summary { display: none; }
.portal-sidebar-inner { padding: 22px 15px; }
.modern .portal-brand { min-height: 46px; padding: 0 6px; margin-bottom: 27px; color: var(--modern-ink); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.portal-brand-mark { display: grid; place-items: center; flex: 0 0 33px; height: 33px; background: #27272a; color: white; border-radius: 9px; font-size: 16px; }
.portal-brand small { display: block; color: var(--modern-muted); font-size: 11px; font-weight: 500; margin-top: 3px; }
.portal-nav-group { margin: 4px 0; }
.portal-nav-group summary { display: flex; justify-content: space-between; align-items: center; border-radius: 7px; padding: 8px 9px; cursor: pointer; font-size: 12px; font-weight: 650; color: #60606b; }
.portal-nav-group summary .portal-nav-chevron { width: 14px; height: 14px; }
.portal-nav-group[open] > summary .portal-nav-chevron { transform: rotate(90deg); }
.portal-nav-group summary:hover, .portal-nav-links a:hover { background: #efeff1; }
.portal-nav-links { margin: 2px 0 8px; border-left: 1px solid var(--modern-line); padding-left: 8px; margin-left: 10px; }
.modern .portal-nav-links a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; color: #3f3f46; font-size: 13px; overflow-wrap: anywhere; }
.modern .portal-nav-links .portal-nav-logout { color: #b42338; }
.modern .portal-nav-links a[aria-current=page] { color: #3b2d86; background: #ece8ff; font-weight: 650; }
.modern .modern-workspace { padding: 0; }
.portal-toolbar { min-height: 68px; padding: 12px clamp(18px, 4vw, 56px); border-bottom: 1px solid var(--modern-line); }
.modern .portal-toolbar > a, .portal-toolbar-title { color: #3f3f46; font-weight: 600; overflow-wrap: anywhere; }
.portal-toolbar-brand { display: none; }
.portal-toolbar-account { display: inline-flex; align-items: center; flex-shrink: 0; gap: 7px; border: 1px solid var(--modern-line); padding: 7px 11px; border-radius: 8px; background: #fff; }
.portal-toolbar-account:hover { background: #f7f7f8; }
.modern .modern-content, .modern .modern-footer { width: min(100%, 1440px); margin: 0 auto; padding-inline: clamp(18px, 3vw, 48px); }
.modern .modern-content { border: 0; box-shadow: none; border-radius: 0; padding-top: 34px; padding-bottom: 24px; background: transparent; }
.modern.portal-home .modern-content { overflow: visible; }
.modern .modern-footer { padding-block: 20px; color: var(--modern-muted); }
.portal-home-grid { display: grid; gap: 24px; align-items: start; }
.portal-home-grid.with-account { grid-template-columns: minmax(0, 1fr) minmax(290px, 350px); }
.portal-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(90px, 34%);
    align-items: stretch;
    isolation: isolate;
    overflow: hidden;
    min-height: 220px;
    border-radius: 18px;
    border: 1px solid #e7dffa;
    background: linear-gradient(125deg, #fbfaff 30%, #eee8fb 100%);
}
.portal-intro-copy { z-index: 1; align-self: center; padding: clamp(20px, 3vw, 40px); }
.portal-intro h1 { margin: 0 0 12px; font-size: clamp(30px, 3.8vw, 55px); font-weight: 740; letter-spacing: -.055em; line-height: 1.05; }
.modern .portal-intro p { max-width: 38ch; margin-bottom: 22px; color: #555166; font-size: 15px; }
.portal-intro-art {
    position: relative;
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at center, #d8c9f8 0, transparent 74%);
}
.portal-intro-art::before, .portal-intro-art::after { content: ''; position: absolute; aspect-ratio: 1; border-radius: 28%; transform: rotate(-14deg); }
.portal-intro-art::before { width: clamp(85px, 13vw, 188px); border: 1px solid #bca6e8; opacity: .6; }
.portal-intro-art::after { width: clamp(68px, 10.5vw, 150px); border: 1px solid #c8b6f0; background: #fbfaff88; transform: rotate(14deg); }
.portal-art-tile {
    z-index: 1;
    display: grid;
    place-items: center;
    width: clamp(52px, 7.5vw, 110px);
    aspect-ratio: 1;
    border-radius: 26%;
    color: white;
    background: linear-gradient(145deg, #8065ca, #52399b);
    box-shadow: 0 12px 22px #6442ad45, inset 0 1px 0 #ffffff66;
    transform: rotate(-8deg);
}
.portal-art-tile .portal-icon { width: 56%; height: 56%; stroke-width: 1.5; }
.portal-intro-with-image {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
}
.portal-intro-with-image::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, #fbfaff 0%, #f7f4fe 38%, rgba(243, 238, 252, 0.88) 52%, rgba(238, 232, 251, 0.35) 68%, rgba(238, 232, 251, 0) 84%);
}
.portal-intro-with-image .portal-intro-copy {
    position: relative;
    z-index: 2;
    max-width: min(100%, 560px);
}
.portal-intro-banner {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    width: clamp(260px, 60%, 720px);
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: right center;
    pointer-events: none;
}
.modern .modern-button, .modern .portal-signin { background: #27272a; border-radius: 8px; min-height: 40px; }
.modern .modern-button:hover, .modern .portal-signin:hover { background: #3f3f46; color: white; }
.modern .modern-button.secondary { color: #27272a; border-color: var(--modern-line); background: white; }
.modern .modern-button.secondary:hover { background: #f4f4f5; }
.portal-features { container-type: inline-size; margin-top: 14px; }
.portal-shortcuts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@container (min-width: 24rem) {
    .portal-shortcuts:is([data-columns="2"], [data-columns="3"], [data-columns="4"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 36rem) {
    .portal-shortcuts:is([data-columns="3"], [data-columns="4"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (min-width: 48rem) {
    .portal-shortcuts[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.modern .portal-shortcuts a { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--modern-line); border-radius: 10px; color: var(--modern-ink); }
.modern .portal-shortcuts a:hover { border-color: #d8caef; background: #faf9fd; }
.portal-shortcuts a > span:not(.portal-shortcut-icon) { min-width: 0; overflow-wrap: anywhere; }
.portal-shortcut-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 8px; color: #5e489c; background: #f1ecfb; }
.portal-shortcut-arrow { margin-inline-start: auto; color: var(--modern-muted); }
.portal-shortcuts small, .portal-identity small { display: block; font-size: 12px; color: var(--modern-muted); }
.portal-panel { border: 1px solid var(--modern-line); border-radius: 15px; background: white; box-shadow: 0 3px 8px #18181b06; }
.modern .portal-panel-title { margin: 0; padding: 20px 21px 0; font-size: 21px; letter-spacing: -.035em; color: var(--modern-ink); }
.portal-panel-body, .portal-identity { padding: 14px 21px 20px; }
.portal-avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; background: #ece8ff; border-radius: 9px; color: #45338d; font-weight: 700; }
.portal-account-links { padding: 0 12px 12px; }
.portal-link { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 7px; overflow-wrap: anywhere; }
.portal-link:hover, .portal-pin { background: #f5f2fe; }
.portal-login { display: grid; gap: 6px; }
.portal-login label { margin-top: 3px; font-weight: 650; font-size: 12px; }
.modern .portal-login input:not([type=hidden]), .modern .portal-login select { width: 100%; min-width: 0; border-color: #d9d9df; background: #fff; }
.portal-password { position: relative; }
.portal-password:has(button:not([hidden])) input { padding-right: 64px !important; }
.modern .portal-password button { position: absolute; right: 4px; top: 4px; min-height: 32px; padding: 4px 8px; background: #f4f4f5; color: #3f3f46; font-size: 11px; }
.modern .portal-password button[hidden] { display: none; }
.modern .portal-signin { margin-top: 7px; }
.portal-recovery { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--modern-line); }
.modern .portal-recovery .modern-button { justify-content: flex-start; gap: 8px; min-width: 0; min-height: 38px; padding: 7px 10px; text-align: left; font-size: 12px; }
.portal-recovery .portal-icon { color: var(--modern-accent); }
.portal-news { margin-top: 26px; border-top: 1px solid var(--modern-line); overflow-wrap: anywhere; }
.modern .portal-news h2 { margin: 17px 0 14px; font-size: 20px; }
.portal-status-card { margin-top: 14px; padding: 16px; border: 1px solid var(--modern-line); border-radius: 12px; background: #fff; }
.portal-status-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.modern .portal-status-header h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.portal-status-detail { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: auto; font-size: 12px; }
.portal-status-detail .portal-icon { width: 14px; height: 14px; }
.portal-status-content { margin-top: 12px; }
.modern .portal-status-message { margin: 0; color: var(--modern-muted); font-size: 13px; }
.portal-status-world + .portal-status-world { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--modern-line); }
.portal-world-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.modern .portal-world-heading h3 { margin: 0; color: #3f3f46; font-size: 13px; }
.modern .portal-player-count { display: flex; align-items: baseline; gap: 7px; margin: 0; color: var(--modern-muted); font-size: 12px; }
.portal-player-count strong { color: var(--modern-ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.portal-status-card .portal-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.portal-status-card .portal-service { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 10px; border: 1px solid #ebebee; border-radius: 8px; background: #fafafa; }
.portal-service-label { min-width: 0; color: #3f3f46; font-size: 12px; }
.portal-service .portal-service-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: #eeeef1; color: #52525b; font-size: 10px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.portal-service-pill[data-state="online"] { background: #e7f7ee; color: #17623f; }
.portal-service-pill[data-state="offline"] { background: #fcebed; color: #922b35; }
.portal-service-pill[data-state="online"]::before, .portal-service-pill[data-state="offline"]::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
@media (max-width: 1060px) {
    .modern .modern-layout { grid-template-columns: 194px minmax(0, 1fr); }
    .portal-home-grid.with-account { grid-template-columns: minmax(0, 1fr) minmax(255px, 310px); gap: 16px; }
}
@media (max-width: 820px) {
    .modern .modern-layout { display: block; }
    .portal-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--modern-line); }
    .portal-sidebar > summary { display: flex; justify-content: space-between; padding: 10px 18px; cursor: pointer; font-weight: 650; }
    .portal-sidebar-inner { padding-block: 6px 12px; }
    .portal-sidebar .portal-brand { display: none; }
    .portal-toolbar { min-height: 54px; }
    .portal-toolbar-title { display: none; }
    .portal-toolbar-brand { display: inline-block; }
}
@media (max-width: 720px) {
    .modern .modern-content { padding-top: 18px; }
    .portal-home-grid.with-account { grid-template-columns: minmax(0, 1fr); }
    .portal-home-account { grid-row: 1; }
    .portal-intro { min-height: 180px; }
    .portal-intro-with-image::after {
        background: linear-gradient(90deg, rgba(251, 250, 255, 0.96) 0%, rgba(243, 238, 252, 0.88) 50%, rgba(238, 232, 251, 0.25) 100%);
    }
    .portal-intro-banner { width: 75%; }
}
/* Profile navigation: native disclosure works with keyboard and without JavaScript. */
.portal-toolbar { position: relative; z-index: 5; gap: 16px; }
.portal-profile { position: relative; flex-shrink: 0; }
.portal-profile > summary { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; list-style: none; }
.portal-profile > summary::-webkit-details-marker { display: none; }
.portal-profile > summary:hover, .portal-profile[open] > summary { background: #f4f4f5; border-color: #e4e4e7; }
.portal-profile .portal-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
.portal-profile-name { max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: 13px; }
.portal-profile-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 288px; max-width: calc(100vw - 36px); max-height: calc(100dvh - 150px); overflow: auto; padding: 5px; border: 1px solid var(--modern-line); border-radius: 12px; background: #fff; box-shadow: 0 10px 30px #18181b14, 0 2px 5px #18181b08; }
.portal-profile-heading { padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--modern-line); overflow-wrap: anywhere; }
.portal-profile-heading strong, .portal-profile-heading small { display: block; }
.portal-profile-heading small { color: var(--modern-muted); font-size: 12px; margin-top: 2px; }
.portal-profile-chevron { transform: rotate(90deg); }
.modern .portal-profile .portal-link { color: #3f3f46; min-height: 38px; align-items: center; justify-content: flex-start; padding-inline: 10px; font-size: 13px; }
.modern .portal-profile .portal-link:hover { background: #f4f4f5; }
.portal-profile .portal-pin { background: transparent; }
.portal-profile-server { margin: 5px 0 0; padding: 11px 10px; border-top: 1px solid var(--modern-line); }
.portal-profile-server label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--modern-muted); }
.modern .portal-profile-server select { flex: 1; min-width: 0; font-size: 12px; }
.modern .portal-profile-server button { min-height: 40px; padding: 7px 11px; background: #fff; color: var(--modern-ink); border-color: var(--modern-line); }
.portal-nav-external { margin-inline-start: auto; color: var(--modern-muted); }
.portal-sidebar-server { padding: 8px 0 0; }
.portal-sidebar-server > div { gap: 5px; }
.modern .portal-sidebar-server :is(select, button) { min-height: 36px; padding: 5px 7px; font-size: 12px; }
.portal-profile-signout { border-top: 1px solid var(--modern-line); padding-top: 5px; }
.modern .portal-profile .portal-profile-signout .portal-link { color: #b42338; }
/* Keep legacy views intact, while giving data tables room to stay readable. */
.modern .modern-content { min-width: 0; overflow: visible; }
.modern .modern-table-scroll { border: 1px solid var(--modern-line); border-radius: 10px; overflow-x: auto; }
.modern .modern-content table { overflow-wrap: normal; word-break: normal; }
.modern .modern-content .horizontal-table { margin: 0; width: 100%; }
.modern .horizontal-table :is(th, td) { border: 0; border-bottom: 1px solid var(--modern-line); padding: 13px 16px; vertical-align: middle; text-align: left; }
.modern .horizontal-table th { background: #fafafa; color: #71717a; font-weight: 600; white-space: nowrap; }
.modern .horizontal-table th a { color: #52525b; }
.modern .horizontal-table tr:last-child td { border-bottom: 0; }
.modern .horizontal-table tr:hover td { background: #fafafa; }
.modern .horizontal-table td { color: #3f3f46; }
.modern .vertical-table :is(th, td) { border-color: var(--modern-line); padding: 13px 16px; }
.modern .vertical-table th { background: #fafafa; color: #71717a; white-space: nowrap; text-align: left; }
.modern .portal-vendors { min-width: 740px; }
.modern .portal-vendors td { white-space: nowrap; }
.modern .portal-vendors strong { font-weight: 600; color: #27272a; }
.portal-shop-title { display: flex; align-items: center; gap: 10px; }
.portal-shop-title svg { flex: 0 0 18px; color: #a1a1aa; }
.portal-map { display: inline-block; border: 1px solid #e4e4e7; background: #fafafa; padding: 1px 7px; border-radius: 5px; font-size: 12px; }
.modern .horizontal-table .portal-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.portal-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.modern .search-form, .modern .search-form2, .modern .generic-form { background: #fafafa; }
.modern .info { border: 0; background: transparent; color: var(--modern-muted); text-align: left; padding: 0; }
@media (max-width: 610px) {
    .portal-profile-name { display: none; }
    .portal-toolbar { padding-inline: 18px; }
    .portal-profile > summary { gap: 5px; }
}

/* UniTip's 115px center plus 30px padding must match its 145px sprite caps. */
.modern #unitipmid { box-sizing: content-box; }
.modern #unitip { pointer-events: none; }
