:root {
  --bg: #F4F4F6;
  --bg-2: #E9E9EC;
  --panel: #FFFFFF;
  --panel-2: #ECECF0;
  --panel-3: #E0E0E0;
  --line: #D9D9DF;
  --line-2: #C4C4CC;
  --text: #0F0F12;
  --muted: #55555A;
  --muted-2: #707078;
  --red: #D91842;
  --red-2: #F02856;
  --gold: #f1b74b;
  --blue: #68a7ff;
  --green: #58d69b;
  --orange: #ff9d62;
  --purple: #7646DD;
  --radius-lg: 18px;
  --shadow: 0 4px 12px rgba(0,0,0,.04);
  --font: 'Montserrat', Arial, Helvetica, sans-serif;
  --pa-sidebar: 205px;
  --pa-header-offset: var(--versys-header-height, 82px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* Ã¢â€â‚¬Ã¢â€â‚¬ App shell: CSS grid with sticky left sidebar Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.pal-atlas-layout {
  display: grid;
  grid-template-columns: var(--pa-sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--pa-header-offset));
  align-items: start;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ Sidebar: sticky, contained within page Ã¢â‚¬â€ never over footer Ã¢â€â‚¬Ã¢â€â‚¬ */
.pal-atlas-sidebar {
  position: sticky;
  top: var(--pa-header-offset);
  align-self: start;
  max-height: calc(100vh - var(--pa-header-offset));
  overflow-y: auto;
  z-index: 40;
  display: flex;
  width: var(--pa-sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 14px 14px 14px; border-bottom: 1px solid var(--line); text-decoration: none; flex-shrink: 0; }
.brand-symbol { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.brand-symbol img { width: 36px; height: 36px; }

.brand strong { display: block; font-size: 10.5px; letter-spacing: .07em; color: var(--text); line-height: 1.35; }
.brand small, .sidebar-foot small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 7.5px; letter-spacing: .1em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding: 8px; flex-grow: 1; overflow-y: auto; scrollbar-gutter: stable; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.nav-item { display: flex; min-height: 40px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; color: #3a3a3e; font-size: 11.5px; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .16s ease, color .16s ease, border-color .16s ease; flex-shrink: 0; }
.nav-item span { display: grid; flex-shrink: 0; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); font-size: 9px; transition: border-color .16s ease, color .16s ease; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { border-color: var(--line); color: var(--text); background: rgba(217, 24, 66, 0.055); box-shadow: inset 3px 0 0 var(--red); }
.nav-item.active span { border-color: rgba(217, 10, 44, .45); color: var(--red-2); }

.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sidebar-foot strong { font-size: 10px; letter-spacing: .08em; color: var(--text); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(88,214,155,.08); flex-shrink: 0; }
.sidebar-scrim { display: none; }

.pal-atlas-content { width: 100%; min-height: 0; }
.topbar { position: sticky; top: var(--pa-header-offset); z-index: 50; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(18px, 3vw, 32px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar p { margin: 0 0 2px; color: var(--red-2); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.topbar h1 { margin: 0; font-size: clamp(22px, 2.2vw, 29px); line-height: 1.1; letter-spacing: -.035em; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.inventory-pill { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.inventory-pill b { color: var(--text); }
.mobile-only { display: none; }

.view-container { padding: clamp(18px, 2.5vw, 32px); }
.view { animation: viewIn .14s ease-out both; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.page-heading h2 { margin: 4px 0 0; font-size: clamp(28px, 3.2vw, 43px); line-height: 1; letter-spacing: -.055em; }
.page-heading p { max-width: 690px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--red-2); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.compact-heading { align-items: center; margin-bottom: 14px; }
.compact-heading h2 { font-size: clamp(21px, 2.1vw, 29px); }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }

.panel, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel { padding: clamp(17px, 2.2vw, 25px); }
.card { position: relative; padding: 14px; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.card:hover { border-color: var(--line-2); background: var(--panel-2); }

.button, button { border: 0; cursor: pointer; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: .025em; text-decoration: none; transition: transform .15s ease, filter .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--red); }
.button-primary:hover { filter: brightness(1.1); }
.button-secondary { border: 1px solid var(--line-2); color: var(--text); background: var(--panel); }
.button-outline, .button-ghost { border: 1px solid var(--line); color: var(--muted); background: transparent; }
.button-danger { border: 1px solid rgba(255,49,84,.35); color: #ff8da1; background: rgba(217,10,44,.08); }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 10px; }
.link-button { padding: 0; color: var(--text); background: transparent; font-size: inherit; }
.icon-button, .menu-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel); }
.menu-button span { display: block; width: 18px; height: 2px; margin: 2px 0; background: currentColor; }

input, select, textarea { width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid var(--line-2); outline: none; border-radius: 8px; color: var(--text); background: var(--panel); transition: border-color .16s ease, box-shadow .16s ease; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: rgba(217,24,66,.75); box-shadow: 0 0 0 3px rgba(217,24,66,.1); }
label { color: var(--text); font-size: 11px; font-weight: 700; }
.field { display: grid; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.toolbar .search-field { min-width: 230px; flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin-bottom: 18px; }
.stat-card { min-height: 112px; padding: 17px; box-shadow: none; }
.stat-label { color: #444448; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.stat-value { display: block; margin-top: 8px; font-size: 30px; line-height: 1; letter-spacing: -.045em; color: var(--text); }
.stat-note { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 14px; }
.hero-panel { position: relative; min-height: 260px; display: flex; align-items: center; overflow: hidden; border-top: 3px solid var(--red); }
.hero-panel::after { content: ""; position: absolute; right: -55px; top: -55px; width: 220px; height: 220px; border: 1px solid #28282f; border-radius: 50%; box-shadow: 0 0 0 32px rgba(255,255,255,.012), 0 0 0 64px rgba(255,255,255,.008); }
.hero-copy { position: relative; z-index: 1; max-width: 680px; }
.hero-copy h2 { margin: 7px 0 12px; font-size: clamp(35px, 5vw, 61px); line-height: .96; letter-spacing: -.065em; }
.hero-copy h2 span { color: var(--red-2); }
.hero-copy p { max-width: 600px; color: var(--muted); font-size: 13px; }
.quick-list { display: grid; gap: 8px; margin-top: 15px; }
.quick-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.quick-item:last-child { border-bottom: 0; }
.quick-item span { color: var(--muted); font-size: 11px; }
.quick-item strong { font-size: 11px; text-align: right; }

.pal-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(205px,1fr)); gap: 10px; }
.pal-card { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 11px; min-width: 0; min-height: 91px; align-items: center; padding: 11px; cursor: pointer; box-shadow: none; }
.pal-card:hover { transform: translateY(-1px); }
.pal-image-wrap { display: grid; width: 58px; height: 58px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.pal-image, img.pal-image, .pal-card img[data-pal-image] { width: 52px !important; height: 52px !important; max-width: 52px !important; max-height: 52px !important; object-fit: contain !important; }
.pal-info { min-width: 0; }
.pal-card h3 { overflow: hidden; margin: 2px 0 0; font-size: 13px; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.pal-number { color: var(--muted-2); font-size: 8px; font-weight: 750; letter-spacing: .055em; }
.pal-elements, .pal-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.element-badge, .tier-badge, .owned-badge, .meta-badge { display: inline-flex; min-height: 19px; align-items: center; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 8px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.element-badge { color: #d7d7dc; }
.tier-badge.tier-S { border-color: rgba(241,183,75,.4); color: var(--gold); }
.tier-badge.tier-A { border-color: rgba(179,154,255,.4); color: var(--purple); }
.tier-badge.tier-B { border-color: rgba(104,167,255,.4); color: var(--blue); }
.tier-badge.tier-C { border-color: rgba(88,214,155,.35); color: var(--green); }
.tier-badge.tier-D { border-color: rgba(255,157,98,.35); color: var(--orange); }
.owned-badge { border-color: rgba(88,214,155,.35); color: var(--green); }
.pal-card-footer { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.pal-card-footer span { color: var(--muted); font-size: 9px; }

.empty-state { display: grid; min-height: 230px; place-items: center; padding: 30px; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; background: var(--panel); }
.empty-state-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 14px; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; color: var(--red-2); font-size: 18px; font-weight: 800; }
.empty-state h3 { margin: 0 0 5px; }
.empty-state p { max-width: 520px; margin: 0 auto 16px; color: var(--muted); font-size: 12px; }
.notice { display: flex; gap: 9px; margin: 13px 0; padding: 11px 12px; border-left: 3px solid var(--gold); color: #8a6c1c; background: rgba(241,183,75,.1); font-size: 11px; }
.notice.info { border-left-color: var(--blue); color: #1c529b; background: rgba(104,167,255,.1); }

.breeding-stage { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 14px; align-items: center; }
.parent-slot { min-height: 188px; padding: 15px; box-shadow: none; }
.parent-preview { display: grid; min-height: 105px; place-items: center; margin-top: 11px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--panel); }
.parent-preview img, .parent-pal img, .parent-preview img[data-pal-image] { width: 82px !important; height: 82px !important; max-width: 82px !important; max-height: 82px !important; object-fit: contain !important; }
.parent-pal { display: grid; place-items: center; gap: 5px; text-align: center; cursor: pointer; }
.parent-pal strong { font-size: 13px; }
.breed-symbol { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 50%; color: var(--red-2); background: var(--panel); font-size: 23px; line-height: 1; }
.result-panel { margin-top: 14px; padding: 18px; text-align: center; box-shadow: none; }
.result-arrow { width: 1px; height: 22px; margin: 0 auto 10px; background: var(--red); }
.result-card { width: min(100%, 390px); margin: 0 auto; }
.result-card .pal-card { grid-template-columns: 62px minmax(0,1fr); }
.result-card .pal-image-wrap { width: 62px; height: 62px; }
.result-card .pal-image { width: 56px !important; height: 56px !important; max-width: 56px !important; max-height: 56px !important; }
.slot-empty, .result-placeholder { display: grid; min-height: 95px; place-items: center; align-content: center; gap: 4px; color: var(--muted-2); text-align: center; }
.slot-empty span { font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.slot-empty strong { color: var(--muted); font-size: 12px; }
.result-title { margin: 6px 0 13px; font-size: 16px; }
.result-placeholder h3 { margin: 3px 0 0; }
.result-placeholder p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; }
.result-actions { justify-content: center; margin-top: 13px; }

.tier-controls { margin-bottom: 14px; box-shadow: none; }
.tier-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.tier-tab { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel); font-size: 10px; font-weight: 800; }
.tier-tab.active { border-color: rgba(217,10,44,.55); color: var(--text); background: rgba(217,10,44,.13); }
.toggle-control { display: inline-flex; min-height: 45px; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel); cursor: pointer; }
.toggle-control input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--red); }
.tier-list-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; color: var(--muted); font-size: 9px; }
.tier-list-summary span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.tier-section { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px; margin-bottom: 10px; padding: 10px; box-shadow: none; }
.tier-rank { display: grid; min-height: 58px; place-items: center; align-content: center; border-radius: 8px; background: var(--panel); font-size: 27px; font-weight: 900; }
.tier-rank small { display: block; margin-top: -5px; color: var(--muted-2); font-size: 7px; letter-spacing: .12em; }
.tier-rank.S { color: var(--gold); }
.tier-rank.A { color: var(--purple); }
.tier-rank.B { color: var(--blue); }
.tier-rank.C { color: var(--green); }
.tier-rank.D { color: var(--orange); }
.tier-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tier-section-heading strong { font-size: 13px; }
.tier-section-heading span { color: var(--muted-2); font-size: 9px; }
.tier-pal-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 7px; }
.tier-pal-grid .pal-card { grid-template-columns: 46px minmax(0,1fr); min-height: 73px; padding: 8px; }
.tier-pal-grid .pal-image-wrap { width: 46px; height: 46px; }
.tier-pal-grid .pal-image, .tier-pal-grid img[data-pal-image] { width: 42px !important; height: 42px !important; max-width: 42px !important; max-height: 42px !important; }
.tier-pal-grid .pal-card h3 { font-size: 11px; }
.tier-pal-grid .pal-number { font-size: 7px; }
.tier-pal-grid .element-badge, .tier-pal-grid .tier-badge, .tier-pal-grid .owned-badge { min-height: 17px; padding: 1px 5px; font-size: 7px; }

.recommendation-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); gap: 10px; }
.recommendation-card { padding: 0; overflow: hidden; box-shadow: none; }
.recommendation-head { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 11px; align-items: center; padding: 13px; cursor: pointer; }
.recommendation-head .pal-image-wrap { width: 58px; height: 58px; }
.recommendation-head .pal-image { width: 52px !important; height: 52px !important; max-width: 52px !important; max-height: 52px !important; }
.recommendation-head h3 { margin: 2px 0 5px; font-size: 14px; }
.recommendation-body { padding: 12px 13px 14px; border-top: 1px solid var(--line); }
.recommendation-body p { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.score-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.score-track { height: 4px; margin-top: 5px; overflow: hidden; background: #24242b; }
.score-track span { display: block; height: 100%; background: var(--red); }
.recommendation-controls { margin-bottom: 14px; box-shadow: none; }
.recommendation-control-row, .recommendation-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.recommendation-control-row p, .recommendation-summary p { max-width: 700px; margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.recommendation-depth-field { min-width: 180px; }
.recommendation-results { display: grid; gap: 13px; }
.recommendation-summary h2 { margin: 3px 0; font-size: 23px; }
.recommendation-actions { margin-top: 11px; }
.breed-parents { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.breed-parent { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text); cursor: pointer; }
.breed-parent:hover { color: var(--red); }
.breed-parent-img { width: 26px !important; height: 26px !important; max-width: 26px !important; max-height: 26px !important; object-fit: contain !important; }
.breed-plus { color: var(--muted-2); font-weight: 700; font-size: 13px; }
.tier-badge.tier-unranked { background: rgba(128,128,128,.15); color: var(--muted); border-color: rgba(128,128,128,.2); }
.rec-unranked .recommendation-head { opacity: .8; }

.target-search-panel { margin-bottom: 14px; box-shadow: none; }
.target-search-grid { display: grid; grid-template-columns: minmax(240px,1fr) 180px auto; gap: 10px; align-items: end; }
.target-search-button { min-height: 45px; }
.target-results { display: grid; gap: 13px; }
.target-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; box-shadow: none; }
.target-summary-pal { display: flex; align-items: center; gap: 16px; min-width: 0; }
.target-summary-pal img, .target-summary-pal img[data-pal-image] { width: 94px !important; height: 94px !important; max-width: 94px !important; max-height: 94px !important; object-fit: contain !important; }
.target-summary-pal h2 { margin: 3px 0 7px; font-size: 27px; }
.target-summary-pal p { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.target-summary-stats { display: grid; min-width: 250px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.target-summary-stats div { padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); text-align: center; }
.target-summary-stats span { display: block; color: var(--muted-2); font-size: 7px; letter-spacing: .06em; text-transform: uppercase; }
.target-summary-stats strong { display: block; margin-top: 4px; font-size: 14px; }
.path-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.breeding-tree { display: grid; gap: 8px; }
.tree-step { padding: 12px; box-shadow: none; }
.tree-step-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.tree-step-head h4 { margin: 0; font-size: 13px; }
.tree-equation { display: grid; grid-template-columns: 1fr 22px 1fr 22px 1fr; gap: 6px; align-items: center; }
.mini-pal { display: grid; min-width: 0; grid-template-columns: 38px minmax(0,1fr); gap: 7px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); cursor: pointer; }
.mini-pal img, .mini-pal img[data-pal-image] { width: 38px !important; height: 38px !important; max-width: 38px !important; max-height: 38px !important; object-fit: contain !important; }
.mini-pal strong { display: block; font-size: 10px; line-height: 1.2; word-break: break-word; overflow-wrap: break-word; }
.equation-symbol { color: var(--muted-2); text-align: center; font-weight: 800; }
.direct-pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 10px; }
.direct-pair-card { padding: 9px; box-shadow: none; }
.direct-pair-card.pair-ready { border-color: rgba(88,214,155,.4); }
.pair-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

html.modal-page-locked, body.modal-page-locked { overflow: hidden !important; overscroll-behavior: none !important; }
.modal-container { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.82); overscroll-behavior: contain; }
.modal-shell { display: flex; width: min(760px,100%); min-height: 0; max-height: min(88vh,760px); flex-direction: column; overflow: hidden; overscroll-behavior: contain; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); box-shadow: 0 30px 90px rgba(0,0,0,.65); animation: modalIn .16s ease both; }
.modal-shell.modal-small { width: min(590px,100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel); font-size: 19px; }
.modal-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 17px; }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding: 12px 17px; border-top: 1px solid var(--line); }
.pal-detail-hero { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 17px; align-items: center; margin-bottom: 14px; }
.pal-detail-image { display: grid; width: 116px; height: 116px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.pal-detail-image img, .pal-detail-image img[data-pal-image] { width: 106px !important; height: 106px !important; max-width: 106px !important; max-height: 106px !important; object-fit: contain !important; }
.pal-detail-title h3 { margin: 3px 0 6px; font-size: 27px; letter-spacing: -.045em; }
.pal-detail-title p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.detail-panel { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.detail-panel h4 { margin: 0 0 9px; color: var(--text); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.info-list { display: grid; gap: 6px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.info-row:last-child { padding-bottom: 0; border-bottom: 0; }
.info-row strong { color: var(--text); text-align: right; }
.work-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.work-item { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 9px; }
.work-item-label { display: inline-flex; min-width: 0; align-items: center; gap: 7px; }
.work-item-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
.work-item strong { color: var(--red-2); }
.location-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.location-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.location-card strong { display: block; margin-bottom: 3px; font-size: 11px; }
.location-card p { min-height: 30px; margin: 0 0 8px; color: var(--muted); font-size: 9px; }
.privacy-copy h3 { margin: 20px 0 6px; font-size: 14px; }
.privacy-copy h3:first-child { margin-top: 0; }
.privacy-copy p, .privacy-copy li { color: var(--muted); font-size: 11px; line-height: 1.7; }
.privacy-copy ul { padding-left: 19px; }

.toast-container { position: fixed; right: 16px; bottom: 16px; z-index: 1200; display: grid; gap: 7px; }
.toast { min-width: 240px; max-width: 380px; padding: 11px 13px; border: 1px solid var(--line-2); border-left: 3px solid var(--red); border-radius: 8px; color: #fff; background: var(--panel); box-shadow: var(--shadow); font-size: 11px; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red-2); }

.app-footer { padding: 24px clamp(18px,3vw,38px); border-top: 1px solid var(--line); color: var(--muted-2); text-align: center; font-size: 9px; }
.app-footer p { max-width: 900px; margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 9px; }
.footer-links a, .footer-links button { color: var(--text); text-decoration: none; }
.footer-links a:hover, .footer-links button:hover { color: var(--text); }

.import-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.import-summary-grid .detail-panel { text-align: center; }
.privacy-note { color: var(--muted-2); font-size: 9px; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .breeding-stage { grid-template-columns: 1fr; }
  .breed-symbol { margin: -2px auto; }
  .target-summary { align-items: flex-start; flex-direction: column; }
  .target-summary-stats { width: 100%; }
  .direct-pair-grid { grid-template-columns: 1fr; }
}

/* Mobile: sidebar becomes horizontal scrollable nav above content */
@media (max-width: 800px) {
  .pal-atlas-layout {
    grid-template-columns: 1fr;
  }
  .pal-atlas-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
  }
  .pal-atlas-sidebar::-webkit-scrollbar { display: none; }
  .brand { display: none; }
  .sidebar-foot { display: none; }
  .sidebar-nav {
    flex-direction: row;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    flex-grow: 1;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
    font-size: 11px;
    padding: 6px 10px;
  }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--red); }
  .sidebar-scrim { display: none !important; }
  .pal-atlas-content { width: 100%; }
  .mobile-only { display: block; }
  .topbar { min-height: 64px; padding: 10px 14px; }
  .topbar-actions .button { display: none; }
  .view-container { padding: 16px 14px 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .pal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tier-section { grid-template-columns: 1fr; }
  .tier-rank { min-height: 43px; }
  .target-search-grid { grid-template-columns: 1fr; }
  .tree-equation { grid-template-columns: 1fr; }
  .equation-symbol { padding: 2px; }
  .recommendation-control-row, .recommendation-summary { align-items: flex-start; flex-direction: column; }
  .recommendation-depth-field { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .inventory-pill { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 96px; padding: 13px; }
  .stat-value { font-size: 25px; }
  .pal-grid, .tier-pal-grid, .recommendation-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .search-field { min-width: 0; }
  .action-row { width: 100%; }
  .action-row .button { flex: 1; }
  .target-summary-pal { align-items: flex-start; }
  .target-summary-stats { grid-template-columns: 1fr 1fr 1fr; min-width: 0; }
  .modal-container { align-items: flex-end; padding: 0; }
  .modal-shell, .modal-shell.modal-small { width: 100%; max-height: 94vh; border-radius: 14px 14px 0 0; }
  .modal-content { padding: 14px; }
  .pal-detail-hero { grid-template-columns: 90px minmax(0,1fr); gap: 12px; }
  .pal-detail-image { width: 90px; height: 90px; }
  .pal-detail-image img, .pal-detail-image img[data-pal-image] { width: 82px !important; height: 82px !important; max-width: 82px !important; max-height: 82px !important; }
  .pal-detail-title h3 { font-size: 21px; }
  .detail-grid, .location-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Professional layout refinements */
.hero-panel { justify-content: space-between; gap: 28px; }
.hero-panel::after { display: none; }
.hero-copy { max-width: 720px; }
.hero-copy h2 { max-width: 720px; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.01; }
.hero-actions { margin-top: 20px; }
.hero-diagram { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.hero-diagram i { width: 28px; height: 1px; background: var(--line-2); }
.diagram-node { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; color: var(--muted); background: var(--panel); font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.diagram-node.egg-node { border-color: rgba(241,183,75,.5); color: var(--gold); }
.diagram-node.child-node { border-color: rgba(217,10,44,.55); color: var(--text); box-shadow: inset 0 -3px 0 var(--red); }
.quick-panel { box-shadow: none; }
.overview-target { margin-top: 18px; }
.overview-pal-grid { max-width: 420px; }

.tier-section-body { min-width: 0; }
.tier-card-detail { display: block; overflow: hidden; margin-top: 5px; color: var(--muted-2); font-size: 8px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.tier-pal-grid .pal-card-meta { margin-top: 4px; }
.tier-pal-grid .pal-elements { display: none; }

.pair-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 8px; }
.pair-status { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.pair-status.ready { color: var(--green); }
.direct-pair-card .tree-equation { margin-top: 2px; }

@media (max-width: 1080px) {
  .hero-diagram { display: none; }
}

@media (max-width: 520px) {
  .hero-copy h2 { font-size: 34px; }
  .tier-pal-grid .pal-elements { display: flex; }
}
.inventory-remove { position: absolute; top: 7px; right: 7px; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: var(--muted-2); background: transparent; cursor: pointer; font-size: 16px; line-height: 1; }
.inventory-remove:hover, .inventory-remove:focus-visible { border-color: rgba(217,10,44,.45); color: var(--text); background: rgba(217,10,44,.13); }
#inventory-results .pal-card { padding-right: 34px; }


/* Clear Pal details popup */
.detail-grid-clean {
  align-items: start;
}

.detail-panel-wide {
  grid-column: 1 / -1;
}

.detail-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.detail-panel-heading h4 {
  margin: 0;
}

.data-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 999px;
  color: #5eead4;
  background: rgba(45, 212, 191, 0.07);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-status-badge.muted {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
}

.spawn-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.spawn-map-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.spawn-map-preview,
.spawn-map-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 8.5;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.08), transparent 42%),
    radial-gradient(circle at 72% 30%, rgba(59, 130, 246, 0.12), transparent 28%),
    var(--panel);
}

.spawn-map-placeholder {
  position: relative;
  color: #555560;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.spawn-map-placeholder::before,
.spawn-map-placeholder::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
}

.spawn-map-placeholder::before {
  width: 34%;
  height: 55%;
  left: 16%;
  top: 20%;
  transform: rotate(-18deg);
}

.spawn-map-placeholder::after {
  width: 25%;
  height: 43%;
  right: 18%;
  bottom: 18%;
  transform: rotate(25deg);
}

.spawn-map-placeholder span {
  position: relative;
  z-index: 1;
}

.spawn-map-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spawn-map-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
}

.spawn-map-copy strong,
.spawn-map-copy span {
  display: block;
}

.spawn-map-copy strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 11px;
}

.spawn-map-copy span {
  color: var(--muted);
  font-size: 9px;
}

.spawn-map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.detail-footnote {
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 9px;
}

.habitat-empty {
  padding: 4px 0 2px;
}

.habitat-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
}

.habitat-empty p {
  max-width: 620px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

@media (max-width: 620px) {
  .spawn-map-grid {
    grid-template-columns: 1fr;
  }

  .spawn-map-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .spawn-map-actions {
    justify-content: flex-start;
  }
}


/* Detailed current Pal profile */
.modal-shell.modal-wide { width: min(980px,100%); max-height: min(92vh,900px); }
.modal-shell.modal-wide .pal-subtitle,
.modal-shell.modal-wide .detail-panel p,
.modal-shell.modal-wide .partner-panel > p,
.modal-shell.modal-wide .detail-loading-panel p { font-size: 12px; line-height: 1.7; }
.modal-shell.modal-wide .info-row { font-size: 11px; line-height: 1.5; }
.modal-shell.modal-wide .work-item { font-size: 11px; line-height: 1.45; }
.modal-shell.modal-wide .drop-list strong { font-size: 12px; }
.modal-shell.modal-wide .drop-list span { font-size: 11px; }
.modal-shell.modal-wide .skill-card p { font-size: 11px; line-height: 1.65; }
.modal-shell.modal-wide .detail-source-line { font-size: 10px; }
.pal-subtitle { display:block; margin:-2px 0 7px; color: var(--text); font-size:11px; font-weight:700; }
.detail-description { max-width:720px; margin-top:10px !important; color:#aaaab4 !important; line-height:1.65; }
.detail-stat-grid { display:grid; gap:7px; }
.detail-stat-grid-primary { grid-template-columns:repeat(4,minmax(0,1fr)); }
.detail-stat-grid-secondary { grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:7px; }
.detail-stat { display:flex; min-width:0; min-height:66px; flex-direction:column; justify-content:space-between; gap:8px; padding:10px; border:1px solid var(--line); border-radius:8px; background:#0a0a0e; }
.info-list > .detail-stat { min-height:auto; padding:0; border:0; border-radius:0; background:transparent; }
.detail-stat span { color:var(--muted); font-size:9px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; }
.detail-stat strong { color: var(--text); font-size:20px; letter-spacing:-.04em; }
.info-list > .detail-stat strong { font-size:11px; }
.data-status-badge.success { border-color:rgba(34,197,94,.3); color:#86efac; background:rgba(34,197,94,.08); }
.data-status-badge.warning { border-color:rgba(245,158,11,.3); color:#fbbf24; background:rgba(245,158,11,.08); }
.detail-loading-panel p { margin:0; color:var(--muted); font-size:10px; }
.partner-panel > strong { display:block; margin-bottom:5px; color: var(--text); font-size:14px; }
.partner-panel > p { margin:0; color:var(--muted); font-size:10px; line-height:1.65; }
.drop-list { display:grid; gap:6px; }
.drop-list > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 9px; border:1px solid var(--line); border-radius:7px; background:#0a0a0e; }
.drop-list strong { color: var(--text); font-size:10px; }
.drop-list span { color:var(--muted); font-size:9px; text-align:right; }
.skill-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; list-style:none; color: var(--text); font-size:11px; font-weight:800; text-transform:uppercase; }
.skill-disclosure > summary::-webkit-details-marker { display:none; }
.skill-disclosure > summary b { display:grid; min-width:24px; height:24px; place-items:center; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:9px; }
.skill-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:12px; }
.skill-card { padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.skill-card > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.skill-card strong { color: var(--text); font-size:11px; }
.skill-card > div:first-child span { color:var(--muted); font-size:8px; }
.skill-metrics { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.skill-metrics span { padding:4px 6px; border:1px solid var(--line); border-radius:5px; color:var(--muted); font-size:8px; }
.skill-metrics b { color: var(--text); }
.skill-card p { margin:8px 0 0; color:var(--muted-2); font-size:9px; line-height:1.55; }
.detail-source-line { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; margin-top:10px; padding:9px 11px; border:1px solid var(--line); border-radius:8px; color:var(--muted-2); font-size:8px; }
.detail-source-line a { margin-left:auto; color:#ff4b67; font-weight:800; text-transform:uppercase; }
.spawn-map-preview img { object-fit:contain; background:var(--panel); }
@media(max-width:760px){
  .detail-stat-grid-primary,.detail-stat-grid-secondary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .skill-list { grid-template-columns:1fr; }
}
@media(max-width:430px){
  .detail-stat-grid-primary,.detail-stat-grid-secondary { grid-template-columns:1fr 1fr; }
  .detail-stat { min-height:58px; }
  .detail-stat strong { font-size:17px; }
  .detail-source-line a { margin-left:0; }
}

/* Functional additions - existing layout and palette retained */
.brand-symbol { display:grid; place-items:center; }
.brand-symbol svg { width:32px; height:32px; fill:none; stroke:var(--red-2); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.brand-symbol svg circle:first-child { stroke:var(--line-2); }
.brand-symbol svg circle:not(:first-child) { fill:var(--red); stroke:none; }
.brand-symbol i { display:none; }
.drop-list strong { display:flex; align-items:center; gap:7px; min-width:0; }
.drop-item-icon { width:16px; height:16px; flex:0 0 16px; fill:none; stroke:var(--red-2); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.team-summary { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:18px 0 14px; }
.team-summary h2 { margin:4px 0 0; font-size:clamp(24px,2.6vw,34px); letter-spacing:-.045em; }
.team-summary p { max-width:720px; margin:8px 0 0; color:var(--muted); font-size:12px; }
.team-pal-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.team-pal-card { grid-template-columns:58px minmax(0,1fr); min-height:150px; align-content:start; }
.team-pal-reason { margin:8px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
@media (max-width:1180px) { .team-pal-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:760px) { .team-summary { align-items:flex-start; flex-direction:column; } .team-pal-grid { grid-template-columns:1fr; } .team-pal-card { min-height:0; } }

/* Local import, backup and personalised team tools */
.import-options {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 12px;
  margin-bottom: 18px;
}
.import-option-card { min-width: 0; }
.import-option-card.recommended { border-color: rgba(239, 0, 60, .36); box-shadow: inset 3px 0 0 var(--red); }
.import-option-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.import-option-heading h3 { margin: 2px 0 0; color: var(--text); font-size: 20px; letter-spacing: -.035em; }
.option-number { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid var(--line-2); border-radius: 8px; color: var(--red-2); background: var(--panel); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.import-option-card > p { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.save-drop { display: grid; place-items: center; gap: 8px; padding: 18px; border: 1px dashed #454550; border-radius: 10px; background: #0a0a0e; text-align: center; }
.save-drop-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(239, 0, 60, .35); border-radius: 50%; background: rgba(239, 0, 60, .07); }
.save-drop-icon svg { width: 21px; height: 21px; fill: none; stroke: var(--red-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.save-drop strong { color: var(--text); font-size: 12px; }
.save-drop > span { max-width: 540px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.action-row.centered { justify-content: center; margin-top: 5px; }
.save-location-help { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.save-location-help summary { padding: 10px 12px; cursor: pointer; color: var(--text); font-size: 10px; font-weight: 800; }
.save-location-help > div { display: grid; gap: 8px; padding: 0 12px 12px; }
.save-location-help p { display: grid; gap: 4px; margin: 0; color: var(--muted); font-size: 9px; }
.save-location-help code { overflow-wrap: anywhere; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; color: #c8d7ec; background: var(--panel); font-family: Consolas, Monaco, monospace; font-size: 9px; }
.local-processing-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--green); font-size: 9px; font-weight: 800; }
.local-processing-note .status-dot { width: 7px; height: 7px; }
.option-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.option-action-grid .button { width: 100%; justify-content: center; text-align: center; }
.compact-notice { margin-top: 12px; }

.inventory-meta { padding-right: 0; }
.inventory-passives { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.inventory-passives span { max-width: 100%; overflow: hidden; padding: 3px 6px; border: 1px solid rgba(83, 118, 255, .24); border-radius: 999px; color: #b9c8ff; background: rgba(83, 118, 255, .06); font-size: 7px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.manual-pal-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.team-section-block { margin-top: 16px; }
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.section-heading-row h3 { margin: 3px 0 0; color: var(--text); font-size: 19px; letter-spacing: -.035em; }
.team-status { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.team-status.success { border-color: rgba(52, 211, 153, .35); color: #6ee7b7; background: rgba(52, 211, 153, .08); }
.team-status.good { border-color: rgba(59, 130, 246, .35); color: #93c5fd; background: rgba(59, 130, 246, .08); }
.team-status.warning { border-color: rgba(245, 158, 11, .35); color: #fbbf24; background: rgba(245, 158, 11, .08); }
.team-status.danger { border-color: rgba(239, 68, 68, .35); color: #fca5a5; background: rgba(239, 68, 68, .08); }
.team-alternatives { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.team-alternatives strong { width: 100%; color: var(--text); font-size: 9px; text-transform: uppercase; }
.team-alternatives span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.personal-team-panel { margin-top: 18px; }
.owned-team-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.owned-team-card { min-width: 0; }
.owned-team-head { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 9px; align-items: center; }
.owned-team-head h3 { overflow: hidden; margin: 2px 0 5px; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.owned-team-card > p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.team-analysis-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 12px; margin-top: 12px; }
.analysis-card h3 { margin: 3px 0 10px; color: var(--text); font-size: 19px; }
.analysis-card ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.analysis-card li { position: relative; padding-left: 16px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.analysis-card li::before { position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--red); content: ''; }
.analysis-footnote { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; line-height: 1.55; }
.target-suggestion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.target-suggestion-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #0a0a0e; }
.target-suggestion-head { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 9px; align-items: center; }
.target-suggestion-head h4 { margin: 2px 0; color: var(--text); font-size: 13px; }
.target-suggestion-head small { color: var(--muted-2); font-size: 8px; }
.priority-badge { color: var(--red-2); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.target-suggestion-card > p { margin: 9px 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.target-suggestion-card .action-row { gap: 6px; }
.target-suggestion-card .button { min-height: 30px; padding: 7px 9px; font-size: 8px; }
.empty-state.compact { min-height: 220px; }

/* Compact local Pal profile */
.detail-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail-grid-compact .detail-panel { min-width: 0; padding: 12px; }
.detail-grid-compact .detail-panel-wide { grid-column: 1 / -1; }
.detail-stat-grid-auto { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
.detail-profile-panel .info-row, .detail-grid-compact .info-row { min-height: 27px; }
.local-data-note { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-2); background: #0a0a0e; font-size: 8px; line-height: 1.5; }
.pal-detail-hero-compact { margin-bottom: 10px; }
.pal-detail-hero-compact .pal-detail-image { width: 116px; min-width: 116px; height: 116px; }
.pal-detail-hero-compact .availability-line { margin: 6px 0 0; color: #c6c6ce; font-size: 10px; font-weight: 700; }

@media (max-width: 1180px) {
  .owned-team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .import-options, .team-analysis-grid { grid-template-columns: 1fr; }
  .owned-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .option-action-grid, .target-suggestion-grid, .manual-pal-form { grid-template-columns: 1fr; }
  .manual-pal-form .field { grid-column: 1 !important; }
  .owned-team-grid { grid-template-columns: 1fr; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .detail-grid-compact { grid-template-columns: 1fr; }
  .detail-grid-compact .detail-panel-wide { grid-column: 1; }
  .pal-detail-hero-compact { align-items: flex-start; }
  .pal-detail-hero-compact .pal-detail-image { width: 86px; min-width: 86px; height: 86px; }
}

.backup-reminder { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 24px 0; padding: 10px 12px; border: 1px solid rgba(239,0,60,.28); border-radius: 8px; background: rgba(239,0,60,.055); }
.backup-reminder.hidden { display: none; }
.backup-reminder > div:first-child { display: grid; gap: 2px; }
.backup-reminder strong { color: var(--text); font-size: 10px; }
.backup-reminder span { color: var(--muted); font-size: 9px; }
.backup-reminder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.backup-reminder .button { min-height: 30px; padding: 7px 10px; font-size: 8px; }
@media(max-width:720px){ .backup-reminder { align-items:flex-start; flex-direction:column; margin:10px 12px 0; } .backup-reminder-actions { justify-content:flex-start; } }

/* Palworld 1.0 partner skills and in-depth Pal guides */
.partner-guide-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(239, 0, 60, .28);
  background: linear-gradient(135deg, rgba(239, 0, 60, .055), rgba(9, 9, 13, .96) 46%);
}
.partner-guide-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--red);
  content: '';
}
.partner-guide-heading,
.pal-guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.partner-guide-heading h4,
.pal-guide-heading h4 {
  margin-bottom: 7px;
}
.partner-guide-heading > div:first-child > strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -.025em;
}
.partner-skill-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.partner-skill-meta span,
.guide-data-status {
  padding: 5px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: #d8d8de;
  background: rgba(7, 7, 10, .82);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.partner-effect {
  max-width: 830px;
  margin: 11px 0 0 !important;
  color: #c8c8cf !important;
  font-size: 11px !important;
  line-height: 1.7 !important;
}
.guide-callout {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(239, 0, 60, .22);
  border-radius: 8px;
  background: rgba(239, 0, 60, .04);
}
.guide-callout > span,
.guide-section-grid article > span,
.guide-matchups span {
  color: var(--red-2);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.guide-callout p {
  margin: 0 !important;
  color: #b9b9c2 !important;
  font-size: 10px !important;
  line-height: 1.65 !important;
}
.partner-rank-note {
  margin: 10px 0 0 !important;
  color: var(--muted-2) !important;
  font-size: 8px !important;
  line-height: 1.55 !important;
}
.pal-guide-panel {
  border-color: rgba(255, 255, 255, .11);
  background: var(--panel);
}
.pal-guide-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}
.guide-use-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.guide-use-list span {
  padding: 6px 8px;
  border: 1px solid rgba(84, 111, 255, .28);
  border-radius: 6px;
  color: #bfcaff;
  background: rgba(84, 111, 255, .075);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .025em;
}
.guide-matchups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.guide-matchups > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #08080b;
}
.guide-matchups strong {
  color: var(--text);
  font-size: 9px;
  text-align: right;
}
.guide-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.guide-section-grid article {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08080b;
}
.guide-section-grid article p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

@media (max-width: 650px) {
  .partner-guide-heading,
  .pal-guide-heading {
    flex-direction: column;
  }
  .partner-skill-meta {
    justify-content: flex-start;
  }
  .guide-callout {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .guide-matchups,
  .guide-section-grid {
    grid-template-columns: 1fr;
  }
}

/* Hotfix: lightweight route loading state. */
.view-loading-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.view-loading-state span {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: nova-route-spin .7s linear infinite;
}
@keyframes nova-route-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .view-loading-state span { animation: none; } }

.pal-atlas-boot-loader {
  min-height: min(75vh, 600px);
  padding: 34px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pal-atlas-boot-loader strong {
  color: var(--text);
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: .01em;
  text-transform: none;
}

.pal-atlas-boot-loader small {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 6px;
}

.pal-atlas-loading-flipbook {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 12px;
}

.pal-atlas-loading-flipbook img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  image-rendering: auto;
  animation: palAtlasFlipbook 1.8s steps(1, end) infinite;
}

.pal-atlas-loading-flipbook img:first-child { opacity: 1; }
.pal-atlas-loading-flipbook img:nth-child(1) { animation-delay: 0s; }
.pal-atlas-loading-flipbook img:nth-child(2) { animation-delay: .2s; }
.pal-atlas-loading-flipbook img:nth-child(3) { animation-delay: .4s; }
.pal-atlas-loading-flipbook img:nth-child(4) { animation-delay: .6s; }
.pal-atlas-loading-flipbook img:nth-child(5) { animation-delay: .8s; }
.pal-atlas-loading-flipbook img:nth-child(6) { animation-delay: 1s; }
.pal-atlas-loading-flipbook img:nth-child(7) { animation-delay: 1.2s; }
.pal-atlas-loading-flipbook img:nth-child(8) { animation-delay: 1.4s; }
.pal-atlas-loading-flipbook img:nth-child(9) { animation-delay: 1.6s; }

@keyframes palAtlasFlipbook {
  0%, 11.1% { opacity: 1; }
  11.11%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pal-atlas-loading-flipbook img {
    animation: none;
  }

  .pal-atlas-loading-flipbook img:first-child {
    opacity: 1;
  }
}

/* ==============================================================
   2026 Pal Atlas clarity and data-density refinement
   ============================================================== */
:root {
  --bg: #e9e9ed;
  --bg-2: #dedee4;
  --panel: #ffffff;
  --panel-2: #f2f2f5;
  --panel-3: #e8e8ed;
  --line: #c9c9d1;
  --line-2: #aeb0bb;
  --text: #101014;
  --muted: #484850;
  --muted-2: #65656f;
  --shadow: 0 10px 30px rgba(15,15,20,.07);
}
body { background: var(--bg); }
.view-container { max-width: 1680px; margin-inline: auto; }
.panel,.card { border-color: var(--line); }
.page-heading p,.stat-note,.quick-item span,.empty-state p,.pal-card-footer span { color: var(--muted); }
.element-badge { color: #2f3038; background: #f3f3f6; border-color: #c4c5ce; }
.tier-badge,.meta-badge { background: #fff; }
.nav-item { color:#292a31; }
.nav-item:hover { background:#ededf1; }

.overview-hero { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:40px; align-items:center; padding:clamp(28px,4vw,58px); margin-bottom:16px; border-top:4px solid var(--red); overflow:hidden; }
.overview-hero-copy h2 { max-width:850px; margin:8px 0 15px; font-size:clamp(38px,5.3vw,76px); line-height:.92; letter-spacing:-.07em; }
.overview-hero-copy p { max-width:760px; margin:0 0 22px; color:var(--muted); font-size:14px; }
.overview-completion { display:grid; justify-items:center; gap:14px; padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--panel-2); text-align:center; }
.overview-completion p { margin:0; color:var(--muted); font-size:12px; }
.completion-ring { display:grid; width:156px; height:156px; place-items:center; border-radius:50%; background:conic-gradient(var(--red) var(--progress),#d5d5dc 0); }
.completion-ring:before { content:""; position:absolute; width:122px; height:122px; border-radius:50%; background:#fff; }
.completion-ring { position:relative; }
.completion-ring>div { position:relative; z-index:1; display:grid; text-align:center; }
.completion-ring strong { font-size:35px; line-height:1; }
.completion-ring span { margin-top:4px; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }
.overview-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.overview-metrics article { min-width:0; padding:17px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.overview-metrics span { display:block; color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.overview-metrics strong { display:block; margin:7px 0 4px; font-size:28px; line-height:1; }
.overview-metrics small { display:block; color:var(--muted); font-size:9px; line-height:1.35; }
.overview-onboarding { display:flex; align-items:center; justify-content:space-between; gap:25px; margin-bottom:16px; background:#fff8fa; border-color:#e5a5b4; }
.overview-onboarding h3,.overview-section h3,.overview-tools h3,.overview-target-card h3 { margin:5px 0 8px; font-size:23px; letter-spacing:-.035em; }
.overview-onboarding p { max-width:720px; margin:0; color:var(--muted); font-size:12px; }
.overview-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:14px; margin-bottom:16px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:15px; margin-bottom:15px; }
.section-heading h3 { margin:4px 0 0; }
.section-heading>a { color:var(--red); font-size:10px; font-weight:800; text-decoration:none; }
.overview-progress-list { display:grid; gap:8px; }
.overview-progress-list a { display:grid; grid-template-columns:90px minmax(0,1fr) 58px; gap:12px; align-items:center; color:var(--text); font-size:10px; font-weight:750; text-decoration:none; }
.overview-progress-list i { height:8px; overflow:hidden; border-radius:99px; background:#dedee4; }
.overview-progress-list i b { display:block; height:100%; border-radius:inherit; background:var(--red); }
.overview-progress-list strong { text-align:right; }
.work-coverage-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.work-coverage-grid>div { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:13px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.work-coverage-grid .work-item-label { display:flex; align-items:center; gap:8px; min-width:0; }
.work-coverage-grid .work-item-label > span:last-child { color:var(--muted); font-size:10px; }
.work-coverage-grid strong { color:var(--red); font-size:11px; white-space:nowrap; }
.overview-empty { min-height:180px; display:grid; place-items:center; align-content:center; text-align:center; }
.overview-empty p { margin:4px 0 0; color:var(--muted); font-size:11px; }
.overview-target-card { display:grid; grid-template-columns:minmax(260px,420px) minmax(0,1fr); gap:28px; align-items:center; margin-bottom:18px; }
.overview-target-card p { max-width:720px; color:var(--muted); font-size:12px; }
.overview-tools { padding:22px 0 6px; }
.overview-tool-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.overview-tool-card { display:grid; grid-template-columns:34px minmax(0,1fr) auto; gap:12px; align-items:center; min-height:92px; padding:15px; border:1px solid var(--line); border-radius:12px; background:#fff; text-decoration:none; transition:.18s ease; }
.overview-tool-card:hover { border-color:#9c9eaa; transform:translateY(-2px); box-shadow:var(--shadow); }
.overview-tool-card>span { display:grid; width:34px; height:34px; place-items:center; border-radius:8px; background:#f7e7eb; color:var(--red); font-size:10px; font-weight:900; }
.overview-tool-card strong { display:block; font-size:12px; }
.overview-tool-card p { margin:3px 0 0; color:var(--muted); font-size:9px; line-height:1.45; }
.overview-tool-card>b { color:var(--red); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }

.data-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin-bottom:14px; padding:15px; }
.data-toolbar .search-field { min-width:280px; flex:1; }
.data-toolbar .field:not(.search-field) { min-width:190px; }
.data-count { margin-left:auto; padding:10px 12px; border:1px solid var(--line); border-radius:999px; background:var(--panel-2); color:var(--muted); font-size:10px; font-weight:800; }
.entity-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:9px; }
.entity-card { display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:88px; padding:12px; border:1px solid var(--line); border-radius:11px; background:#fff; text-align:left; }
.entity-card:hover { border-color:#9fa1ac; background:#f9f9fb; }
.entity-card img,.entity-placeholder { width:58px; height:58px; object-fit:contain; border:1px solid var(--line); border-radius:9px; background:var(--panel-2); }
.entity-placeholder { display:grid; place-items:center; color:var(--red); font-size:10px; font-weight:900; }
.entity-card small { display:block; color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.entity-card strong { display:block; margin-top:3px; font-size:12px; }
.entity-card p { margin:4px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }
.entity-card>b { color:var(--red); font-size:9px; }
.entity-card-wide { grid-column:auto; }
.entity-detail { display:grid; gap:18px; }
.entity-detail-head { display:grid; grid-template-columns:96px minmax(0,1fr); gap:18px; align-items:center; padding:18px; border:1px solid var(--line); border-radius:13px; background:var(--panel-2); }
.entity-detail-head img,.entity-detail-head>span { width:96px; height:96px; object-fit:contain; border-radius:12px; background:#fff; border:1px solid var(--line); }
.entity-detail-head>span { display:grid; place-items:center; color:var(--red); font-weight:900; }
.entity-detail-head h3 { margin:4px 0 6px; font-size:28px; }
.entity-detail-head p,.entity-detail section>p { margin:0; color:var(--muted); font-size:11px; }
.entity-detail-grid,.raw-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.data-row { display:grid; grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr); gap:12px; align-items:start; padding:9px 10px; border:1px solid var(--line); border-radius:7px; background:#fff; }
.data-row span { color:var(--muted); font-size:9px; text-transform:none; overflow-wrap:anywhere; }
.data-row strong { color:var(--text); font-size:9px; font-weight:750; text-align:right; overflow-wrap:anywhere; }
.raw-data { border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.raw-data summary { display:flex; align-items:center; justify-content:space-between; padding:13px; cursor:pointer; color:var(--text); font-size:10px; font-weight:850; }
.raw-data>div { display:grid; gap:6px; max-height:520px; overflow:auto; padding:0 12px 12px; }
.merchant-item-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:7px; }
.merchant-item-grid article { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:9px; }
.item-browser-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:9px; }
.item-browser-card { display:grid; grid-template-columns:64px minmax(0,1fr); gap:12px; align-items:center; min-height:98px; padding:12px; border:1px solid var(--line); border-radius:11px; background:#fff; text-align:left; }
.item-browser-card:hover { border-color:#999ca8; }
.item-browser-card img,.item-browser-card>span { width:64px; height:64px; object-fit:contain; border:1px solid var(--line); border-radius:9px; background:var(--panel-2); }
.item-browser-card>span { display:grid; place-items:center; color:var(--red); font-size:9px; font-weight:900; }
.item-browser-card small { color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; }
.item-browser-card strong { display:block; margin:3px 0; font-size:12px; }
.item-browser-card p { display:-webkit-box; margin:0; overflow:hidden; color:var(--muted); font-size:9px; line-height:1.4; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* Map controls: high-contrast light UI while preserving map artwork */
.map-filter-panel,.map-sidebar,.map-control-panel,.map-details-panel,.map-top-controls,.map-category-list,.map-toolbar { color:var(--text)!important; background:#fff!important; border-color:var(--line)!important; }
.map-filter-panel *, .map-sidebar *, .map-control-panel *, .map-details-panel * { text-shadow:none!important; }
.map-category-button,.map-category-row,.map-filter-button,.map-control-button { color:#24252b!important; background:#f7f7f9!important; border-color:#c7c8d0!important; }
.map-category-button:hover,.map-category-row:hover,.map-filter-button:hover,.map-control-button:hover { background:#ededf1!important; }
.map-category-button.active,.map-category-row.active,.map-filter-button.active { color:#fff!important; background:var(--red)!important; border-color:var(--red)!important; }
.map-category-button span,.map-category-row span,.map-filter-panel label,.map-details-panel p { color:inherit!important; }
.map-marker img,.map-asset-wrap img { object-fit:contain!important; }
.map-asset-wrap { background:rgba(255,255,255,.92)!important; border-radius:50%!important; }

@media (max-width:1100px){
  .overview-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  .overview-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:760px){
  .overview-hero{grid-template-columns:1fr;padding:24px}.overview-completion{grid-template-columns:auto 1fr;justify-items:start;text-align:left}.completion-ring{width:110px;height:110px}.completion-ring:before{width:84px;height:84px}.completion-ring strong{font-size:25px}
  .overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-grid,.overview-target-card{grid-template-columns:1fr}.overview-tool-grid{grid-template-columns:1fr}.overview-onboarding{align-items:flex-start;flex-direction:column}.entity-detail-grid,.raw-data-grid{grid-template-columns:1fr}.data-count{margin-left:0}.entity-detail-head{grid-template-columns:72px minmax(0,1fr)}.entity-detail-head img,.entity-detail-head>span{width:72px;height:72px}
}


/* Pal Atlas usability hotfix: readable controls, compact navigation and data cards. */
@media (min-width: 901px) {
  .pal-atlas-sidebar { align-self:start; height:auto!important; min-height:0!important; max-height:calc(100vh - var(--pa-header-offset,82px)); padding-bottom:14px!important; background:#fff; }
  .sidebar-nav { padding-bottom:8px!important; }
}
.nav-item { min-height:42px!important; margin:0 7px 4px!important; color:#17171b!important; background:#fff!important; border:1px solid transparent!important; }
.nav-item:hover { color:#0f0f12!important; background:#f4f4f6!important; border-color:#d9d9df!important; }
.nav-item.active { color:#0f0f12!important; background:#fff0f3!important; border-color:#d90a2c!important; box-shadow:inset 3px 0 0 #d90a2c!important; }
.nav-item span { color:#33343a!important; background:#fff!important; border-color:#c7c8d0!important; }
.nav-item.active span { color:#d90a2c!important; border-color:#d90a2c!important; }
.merchant-item-grid article { display:grid!important; grid-template-columns:34px minmax(0,1fr) auto!important; align-items:center!important; }
.merchant-item-grid article img,.merchant-item-placeholder { width:34px;height:34px;object-fit:contain;border:1px solid var(--line);border-radius:7px;background:var(--panel-2); }
.merchant-item-placeholder { display:grid;place-items:center;font-size:7px;font-weight:900;color:var(--muted); }
.merchant-item-grid article strong { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.item-pal-drop-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px; }
.item-pal-drop { display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:10px;padding:9px;border:1px solid var(--line);border-radius:9px;background:#fff;text-align:left;cursor:pointer; }
.item-pal-drop:hover { border-color:var(--red);background:#fff5f7; }
.item-pal-drop img { width:44px;height:44px;object-fit:contain;border-radius:8px;background:var(--panel-2); }
.item-pal-drop span { min-width:0;display:grid;gap:3px; }.item-pal-drop strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item-pal-drop small{color:var(--muted)}
.item-browser-card { overflow:hidden; }
.item-browser-card>div { min-width:0;overflow:hidden; }
.item-browser-card strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%; }
.item-browser-card p { overflow:hidden;word-break:break-word; }


/* 2026-08-06 Pal detail and item-detail contrast hotfix. */
.detail-stat {
  color: #111114 !important;
  background: #f4f4f6 !important;
  border-color: #cfd0d7 !important;
}
.detail-stat span { color: #55555f !important; }
.detail-stat strong { color: #0f0f12 !important; }
.drop-list > div {
  color: #111114 !important;
  background: #f7f7f9 !important;
  border-color: #cfd0d7 !important;
}
.drop-list strong,
.drop-list strong span { color: #16161b !important; }
.drop-list > div > span { color: #4d4d55 !important; }
.breeding-detail-panel .info-row span,
.breeding-detail-panel h5 { color: #3f3f47 !important; }
.breeding-detail-panel .info-row strong { color: #111114 !important; }
.breeding-detail-panel .detail-route-list span {
  color: #222228 !important;
  background: #f7f7f9 !important;
  border-color: #cfd0d7 !important;
}
.item-pal-drop-section {
  margin-top: 22px !important;
  padding-top: 18px !important;
  border-top: 3px solid #ececf0 !important;
}
.detail-grid + .item-pal-drop-section { margin-top: 26px !important; }
.item-pal-drop-section h4 { margin-bottom: 12px !important; }


/* 2026-08-06 comprehensive readability and detail cleanup */
.save-drop,
.target-suggestion-card,
.local-data-note,
.guide-matchups > div,
.guide-section-grid article {
  color:#0f0f12!important;
  background:#ffffff!important;
  border-color:#cfd0d7!important;
}
.save-drop strong,.save-drop > span,
.target-suggestion-card h4,.target-suggestion-card p,.target-suggestion-card small,
.guide-matchups strong,.guide-section-grid article p,
.local-data-note { color:#222228!important; }
.save-drop > span,.target-suggestion-card small,.target-suggestion-card p,.guide-section-grid article p { color:#55555f!important; }
.save-location-help code { color:#15151a!important;background:#f4f4f6!important; }
.inventory-passives span,.guide-use-list span { color:#29324d!important;background:#f1f4ff!important;border-color:#bcc8f5!important; }
.team-status.success,.team-status.good,.team-status.warning,.team-status.danger { color:#17171b!important;background:#fff!important; }
.analysis-card,.targets-card { background:#fff!important;color:#0f0f12!important; }
.analysis-card h3,.analysis-card li,.analysis-footnote { color:#222228!important; }
.target-suggestion-card .priority-badge { color:#d90a2c!important; }

/* Technology cards and details */
.technology-grid .technology-card { min-height:112px; align-items:center; }
.technology-card > img,.technology-card > .tech-icon-placeholder { width:64px!important;height:64px!important;flex:0 0 64px!important;object-fit:contain;background:#f1f1f4!important;border:1px solid #d5d6dc!important;border-radius:9px!important; }
.tech-icon-placeholder { display:grid;place-items:center;color:#d90a2c;font-size:10px;font-weight:900;letter-spacing:.08em; }
.technology-card > div { min-width:0;overflow:hidden; }
.technology-card strong { display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#111114!important; }
.technology-card p { display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.45;color:#55555f!important; }
.tech-detail .entity-detail-head > img,.tech-detail .entity-detail-head > .tech-icon-placeholder { width:96px;height:96px;object-fit:contain;background:#f1f1f4;border:1px solid #d5d6dc;border-radius:10px; }
.tech-detail-section { margin-top:18px;padding-top:16px;border-top:1px solid #d9d9df; }
.tech-detail-section h4 { margin:0 0 10px;color:#15151a; }
.tech-stat-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px; }
.tech-stat { display:flex;min-height:70px;flex-direction:column;justify-content:space-between;padding:10px;border:1px solid #d5d6dc;border-radius:8px;background:#f7f7f9; }
.tech-stat span { color:#55555f;font-size:9px;font-weight:800;text-transform:uppercase; }
.tech-stat strong { color:#101014;font-size:18px; }
.tech-material-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px; }
.tech-material { display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:9px;align-items:center;padding:9px;border:1px solid #d5d6dc;border-radius:8px;background:#fff; }
.tech-material img,.tech-material .tech-icon-placeholder { width:42px;height:42px;object-fit:contain;background:#f1f1f4;border:1px solid #d5d6dc;border-radius:7px; }
.tech-material span { min-width:0;display:grid;gap:2px; }.tech-material strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#15151a}.tech-material small{overflow:hidden;text-overflow:ellipsis;color:#666670}.tech-material b{color:#d90a2c}

/* Item details: stronger separation between recipes and drop sources */
.item-material-grid { margin-bottom:4px; }
.item-pal-drop-section { margin-top:30px!important;padding-top:24px!important;border-top:4px solid #e3e3e8!important; }
.item-pal-drop-section::before { display:block;margin-bottom:10px;color:#777780;font-size:9px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;content:'Drop sources'; }

/* Ensure no raw-data disclosure dominates player-facing details */
.raw-data { display:none!important; }

@media(max-width:650px){.tech-stat-grid,.tech-material-grid{grid-template-columns:1fr}.technology-grid .technology-card{min-height:96px}}


/* Polished desktop Pal Atlas navigation */
@media (min-width: 901px) {
  .pal-atlas-sidebar {
    position: sticky !important;
    top: var(--pa-header-offset) !important;
    width: var(--pa-sidebar) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - var(--pa-header-offset) - 18px) !important;
    margin: 0 !important;
    padding: 10px 9px 0 !important;
    overflow: hidden !important;
    border-right: 1px solid #d7d7dd !important;
    border-bottom: 1px solid #d7d7dd !important;
    border-radius: 0 0 14px 0 !important;
    background: #ffffff !important;
    box-shadow: 8px 10px 30px rgba(15, 15, 18, 0.055) !important;
  }

  .sidebar-nav {
    display: flex !important;
    flex: 0 1 auto !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 0 0 10px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .sidebar-nav .nav-item {
    position: relative !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    gap: 10px !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #222228 !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    letter-spacing: -0.01em !important;
    box-shadow: none !important;
  }

  .sidebar-nav .nav-item span {
    width: 26px !important;
    height: 26px !important;
    border: 1px solid #cfd0d7 !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #575861 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
  }

  .sidebar-nav .nav-item:hover {
    border-color: #dadbe1 !important;
    background: #f3f3f6 !important;
    color: #0f0f12 !important;
    transform: translateX(2px);
  }

  .sidebar-nav .nav-item.active {
    border-color: #d90a2c !important;
    background: #fff1f4 !important;
    color: #0f0f12 !important;
    box-shadow: none !important;
  }

  .sidebar-nav .nav-item.active::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: -10px;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: #d90a2c;
  }

  .sidebar-nav .nav-item.active span {
    border-color: #d90a2c !important;
    background: #ffffff !important;
    color: #d90a2c !important;
  }

  .sidebar-status {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 0 -9px;
    padding: 13px 15px 14px;
    border-top: 1px solid #e2e2e7;
    background: #f7f7f9;
  }

  .sidebar-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38c985;
    box-shadow: 0 0 0 4px rgba(56, 201, 133, 0.12);
  }

  .sidebar-status strong {
    display: block;
    color: #17171b;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.12em;
  }

  .sidebar-status small {
    display: block;
    margin-top: 2px;
    color: #686971;
    font-size: 8px;
    line-height: 1.35;
  }
}

@media (max-width: 900px) {
  .sidebar-status {
    display: none;
  }
}


/* Full-height desktop sidebar column down to the global footer */
@media (min-width: 901px) {
  .pal-atlas-layout {
    position: relative !important;
    align-items: stretch !important;
    min-height: calc(100vh - var(--pa-header-offset)) !important;
    background:
      linear-gradient(
        to right,
        #ffffff 0,
        #ffffff var(--pa-sidebar),
        var(--bg) var(--pa-sidebar),
        var(--bg) 100%
      ) !important;
  }

  .pal-atlas-layout::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--pa-sidebar);
    border-right: 1px solid #d7d7dd;
    background: #ffffff;
    pointer-events: none;
  }

  .pal-atlas-sidebar,
  .pal-atlas-content,
  .sidebar-scrim {
    position: relative;
    z-index: 1;
  }

  .pal-atlas-sidebar {
    align-self: stretch !important;
    min-height: 100% !important;
    max-height: none !important;
    height: auto !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .sidebar-nav {
    position: sticky !important;
    top: calc(var(--pa-header-offset) + 10px) !important;
    max-height: calc(100vh - var(--pa-header-offset) - 82px) !important;
    padding-bottom: 8px !important;
  }

  .sidebar-status {
    position: sticky !important;
    top: calc(100vh - 64px) !important;
    margin-top: auto !important;
  }
}


/* Keep the navigation visible while scrolling, then stop at the global footer */
@media (min-width: 901px) {
  /*
   * The aside fills the Pal Atlas content height so its white background reaches
   * the footer. It must NOT be a scroll container, otherwise sticky children
   * stick to the aside instead of the browser viewport.
   */
  .pal-atlas-sidebar {
    position: relative !important;
    top: auto !important;
    align-self: stretch !important;
    width: var(--pa-sidebar) !important;
    min-height: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 10px 9px 14px !important;
    border-right: 1px solid #d7d7dd !important;
    background: #ffffff !important;
  }

  /*
   * The actual menu follows the viewport while the user reads the page.
   * Because it remains inside .pal-atlas-layout, it naturally stops when the
   * layout ends and never overlaps the global footer.
   */
  .sidebar-nav {
    position: sticky !important;
    top: calc(var(--pa-header-offset) + 10px) !important;
    z-index: 45 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    max-height: calc(100vh - var(--pa-header-offset) - 20px) !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    scrollbar-color: #cfd0d7 transparent !important;
    background: #ffffff !important;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: block !important;
    width: 5px !important;
  }

  .sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 99px !important;
    background: #cfd0d7 !important;
  }

  .sidebar-status {
    display: none !important;
  }
}


/* Remove the unnecessary horizontal scrollbar from the sticky sidebar */
@media (min-width: 901px) {
  .pal-atlas-sidebar,
  .sidebar-nav {
    overflow-x: hidden !important;
  }

  .sidebar-nav {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .sidebar-nav::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  .sidebar-nav .nav-item,
  .sidebar-nav .nav-item:hover,
  .sidebar-nav .nav-item:focus,
  .sidebar-nav .nav-item:focus-visible,
  .sidebar-nav .nav-item.active {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }
}


/* Corrected sticky sidebar: follows viewport, no horizontal scrollbar */
@media (min-width: 901px) {
  /*
   * Do not place overflow:hidden on the aside. Any non-visible overflow on an
   * ancestor prevents the sticky navigation from following the browser scroll.
   */
  .pal-atlas-sidebar {
    overflow: visible !important;
  }

  .sidebar-nav {
    position: sticky !important;
    top: calc(var(--pa-header-offset) + 10px) !important;
    z-index: 45 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - var(--pa-header-offset) - 20px) !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: #cfd0d7 transparent !important;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: block !important;
    width: 5px !important;
    height: 0 !important;
  }

  .sidebar-nav::-webkit-scrollbar-track {
    background: transparent !important;
  }

  .sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 99px !important;
    background: #cfd0d7 !important;
  }

  .sidebar-nav .nav-item,
  .sidebar-nav .nav-item:hover,
  .sidebar-nav .nav-item:focus,
  .sidebar-nav .nav-item:focus-visible,
  .sidebar-nav .nav-item.active {
    width: calc(100% - 1px) !important;
    max-width: calc(100% - 1px) !important;
    transform: none !important;
  }
}


/* Recommended Teams and Boss Database hotfix */
.team-category-bar,
.boss-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-category-bar {
  margin: 0 0 18px;
}

.team-category-bar button,
.boss-tabs button {
  border: 1px solid #d5d5db;
  border-radius: 999px;
  padding: 9px 13px;
  background: #fff;
  color: #29292f;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.team-category-bar button.active,
.boss-tabs button.active {
  border-color: #d90a2c;
  background: #d90a2c;
  color: #fff;
}

.team-category-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  gap: 24px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid #d9d9df;
  border-radius: 14px;
  background: #fff;
}

.team-category-intro span,
.team-block-heading span,
.section-heading span,
.boss-info-card > span,
.boss-detail-hero > div > span {
  color: #d90a2c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
}

.team-category-intro h3 {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.team-category-intro p {
  margin: 0;
  color: #55555d;
  line-height: 1.65;
}

.team-output-grid {
  display: grid;
  gap: 18px;
}

.team-reference-block {
  border: 1px solid #d9d9df;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.team-reference-block.recommended-team {
  border-top: 5px solid #d90a2c;
}

.team-reference-block.budget-team {
  border-top: 5px solid #55555d;
}

.team-reference-block.personalised-team {
  border-top: 5px solid #168c4c;
}

.team-block-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 17px 18px;
  border-bottom: 1px solid #e1e1e6;
  background: #f8f8fa;
}

.team-block-heading h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.team-block-heading > strong {
  color: #55555d;
  font-size: 10px;
}

.team-pal-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.team-pal-card {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid #e4e4e8;
}

.team-pal-card:last-child {
  border-right: 0;
}

.team-pal-card.active-carry {
  background: #fff3f5;
}

.team-pal-image {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border: 1px solid #dadbe1;
  border-radius: 12px;
  background: #f2f2f5;
  overflow: hidden;
}

.team-pal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-pal-image span {
  color: #777780;
  font-weight: 900;
}

.team-pal-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  align-items: flex-start;
}

.team-pal-copy strong {
  color: #151518;
  font-size: 14px;
}

.team-pal-copy > b {
  display: block;
  margin: 8px 0 5px;
  color: #d90a2c;
  font-size: 10px;
  letter-spacing: .05em;
}

.team-pal-copy p,
.team-pal-copy small {
  color: #55555d;
  font-size: 11px;
  line-height: 1.55;
}

.owned-badge,
.missing-badge {
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}

.owned-badge {
  background: #def6e8;
  color: #0f6938;
}

.missing-badge {
  background: #f0f0f3;
  color: #66666f;
}

.team-personal-note {
  margin: 0;
  padding: 13px 18px;
  border-top: 1px solid #e5e5e9;
  color: #606069;
  font-size: 11px;
}

.boss-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.boss-toolbar input {
  width: min(320px, 100%);
  min-height: 40px;
  border: 1px solid #d5d5db;
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
  color: #17171b;
}

.boss-page-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.boss-list {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  border: 1px solid #d9d9df;
  border-radius: 14px;
  background: #fff;
}

.boss-list-count {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  border-bottom: 1px solid #e1e1e6;
  background: #f8f8fa;
  color: #55555d;
  font-size: 10px;
  font-weight: 900;
}

.boss-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #ececf0;
  background: #fff;
  color: #17171b;
  text-align: left;
  cursor: pointer;
}

.boss-card:hover {
  background: #fff3f5;
}

.boss-card-image {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #dedee3;
  border-radius: 10px;
  background: #f2f2f5;
  overflow: hidden;
}

.boss-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.boss-card-image span {
  font-size: 9px;
  font-weight: 900;
}

.boss-card span {
  color: #d90a2c;
  font-size: 8px;
  font-weight: 900;
}

.boss-card h3 {
  margin: 3px 0;
  font-size: 13px;
}

.boss-card p,
.boss-card small {
  display: block;
  margin: 0;
  color: #616169;
  font-size: 9px;
  line-height: 1.45;
}

.boss-detail-panel {
  display: grid;
  gap: 18px;
}

.boss-detail-hero,
.boss-info-card,
.boss-section {
  border: 1px solid #d9d9df;
  border-radius: 14px;
  background: #fff;
}

.boss-detail-hero {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
}

.boss-detail-image {
  display: grid;
  place-items: center;
  width: 115px;
  height: 115px;
  border: 1px solid #dadbe1;
  border-radius: 14px;
  background: #f2f2f5;
  overflow: hidden;
}

.boss-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.boss-detail-hero h2 {
  margin: 5px 0;
  font-size: 25px;
}

.boss-detail-hero p {
  margin: 0;
  color: #5b5b63;
}

.boss-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.boss-tags b {
  padding: 6px 8px;
  border: 1px solid #dddde2;
  border-radius: 999px;
  background: #f7f7f9;
  font-size: 9px;
}

.boss-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.boss-info-card {
  padding: 17px;
}

.boss-info-card h3 {
  margin: 8px 0;
  font-size: 16px;
}

.boss-info-card p,
.boss-info-card a {
  color: #56565e;
  font-size: 11px;
  line-height: 1.55;
}

.boss-info-card a {
  color: #d90a2c;
  font-weight: 800;
}

.boss-section {
  padding: 19px;
}

.section-heading h3 {
  margin: 5px 0 15px;
}

.boss-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.boss-stat-grid div {
  padding: 12px;
  border: 1px solid #e1e1e6;
  border-radius: 9px;
  background: #f8f8fa;
}

.boss-stat-grid span {
  display: block;
  color: #66666e;
  font-size: 9px;
}

.boss-stat-grid strong {
  display: block;
  margin-top: 5px;
  color: #17171b;
  font-size: 15px;
}

.team-pal-elements { display:block; color:#8b4050 !important; font-size:9px !important; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.team-pal-mechanic { display:block; margin-top:7px; padding:7px 8px; border-left:3px solid #d90a2c; background:#fff8f9; font-size:10px !important; }
.team-pal-mechanic strong { color:#d90a2c; font-size:9px; }
.team-block-note { margin:0; padding:11px 15px; border-top:1px solid #e4e4e8; color:#55555d; font-size:10px; line-height:1.55; background:#fafafd; }
.team-mechanics-note { margin-top:14px; padding:13px 15px; border:1px solid #c9d5f4; border-radius:10px; background:#f4f7ff; }
.team-mechanics-note strong { display:block; margin-bottom:4px; color:#202d54; font-size:11px; }
.team-mechanics-note span { color:#4d5872; font-size:11px; line-height:1.6; }

.boss-reward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.boss-reward-card {
  padding: 1rem;
  border: 1px solid var(--line, #e4e6eb);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.boss-reward-card h4,
.boss-reward-card h5 { margin: 0 0 .65rem; }
.boss-drop-list { display: grid; gap: .5rem; }
.boss-drop-row { padding: .55rem .7rem; border-radius: 10px; background: var(--surface-muted, #f6f7f9); }
.boss-drop-row { display: flex; align-items: center; gap: .65rem; }
.boss-drop-leading { display: grid; place-items: center; flex: 0 0 34px; }
.boss-drop-icon, .boss-work-icon { width: 32px; height: 32px; object-fit: contain; }
.boss-drop-icon-fallback { display: grid; place-items: center; border-radius: 8px; background: #e5e7eb; color: #6b7280; font-size: 8px; font-weight: 700; }
.boss-drop-row strong, .boss-drop-row small { display: block; }
.boss-drop-row small { margin-top: .2rem; color: var(--muted, #69707d); }
.boss-work-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.boss-work-list span { padding: .4rem .55rem; border-radius: 999px; background: var(--surface-muted, #f6f7f9); }
.boss-work-list span { display: inline-flex; align-items: center; gap: .35rem; }
.boss-work-icon { width: 22px; height: 22px; }
.boss-work-list b { margin-left: .25rem; color: var(--accent, #d71945); }

@media (max-width: 760px) {
  .boss-reward-grid { grid-template-columns: 1fr; }
}

.summon-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.summon-card > img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border: 1px solid #dddde2;
  border-radius: 12px;
  background: #f4f4f6;
}

.summon-material {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e1e1e6;
  border-radius: 8px;
  background: #f8f8fa;
  font-size: 10px;
}

.boss-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.boss-guide-grid article {
  padding: 14px;
  border: 1px solid #e1e1e6;
  border-radius: 9px;
  background: #f8f8fa;
}

.boss-guide-grid h4 {
  margin: 0 0 6px;
}

.boss-guide-grid p {
  margin: 0;
  color: #5d5d65;
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .team-pal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-pal-card {
    border-bottom: 1px solid #e4e4e8;
  }

  .boss-page-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .boss-detail-hero {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .boss-primary-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .team-category-intro,
  .boss-page-layout,
  .boss-info-grid,
  .boss-stat-grid,
  .boss-guide-grid {
    grid-template-columns: 1fr;
  }

  .team-pal-list {
    grid-template-columns: 1fr;
  }

  .team-pal-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 13px;
    border-right: 0;
  }

  .boss-toolbar {
    display: grid;
  }

  .boss-toolbar input {
    width: 100%;
  }

  .boss-list {
    max-height: 360px;
  }

  .boss-detail-hero {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 15px;
  }

  .boss-detail-image {
    width: 76px;
    height: 76px;
  }

  .boss-detail-hero h2 {
    font-size: 20px;
  }
}

.personalised-team .team-pal-copy {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #17171b !important;
}
.personalised-team .team-pal-card {
  min-height: 210px;
}
.boss-image-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
  color: #55555d;
  font-size: 9px;
  font-weight: 900;
}

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { 
  display: flex; align-items: center; justify-content: space-between; 
  cursor: pointer; user-select: none;
}
.dropdown-icon { 
  display: inline-block; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  font-weight: 800; font-size: 16px; margin-right: 14px; color: var(--muted);
}
.boss-info-card p,
.boss-info-card a {
  color: #56565e;
  font-size: 11px;
  line-height: 1.55;
}

.boss-info-card a {
  color: #d90a2c;
  font-weight: 800;
}

.boss-section {
  padding: 19px;
}

.section-heading h3 {
  margin: 5px 0 15px;
}

.boss-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.boss-stat-grid div {
  padding: 12px;
  border: 1px solid #e1e1e6;
  border-radius: 9px;
  background: #f8f8fa;
}

.boss-stat-grid span {
  display: block;
  color: #66666e;
  font-size: 9px;
}

.boss-stat-grid strong {
  display: block;
  margin-top: 5px;
  color: #17171b;
  font-size: 15px;
}

.summon-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.summon-card > img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border: 1px solid #dddde2;
  border-radius: 12px;
  background: #f4f4f6;
}

.summon-material {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e1e1e6;
  border-radius: 8px;
  background: #f8f8fa;
  font-size: 10px;
}

.boss-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.boss-guide-grid article {
  padding: 14px;
  border: 1px solid #e1e1e6;
  border-radius: 9px;
  background: #f8f8fa;
}

.boss-guide-grid h4 {
  margin: 0 0 6px;
}

.boss-guide-grid p {
  margin: 0;
  color: #5d5d65;
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .team-pal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-pal-card {
    border-bottom: 1px solid #e4e4e8;
  }

  .boss-page-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .boss-detail-hero {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .boss-primary-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .team-category-intro,
  .boss-page-layout,
  .boss-info-grid,
  .boss-stat-grid,
  .boss-guide-grid {
    grid-template-columns: 1fr;
  }

  .team-pal-list {
    grid-template-columns: 1fr;
  }

  .team-pal-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 13px;
    border-right: 0;
  }

  .boss-toolbar {
    display: grid;
  }

  .boss-toolbar input {
    width: 100%;
  }

  .boss-list {
    max-height: 360px;
  }

  .boss-detail-hero {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 15px;
  }

  .boss-detail-image {
    width: 76px;
    height: 76px;
  }

  .boss-detail-hero h2 {
    font-size: 20px;
  }
}

.personalised-team .team-pal-copy {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #17171b !important;
}
.personalised-team .team-pal-card {
  min-height: 210px;
}
.boss-image-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
  color: #55555d;
  font-size: 9px;
  font-weight: 900;
}

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { 
  display: flex; align-items: center; justify-content: space-between; 
  cursor: pointer; user-select: none;
}
.dropdown-icon { 
  display: inline-block; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  font-weight: 800; font-size: 16px; margin-right: 14px; color: var(--muted);
}
.nav-dropdown-menu { 
  display: none; flex-direction: column; padding-left: 20px; 
  background: var(--panel-hover); border-left: 2px solid var(--accent); 
  margin-top: 4px; overflow: hidden; opacity: 0;
}
.nav-dropdown-menu .nav-item {
  min-height: 32px;
  font-size: 10.5px;
  padding: 6px 10px;
}
.nav-dropdown.open .nav-dropdown-menu { 
  display: flex; animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; 
}
.nav-dropdown.open .dropdown-icon { 
  transform: rotate(90deg); color: var(--accent);
}
@keyframes slideDown { 
  from { opacity: 0; transform: translateY(-5px); } 
  to { opacity: 1; transform: translateY(0); } 
}

.passive-rank-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 800; color: #fff;
}
.passive-rank-badge img { width: auto; height: 11px; }
.passive-rank-badge.rank-1, .passive-rank-badge.rank-2 { background: #55555e; }
.passive-rank-badge.rank-3, .passive-rank-badge.rank-4, .passive-rank-badge.rank-5 { background: #d9aa0a; color: #fff; box-shadow: 0 0 8px rgba(217, 170, 10, 0.4); }
.passive-rank-badge.rank--1, .passive-rank-badge.rank--2, .passive-rank-badge.rank--3 { background: #d90a2c; }

/* ===== TASK 3: PALWORLD PASSIVE SKILL VISUALS ===== */
.passive-db-card {
  overflow: hidden;
  border: 1px solid #c9cbd2;
  background: #fff;
}

.passive-db-card .passive-game-banner {
  --passive-accent: #8a8d96;
  --passive-bg-a: #4b4e56;
  --passive-bg-b: #2b2e35;
  position: relative;
  min-height: 34px;
  padding: 6px 42px 6px 12px;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  border-left: 4px solid var(--passive-accent);
  border-right: 1px solid var(--passive-accent);
  border-top: 1px solid var(--passive-accent);
  border-bottom: 1px solid var(--passive-accent);
  background: linear-gradient(90deg, var(--passive-bg-a), var(--passive-bg-b));
}

.passive-db-card .passive-game-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .34;
  background-image: url('/pal-atlas/assets/images/items/T_prt_pal_skill_base_02.png');
  background-repeat: repeat-x;
  background-size: auto 100%;
  animation: palPassivePattern 8s linear infinite;
}

.passive-db-card .passive-game-banner::after {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -35%;
  width: 24%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.48), transparent);
}

.passive-db-card.rank-5 .passive-game-banner::after,
.passive-db-card.rank-4 .passive-game-banner::after {
  opacity: .65;
  animation: palPassiveShimmer 3.4s ease-in-out infinite;
}

.passive-db-card .passive-game-banner h3 {
  margin: 0;
  color: #f7f7f8;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
}

.passive-game-rank-arrow {
  position: absolute;
  z-index: 2;
  right: 8px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.7));
}

.passive-db-card.rank-5 .passive-game-banner {
  --passive-accent: #44fff2;
  --passive-bg-a: #236d68;
  --passive-bg-b: #2b2578;
  box-shadow: inset 0 0 12px rgba(68,255,242,.18);
}
.passive-db-card.rank-4 .passive-game-banner {
  --passive-accent: #4ff6e6;
  --passive-bg-a: #205c5e;
  --passive-bg-b: #263974;
}
.passive-db-card.rank-3 .passive-game-banner {
  --passive-accent: #ffe900;
  --passive-bg-a: #665b0a;
  --passive-bg-b: #332d08;
}
.passive-db-card.rank-2 .passive-game-banner {
  --passive-accent: #82a8ff;
  --passive-bg-a: #3d526d;
  --passive-bg-b: #252d3b;
}
.passive-db-card.rank-1 .passive-game-banner {
  --passive-accent: #aeb4be;
  --passive-bg-a: #50545d;
  --passive-bg-b: #30333a;
}
.passive-db-card.rank-0 .passive-game-banner {
  --passive-accent: #8e929b;
  --passive-bg-a: #43464d;
  --passive-bg-b: #292c31;
}
.passive-db-card.rank-neg-1 .passive-game-banner,
.passive-db-card.rank-neg-2 .passive-game-banner,
.passive-db-card.rank-neg-3 .passive-game-banner {
  --passive-accent: #ff7395;
  --passive-bg-a: #643242;
  --passive-bg-b: #35262d;
}
.passive-db-card.rank-neg-2 .passive-game-banner { --passive-accent: #ff527d; }
.passive-db-card.rank-neg-3 .passive-game-banner { --passive-accent: #ff315f; }

.passive-db-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 12px 0;
}

.passive-source-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #d5d7dd;
  border-radius: 999px;
  background: #f4f4f6;
  color: #454850;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .05em;
}

.passive-source-tag.source-world-tree {
  border-color: #3fd8c7;
  background: #e9fbf8;
  color: #146b62;
}
.passive-source-tag.source-mutation {
  border-color: #bf66d8;
  background: #f8eefb;
  color: #77328b;
}
.passive-source-tag.source-lucky {
  border-color: #e8b83d;
  background: #fff8df;
  color: #765b12;
}
.passive-source-tag.source-special {
  border-color: #858a96;
  background: #f0f1f3;
  color: #4c5058;
}
.passive-source-tag.source-equipment {
  border-color: #ad7f34;
  background: #faf3e6;
  color: #6e4c16;
}
.passive-source-tag.source-category {
  background: #fff;
}

@keyframes palPassivePattern {
  from { background-position: 0 0; }
  to { background-position: 264px 0; }
}

@keyframes palPassiveShimmer {
  0%, 18% { left: -35%; opacity: 0; }
  25% { opacity: .65; }
  55% { left: 112%; opacity: .35; }
  56%, 100% { left: 112%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .passive-db-card .passive-game-banner::before,
  .passive-db-card .passive-game-banner::after {
    animation: none !important;
  }
}


/* ===== TASK 3 FINAL USER-SUPPLIED RANK/SOURCE MAPPING ===== */

.passive-db-card .passive-game-banner::before,
.passive-db-card .passive-game-banner::after {
  animation: none !important;
}

.passive-db-card.rank-4 .passive-game-banner::before,
.passive-db-card.rank-5 .passive-game-banner::before {
  animation: palPassivePattern 8s linear infinite !important;
}

.passive-db-card.rank-4 .passive-game-banner::after,
.passive-db-card.rank-5 .passive-game-banner::after {
  opacity: .65;
  animation: palPassiveShimmer 3.4s ease-in-out infinite !important;
}

.passive-db-card.rank-neg-1 .passive-game-banner,
.passive-db-card.rank-neg-2 .passive-game-banner,
.passive-db-card.rank-neg-3 .passive-game-banner {
  --passive-accent: #ff315f !important;
  --passive-bg-a: #8c2441 !important;
  --passive-bg-b: #3a1422 !important;
  border-color: rgba(255,49,95,.7) !important;
}

.passive-banner-right {
  position: absolute;
  z-index: 5;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
}

.passive-banner-right .passive-game-rank-arrow {
  position: static !important;
  transform: none !important;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.passive-banner-right .negative-rank-arrow {
  transform: rotate(180deg) !important;
  filter: sepia(1) saturate(9) hue-rotate(300deg) brightness(1.12) contrast(1.08);
}

.passive-origin-icon {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(139,112,255,.7);
  background: linear-gradient(145deg, rgba(72,92,214,.92), rgba(132,64,204,.92));
  box-shadow: 0 0 9px rgba(111,82,230,.28);
}

.passive-origin-icon svg {
  width: 17px;
  height: 17px;
  fill: #f4f3ff;
}

.mutation-origin {
  background: linear-gradient(145deg, rgba(48,106,218,.95), rgba(130,55,204,.95));
}

.passive-db-source-row {
  padding-bottom: 13px !important;
  margin-bottom: 3px !important;
}

.passive-db-card .passive-game-banner {
  padding-right: 112px;
}

@media (prefers-reduced-motion: reduce) {
  .passive-db-card.rank-4 .passive-game-banner::before,
  .passive-db-card.rank-5 .passive-game-banner::before,
  .passive-db-card.rank-4 .passive-game-banner::after,
  .passive-db-card.rank-5 .passive-game-banner::after {
    animation: none !important;
  }
}


/* ===== TASK 3 UI CLEANUP ===== */

/* Give filter selects enough room for their full labels. */
.passive-db-controls select,
.passive-db-toolbar select,
#passive-db-category,
#passive-db-availability,
#passive-db-rank,
#passive-db-sort {
  min-width: 170px;
  width: auto;
  max-width: 220px;
  padding-right: 34px;
  text-overflow: clip;
  white-space: nowrap;
}

#passive-db-availability {
  min-width: 190px;
}

@media (max-width: 760px) {
  .passive-db-controls select,
  .passive-db-toolbar select,
  #passive-db-category,
  #passive-db-availability,
  #passive-db-rank,
  #passive-db-sort {
    min-width: 150px;
    max-width: 100%;
  }
}

/* Negative passives: red text treatment across the whole card. */
.passive-db-card.rank-neg-1,
.passive-db-card.rank-neg-2,
.passive-db-card.rank-neg-3 {
  color: #b7193f;
}

.passive-db-card.rank-neg-1 .passive-game-banner,
.passive-db-card.rank-neg-2 .passive-game-banner,
.passive-db-card.rank-neg-3 .passive-game-banner {
  --passive-accent: #ff315f !important;
  --passive-bg-a: #8e203c !important;
  --passive-bg-b: #3d111f !important;
  border-color: #ff315f !important;
}

.passive-db-card.rank-neg-1 .passive-game-banner .passive-name,
.passive-db-card.rank-neg-2 .passive-game-banner .passive-name,
.passive-db-card.rank-neg-3 .passive-game-banner .passive-name,
.passive-db-card.rank-neg-1 .passive-game-banner strong,
.passive-db-card.rank-neg-2 .passive-game-banner strong,
.passive-db-card.rank-neg-3 .passive-game-banner strong,
.passive-db-card.rank-neg-1 .passive-db-effects,
.passive-db-card.rank-neg-2 .passive-db-effects,
.passive-db-card.rank-neg-3 .passive-db-effects,
.passive-db-card.rank-neg-1 .passive-db-effects *,
.passive-db-card.rank-neg-2 .passive-db-effects *,
.passive-db-card.rank-neg-3 .passive-db-effects * {
  color: #d71946 !important;
}

/* Red overlay/tint for negative rank icons. */
.passive-db-card.rank-neg-1 .negative-rank-arrow,
.passive-db-card.rank-neg-2 .negative-rank-arrow,
.passive-db-card.rank-neg-3 .negative-rank-arrow {
  filter:
    brightness(0)
    saturate(100%)
    invert(18%)
    sepia(98%)
    saturate(5864%)
    hue-rotate(336deg)
    brightness(97%)
    contrast(102%) !important;
}

/* Remove any leftover empty metadata region spacing. */
.passive-db-meta,
.passive-db-stats {
  display: none !important;
}

.passive-db-card .passive-db-effects {
  margin-bottom: 14px;
}


/* ===== PASSIVE FILTER BAR REDESIGN ===== */

.passive-db-controls {
  padding: 14px 16px !important;
  overflow: visible;
}

.passive-filter-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 170px 180px 140px 160px auto;
  gap: 10px;
  align-items: end;
}

.passive-search-field,
.passive-filter-field {
  min-width: 0;
}

.passive-filter-field {
  display: grid;
  gap: 6px;
}

.passive-filter-field label {
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #666973;
}

.passive-filter-grid input,
.passive-filter-grid select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 42px;
  padding: 0 38px 0 13px;
  border: 1px solid #cfd1d8;
  border-radius: 8px;
  background: #fff;
  color: #1c1c21;
  font: inherit;
  white-space: nowrap;
  text-overflow: clip;
  box-sizing: border-box;
}

.passive-filter-grid input {
  padding-right: 13px;
}

.passive-filter-grid select {
  appearance: auto;
}

.passive-filter-grid input:focus,
.passive-filter-grid select:focus {
  outline: none;
  border-color: #9a9daa;
  box-shadow: 0 0 0 3px rgba(25, 28, 36, .06);
}

.passive-filter-reset {
  height: 42px;
  min-width: 86px;
  align-self: end;
}

@media (max-width: 1180px) {
  .passive-filter-grid {
    grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(150px, 1fr));
  }

  .passive-filter-reset {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .passive-filter-grid {
    grid-template-columns: 1fr;
  }

  .passive-filter-grid input,
  .passive-filter-grid select,
  .passive-filter-reset {
    width: 100% !important;
  }
}


/* ===== WORLD TREE + FILTER CLEANUP ===== */

.passive-filter-grid {
  grid-template-columns: minmax(360px, 1fr) 180px 190px 145px auto !important;
}

@media (max-width: 1180px) {
  .passive-filter-grid {
    grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(160px, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .passive-filter-grid {
    grid-template-columns: 1fr !important;
  }
}


/* HF41: Fishing Guide readability on the light site theme */
.fishing-guide-card {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.fishing-guide-card:last-child { margin-bottom: 0; }
.fishing-guide-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}
.fishing-guide-list li::marker {
  color: #d90a2c;
}
.fishing-guide-term {
  color: var(--text);
  font-weight: 800;
}


/* PAL ATLAS GUIDE RED FILL HOTFIX 20260811 */
.guide-v3-nav button:hover,
.guide-v3-nav button.is-active {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
}

.guide-v3-step:before {
  background: var(--red) !important;
  color: #fff !important;
}

.guide-v3-tools {
  background: var(--red) !important;
  color: #fff !important;
}

.guide-v3-tools h2 {
  color: #fff !important;
}

.guide-v3-tools p {
  color: rgba(255,255,255,.84) !important;
}

.guide-v3-tools .guide-v3-actions a {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.35) !important;
  color: #fff !important;
}

.guide-v3-tools .guide-v3-actions a:hover {
  background: rgba(255,255,255,.22) !important;
  border-color: rgba(255,255,255,.55) !important;
}


/* PAL ATLAS FISHING GUIDE RED HOTFIX 20260811 */
.fish-step:before {
  background: var(--red) !important;
  color: #fff !important;
}

.fish-tip {
  background: var(--red) !important;
  color: #fff !important;
}

.fish-tip b {
  color: #fff !important;
}

.fish-tip span {
  color: rgba(255,255,255,.88) !important;
}


/* PAL ATLAS SPAWN MAP/TIME HOTFIX 20260812 */
.pal-spawn-map-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.pal-spawn-map-actions .button{white-space:nowrap}
@media(max-width:760px){.pal-spawn-map-actions{width:100%;justify-content:flex-start}.pal-spawn-map-actions .button{flex:1 1 180px}}


/* Pal detail layout 20260812-1434-paldetail5 */
.profile-partner-grid {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  min-width: 0;
}
.profile-partner-grid > .detail-panel {
  min-width: 0;
  margin: 0 !important;
}
.profile-partner-grid .partner-panel {
  align-self: stretch;
}
.partner-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.partner-panel-heading h4 {
  margin: 0;
}
.partner-mode {
  padding: 3px 7px;
  border: 1px solid #d8d9df;
  border-radius: 999px;
  background: #f4f4f6;
  color: #55555f;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.partner-skill-name {
  display: block;
  margin: 0 0 8px;
  color: #111114 !important;
  font-size: 16px !important;
}
.partner-panel p {
  margin: 0;
  color: #4d4d55 !important;
  font-size: 10px;
  line-height: 1.65;
}
.partner-rank-note-inline {
  display: block;
  margin-top: 9px;
  color: #73737b;
  font-size: 8px;
  line-height: 1.5;
}
.pal-drops-panel {
  grid-column: 1 / -1 !important;
}
.pal-drops-panel .pal-drop-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}
.pal-drops-panel .pal-drop-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-width: 0;
}
.pal-drops-panel .pal-drop-row strong {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0;
}
.pal-drops-panel .pal-drop-row strong > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pal-drops-panel .pal-drop-row .pal-drop-name {
  display: inline-block !important;
  color: #16161b !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.drop-item-image {
  display: block !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  flex: 0 0 38px !important;
  object-fit: contain !important;
  border-radius: 6px;
}
.drop-item-missing {
  display: block !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  flex: 0 0 38px !important;
  border: 1px solid #d9d9df;
  border-radius: 6px;
  background: #f4f4f6;
}
@media (max-width: 720px) {
  .profile-partner-grid,
  .pal-drops-panel .pal-drop-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Global readability pass - body/copy text only.
   Headings, section titles and large numeric values are intentionally unchanged. */

.page-heading p,
.hero-copy p,
.notice,
.empty-state p,
.result-placeholder p,
.recommendation-body p,
.recommendation-control-row p,
.recommendation-summary p,
.target-summary-pal p,
.team-summary p,
.team-pal-reason,
.import-option-card > p,
.save-drop > span,
.save-location-help p,
.local-processing-note,
.privacy-copy p,
.privacy-copy li {
  font-size: 13px !important;
  line-height: 1.62 !important;
}

.pal-detail-title p,
.detail-loading-panel p,
.partner-panel p,
.partner-panel > p,
.location-card p,
.skill-card p {
  font-size: 12px !important;
  line-height: 1.62 !important;
}

.info-row,
.quick-item span,
.quick-item strong,
.parent-pal,
.breed-parent,
.recommendation-body,
.team-status-copy,
label {
  font-size: 12px !important;
}

.work-item,
.drop-list strong,
.pal-drops-panel .pal-drop-row strong,
.pal-drops-panel .pal-drop-row > span,
.skill-card strong,
.skill-disclosure > summary,
.inventory-pill,
.button,
.link-button {
  font-size: 11.5px !important;
}

.drop-list span,
.skill-card > div:first-child span,
.skill-metrics span,
.detail-source-line,
.stat-note,
.location-card .meta,
.save-location-help summary,
.save-location-help code {
  font-size: 10.5px !important;
}

.pal-card-footer span,
.tier-list-summary,
.tier-section-heading span,
.score-line,
.partner-rank-note-inline,
.partner-mode,
.stat-label {
  font-size: 10px !important;
}

/* Generic copy inside content panels that previously inherited very small text. */
.detail-panel p:not(.eyebrow),
.detail-panel li,
.panel p:not(.eyebrow),
.panel li,
.card p:not(.eyebrow),
.card li {
  font-size: max(12px, 1em);
  line-height: 1.6;
}

/* Preserve compact metadata/badges while making descriptive text readable. */
.meta-badge,
.element-badge,
.tier-badge,
.owned-badge,
.eyebrow,
.detail-panel h4,
.stat-label {
  line-height: 1.35;
}

@media (max-width: 720px) {
  .page-heading p,
  .hero-copy p,
  .notice,
  .empty-state p,
  .result-placeholder p,
  .recommendation-body p,
  .recommendation-control-row p,
  .recommendation-summary p,
  .target-summary-pal p,
  .team-summary p,
  .team-pal-reason,
  .import-option-card > p,
  .save-drop > span,
  .save-location-help p,
  .privacy-copy p,
  .privacy-copy li {
    font-size: 12.5px !important;
  }

  .info-row,
  .pal-detail-title p,
  .detail-loading-panel p,
  .partner-panel p,
  .location-card p,
  .skill-card p {
    font-size: 11.5px !important;
  }
}


/* Unified Pal Atlas loading and detail disclosure. */
.pal-atlas-loading-overlay,
.pal-atlas-boot-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(240px, 62vh, 720px);
  padding: 32px 18px;
  box-sizing: border-box;
  background: #050507 !important;
  color: #fff !important;
  text-align: center;
  border-radius: 10px;
}
.pal-atlas-loading-overlay.is-compact {
  min-height: 220px;
}
.pal-atlas-loading-overlay strong,
.pal-atlas-boot-loader strong {
  color: #fff !important;
  font-size: clamp(18px, 2.2vw, 28px);
  text-transform: none;
  letter-spacing: .01em;
}
.pal-atlas-loading-overlay small,
.pal-atlas-boot-loader small {
  color: #b8b8c0 !important;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 5px;
}
.pal-atlas-loading-overlay .pal-atlas-loading-flipbook,
.pal-atlas-boot-loader .pal-atlas-loading-flipbook {
  margin: 0 0 14px;
}
.detail-more-details > summary {
  list-style: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.detail-more-details > summary::-webkit-details-marker { display: none !important; }
.detail-more-details > summary::marker { content: '' !important; }
.detail-more-details > summary::after { content: none !important; display: none !important; }


/* Pal Atlas loading presentation and viewport coverage. */
.pal-atlas-content {
  position: relative;
  min-width: 0;
  min-height: calc(100dvh - var(--pa-header-offset));
}
.view-container {
  min-width: 0;
  min-height: calc(100dvh - var(--pa-header-offset));
}
.view-container.is-loading {
  padding: 0 !important;
  max-width: none !important;
}
.view-container.is-loading > .pal-atlas-loading-overlay {
  min-height: calc(100dvh - var(--pa-header-offset)) !important;
  border-radius: 0 !important;
}
/* Route loader is viewport-fixed so sidebar scroll/expanded menu height cannot move it. */
.pal-atlas-route-loader {
  position: fixed !important;
  z-index: 120;
  top: var(--pa-header-offset) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--pa-sidebar) !important;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: all;
  overflow: hidden;
  background: #050507;
}
.pal-atlas-route-loader > .pal-atlas-loading-overlay {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  padding: clamp(24px, 4vh, 48px) 18px;
  border-radius: 0 !important;
}
@media (max-width: 900px) {
  .pal-atlas-content,
  .view-container { min-height: calc(100dvh - var(--pa-header-offset)); }
  .pal-atlas-route-loader {
    left: 0 !important;
    top: var(--pa-header-offset) !important;
  }
  .pal-atlas-route-loader > .pal-atlas-loading-overlay {
    min-height: 0 !important;
  }
}


/* 2026-08-19 cumulative UI/UX refinement */
.raid-guaranteed-egg{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff;}
.raid-guaranteed-egg img,.raid-guaranteed-egg .raid-egg-fallback{width:64px;height:64px;object-fit:contain;flex:0 0 64px;}
.raid-guaranteed-egg div{min-width:0;flex:1;}
.raid-guaranteed-egg strong{display:block;font-size:15px;}
.raid-guaranteed-egg p{margin:4px 0 0;color:var(--muted);}
.raid-guaranteed-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 9px;border-radius:999px;background:var(--accent);color:#fff;font-size:9px;font-weight:900;letter-spacing:.06em;}
.raid-outcome-heading{margin-top:18px;}
.rich-item-data-panel>.info-list{margin-top:2px;}

/* Keep dense toolbars usable on every width without text escaping cards. */
.toolbar,.data-toolbar,.tier-controls .toolbar,.recommendation-control-row{min-width:0;}
.toolbar>* ,.data-toolbar>* ,.tier-controls .toolbar>*{min-width:0;}
.panel,.detail-panel,.entity-card,.pal-card,.dx-card{min-width:0;overflow-wrap:anywhere;}
input,select,button{max-width:100%;}

@media (max-width:1200px){
  .tier-controls .toolbar{display:grid!important;grid-template-columns:minmax(220px,1.5fr) repeat(2,minmax(150px,1fr));gap:10px;}
  .tier-controls .toolbar .toggle-control{align-self:end;}
}
@media (max-width:900px){
  .tier-controls .toolbar{grid-template-columns:1fr 1fr;}
  .recommendation-control-row{gap:12px;}
  .raid-reward-columns,.raid-egg-grid{grid-template-columns:1fr!important;}
  .modal-card{max-width:calc(100vw - 20px)!important;}
}
@media (max-width:620px){
  .tier-controls .toolbar{grid-template-columns:1fr;}
  .page-heading h2{font-size:clamp(30px,10vw,46px)!important;line-height:.98;}
  .page-heading{gap:12px;}
  .panel{border-radius:10px;}
  .button{min-height:42px;}
  .raid-guaranteed-egg{align-items:flex-start;flex-wrap:wrap;}
  .raid-guaranteed-badge{margin-left:78px;}
}


/* V10: readable drop names on dark Pal detail panels. */
.pal-drops-panel .pal-drop-row,
.pal-drops-panel .pal-drop-row strong,
.pal-drops-panel .pal-drop-row strong > span,
.pal-drops-panel .pal-drop-row .pal-drop-name,
.pal-drops-panel .pal-drop-row > span,
.pal-drops-panel .pal-drop-row small {
  color: #fff !important;
  opacity: 1 !important;
}
