/* Legacy color aliases keep the existing Blade modules on the shared palette. */
html.dark-theme[data-theme] {
  color-scheme: dark;
  --signal: var(--primary);
  --signal-hover: var(--primary-hover);
  --signal-text: color-mix(in srgb, var(--primary-hover) 72%, var(--text));
  --tone-text: var(--signal-text);
  --tone-strong: var(--accent);
  --tone-panel: var(--surface-hover);
  --sage-accent: var(--success-text);
  --mist-accent: var(--text-muted);
  --iris-accent: var(--danger-text);
  --clay-accent: var(--primary-hover);
  --panel-sage: color-mix(in srgb, var(--success) 14%, var(--surface));
  --panel-mist: var(--surface-hover);
  --panel-iris: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --panel-clay: color-mix(in srgb, var(--primary) 12%, var(--surface));
  --surface-glaze: var(--surface);
  --accent-blend: var(--primary);
  --card: var(--surface);
  --card2: var(--surface-hover);
  --row: color-mix(in srgb, var(--surface-hover) 65%, var(--surface));
  --line: var(--border);
  --line2: color-mix(in srgb, var(--border) 76%, var(--primary));
  --line3: var(--border-strong);
  --txt: var(--text);
  --txt2: var(--text);
  --tan: var(--text-muted);
  --mut: var(--text-muted);
  --faint: var(--text-muted);
  --gold: var(--primary);
  --gold2: var(--primary);
  --golddeep: var(--primary);
  --goldlt: var(--signal-text);
  --gold3: var(--border-strong);
  --acc: var(--primary-hover);
  --acc2: var(--accent);
  --accdd: var(--surface-hover);
  --brown: var(--ink);
  --hd: var(--text);
  --portal-width: 1280px;
  --portal-display: var(--font-display);
}
html.dark-theme[data-theme=night] { --surface: #1c1b19; --surface-hover: #272522; --primary: #b9ab98; --primary-hover: #d2c4b0; }
html.dark-theme[data-theme=ocean] { --surface: #1b211b; --surface-hover: #242b23; --primary: #a6ac87; --primary-hover: #c0c6a2; }
html.dark-theme[data-theme=royal] { --surface: #251e19; --surface-hover: #30251d; --primary: #bd977d; --primary-hover: #d5ae92; }
html.dark-theme[data-theme=fire] { --surface: #241b18; --surface-hover: #30211d; --primary: #c29885; --primary-hover: #d9af9b; }
html.dark-theme[data-theme] body {
  background: var(--silk), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.osi-main :where(h1, h2, h3) { color: var(--hd); }
:where(.osi-top, .osi-nav, .osi-main, .osi-foot) :where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
.osi-top {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  box-shadow: none;
  font-size: .77rem;
}
.osi-top-in, .osi-nav-in {
  width: min(calc(100% - 56px), var(--portal-width));
  max-width: none;
  padding-inline: 0;
}
.osi-top-in { min-height: 40px; padding-block: 5px; }
.osi-top .osi-online { color: var(--sage-accent); }
.osi-top .osi-time { color: var(--mut); }
.osi-top .osi-login button, .osi-langbtn {
  background: var(--card2);
  border: 1px solid var(--line2);
  color: var(--txt);
}
.osi-top .osi-langmenu { inset-inline-end: 0; inset-inline-start: auto; }
.osi-music {
  display: inline-grid;
  place-items: center;
  inline-size: 32px;
  block-size: 29px;
  flex: none;
  border: 1px solid var(--line2);
  border-radius: var(--radius-md);
  background: var(--card2);
  color: var(--txt);
  cursor: pointer;
}
.osi-music[hidden] { display: none; }
.osi-music:hover, .osi-music[aria-pressed=true] { color: var(--primary-hover); border-color: var(--primary-hover); }
.guide-showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide-showcase-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.guide-showcase-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.guide-showcase-title h4 { margin: 0; color: var(--text); }
.guide-showcase-title span, .guide-showcase-weapons { color: var(--primary-hover); font-weight: 600; }
.guide-showcase-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(ellipse at 50% 70%, var(--surface-hover), var(--bg) 78%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-block: 10px;
}
.guide-showcase-preview :is(canvas,img) { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; }
.guide-showcase-preview img { border-radius: inherit; }
.guide-showcase-preview canvas:not([hidden]) + img { display: none; }
.guide-showcase-preview [data-s] { position: absolute; inset-block-end: 8px; padding: 3px 8px; background: var(--bg); color: var(--text-muted); border-radius: var(--radius-sm); }
.guide-showcase-preview canvas[hidden], .guide-showcase-preview [data-s][hidden] { display: none; }
.guide-showcase-preview[data-preview-still] [data-s] { display: none; }
.guide-showcase-card p { margin: 7px 0 0; }
@media (max-width: 900px) { .guide-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .guide-showcase { grid-template-columns: minmax(0, 1fr); } }
.osi-thm .th-fire { background: #e5a1a9; }
.osi-thm .th-night { background: #d0cfca; }
.osi-thm .th-ocean { background: #a8cf9d; }
.osi-thm .th-royal { background: #cfaadd; }
.osi-thm .th-dark { background: #dfb777; }
.osi-top .osi-thm button.on { box-shadow: none; border-color: var(--sage-12); }
html.dark-theme[data-theme] .osi-nav {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: none;
}
.osi-nav-in { min-height: 74px; gap: 22px; flex-wrap: nowrap; }
.osi-nav .osi-logo { flex: 0 0 auto; }
.osi-nav .osi-badge-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 3px 8px rgb(0 0 0 / 45%));
}
.osi-nav .osi-links {
  box-sizing: border-box;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, var(--bg));
}
.osi-nav .osi-links a { font-size: .82rem; padding: 9px 10px; border-radius: 6px; }
.osi-nav .osi-dd:focus-within .osi-dd-menu { display: block; }
.osi-dd .osi-dd-menu { inset-inline-start: 0; inset-inline-end: auto; }
.osi-nav .osi-btns { margin-inline-start: auto; margin-inline-end: 0; gap: 7px; }
.osi-nav .osi-btns a, .portal-hero .osi-cta a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 7px;
  box-shadow: none;
  text-shadow: none;
  text-decoration: none;
  white-space: nowrap;
}
.osi-nav .osi-btns .osi-dl, .portal-hero .osi-cta .g {
  background: var(--accent-blend);
  border: 1px solid var(--signal);
  color: var(--brown);
}
.osi-nav .osi-btns .osi-dl:hover, .portal-hero .osi-cta .g:hover { background: var(--signal-hover); }
.portal-hero .osi-cta .o {
  background: color-mix(in srgb, var(--sage-accent) 12%, var(--card2));
  border: 1px solid color-mix(in srgb, var(--sage-accent) 36%, var(--line3));
  color: var(--hd);
}
.portal-hero .osi-cta .o:hover { background: color-mix(in srgb, var(--sage-accent) 21%, var(--card2)); }
.osi-nav .osi-btns .osi-dc, .osi-main .portal-community .portal-community-join {
  background: #292b50;
  border: 1px solid #5865f2;
  color: #e0e3ff;
  box-shadow: none;
}
.osi-nav .osi-btns .osi-dc:hover, .osi-main .portal-community .portal-community-join:hover {
  background: #35396d;
  border-color: #a5afff;
  color: #fff;
}
.portal-service.portal-service-discord {
  --service-accent: #a5afff;
  --service-panel: #292b50;
}
.osi-main .portal-video-link { display: inline-flex; align-items: center; gap: 8px; }
.osi-main .portal-video-link i { color: #ff646c; }
.osi-menu-toggle { display: none; }
.osi-main {
  width: min(calc(100% - 56px), var(--portal-width));
  max-width: none;
  padding: 28px 0 46px;
  min-width: 0;
}
.osi-landing .osi-main { padding-top: 24px; }
.portal-hero .osi-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--signal);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  margin-bottom: 14px;
}
.portal-hero .osi-eyebrow::before { content: ''; width: 24px; height: 2px; background: currentColor; }
.portal-version { padding: 3px 7px; border: 1px solid var(--line3); border-radius: 4px; letter-spacing: .08em; }
html[dir=ltr] .portal-hero h1 { text-transform: uppercase; }
html.dark-theme[data-theme] .portal-hero h1 {
  max-width: 610px;
  margin: 0;
  color: var(--hd);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(3.8rem, 6vw, 5.9rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .92;
  text-wrap: balance;
  text-shadow: 0 2px 26px #10111862;
}
.portal-hero h1 span {
  display: block;
  height: auto;
  padding: 0;
  border: 0;
  color: var(--signal-text);
  font: inherit;
  text-shadow: inherit;
}
.portal-hero p { margin: 25px 0 0; color: #e0deec; font-size: 1rem; line-height: 1.7; max-width: 440px; }
.portal-hero .portal-promise { margin: 17px 0 0; color: var(--hd); font-size: 1.15rem; font-weight: 800; }
.portal-hero .portal-promise + p { margin-top: 8px; }
.portal-hero .osi-cta { margin: 24px 0 0; }
.portal-hero .osi-cta a { min-height: 48px; padding-inline: 20px; font-size: .88rem; }
.portal-stats {
  margin: 16px 0 0;
  gap: 0;
  background: linear-gradient(110deg, var(--panel-sage), var(--panel-mist) 52%, var(--panel-iris));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.portal-stats .osi-stat { background: transparent; border: 0; border-radius: 0; padding: 16px clamp(14px, 2.5vw, 32px); }
.portal-stats .osi-stat + .osi-stat { border-inline-start: 1px solid var(--line); }
.portal-stats .osi-stat b { color: var(--hd); font-size: 1.7rem; line-height: 1.24; font-variant-numeric: tabular-nums; }
.portal-stats .osi-stat:first-child b { color: var(--signal); }
.portal-stats .osi-stat small { color: var(--mut); font-size: .76rem; letter-spacing: .05em; }
.portal-showcase { margin: 36px 0; }
.portal-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.portal-section-heading h2 { font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.08 Cinzel, Georgia, serif; margin: 0 0 7px; }
html[dir=rtl] .portal-section-heading h2 { font-family: var(--portal-display); }
.portal-section-heading p { margin: 0; color: var(--mut); font-size: .92rem; }
.portal-section-link { padding: 10px 15px; flex: 0 0 auto; border: 1px solid var(--line3); border-radius: 6px; color: var(--signal-text); background: var(--card); text-decoration: none; }
.portal-section-link:hover { border-color: var(--signal); background: var(--card2); }
.portal-showcase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px); }
.portal-champion { --stage-light: 195 153 95; min-width: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
.portal-champion:nth-child(2) { --stage-light: 126 164 150; }
.portal-champion:nth-child(3) { --stage-light: 140 158 187; }
.portal-champion .portal-champion-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(260px, 23vw, 320px);
  margin: 0;
  background:
    radial-gradient(ellipse 43% 48% at 50% 36%, rgb(var(--stage-light) / 28%), transparent 100%),
    linear-gradient(155deg, rgb(var(--stage-light) / 13%), transparent 64%),
    #141414;
}
.portal-champion-stage::before, .portal-champion-stage::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.portal-champion-stage::before {
  inset: 16px 13% 29px;
  border: 1px solid rgb(var(--stage-light) / 28%);
  border-radius: 48% 48% 4px 4px / 64% 64% 4px 4px;
  box-shadow: inset 0 0 0 5px rgb(14 14 14 / 31%), 0 0 0 5px rgb(14 14 14 / 24%);
}
.portal-champion-stage::after {
  inset: auto 16% 5%;
  height: 19%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(var(--stage-light) / 24%) 0%, rgb(var(--stage-light) / 8%) 49%, transparent 72%);
}
.portal-champion canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.portal-champion canvas[hidden] { display: none; }
.portal-champion .osiris-st { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; color: var(--mut); }
.portal-champion .osiris-st[hidden] { display: none; }
.portal-champion-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 15px; border-block-start: 1px solid var(--border-strong); color: var(--mut); font-size: .78rem; }
.portal-champion-identity { min-width: 0; }
.portal-champion-name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.portal-champion-name .rk-nobility { display: inline-flex; align-items: center; flex: none; }
.portal-champion-name .rk-nobility img { display: block; inline-size: 26px; block-size: 26px; object-fit: contain; }
.portal-champion-caption a { display: block; color: var(--hd); font-size: 1rem; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.portal-champion-caption a:hover, .portal-champion-caption strong { color: var(--signal); }
.portal-champion-caption small { color: var(--tone-text); }
.portal-champion-power { margin-inline-start: auto; white-space: nowrap; }
.portal-services { margin: 36px 0 28px; }
.portal-services .osi-sec {
  margin: 0 0 6px;
  font: 800 clamp(2rem, 4vw, 3.2rem)/1.03 var(--portal-display);
  text-shadow: none;
  color: var(--hd);
}
.portal-services .osi-sec-sub { margin: 0 0 18px; font-size: .93rem; }
.portal-service-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.portal-service {
  --service-accent: var(--sage-accent);
  --service-panel: var(--panel-sage);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 74px;
  padding: 12px 15px;
  background: linear-gradient(145deg, var(--service-panel), var(--card) 78%);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--txt);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
}
.portal-service:nth-child(2) { --service-accent: var(--mist-accent); --service-panel: var(--panel-mist); }
.portal-service:nth-child(3) { --service-accent: var(--iris-accent); --service-panel: var(--panel-iris); }
.portal-service:nth-child(4) { --service-accent: var(--clay-accent); --service-panel: var(--panel-clay); }
.portal-service i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 7px;
  color: var(--service-accent);
  background: color-mix(in srgb, var(--service-accent) 12%, var(--card));
}
.portal-service:hover { border-color: var(--service-accent); color: var(--hd); background: var(--service-panel); }
.osi-main .portal-community {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  box-sizing: border-box;
  width: min(100%, 960px);
  margin: 26px auto 0;
  padding: clamp(15px, 2.5vw, 28px);
  scroll-margin-top: 88px;
}
.portal-community-copy { display: grid; justify-items: start; gap: 10px; }
.portal-community-widget { display: block; inline-size: 100%; block-size: 250px; border: 0; border-radius: var(--radius-md); }
.portal-community-copy p { margin: 0; }
.osi-main .portal-community .portal-community-join { display: inline-flex; align-items: center; gap: 8px; margin-block-start: 4px; }
.portal-community-join i, .osi-dc i { font-size: 1rem; }
.osi-main #nx-root h3 { font: 800 2rem/1.05 var(--portal-display); }
.portal-community p, .osi-main .osi-card p { color: var(--mut); font-size: .93rem; }
.osi-main .nx-card { background: var(--card2); border-color: var(--line2); border-radius: 8px; }
.osi-main .nx-card .nx-name { color: var(--hd); }
.osi-foot {
  margin-top: 0;
  padding: 28px 20px;
  background: var(--card);
  color: var(--mut);
  font-size: .8rem;
  line-height: 1.7;
}
.osi-foot b { color: var(--signal); }

.portal-launch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 18px;
  padding: 15px 20px;
  border: 1px solid var(--line3);
  border-inline-start: 3px solid var(--signal);
  border-radius: 9px;
  background: var(--surface-glaze);
}
.portal-launch h2 { margin: 0 0 4px; color: var(--signal-text); font-size: 1.25rem; }
.portal-launch p { margin: 0; color: var(--mut); }
.portal-launch-clock { display: flex; gap: 8px; flex-wrap: wrap; }
.portal-launch-clock > div { min-width: 58px; padding: 4px 7px; text-align: center; border: 1px solid var(--line); background: var(--card); border-radius: 5px; }
.portal-launch-clock b { display: block; color: var(--signal); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.portal-launch-clock small { color: var(--txt2); font-size: .75rem; }
.portal-visitors {
  position: fixed;
  z-index: 45;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 12px;
  color: var(--txt2);
  background: var(--card);
  border: 1px solid var(--line3);
  border-radius: 7px;
  box-shadow: 0 3px 12px #0005;
  font-size: .8rem;
}
.portal-visitors { pointer-events:none; }
.portal-visitors i, .portal-visitors strong { color: var(--signal); }
.portal-launch[hidden], .portal-visitors[hidden] { display: none; }

.osi-interior .osi-main .homeleft {
  padding: clamp(17px, 3vw, 40px);
  border-radius: 13px;
  background: var(--surface-glaze);
}
.osi-main .homeleft .latestnewstitle { border-bottom: 1px solid var(--line2); margin-bottom: 18px; }
.osi-main .homeleft .latestnewstitle span {
  font-family: var(--portal-display) !important;
  font-size: clamp(2rem, 4vw, 3.05rem) !important;
  color: var(--hd) !important;
  text-shadow: none;
}
.osi-main .osi-card, .osi-main .osi-item-card, .osi-main .osi-ev-card, .osi-main .osi-dl-card {
  background: var(--card);
  border-color: var(--line2);
  border-radius: 12px;
  box-shadow: none;
}
.osi-main .osi-item-card:hover { box-shadow: 0 8px 28px #10111875; }
.osi-main .rk-layout, .osi-main .rk-livebar, .osi-main .dm-wrap, .osi-main .pd-wrap {
  max-width: none;
  padding-inline: 0;
}
.osi-main .rk-side, .osi-main .dm-panel { border-radius: 12px; }
.osi-main .rk-side { top: 84px; max-height: calc(100vh - 94px); }
.osi-main .rk-pod { background: var(--surface-glaze); border-color: var(--line2); border-radius: 12px; }
.osi-main .rk-pod.first { background: linear-gradient(150deg, var(--panel-sage), var(--panel-mist) 47%, var(--card)); border-color: var(--tone-text); }
.osi-main .rk-pod.third { background: linear-gradient(150deg, var(--panel-iris), var(--card) 75%); }
.osi-main .rk-pod .osiris-preview[data-pirate-pair] { width: min(410px, calc(100% - 18px)); }
.osi-main .rk-pod.second, .osi-main .rk-pod.third { border-color: var(--line2); }
.osi-main .rk-pod .rk-ppow, .osi-main .rk-pod .rk-pname { color: var(--hd); }
.osi-main .rk-pod.first .rk-ppow { color: var(--signal); }
.osi-main .rk-pod:hover, .osi-main .rk-preview-button:hover { border-color: var(--signal); }
.osi-main .rk-pod .rk-medal { background: var(--slate-12); color: var(--brown); }
.osi-main .rk-pod.first .rk-medal { background: var(--signal); }
.osi-main .rk-pod.third .rk-medal { background: var(--tone-text); }
.osi-main .rank-table tr.top1 td { background: color-mix(in srgb, var(--signal) 9%, var(--card)); }
.osi-main .rank-table tr.top1 td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.osi-main .rank-table tr.top1 .rank-pos { background: var(--signal); color: var(--brown); }
.osi-main .rank-table tr.top3 td { background: color-mix(in srgb, var(--tone-text) 8%, var(--card)); }
.osi-main .rank-table tr.top3 td:first-child { box-shadow: inset 3px 0 0 var(--tone-text); }
.osi-main .rank-table tr.top3 .rank-pos { background: var(--tone-text); border-color: var(--tone-text); color: var(--brown); }
.osi-main .pd-hero { border-radius: 12px; border-inline-start: 3px solid var(--tone-text); }
.osi-main .pd-guild { background: var(--tone-panel); }
.osi-main .pd-name { font-family: var(--portal-display); font-size: clamp(2rem, 4vw, 3.2rem); }
.osi-main .profile-c3 .c3-motion-selector { background: var(--card2) !important; border-color: var(--line3) !important; color: var(--txt) !important; }
.osi-main .rk-it .arw { display: none; }
.portal-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: var(--mut); }
.portal-pagination > :is(a, span) { min-width: 34px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 5px; text-align: center; }
.portal-pagination a { color: var(--txt); text-decoration: none; background: var(--card2); }
.portal-pagination a:hover { border-color: var(--signal); color: var(--signal-text); }
.portal-pagination [aria-current=page] { color: var(--brown); background: var(--signal); border-color: var(--signal); font-weight: 800; }
.portal-pagination [aria-disabled=true] { opacity: .7; }

@media (max-width: 1090px) {
  .osi-nav-in { flex-wrap: wrap; min-height: 62px; gap: 10px; padding-block: 8px; }
  .osi-nav .osi-btns { margin-inline-start: auto; }
  .osi-menu-toggle {
    order: 2;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 7px;
    border: 1px solid var(--line2);
    color: var(--hd);
    background: var(--card2);
  }
  .osi-nav .osi-links { order: 3; width: 100%; flex-wrap: wrap; overflow: visible; border-radius: 16px; padding: 7px; }
  .osi-nav .osi-links > :is(a, .osi-dd) { flex: 1 1 auto; }
  .osi-nav .osi-links > .osi-dd > a { width: 100%; }
  .osi-menu-toggle[aria-expanded=false] + .osi-links { display: none; }
  .osi-nav .osi-links a { display: inline-block; padding: 9px 12px; }
  .portal-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .osi-top-in, .osi-nav-in, .osi-main { width: calc(100% - 28px); }
  .osi-top-in { gap: 4px 12px; padding-block: 6px; }
  .osi-top-in > div:first-child { font-size: .68rem; }
  .osi-top-in > div:last-child { flex-wrap: wrap; gap: 6px !important; }
  .osi-top-in .osi-login { width: auto; }
  .osi-top-in .osi-thm button { width: 17px; height: 17px; }
  .osi-top-in .osi-fnt button { padding-inline: 5px; }
  .osi-nav-in { padding-inline: 0; }
  .osi-nav .osi-btns { width: auto; }
  .osi-nav .osi-btns a { flex: 0 0 auto; }
  .osi-top .osi-langmenu { inset-inline-start: 0; inset-inline-end: auto; }
  .osi-main, .osi-landing .osi-main { padding-top: 14px; }
  html.dark-theme[data-theme] .portal-hero h1 { font-size: clamp(3rem, 10.7vw, 4.5rem); }
  .portal-hero p { margin-top: 17px; font-size: .9rem; }
  .portal-hero .osi-cta { margin-top: 16px; }
  .portal-hero .osi-cta a { padding-inline: 13px; }
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-stats .osi-stat:nth-child(odd) { border-inline-start: 0; }
  .portal-stats .osi-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .portal-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-section-heading { flex-wrap: wrap; }
  .portal-showcase-grid { grid-template-columns: 1fr; }
  .portal-service { padding-inline: 9px; gap: 8px; }
  .osi-main .portal-community { grid-template-columns: 1fr; }
  .osi-main .rk-side { position: static; max-height: none; }
}
@media (max-width: 410px) {
  .osi-nav .osi-btns a { font-size: .7rem; padding-inline: 8px; }
  .osi-nav .osi-badge-img { width: 52px; height: 52px; }
  .osi-nav .osi-logo { gap: 5px; }
  .osi-menu-toggle { width: 36px; }
  .portal-hero .osi-cta { gap: 7px; }
  .portal-hero .osi-cta a { font-size: .74rem; padding-inline: 9px; }
}

/* Navigation and shared chrome */
html.dark-theme[data-theme] .osi-nav {
  background: var(--bg);
  border-block-end: 1px solid var(--border-strong);
  backdrop-filter: none;
}
.osi-nav-in { min-height: 72px; gap: 18px; }
.osi-nav .osi-badge-img { width: 60px; height: 60px; filter: none; }
.osi-nav .osi-links a { font-size: .87rem; border-radius: var(--radius-sm); color: var(--text-muted); }
.osi-nav .osi-links a:hover { color: var(--text); background: var(--surface); }
.osi-nav :is(.osi-links > a, .osi-links > .osi-dd > a) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-block-size: 36px;
  padding: 7px clamp(9px, .95vw, 15px);
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-hover) 48%, var(--surface));
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.osi-nav :is(.osi-links > a, .osi-links > .osi-dd > a):hover {
  background: var(--surface-hover);
  color: var(--text);
}
.osi-nav :is(.osi-links > a, .osi-links > .osi-dd > a)[aria-current="page"] {
  background: color-mix(in srgb, var(--surface) 77%, var(--primary));
  border-color: color-mix(in srgb, var(--border) 58%, var(--primary));
  color: var(--primary-hover);
}
.osi-nav .osi-links > .osi-dd > a { gap: 7px; }
.osi-nav .osi-links > .osi-dd > a::after {
  content: '';
  inline-size: 5px;
  block-size: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.osi-top .osi-login button, .osi-langbtn, .osi-menu-toggle { border-radius: var(--radius-md); }
.osi-nav .osi-btns a { border-radius: 999px; }
.osi-thm .th-fire { background: #c29885; }
.osi-thm .th-night { background: #b9ab98; }
.osi-thm .th-ocean { background: #a6ac87; }
.osi-thm .th-royal { background: #bd977d; }
.osi-thm .th-dark { background: #b89b62; }
.osi-top .osi-thm button.on { border-color: var(--primary-hover); }
.osi-nav .osi-btns .osi-dc, .osi-main .portal-community .portal-community-join {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.osi-dc i, .portal-community-join i { color: #b8bdff; }
.osi-nav .osi-btns .osi-dc:hover, .osi-main .portal-community .portal-community-join:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}
.osi-foot {
  padding: 26px max(16px, calc((100% - var(--portal-width)) / 2));
  background: var(--bg);
  border-block-start: 1px solid var(--border-strong);
}
.imperial-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; text-align: start; }
.imperial-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.imperial-footer-links a { color: var(--text-muted); text-decoration: none; }
.imperial-footer-links a:hover { color: var(--primary-hover); }

/* Imperial gate and home editorial layout */
html.dark-theme[data-theme] .portal-hero {
  --hero-shade-direction: to right;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  box-sizing: border-box;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
html.dark-theme[data-theme][dir=rtl] .portal-hero { --hero-shade-direction: to left; }
.portal-hero::before, .portal-hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.portal-hero::before {
  z-index: 1;
  inset: 0;
  background: linear-gradient(var(--hero-shade-direction), rgb(12 11 12 / 92%), rgb(12 11 12 / 76%) 27%, rgb(12 11 12 / 30%) 55%, transparent 82%);
}
.portal-hero::after {
  inset: 9px;
  z-index: 1;
  border: 1px solid rgb(224 188 124 / 35%);
}
.portal-hero-art, .portal-hero-copy { grid-area: 1 / 1; min-width: 0; }
.portal-hero-art {
  align-self: start;
  margin: 0;
}
.portal-hero-art img { display: block; width: 100%; height: auto; }
.portal-hero-copy {
  position: relative;
  z-index: 2;
  justify-self: start;
  box-sizing: border-box;
  width: min(100%, 650px);
  padding: clamp(32px, 6vw, 88px);
}
.portal-hero .osi-eyebrow { color: var(--primary-hover); font-size: .81rem; font-weight: 600; letter-spacing: .08em; }
.portal-hero .osi-eyebrow::before { width: 15px; height: 15px; border: 1px solid var(--primary); background: var(--accent); transform: rotate(45deg) scale(.62); }
.portal-version { border-color: var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font-variant-numeric: tabular-nums; }
html.dark-theme[data-theme] .portal-hero h1 {
  font: 700 clamp(2.6rem, 4.95vw, 4.5rem)/1.04 var(--font-display);
  letter-spacing: -.045em;
  text-transform: none;
  color: #f5ead9;
  text-shadow: 0 3px 26px rgb(0 0 0 / 68%);
  overflow-wrap: anywhere;
}
.portal-hero h1 span { color: var(--primary-hover); }
.portal-hero p { margin-block-start: 16px; color: #e4dace; }
.portal-hero .osi-cta a { min-height: 44px; padding-inline: 15px; border-radius: var(--radius-md); }
.portal-hero .osi-cta .o { background: var(--bg); border-color: var(--border-strong); }
.portal-hero .osi-cta .o:hover { background: var(--surface-hover); }
.portal-stats { margin-block-start: 0; border-color: var(--border-strong); border-block-start: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--surface); }
.portal-stats .osi-stat { padding-block: 13px; }
.portal-stats .osi-stat b { font-size: 1.6rem; }
.portal-stats .osi-stat small { font-size: .82rem; }
.portal-showcase { margin-block: 38px 34px; }
.portal-section-heading h2 { font: 700 clamp(1.55rem, 3vw, 2.15rem)/1.2 var(--font-display); }
.portal-section-heading { padding-block-end: 12px; border-block-end: 1px solid var(--border-strong); }
.portal-section-link { border-radius: var(--radius-md); }
.portal-ledger { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-block: 32px; }
.portal-ledger > * { min-width: 0; }
.portal-ledger .portal-services:only-child { grid-column: 1/-1; grid-row: auto; }
.portal-ledger .portal-services { margin: 0; grid-column: 2; grid-row: 1; }
.portal-ledger #nx-root { margin: 0; padding: 0; background: none; border: 0; }
.portal-ledger #nx-root h2, .portal-services .osi-sec, .portal-video h2,
.osi-main .portal-community h2 { font: 700 clamp(1.35rem, 2.4vw, 1.8rem)/1.22 var(--font-display); margin: 0; }
.ledger-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-block-end: 10px; border-block-end: 1px solid var(--border-strong); }
.ledger-heading h2 { margin: 0; }
.portal-service-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border); border-block-start: 0; background: var(--surface); }
.portal-service {
  min-height: 43px;
  border: 0;
  border-block-end: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  color: var(--text);
  background: none;
  font-weight: 600;
}
.portal-service:last-child { border-block-end: 0; }
.portal-service i { width: 22px; height: 22px; flex-basis: 22px; color: var(--primary); background: none; }
.portal-service.portal-service-discord i { color: #b8bdff; }
.portal-service:hover { background: var(--surface-hover); }
.nx-grid { display: grid; gap: 0; border: 1px solid var(--border); border-block-start: 0; }
.osi-main .nx-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 10px; padding: 10px 13px; background: var(--surface); border: 0; border-radius: 0; }
.nx-card + .nx-card { border-block-start: 1px solid var(--border); }
.nx-name { font-weight: 600; }
.nx-time { grid-column: 1/-1; color: var(--text-muted); font-size: .83rem; }
.nx-next, .nx-live { color: var(--primary-hover); font-size: .84rem; font-variant-numeric: tabular-nums; }
.nx-live { color: var(--success-text); }
.portal-video { text-align: center; }
.portal-video h2 { margin: 0 0 8px; }
.portal-video-action { margin-block-start: 14px; }

/* Existing views, tables and forms */
.osi-main :where(h1, h2, h3, .rk-title, .pd-h) { text-wrap: pretty; }
.osi-main .homeleft .latestnewstitle span { font-family: var(--font-display) !important; }
.osi-main .osi-card, .osi-main .osi-item-card, .osi-main .osi-ev-card,
.osi-main .osi-dl-card, .osi-interior .osi-main .homeleft, .osi-main .rk-side,
.osi-main .dm-panel, .osi-main .rk-pod, .osi-main .pd-hero, .osi-main .pd-panel,
.osi-main .pd-strip, .osi-main .sr-win, .portal-launch, .portal-visitors {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.osi-main .osi-item-card:hover { border-color: var(--border-strong); box-shadow: none; }
.osi-main .rk-pod, .osi-main .rk-pod.third { background: var(--silk), var(--surface); }
.osi-main .rk-pod.first { background: var(--silk), var(--panel-iris); border-color: var(--border-strong); }
.osi-main .rk-pod.first::after { content: none; }
.osi-main tr.top1 td.pot { animation: none; }
.osi-main .rk-it, .osi-main .rk-preview-button, .osi-main .rk-topbar :is(input,button), .osi-main .btn, .portal-pagination > :is(a,span) { border-radius: var(--radius-md); }
.osi-main .rank-table :is(th,td) { padding-block: 8px; }
.osi-main .rank-table th { background: var(--surface-hover); color: var(--text-muted); }
.osi-main .rk-livebar .dot, .osi-main .osi-live .dot { animation: none; }
.osi-main .osi-live, .osi-main .osi-next, .osi-main .st-badge { border-radius: var(--radius-sm); }
.osi-main .osi-live, .osi-main .st-badge.on, .osi-main .pd-online.on { color: var(--success-text); border-color: var(--success); background: var(--panel-sage); }
.osi-main .st-badge.off, .imperial-error { color: var(--danger-text); border-color: var(--danger); }
.osi-main .pd-hero, .osi-main .sr-win { background: var(--surface); }
.osi-main .sr-title { background: var(--surface-hover); color: var(--primary-hover); }
.osi-main .sr-title small { color: var(--text-muted); }
.osi-main .sr-doll2 { background: var(--bg); }
.osi-main .sr-board { background: radial-gradient(ellipse at 50% 33%, var(--surface-hover), var(--bg) 82%); border-color: var(--border-strong); }
.osi-main :is(.sr-cell,.sr-acc,.sr-gbox) { background: var(--bg); border-color: var(--border-strong); }
.osi-main .sr-sub { border-color: var(--border); }
.osi-main .sr-gtag { color: var(--text-muted); }
.osi-main :where(.co-box,.co-item,.pd-m,.rk-preview-dialog) { border-radius: var(--radius-md); }
.osi-main .imperial-form-page { max-width: 690px; margin-inline: auto; }
.imperial-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; text-align: start; }
.imperial-back { display:inline-block; color:var(--primary-hover); margin-block-end:10px; }
.imperial-field { display: grid; gap: 5px; min-width: 0; }
.imperial-field :is(label,span) { font-size: .93rem; font-weight: 600; color: var(--text); }
.imperial-field :is(input,select), .osi-modal-box input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}
.imperial-field input[dir=ltr] { text-align: start; }
.imperial-form-wide { grid-column: 1/-1; }
.imperial-form .g-recaptcha { max-width: 100%; overflow-x: auto; }
.osi-modal-box .g-recaptcha { min-block-size: 79px; }
@media (max-width: 370px) {
  .osi-modal-box .g-recaptcha { transform: scale(.84); transform-origin: top left; }
  [dir=rtl] .osi-modal-box .g-recaptcha { transform-origin: top right; }
}
.imperial-form .osi-dl { justify-self: start; margin: 0; }
.imperial-error, .imperial-success { padding: 10px 13px; border: 1px solid var(--danger); border-radius: var(--radius-md); }
.imperial-shop-error { width:min(calc(100% - 28px),var(--portal-width)); box-sizing:border-box; margin:12px auto; }
.imperial-success { color: var(--success-text); border-color: var(--success); }
.imperial-chronicle { display: grid; list-style: none; margin: 0; padding: 0; }
.imperial-chronicle li { display: grid; grid-template-columns: minmax(84px,10rem) minmax(0,1fr); gap: 14px; padding: 13px 0; border-block-end: 1px solid var(--border); }
.imperial-chronicle time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.imperial-chronicle a { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.imperial-chronicle a:hover { color: var(--primary-hover); }

@media (max-width: 960px) {
  .portal-hero-copy { padding: clamp(20px, 4vw, 38px); }
  .portal-ledger { gap: 16px; }
}
@media (max-width: 720px) {
  .osi-nav .osi-badge-img { width: 52px; height: 52px; }
  .portal-hero::before { background: linear-gradient(to bottom, transparent 9vw, rgb(12 11 12 / 30%) 24vw, rgb(12 11 12 / 79%) 45vw, var(--bg) 63vw); }
  .portal-hero::after { inset: 6px; }
  .portal-hero-copy { padding: clamp(104px, 29vw, 205px) 24px 28px; }
  html.dark-theme[data-theme] .portal-hero h1 { font-size: clamp(2.05rem, 8.8vw, 3.1rem); }
  .portal-hero p { margin-block-start: 12px; }
  .portal-hero .osi-cta { gap: 8px; }
  .portal-showcase-grid, .portal-ledger, .osi-main .portal-community { grid-template-columns: 1fr; }
  .osi-main .portal-community { max-width: 610px; }
  .portal-ledger .portal-services { grid-column: auto; grid-row: auto; }
  .imperial-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .osi-main .rk-pod, .osi-main .rk-livebar .dot, .osi-main .portal-launch { animation: none; }
}
