@font-face {
  font-family: "Inter";
  src: url("vendor/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* Open-licence pixel font (SIL OFL, vendor/fonts/LICENSE-PixelifySans) used after the RuneScape fonts if a visitor has them. */
@font-face {
  font-family: "Pixelify Sans";
  src: url("vendor/fonts/pixelify-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0e1014;
  --surface: #15181e;
  --surface-2: #1b1f27;
  --surface-3: #232833;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eceef2;
  --text-2: #a9b0bc;
  --text-3: #6f7785;
  --accent: #e7b24a;
  --accent-ink: #1a1408;
  --accent-soft: rgba(231, 178, 74, 0.14);
  --green: #3ecf8e;
  --green-soft: rgba(62, 207, 142, 0.14);
  --red: #f0616d;
  --red-soft: rgba(240, 97, 109, 0.14);
  --amber: #f5a524;
  --blue: #5aa9ff;
  --slot: #1f242d;
  --slot-border: rgba(255, 255, 255, 0.05);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --roster-w: 288px;
  --detail-w: 420px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #f6f7f9;
    --surface-3: #eceef2;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text: #121620;
    --text-2: #4a5263;
    --text-3: #7d8696;
    --accent: #b9831c;
    --accent-ink: #ffffff;
    --accent-soft: rgba(185, 131, 28, 0.12);
    --green: #12a36a;
    --green-soft: rgba(18, 163, 106, 0.12);
    --red: #d93d4a;
    --red-soft: rgba(217, 61, 74, 0.1);
    --slot: #3a3226;
    --slot-border: rgba(0, 0, 0, 0.2);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);
    color-scheme: light;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  cursor: pointer; font-weight: 550; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: grid; gap: 6px; margin: 14px 0; }
.field span { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
input[type="text"], input[type="password"], input[type="search"] {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; width: 100%;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--red); margin: 0 0 12px; font-size: 13px; }

/* ------------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none; position: relative;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px; background: var(--accent-ink);
  -webkit-mask: url("pin-mask.svg") center / contain no-repeat; mask: url("pin-mask.svg") center / contain no-repeat;
}
.brand-lg { font-size: 20px; }
.brand-lg .brand-mark { width: 34px; height: 34px; }

/* ------------------------------------------------------------------ login */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(90, 169, 255, .08), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.login-sub { color: var(--text-2); margin: 14px 0 4px; }

/* ------------------------------------------------------------------ app layout */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--roster-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "top top" "roster map";
  position: relative;
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 20px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); z-index: 20;
}
.topbar-stats { display: flex; gap: 18px; color: var(--text-2); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; }
.topbar-stats b { color: var(--text); font-weight: 650; }
.stat-pill { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 0 10px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 165, 36, .18); }
.conn.live .conn-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); animation: pulse 2.4s infinite; }
.conn.down .conn-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* ------------------------------------------------------------------ roster */
.roster {
  grid-area: roster; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--border);
}
.roster-head { padding: 14px 14px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; fill: var(--text-3); }
.search input { padding-left: 34px; height: 38px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg { border: 0; background: transparent; border-radius: 6px; height: 28px; cursor: pointer; color: var(--text-2); font-weight: 550; font-size: 13px; }
.seg.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.roster-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.player {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.player:hover { background: var(--surface-2); }
.player.selected { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.player.offline .avatar { filter: grayscale(1); opacity: .55; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; position: relative;
  font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .02em;
}
.avatar .dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-3); border: 2.5px solid var(--surface);
}
.player.online .avatar .dot { background: var(--green); }
.player-main { min-width: 0; }
.player-name { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.player-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-sub { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-value { text-align: right; font-weight: 650; font-size: 13px; }
.player-value small { display: block; color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: var(--surface-3); color: var(--text-2); flex: none;
}
.badge-gim { background: rgba(90, 169, 255, .15); color: var(--blue); }
.badge-iron { background: rgba(169, 176, 188, .16); color: var(--text-2); }
.roster-empty { padding: 32px 22px; text-align: center; color: var(--text-2); }
.roster-empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 15px; }
.empty-illustration {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--accent-soft); position: relative;
}
.empty-illustration::after {
  content: ""; position: absolute; inset: 14px; background: var(--accent);
  -webkit-mask: url("pin-mask.svg") center / contain no-repeat; mask: url("pin-mask.svg") center / contain no-repeat;
}

/* ------------------------------------------------------------------ map */
.map-wrap { grid-area: map; position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #000; }
.leaflet-container { font-family: var(--font); background: #000; }
.leaflet-control-attribution { background: rgba(14, 16, 20, .7) !important; color: #9aa3ae !important; font-size: 10.5px; }
.leaflet-control-attribution a { color: #c9cfd8 !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-bar { border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.map-controls { position: absolute; top: 12px; right: 12px; z-index: 500; display: flex; gap: 8px; }
.plane-switch {
  display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 3px; box-shadow: var(--shadow);
}
.plane-label { font-size: 11.5px; color: var(--text-3); padding: 0 6px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.plane-switch button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: var(--text-2); font-weight: 650; }
.plane-switch button.active { background: var(--accent); color: var(--accent-ink); }
.map-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.map-btn svg { width: 18px; height: 18px; fill: var(--text-2); }
.map-coords {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; font: 12px var(--mono);
  background: rgba(14, 16, 20, .78); color: #d6dbe2; padding: 5px 9px; border-radius: 7px; pointer-events: none;
  backdrop-filter: blur(6px);
}
.map-coords:empty { display: none; }

.pin { position: relative; }
.pin-bubble {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px;
  background: rgba(14, 16, 20, .88); color: #fff; white-space: nowrap; font-weight: 650; font-size: 12px;
  border: 1.5px solid var(--pin); box-shadow: 0 4px 14px rgba(0,0,0,.45);
  transition: transform .15s;
}
.pin-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--pin); border-bottom: 0;
}
.pin-avatar { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--pin); font-size: 10px; color: #fff; }
.pin.selected .pin-bubble { transform: translate(-50%, -2px) scale(1.08); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pin) 35%, transparent), 0 6px 18px rgba(0,0,0,.5); }
.pin.offline .pin-bubble { opacity: .55; filter: grayscale(.9); }
.pin.other-plane .pin-bubble { opacity: .45; border-style: dashed; }
.pin-anchor { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--pin); border: 2px solid #fff; box-shadow: 0 0 0 0 var(--pin); }
.pin.online .pin-anchor { animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pin) 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* ------------------------------------------------------------------ detail panel */
.detail {
  position: absolute; top: calc(var(--topbar-h) + 12px); right: 12px; bottom: 12px; width: var(--detail-w);
  z-index: 1100; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
  animation: slide-in .2s ease-out;
}
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } }
.detail-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.detail-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.detail-title { display: flex; align-items: center; gap: 12px; }
.detail-title .avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
.detail-title h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.detail-meta { color: var(--text-2); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status-chip.online { color: var(--green); }
.status-chip.online::before { background: var(--green); }
.detail-close { margin-left: auto; align-self: flex-start; }
.loc-line {
  margin-top: 12px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px;
}
.loc-line svg { width: 16px; height: 16px; fill: var(--accent); flex: none; }
.loc-line .coords { margin-left: auto; font: 12px var(--mono); color: var(--text-2); }
.loc-line button { margin-left: 6px; }

.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.vital { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.vital-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.vital-top b { color: var(--text); }
.bar { height: 5px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; transition: width .4s ease; }
.bar.hp > i { background: linear-gradient(90deg, #e5484d, #ff7a7f); }
.bar.pray > i { background: linear-gradient(90deg, #3e9bff, #7cc0ff); }
.bar.run > i { background: linear-gradient(90deg, #e7b24a, #ffd27a); }

.detail-body { overflow-y: auto; flex: 1; padding: 14px 18px 22px; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.value-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px;
  display: grid; gap: 2px;
}
.value-card.total { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface-2); }
.value-card .k { font-size: 11.5px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.value-card .v { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.value-card.total .v { font-size: 24px; color: var(--accent); }
.value-card .t { font-size: 11.5px; color: var(--text-3); }
.value-card .t.stale { color: var(--amber); }

.tabs { display: flex; gap: 2px; margin: 18px 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab {
  border: 0; background: transparent; padding: 9px 10px; cursor: pointer; color: var(--text-2);
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { color: var(--text-3); font-weight: 600; margin-left: 4px; font-size: 12px; }

.panel-note { font-size: 12.5px; color: var(--text-2); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.panel-note.stale { color: var(--amber); }
.empty-note {
  padding: 22px 16px; text-align: center; color: var(--text-2); background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 13px;
}

/* item slots */
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 290px; margin: 0 auto; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.slot {
  aspect-ratio: 1 / 1; border-radius: 9px; position: relative; display: grid; place-items: center;
  background: var(--slot); border: 1px solid var(--slot-border);
}
.slot.filled { cursor: default; }
.slot.filled:hover { border-color: var(--accent); background: color-mix(in srgb, var(--slot) 85%, var(--accent)); }
.slot img { width: 36px; height: 32px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.6)); }
.slot .qty {
  position: absolute; left: 4px; top: 2px; font: 700 11px/1 var(--font); color: #ffff00;
  text-shadow: 1px 1px 0 #000;
}
.slot .qty.k { color: #fff; }
.slot .qty.m { color: #00ff80; }
.slot .ph { font-size: 10px; color: rgba(255,255,255,.35); text-align: center; padding: 2px; font-weight: 600; }
.slot .fallback { font-size: 10px; color: #d6dbe2; text-align: center; line-height: 1.1; padding: 3px; overflow: hidden; }

.equip-grid {
  display: grid; grid-template-columns: repeat(3, 64px); grid-auto-rows: 64px; gap: 10px;
  justify-content: center; padding: 14px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border);
}
.equip-grid .slot { aspect-ratio: auto; }
.equip-grid .slot.empty::after { content: attr(data-label); position: absolute; bottom: 4px; font-size: 9.5px; color: rgba(255,255,255,.4); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.bank-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.bank-tools input { height: 34px; }
.bank-tools select {
  height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); padding: 0 8px; font: inherit; font-size: 13px;
}
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; }

.ge-list { display: grid; gap: 8px; }
.ge-offer {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.ge-offer .slot { width: 44px; height: 44px; aspect-ratio: auto; }
.ge-offer .slot img { width: 32px; height: 28px; }
.ge-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-sub { font-size: 12px; color: var(--text-2); }
.ge-kind { font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.ge-kind.buy { color: var(--green); }
.ge-kind.sell { color: var(--amber); }
.ge-kind.done { color: var(--blue); }
.ge-kind.cancel { color: var(--red); }
.ge-progress { height: 5px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.ge-progress i { display: block; height: 100%; background: var(--green); }
.ge-progress.sell i { background: var(--amber); }
.ge-progress.cancel i { background: var(--red); }
.ge-value { text-align: right; font-weight: 700; }
.ge-value small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }

/* tooltip */
.tooltip {
  position: fixed; z-index: 2000; pointer-events: none; background: #0b0d10; color: #eef0f3;
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 9px 11px; font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 260px;
}
.tooltip h4 { font-size: 13px; margin-bottom: 4px; color: #ffb84d; }
.tooltip dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; }
.tooltip dt { color: #9aa3ae; }
.tooltip dd { margin: 0; text-align: right; font-weight: 600; }

/* ------------------------------------------------------------------ dialogs */
.dialog {
  width: min(900px, calc(100% - 32px)); border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--surface); color: var(--text); padding: 22px; box-shadow: var(--shadow);
}
.dialog-sm { width: min(400px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(5, 6, 8, .6); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dialog-sub { color: var(--text-2); margin: 6px 0 16px; }
.add-member { display: flex; gap: 8px; }
.new-key {
  margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
}
.new-key p { margin: 0 0 8px; font-size: 13px; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-row code {
  flex: 1; font: 13px var(--mono); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: nowrap;
}
.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.members-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.members-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; padding: 10px 12px; background: var(--surface-2); }
.members-table td { padding: 10px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
.members-table td:last-child { text-align: right; }
.members-table .actions { display: inline-flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.members-table td:last-child { white-space: normal; min-width: 170px; }
.muted { color: var(--text-3); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  :root { --roster-w: 276px; --detail-w: 380px; }
  .topbar-stats .hide-md { display: none; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 42vh 1fr;
    grid-template-areas: "top" "map" "roster";
  }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-stats { display: none; }
  .brand-name { font-size: 15px; }
  .conn-label { display: none; }
  .roster { border-right: 0; border-top: 1px solid var(--border); }
  .detail {
    position: fixed; inset: auto 0 0 0; top: 18vh; width: auto; border-radius: 18px 18px 0 0;
    animation: sheet-up .22s ease-out;
  }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
  .detail-head { padding: 16px; }
  .detail-body { padding: 12px 16px calc(22px + env(safe-area-inset-bottom)); }
  .map-controls { top: 10px; right: 10px; }
  .members-table th:nth-child(3), .members-table td:nth-child(3) { display: none; }
  .add-member { flex-direction: column; }
}
.value-card.wide { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ section switcher */
.views { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex: none; }
.views button {
  border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.views button:hover { color: var(--text); }
.views button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.app.paged .map-wrap { display: none; }
.page { grid-row: 2; grid-column: 2; overflow-y: auto; min-height: 0; background: var(--bg); }
.page-inner { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 16px; align-content: start; }
.page-split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.page-split > div { display: grid; gap: 16px; min-width: 0; }
.page-split aside { position: sticky; top: 16px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--text-2); margin: 4px 0 0; }
.page-note { color: var(--text-3); font-size: 12.5px; margin: 0; }
.page-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-filters:empty { display: none; }
.page-filters .search { width: min(320px, 100%); }
.page-filters select, .card select {
  height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); padding: 0 10px; font: inherit; font-size: 13px;
}
.seg-auto { display: inline-flex; }
.seg-auto .seg { padding: 0 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-width: 0; }
.card h2 { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.card .table-wrap { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile .k { font-size: 11.5px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .v.small { font-size: 18px; line-height: 1.6; }
.tile .v small { font-size: 14px; color: var(--text-3); font-weight: 600; }
.tile .t { font-size: 12px; color: var(--text-3); }
.neg { color: var(--red); }
.pos { color: var(--green); }
.center { text-align: center; }

.who {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; cursor: pointer;
  font-weight: 650; color: var(--text); max-width: 100%;
}
.who:hover { text-decoration: underline; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; padding: 9px 12px; background: var(--surface-2); white-space: nowrap; }
.data-table td { padding: 8px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.matrix-wrap { max-height: 70vh; overflow: auto; }
.matrix thead th { position: sticky; top: 0; z-index: 1; }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix thead th:first-child { background: var(--surface-2); z-index: 2; }
.matrix .pcol { text-align: center; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.pcol-sub { font-size: 11px; color: var(--text-3); font-weight: 550; margin-top: 2px; }
.matrix td:not(:first-child) { text-align: center; }
.c-done { color: var(--green); font-weight: 700; }
.c-part { color: var(--amber); font-weight: 700; }
.c-none { color: var(--text-3); }
.c-unknown { color: var(--text-3); opacity: .6; }
.matrix td.best { color: var(--accent); font-weight: 700; }
.matrix td.maxed { color: var(--green); font-weight: 700; }
.matrix-legend span { margin-left: 8px; }
.matrix-legend span:first-child { margin-left: 0; }
.item-cell { display: flex; align-items: center; gap: 8px; }

.clog-page { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.clog-page summary { padding: 12px 14px; cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.clog-page summary span { font-size: 12.5px; }
.clog-page .table-wrap { margin: 0 12px 12px; }

/* activity */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-2); cursor: pointer; font-weight: 600; font-size: 12.5px;
}
.chip.active { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed-day { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; margin: 10px 0 2px; }
.feed-day:first-child { margin-top: 0; }
.feed-item {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.feed-item.big { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: linear-gradient(90deg, var(--accent-soft), transparent 60%), var(--surface); }
.feed-icon { font-size: 18px; line-height: 22px; text-align: center; }
.feed-main { min-width: 0; line-height: 22px; }
.feed-item time { color: var(--text-3); font-size: 12px; line-height: 22px; white-space: nowrap; }
.feed-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.t-login, .t-logout { padding-top: 6px; padding-bottom: 6px; opacity: .8; }
.feed-more { display: flex; justify-content: center; }
.mini-slot {
  width: 36px; height: 32px; border-radius: 7px; background: var(--slot); border: 1px solid var(--slot-border);
  display: inline-grid; place-items: center; position: relative; flex: none;
}
.mini-slot img { width: 28px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.mini-slot i { position: absolute; left: 3px; top: 1px; font: 700 10px/1 var(--font); color: #ffff00; text-shadow: 1px 1px 0 #000; font-style: normal; }
.best-drops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.best-drops li { display: grid; grid-template-columns: 18px 36px 1fr auto; gap: 10px; align-items: center; }
.best-drops li.empty-note { display: block; }
.best-drops .rank { color: var(--text-3); font-weight: 700; font-size: 12px; text-align: center; }
.bd-main { min-width: 0; }
.bd-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-sub .who { font-size: 12px; font-weight: 600; color: var(--text-2); }
.bd-value { color: var(--accent); }

/* items */
.big-search input { height: 46px; font-size: 16px; padding-left: 40px; }
.big-search svg { top: 15px; left: 14px; }
.results { display: grid; gap: 8px; }
.result { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.result-icon { width: 52px; height: 52px; aspect-ratio: auto; }
.result-name { font-weight: 700; font-size: 15px; }
.result-sub { color: var(--text-2); font-size: 13px; }
.holders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.holder { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }

/* charts */
.chart { display: grid; gap: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.chart-plot { position: relative; width: 100%; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--border); stroke-width: 1; }
.chart-grid text, .chart-end { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart-end { fill: var(--text-2); font-weight: 600; }
.chart-cross { stroke: var(--border-strong); stroke-width: 1; pointer-events: none; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12.5px; min-width: 150px; z-index: 5;
}
.chart-tip-time { color: var(--text-3); font-size: 11.5px; margin-bottom: 4px; }
.chart-tip-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: center; }
.chart-tip-row i { width: 12px; height: 2px; border-radius: 2px; }
.chart-tip-row b { color: var(--text); }
.chart-tip-row span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* player panel: skills and bosses */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.skill {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px; padding: 7px 9px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; min-width: 0;
}
.skill-name { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-lvl { font-weight: 750; font-size: 15px; }
.skill.maxed .skill-lvl { color: var(--green); }
.skill-gain { grid-column: 1 / -1; font-size: 11px; color: var(--green); font-weight: 600; }
.sub-head { font-size: 13px; margin: 18px 0 8px; color: var(--text-2); }
.kc-list { display: grid; gap: 4px; }
.kc { display: grid; grid-template-columns: 1fr auto; padding: 8px 10px; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--border); }
.kc small { grid-column: 1 / -1; color: var(--green); font-size: 11.5px; }
.kc small:empty { display: none; }
.discord-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

@media (max-width: 1100px) {
  .views button { padding: 0 9px; }
  .topbar-stats { display: none; }
  .page-split { grid-template-columns: 1fr; }
  .page-split aside { position: static; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 96px; }
  .topbar { flex-wrap: wrap; align-content: center; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .topbar .brand { flex: 1; }
  .views { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .views button { flex: 1; padding: 0 8px; }
  .app.paged { grid-template-rows: var(--topbar-h) 1fr; }
  .page { grid-row: 2; grid-column: 1; }
  /* The player panels become a drawer on the full-width pages. */
  .app.paged .roster { display: none; }
  .app.paged .btn-players { display: inline-flex; }
  .app.paged.players-open .roster {
    display: flex; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 1200; border-top: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .app.paged.players-open .roster-drawer-head { display: flex; }
  .page-inner { padding: 16px 16px 40px; }
  .feed-item { grid-template-columns: 24px 1fr; }
  .feed-item time { grid-column: 2; line-height: 1.2; }
  .tile .v { font-size: 20px; }
}

/* alerts dialog */
.alerts-table td { vertical-align: middle; white-space: normal; }
.alerts-table input[type="number"] {
  width: 110px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px;
}
.alerts-table select {
  height: 30px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); padding: 0 6px; font: inherit; font-size: 13px;
}
.alerts-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.alerts-when { color: var(--text-2); line-height: 2.2; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.dialog-actions span { margin-right: auto; }
.field small { font-weight: 450; }
.feed-shot { display: block; margin-top: 8px; max-width: 360px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.feed-shot img { display: block; width: 100%; height: auto; }
@media (max-width: 600px) {
  .alerts-table thead { display: none; }
  .alerts-table tr { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; column-gap: 6px; padding: 8px 4px; }
  .alerts-table td { padding: 0; border: 0; }
  .alerts-table td:nth-child(3) { grid-column: 2 / 4; grid-row: 2; line-height: 2; font-size: 13px; }
  .alerts-table td:nth-child(4):has(input)::before { content: "📷 "; font-size: 12px; }
  .alerts-table tr + tr { border-top: 1px solid var(--border); }
  .alerts-table input[type="number"] { width: 100px; }
}

/* ================================================================== game-style (OSRS look) panels and logs
   The same in light and dark themes: stone-brown panels with darker inset borders and in-game text colours. */
:root {
  --os-font: "RuneScape UF", "RuneScape", "Pixelify Sans", var(--font);
  --os-stone: #3e3529;
  --os-stone-2: #2b2620;
  --os-stone-3: #4a3d2c;
  --os-edge-dark: #14110d;
  --os-edge-light: #5f5140;
  --os-text: #f0e2c2;
  --os-dim: #b5a382;
  --os-orange: #ff981f;
  --os-yellow: #ffff00;
  --os-green: #0dc10d;
  --os-red: #ff6a5c; /* softer than the game's #ff0000 so small text keeps its contrast on dark stone */
  --os-shadow: 1px 1px 0 #000;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.s0 { color: var(--os-red); }
.s1 { color: var(--os-yellow); }
.s2 { color: var(--os-green); }
.y { color: var(--os-yellow); }
.g { color: var(--os-green); }
.r { color: var(--os-red); }

/* icons that 404 are swapped for text (see osrs.js) */
.ui-icon { image-rendering: pixelated; object-fit: contain; }
.ui-fb { font: 600 12px/1 var(--os-font); color: var(--os-orange); text-shadow: var(--os-shadow); }
.item-fb { font: 12px/1 var(--os-font); color: #dccaa6; text-shadow: var(--os-shadow); }

/* ------------------------------------------------------------------ roster column of player panels */
.btn-players { display: none; }
.roster-drawer-head { display: none; align-items: center; justify-content: space-between; }
.os-panels { display: grid; gap: 8px; align-content: start; }
.os-panel {
  background: var(--os-stone); color: var(--os-text); font-family: var(--os-font); text-shadow: var(--os-shadow);
  border: 1px solid var(--os-edge-dark); border-radius: 4px; padding: 4px;
  box-shadow: inset 0 0 0 1px var(--os-edge-light), 0 2px 6px rgba(0, 0, 0, .3);
}
.os-panel.selected { outline: 2px solid var(--pc); outline-offset: 1px; }
.os-ph {
  display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 6px; min-height: 28px;
  background: linear-gradient(#302920, #241f19); border: 1px solid var(--os-edge-dark);
}
.os-ph-name {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 2px 0;
  color: var(--os-orange); font: 600 15px/1.2 var(--os-font); text-shadow: var(--os-shadow); cursor: pointer; text-align: left;
}
.os-ph-name:hover .n { text-decoration: underline; }
.os-ph-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-ph-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 1px #000; flex: none; }
.os-panel.offline .os-ph-dot { opacity: .45; }
.os-ph-where { font-size: 13px; color: var(--os-dim); white-space: nowrap; }
.os-panel.online .os-ph-where { color: var(--os-green); }
.os-ph-toggle {
  width: 24px; height: 24px; border: 0; background: none; color: var(--os-dim); cursor: pointer; font-size: 12px;
  transition: transform .15s; border-radius: 3px;
}
.os-ph-toggle:hover { color: var(--os-text); background: rgba(255, 255, 255, .06); }
.os-panel.collapsed .os-ph-toggle { transform: rotate(-90deg); }
.os-panel.collapsed .os-pwrap { display: none; }

.os-bars { display: grid; gap: 3px; margin: 4px 0; }
.os-bar { position: relative; height: 17px; border: 1px solid #000; background: #8c1c12; overflow: hidden; }
.os-bar i { position: absolute; inset: 0 auto 0 0; background: #13a313; transition: width .4s ease; }
.os-bar.pray { background: #13262b; }
.os-bar.pray i { background: #1c96a6; }
.os-bar span { position: relative; display: block; text-align: center; font: 13px/15px var(--os-font); color: #fff; }

.os-ptabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 3px; }
.os-ptab {
  height: 32px; padding: 0; display: grid; place-items: center; cursor: pointer; border-radius: 4px 4px 0 0;
  background: var(--os-stone-3); border: 1px solid var(--os-edge-dark);
  box-shadow: inset 1px 1px 0 #6b5a43, inset -1px -1px 0 #2a231a;
}
.os-ptab:hover { background: #56473a; }
.os-ptab.active { background: #6e2618; box-shadow: inset 1px 1px 0 #9a3a26, inset -1px -1px 0 #3d140c; }
.os-ptab:disabled { opacity: .4; cursor: not-allowed; }
.os-ptab .ui-icon { width: 24px; height: 24px; }
.os-ptab .ui-fb { font-size: 15px; }
.os-ptab:focus-visible, .os-ph-name:focus-visible, .os-ph-toggle:focus-visible { outline: 2px solid var(--os-yellow); outline-offset: -2px; }
.os-pbody {
  background: var(--os-stone-2); border: 1px solid var(--os-edge-dark); box-shadow: inset 0 0 0 1px #3a3127;
  padding: 6px; min-height: 120px;
}
.os-pnote { margin: 0; padding: 18px 6px; text-align: center; color: var(--os-dim); font-size: 14px; }

/* inventory */
.os-inv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px 4px; }
.os-islot { position: relative; height: 36px; display: grid; place-items: center; }
.os-islot img { max-width: 36px; max-height: 32px; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .75)); }
.os-stack { position: absolute; left: 1px; top: 0; font: 12px/1 var(--os-font); color: var(--os-yellow); pointer-events: none; }
.os-stack.k { color: #fff; }
.os-stack.m { color: #00ff80; }

/* worn equipment */
.os-equip { display: grid; grid-template-columns: repeat(3, 42px); grid-auto-rows: 42px; gap: 6px 16px; justify-content: center; padding: 4px 0; }
.os-eq {
  position: relative; display: grid; place-items: center; border-radius: 3px;
  background: #3b3125; border: 1px solid var(--os-edge-dark); box-shadow: inset 1px 1px 0 #564836;
}
.os-eq .os-islot { width: 100%; height: 100%; }
.os-eq-label { font-size: 10.5px; color: var(--os-dim); opacity: .7; }

/* skills */
.os-skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.os-skill {
  display: flex; align-items: center; justify-content: space-between; gap: 2px; height: 28px; padding: 0 5px 0 3px;
  background: #3b3125; border: 1px solid var(--os-edge-dark); box-shadow: inset 1px 1px 0 #564836; border-radius: 2px;
}
.os-skill b { font: 400 14px/1 var(--os-font); color: var(--os-yellow); white-space: nowrap; }
.os-skill b i { font-style: normal; }
.os-skill-icon { width: 20px; height: 20px; }
.os-skill .ui-fb.os-skill-icon { width: auto; height: auto; font-size: 11px; }
.os-skill.maxed b { color: var(--os-green); }
.os-skill.os-total { grid-column: 1 / -1; justify-content: center; gap: 8px; color: var(--os-yellow); font-size: 14px; }

/* quests and diaries */
.os-qhead { display: flex; justify-content: space-between; gap: 6px; color: var(--os-orange); font-size: 14px; margin-bottom: 4px; }
.os-qhead b { color: var(--os-yellow); font-weight: inherit; }
.os-scroll { max-height: 260px; overflow-y: auto; scrollbar-color: #6b5a43 #1e1a15; scrollbar-width: thin; }
.os-scroll:focus-visible { outline: 1px solid var(--os-yellow); }
.os-quests h4 { color: var(--os-orange); font: 600 14px var(--os-font); margin: 6px 0 2px; }
.os-quests h4:first-child { margin-top: 0; }
.os-quests ul { list-style: none; margin: 0; padding: 0; }
.os-quests li { font-size: 13.5px; line-height: 18px; }
.os-diary { display: grid; gap: 1px; padding: 3px 0; border-bottom: 1px solid rgba(0, 0, 0, .4); }
.os-diary-name { font-size: 14px; }
.os-diary-tiers { display: flex; gap: 8px; font-size: 12px; }

/* ------------------------------------------------------------------ game-style windows (collection log, combat achievements) */
.osrs-dialog {
  padding: 0; border: 0; background: transparent; color: inherit; overflow: visible;
  width: min(1020px, calc(100% - 24px)); height: min(780px, calc(100% - 24px)); max-width: none; max-height: none;
}
.osrs-dialog::backdrop { background: rgba(0, 0, 0, .62); }
.os-window {
  height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 4px;
  background: var(--os-stone); color: var(--os-text); font-family: var(--os-font); text-shadow: var(--os-shadow);
  border: 2px solid var(--os-edge-dark); box-shadow: inset 0 0 0 2px var(--os-edge-light), 0 20px 50px rgba(0, 0, 0, .5);
}
.os-window.os-inline { height: min(80vh, 780px); box-shadow: inset 0 0 0 2px var(--os-edge-light); }
.os-window button { text-shadow: inherit; }
.os-window :focus-visible { outline: 2px solid var(--os-yellow); outline-offset: -2px; }
.os-titlebar {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 34px; flex: none;
  background: var(--os-stone-2); border: 1px solid var(--os-edge-dark);
}
.os-title { font: 600 18px/1.2 var(--os-font); color: var(--os-orange); text-align: center; padding: 4px 40px; letter-spacing: 0; }
.os-close {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 26px; cursor: pointer;
  background: #5b1e12; border: 1px solid #000; color: #ffc9a8; font-size: 13px; border-radius: 3px;
  box-shadow: inset 1px 1px 0 #8a3320;
}
.os-close:hover { background: #7a2817; }
.os-tabs { display: flex; gap: 2px; flex: none; overflow-x: auto; scrollbar-width: none; }
.os-tab {
  flex: 1 0 auto; height: 32px; padding: 0 12px; cursor: pointer; border-radius: 4px 4px 0 0;
  background: var(--os-stone-3); border: 1px solid var(--os-edge-dark); box-shadow: inset 1px 1px 0 #6b5a43;
  color: var(--os-orange); font: 15px var(--os-font);
}
.os-tab:hover { background: #56473a; }
.os-tab.active { background: var(--os-stone-2); color: #fff3c4; box-shadow: inset 0 2px 0 var(--os-orange); }
.os-legend-row:empty { display: none; }
.os-note { margin: 0; flex: none; color: var(--os-dim); font-size: 13px; padding: 0 4px; }
.os-dim { color: var(--os-dim); }
.os-empty { padding: 24px 12px; margin: 0; text-align: center; color: var(--os-dim); font: 15px var(--os-font); list-style: none; }
.os-window .os-search {
  height: 30px; margin: 4px; width: auto; padding: 0 8px; border-radius: 2px; flex: none;
  background: #1d1915; border: 1px solid #000; color: var(--os-text); font: 14px var(--os-font);
}
.os-window .os-search:focus { border-color: var(--os-orange); box-shadow: none; }
.os-window .os-search::placeholder { color: #8f805f; }

/* member markers and legend */
.mk { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.mk-yes { background: var(--mk); box-shadow: 0 0 0 1px #000; }
.mk-no { border: 1.5px solid var(--mk); opacity: .6; }
.mk-unknown { border: 1px dashed #8a7a60; opacity: .7; }
.mk-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 54px; }
.mk-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font: 14px var(--os-font); padding: 0 2px; }
.mk-member {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px; border-radius: 3px;
  background: none; border: 1px solid transparent; color: inherit; font: inherit;
}
button.mk-member { cursor: pointer; }
button.mk-member:hover { border-color: #6b5a43; }
.mk-member.on { background: rgba(255, 255, 255, .1); border-color: #8a7a60; color: #fff; }
.mk-member .mk { width: 9px; height: 9px; }
.mk-key { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; color: var(--os-dim); font-size: 12.5px; }
.mk-key .mk { margin-left: 6px; }

/* collection log */
.os-clog-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 6px; }
.os-clog-side { display: flex; flex-direction: column; min-height: 0; background: var(--os-stone-2); border: 1px solid var(--os-edge-dark); }
.os-pagelist { flex: 1; min-height: 0; overflow-y: auto; scrollbar-color: #6b5a43 #1e1a15; scrollbar-width: thin; }
.os-page {
  display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 8px;
  background: transparent; border: 0; text-align: left; cursor: pointer; color: var(--os-orange); font: 14.5px/1.3 var(--os-font);
}
.os-page:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.os-page:hover { background: rgba(255, 255, 255, .07); }
.os-page.active { background: rgba(255, 255, 255, .15); }
.os-page.done { color: var(--os-green); }
.os-page.zero { color: var(--os-red); }
.os-page.unknown { color: var(--os-dim); }
.os-page small { color: var(--os-dim); font-size: 12px; }
.os-page-count { flex: none; }
.os-clog-page { min-height: 0; overflow-y: auto; padding: 10px 12px; background: var(--os-stone-2); border: 1px solid var(--os-edge-dark); }
.os-page-head h3 { color: var(--os-orange); font: 600 20px/1.2 var(--os-font); letter-spacing: 0; }
.os-page-head p { margin: 2px 0 12px; font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.os-page-head b { font-weight: inherit; }
.os-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px 4px; }
.os-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0 4px; border-radius: 3px; }
.os-item:hover { background: rgba(255, 255, 255, .05); }
.os-item-icon { height: 36px; display: grid; place-items: center; }
.os-item img { max-width: 36px; max-height: 32px; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .75)); }
.os-item.missing .os-item-icon { opacity: .32; }
.os-qty { position: absolute; left: 3px; top: 0; font: 13px/1 var(--os-font); color: var(--os-yellow); pointer-events: none; }

/* combat achievements */
.os-tier { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.os-tier small { color: var(--os-dim); font-size: 12px; }
.os-tier.complete small { color: var(--os-green); }
.os-tier-icon { width: 20px; height: 20px; }
.os-tier .ui-fb.os-tier-icon { width: auto; height: auto; font-size: 11px; }
.os-ca-summary { flex: none; padding: 6px 10px; background: var(--os-stone-2); border: 1px solid var(--os-edge-dark); }
.os-ca-summary:empty { display: none; }
.os-ca-points { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 15px; }
.os-ca-points b { font-weight: inherit; }
.os-progress { position: relative; display: block; flex: 1; min-width: 200px; height: 19px; background: #1d1915; border: 1px solid #000; overflow: hidden; }
.os-progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#d9841c, #9c540d); }
.os-progress em { position: relative; display: block; text-align: center; font: normal 13px/17px var(--os-font); color: #fff; }
.os-ca-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.os-ca-member {
  display: grid; gap: 4px; text-align: left; padding: 6px 8px; cursor: pointer; border-radius: 3px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--os-edge-dark); color: inherit; font: inherit;
}
.os-ca-member:hover { background: rgba(255, 255, 255, .07); }
.os-ca-member-name { display: inline-flex; align-items: center; gap: 6px; color: var(--os-orange); font-size: 15px; }
.os-ca-points.compact { font-size: 14px; }
.os-ca-points.compact .os-progress { min-width: 0; width: 100%; flex-basis: 100%; }
.os-ca-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: none; }
.os-ca-tools .os-search { flex: 1; min-width: 180px; margin: 0; }
.os-seg { display: inline-flex; border: 1px solid #000; border-radius: 3px; overflow: hidden; }
.os-seg button {
  height: 30px; padding: 0 10px; cursor: pointer; background: var(--os-stone-3); border: 0; border-right: 1px solid #000;
  color: var(--os-orange); font: 14px var(--os-font);
}
.os-seg button:last-child { border-right: 0; }
.os-seg button.on { background: var(--os-stone-2); color: #fff3c4; }
.os-tasks {
  list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto;
  background: var(--os-stone-2); border: 1px solid var(--os-edge-dark); scrollbar-color: #6b5a43 #1e1a15; scrollbar-width: thin;
}
.os-task { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; padding: 7px 10px; border-bottom: 1px solid rgba(0, 0, 0, .45); }
.os-task:nth-child(even) { background: rgba(255, 255, 255, .025); }
.os-task-mark { font-size: 15px; line-height: 20px; }
.os-task-name { font-size: 15.5px; line-height: 20px; }
.os-task.done .os-task-mark, .os-task.done .os-task-name { color: var(--os-green); }
.os-task.todo .os-task-mark, .os-task.todo .os-task-name { color: var(--os-red); }
.os-task.some .os-task-mark, .os-task.some .os-task-name { color: var(--os-yellow); }
.os-task-desc { font: 13px/1.4 var(--font); color: #ddd0b4; }
.os-task.todo .os-task-desc { color: #bfae8d; }
.os-task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.os-task-monster { color: var(--os-orange); font-size: 13px; }
.os-task-pts { color: var(--os-dim); font-size: 12.5px; }
.os-task .mk-row { max-width: 120px; justify-content: flex-end; }

@media (max-width: 760px) {
  .roster-list.os-panels { padding: 8px; }
  .osrs-dialog { width: 100%; height: 100%; height: 100dvh; margin: 0; }
  .os-window { border-radius: 0; padding: 4px; }
  .os-title { font-size: 15px; padding: 4px 36px 4px 8px; }
  .os-clog-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 38%) minmax(0, 1fr); }
  .os-window.os-inline { height: 78vh; }
  .mk-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mk-member, .mk-key { flex: none; white-space: nowrap; }
  .mk-key { margin-left: 0; }
  .os-task { grid-template-columns: 18px minmax(0, 1fr); }
  .os-task-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 10px; text-align: left; }
  .os-task .mk-row { justify-content: flex-start; max-width: none; }
}

/* Game icons sent by the plugin: keep pixel art crisp when scaled. */
.ui-icon { image-rendering: pixelated; }
.os-eq img.os-eq-empty { width: 30px; height: 30px; object-fit: contain; opacity: .6; }
.os-eq .ui-fb.os-eq-empty { font-size: 10.5px; color: var(--os-dim); opacity: .7; text-shadow: none; }
