:root {
    color-scheme: dark;
    --bg: #08100d;
    --bg-2: #0b1612;
    --panel: #11221a;
    --panel-2: #132920;
    --line: #1c3328;
    --line-strong: #2b5544;
    --text: #dbe7df;
    --muted: #8ba096;
    --soft: #4f675b;
    --gold: #e2b443;
    --gold-2: #f1ca63;
    --red: #e15353;
    --blue: #65a8ff;
    --green: #44c982;
    --orange: #f19a47;
    --pink: #e77ab7;
    --purple: #9b87ff;
    --slate: #9aa7b7;
    --shadow: 0 16px 38px rgba(0, 0, 0, .34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(120, 211, 255, .03) 1px, transparent 1px),
        linear-gradient(0deg, rgba(226, 180, 67, .025) 1px, transparent 1px),
        var(--bg);
    background-size: 32px 32px, 32px 32px, auto;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input {
    font: inherit;
}

select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.pc-nav-icon,
.pc-search-icon,
.panel-glyph,
.legend-dot,
.pin,
.detail-emblem,
.npc-avatar {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.icon-target-reticle { background-image: url("../images/ui-icons/target-reticle.png"); }
.icon-shop-bag { background-image: url("../images/ui-icons/shop-bag.png"); }
.icon-trainer-badge { background-image: url("../images/ui-icons/trainer-badge.png"); }
.icon-item-bottle { background-image: url("../images/ui-icons/item-bottle.png"); }
.icon-checklist { background-image: url("../images/ui-icons/checklist.png"); }
.icon-layer-stack { background-image: url("../images/ui-icons/layer-stack.png"); }
.icon-search-lens { background-image: url("../images/ui-icons/search-lens.png"); }
.icon-signpost { background-image: url("../images/ui-icons/signpost.png"); }
.icon-exit-up { background-image: url("../images/ui-icons/exit-up.png"); }
.icon-stairs-route { background-image: url("../images/ui-icons/stairs-route.png"); }
.icon-elevator-warp { background-image: url("../images/ui-icons/elevator-warp.png"); }
.icon-note-board { background-image: url("../images/ui-icons/note-board.png"); }
.icon-map-pin { background-image: url("../images/ui-icons/map-pin.png"); }
.icon-map-grid { background-image: url("../images/ui-icons/map-grid.png"); }
.icon-guide-card { background-image: url("../images/ui-icons/guide-card.png"); }
.icon-dialog-card { background-image: url("../images/ui-icons/dialog-card.png"); }
.icon-moon-phase { background-image: url("../images/ui-icons/moon-phase.png"); }
.icon-route-gate { background-image: url("../images/ui-icons/route-gate.png"); }
.icon-building { background-image: url("../images/ui-icons/building.png"); }
.icon-ticket-pass { background-image: url("../images/ui-icons/ticket-pass.png"); }
.icon-toggle-on { background-image: url("../images/ui-icons/toggle-on.png"); }
.icon-toggle-off { background-image: url("../images/ui-icons/toggle-off.png"); }
.icon-route-path { background-image: url("../images/ui-icons/route-path.png"); }
.icon-radar-lens { background-image: url("../images/ui-icons/radar-lens.png"); }
.icon-nav-map { background-image: url("../images/ui-icons/nav-map.png"); }
.icon-nav-pokedex { background-image: url("../images/ui-icons/nav-pokedex.png"); }
.icon-nav-gyms { background-image: url("../images/ui-icons/nav-gyms.png"); }
.icon-nav-guides { background-image: url("../images/ui-icons/nav-guides.png"); }
.icon-nav-trainers { background-image: url("../images/ui-icons/nav-trainers.png"); }
.icon-nav-items { background-image: url("../images/ui-icons/nav-items.png"); }
.icon-nav-moves { background-image: url("../images/ui-icons/nav-moves.png"); }
.icon-nav-walkthrough { background-image: url("../images/ui-icons/nav-walkthrough.png"); }

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1411;
}

::-webkit-scrollbar-thumb {
    background: #284e3e;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #376954;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pc-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pc-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 16px;
    background: rgba(17, 34, 26, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
    backdrop-filter: blur(14px);
}

.pc-topbar-left,
.pc-topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.pc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.pc-brand img {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.pc-brand-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pc-brand-tag {
    width: fit-content;
    padding: 1px 6px 2px;
    border-radius: 4px;
    background: var(--gold);
    color: #08100d;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.pc-brand-title {
    color: #fff;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.1;
}

.pc-nav,
.pc-nav-link {
    display: flex;
    align-items: center;
}

.pc-nav {
    gap: 6px;
    min-width: 0;
}

.pc-nav-link {
    gap: 7px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #a7b9b0;
    white-space: nowrap;
}

.pc-nav-link:hover,
.pc-nav-link.is-active {
    color: #fff;
    background: #1a3529;
    border-color: rgba(226, 180, 67, .34);
}

.pc-nav-link.is-active {
    color: var(--gold);
}

.pc-nav-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}

.pc-search {
    position: relative;
    width: min(330px, 26vw);
    min-width: 220px;
}

.pc-search input,
.section-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0b1612;
    color: var(--text);
    outline: none;
}

.pc-search input {
    height: 34px;
    padding: 0 12px 0 36px;
    font-size: 13px;
}

.pc-search input:focus,
.section-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(226, 180, 67, .16);
}

.pc-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    opacity: .94;
}

.pc-search-icon::after {
    content: none;
}

.micro-button,
.panel-link-button,
.ghost-button,
.gold-outline,
.gold-fill,
.icon-button,
.deck-actions button,
.section-search button,
.jump-grid button,
.chip-cloud button,
.floor-grid button,
.encounter-tabs button,
.time-tabs button,
.split-actions button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0b1612;
    color: #cbd8d1;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.micro-button:hover,
.panel-link-button:hover,
.ghost-button:hover,
.gold-outline:hover,
.icon-button:hover,
.deck-actions button:hover,
.section-search button:hover,
.jump-grid button:hover,
.chip-cloud button:hover,
.floor-grid button:hover,
.encounter-tabs button:hover,
.time-tabs button:hover,
.split-actions button:hover {
    border-color: var(--line-strong);
    background: #12281f;
    color: #fff;
}

.pc-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: #2c3c35;
    flex: 0 0 auto;
}

.pc-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d7e2dc;
    transition: transform .16s ease, background .16s ease;
}

.toggle-row.is-on .pc-switch {
    background: #2d9863;
}

.toggle-row.is-on .pc-switch span {
    transform: translateX(12px);
    background: #fff;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    padding: 0;
}

.icon-button.small {
    width: 28px;
    min-height: 28px;
}

.pc-main {
    flex: 1;
}

.map-workbench {
    display: grid;
    grid-template-columns: minmax(230px, 260px) minmax(480px, 1fr) minmax(250px, 292px) minmax(180px, 210px);
    gap: 12px;
    padding: 12px;
    min-height: calc(100vh - 58px);
}

.left-rail,
.right-rail,
.map-stage-column {
    min-width: 0;
}

.left-rail,
.right-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 82px);
    overflow: auto;
}

.left-rail > .tool-panel,
.left-rail > .deck-panel,
.right-rail > .tool-panel,
.right-rail > .deck-panel {
    flex-shrink: 0;
}

.right-rail > .tool-panel,
.right-rail > .deck-panel {
    position: relative;
    isolation: isolate;
}

.right-rail > .grow-panel {
    flex: 0 0 auto;
}

.map-stage-column {
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 8px;
    min-height: 0;
}

.tool-panel,
.deck-panel,
.map-toolbar,
.address-rail,
.list-hero,
.article-shell {
    background: rgba(17, 34, 26, .96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tool-panel,
.deck-panel {
    padding: 12px;
}

.grow-panel {
    flex: 1 1 auto;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.panel-title-row h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
}

.panel-glyph {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .36));
}

.micro-button {
    min-height: 24px;
    padding: 2px 7px;
    color: #8ba096;
    font-size: 11px;
}

.toggle-list {
    display: grid;
    gap: 8px;
}

.toggle-list.compact {
    gap: 7px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #cbd8d1;
    text-align: left;
}

.toggle-row:hover {
    background: transparent;
    color: #fff;
}

.toggle-row > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.legend-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3));
}

.dot-red { background-image: url("../images/ui-icons/exit-up.png"); }
.dot-blue { background-image: url("../images/ui-icons/shop-bag.png"); }
.dot-orange { background-image: url("../images/ui-icons/trainer-badge.png"); }
.dot-gold { background-image: url("../images/ui-icons/item-bottle.png"); }
.dot-green { background-image: url("../images/ui-icons/dialog-card.png"); }
.dot-pink { background-image: url("../images/ui-icons/checklist.png"); }
.dot-purple { background-image: url("../images/ui-icons/elevator-warp.png"); }
.dot-slate { background-image: url("../images/ui-icons/layer-stack.png"); }

.panel-link-button {
    width: 100%;
    min-height: 28px;
    margin-top: 10px;
    color: #8ba096;
    font-size: 12px;
}

.panel-data-note {
    margin: 10px 0 0;
    color: #75867d;
    font-size: 11px;
}

.panel-data-note-strong {
    color: #c7d6cf;
}

.panel-data-note.is-warning,
.panel-data-note-strong.is-warning {
    color: #f1ca63;
}

.start-panel {
    gap: 0;
}

.start-panel-lead {
    margin: 0;
    color: #c7d6cf;
    font-size: 13px;
    line-height: 1.5;
}

.start-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.start-panel-actions a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.start-panel-grid {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.start-task-card {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(226, 180, 67, .18);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(24, 45, 35, .98), rgba(11, 22, 18, .94));
    text-align: left;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.start-task-card strong {
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.start-task-card span {
    color: #95a79d;
    font-size: 12px;
    line-height: 1.4;
}

.start-task-card:hover {
    border-color: rgba(226, 180, 67, .5);
    background:
        linear-gradient(180deg, rgba(29, 53, 41, .98), rgba(12, 24, 19, .96));
    transform: translateY(-1px);
}

.start-panel-steps {
    margin: 12px 0 0;
    padding-left: 18px;
    color: #8fa39a;
    font-size: 12px;
    line-height: 1.55;
}

.start-panel-steps li + li {
    margin-top: 5px;
}

.select-shell {
    display: block;
}

.select-shell select {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0b1612;
    color: #dbe7df;
    outline: none;
}

.select-shell select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(226, 180, 67, .16);
}

.opacity-control {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    color: #aabbb2;
    font-size: 12px;
}

.opacity-control > span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.opacity-control strong {
    color: var(--gold);
}

.opacity-control input {
    width: 100%;
    accent-color: var(--gold);
}

.jump-group + .jump-group {
    margin-top: 12px;
}

.jump-group p {
    margin: 0 0 7px;
    color: #75867d;
    font-size: 12px;
    font-weight: 750;
}

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

.jump-grid button,
.chip-cloud button,
.floor-grid button {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 12px;
}

.jump-grid button {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 2px;
    text-align: left;
}

.jump-grid button strong {
    display: block;
    min-width: 0;
    font-size: 12px;
    line-height: 1.2;
}

.jump-grid button span {
    color: #7f9388;
    font-size: 11px;
    line-height: 1.15;
}

.jump-grid button.is-selected span {
    color: rgba(8, 16, 13, .76);
}

.chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-cloud button {
    color: #b7c7bf;
}

.chip-cloud button.is-selected,
.floor-grid button.is-selected,
.time-tabs button.is-selected {
    border-color: rgba(226, 180, 67, .72);
    background: #e2b443;
    color: #08100d;
    font-weight: 850;
}

.floor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.floor-grid .wide {
    grid-column: span 2;
}

.floor-grid button {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 40px;
    padding: 7px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.notes-panel {
    min-height: 320px;
}

.note-editor {
    display: grid;
    gap: 10px;
    margin: 12px 0 14px;
}

.note-field {
    display: grid;
    gap: 6px;
    color: #d0ddd7;
    font-size: 12px;
}

.note-field input,
.note-field textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(226, 180, 67, .18);
    border-radius: 7px;
    background: #0b1612;
    color: #eef5f1;
    font: inherit;
    box-sizing: border-box;
}

.note-field textarea {
    min-height: 88px;
    resize: vertical;
}

.note-form-meta {
    margin: -2px 0 0;
    color: #7f9388;
    font-size: 11px;
    line-height: 1.35;
}

.note-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.note-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.note-item {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(10, 19, 15, .82);
}

.note-item.is-selected {
    border-color: rgba(226, 180, 67, .72);
    box-shadow: inset 0 0 0 1px rgba(226, 180, 67, .26);
}

.note-summary {
    display: grid;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.note-summary strong,
.note-summary p,
.note-summary small {
    min-width: 0;
    margin: 0;
}

.note-summary strong {
    color: #f2f6f3;
    font-size: 13px;
}

.note-summary p {
    color: #bfccc6;
    font-size: 12px;
    line-height: 1.35;
}

.note-summary small {
    color: #7f9388;
    font-size: 11px;
}

.note-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.note-actions button {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.note-empty {
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #7f9388;
    font-size: 12px;
}

.address-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(89, 118, 103, .32);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(18, 37, 29, .98), rgba(10, 20, 16, .94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .03),
        0 10px 22px rgba(0, 0, 0, .16);
}

.address-card.is-selected {
    border-color: rgba(226, 180, 67, .8);
    box-shadow:
        inset 0 0 0 1px rgba(226, 180, 67, .22),
        0 12px 26px rgba(0, 0, 0, .2);
}

.address-summary {
    display: grid;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.address-summary strong,
.address-summary span,
.address-summary small {
    min-width: 0;
}

.address-summary strong {
    color: #f2f6f3;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.address-summary span {
    color: #c8d4ce;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-summary small {
    color: #7f9388;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.address-actions button {
    min-height: 28px;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 8px;
}

.address-empty {
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #7f9388;
    font-size: 12px;
    text-align: center;
}

.address-rail [data-address-list].is-compact {
    gap: 6px;
}

.address-rail [data-address-list].is-compact .address-card {
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
}

.address-rail [data-address-list].is-compact .address-summary {
    gap: 4px;
}

.address-rail [data-address-list].is-compact .address-summary strong {
    font-size: 13px;
}

.address-rail [data-address-list].is-compact .address-summary span {
    font-size: 11px;
}

.address-rail [data-address-list].is-compact .address-summary small {
    font-size: 10px;
}

.address-rail [data-address-list].is-compact .address-actions button {
    min-height: 26px;
    padding: 5px 6px;
    font-size: 11px;
}

.activity-panel time {
    color: #63766c;
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
    white-space: normal;
}

.map-toolbar {
    position: sticky;
    top: 64px;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 9px;
    background: rgba(17, 34, 26, .98);
    backdrop-filter: blur(10px);
}

.breadcrumb-strip,
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.breadcrumb-strip {
    color: #98aaa1;
    font-size: 13px;
    overflow: hidden;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.breadcrumb-sep,
.breadcrumb-list strong,
.breadcrumb-list button {
    white-space: nowrap;
}

.breadcrumb-list strong,
.gold-text {
    color: var(--gold);
}

.crumb-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #c8d7d0;
    cursor: pointer;
}

.crumb-button:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.green-text {
    color: var(--green);
}

.ghost-button,
.gold-outline,
.gold-fill {
    padding: 5px 9px;
    white-space: nowrap;
}

.gold-outline {
    color: var(--gold);
    border-color: rgba(226, 180, 67, .42);
    background: #1a3529;
}

.gold-fill {
    border-color: var(--gold);
    background: var(--gold);
    color: #08100d;
    font-weight: 850;
}

.gold-fill:hover {
    border-color: var(--gold-2);
    background: var(--gold-2);
    color: #08100d;
}

.toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toolbar-zoom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.zoom-readout {
    min-width: 58px;
    padding: 4px 8px;
    border: 1px solid rgba(226, 180, 67, .24);
    border-radius: 999px;
    background: rgba(8, 16, 13, .92);
    color: #d4e0da;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.map-canvas {
    position: relative;
    display: block;
    min-height: 420px;
    height: clamp(420px, 56vh, 720px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b1612;
    box-shadow: var(--shadow);
}

.map-canvas.is-pannable {
    cursor: grab;
}

.map-canvas.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.map-viewport {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    padding: 24px;
    box-sizing: border-box;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.map-overview {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 12;
    width: min(180px, calc(100% - 28px));
    padding: 8px;
    border: 1px solid rgba(226, 180, 67, .24);
    border-radius: 8px;
    background: rgba(6, 12, 10, .88);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .42);
    backdrop-filter: blur(6px);
}

.map-overview[hidden] {
    display: none;
}

.map-overview-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.2;
}

.map-overview-meta strong {
    color: #f4f7f5;
    font-weight: 800;
}

.map-overview-meta span {
    color: #98aaa1;
    text-align: right;
}

.map-overview-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 112px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    background: #07100d;
}

.map-overview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}

.map-overview-viewport-box {
    position: absolute;
    border: 2px solid rgba(226, 180, 67, .96);
    border-radius: 4px;
    background: rgba(226, 180, 67, .18);
    box-shadow: 0 0 0 1px rgba(8, 16, 13, .74), inset 0 0 0 1px rgba(255, 255, 255, .08);
    pointer-events: none;
}

.map-render-stage {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .48);
    flex: none;
}

.game-region-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    image-rendering: pixelated;
    filter: contrast(1.05) brightness(1.1);
}

.grid-overlay,
.map-marker-layer,
.map-note-layer {
    position: absolute;
    inset: 0;
}

.map-marker-layer,
.map-note-layer {
    pointer-events: none;
}

.map-marker-layer .map-marker {
    pointer-events: auto;
}

.map-note-layer .map-note {
    pointer-events: auto;
}

.grid-overlay {
    background:
        linear-gradient(to right, rgba(226, 180, 67, .11) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(226, 180, 67, .11) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: .24;
    pointer-events: none;
}

.map-marker {
    position: absolute;
    display: inline-flex;
    align-items: center;
    z-index: 2;
    gap: 6px;
    max-width: 148px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .36));
}

.map-marker[hidden] {
    display: none;
}

.map-marker.exit-marker {
    z-index: 8;
}

.map-marker.exit-marker::before {
    content: "";
    position: absolute;
    left: -10px;
    top: -10px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(226, 180, 67, .26) 0%, rgba(226, 180, 67, 0) 72%);
}

.map-marker.exit-marker .pin {
    width: 28px;
    height: 28px;
}

.map-marker.exit-marker:hover .pin,
.map-marker.exit-marker.is-selected .pin {
    transform: translateY(-1px) scale(1.06);
}

.map-area-link {
    align-items: flex-end;
    justify-content: flex-start;
    max-width: none;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    background: rgba(255, 255, 255, .02);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.map-area-link:hover,
.map-area-link.is-selected {
    border-color: rgba(226, 180, 67, .88);
    background: rgba(226, 180, 67, .14);
    box-shadow: inset 0 0 0 1px rgba(226, 180, 67, .44);
}

.map-area-link:hover {
    transform: translateY(-1px);
}

.area-link-label {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.map-area-link:hover .area-link-label,
.map-area-link.is-selected .area-link-label {
    background: rgba(226, 180, 67, .94);
    color: #08100d;
}

.map-marker:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.marker-label {
    display: inline-block;
    max-width: 118px;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 5px;
    background: rgba(0, 0, 0, .72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 750;
}

.pin {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.pin.has-marker-image {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(25, 46, 36, .96), rgba(11, 22, 18, .98));
    background-image: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.pin-image {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35));
}

.pin::after {
    content: none;
}

.marker-kind-exit .pin { background-image: url("../images/ui-icons/exit-up.png"); }
.marker-kind-item .pin { background-image: url("../images/ui-icons/item-bottle.png"); }
.marker-kind-mart .pin { background-image: url("../images/ui-icons/shop-bag.png"); }
.marker-kind-npc .pin { background-image: url("../images/ui-icons/dialog-card.png"); }
.marker-kind-quest .pin { background-image: url("../images/ui-icons/checklist.png"); }
.marker-kind-trainer .pin { background-image: url("../images/ui-icons/trainer-badge.png"); }

.map-marker.is-selected .pin {
    filter: drop-shadow(0 0 10px rgba(226, 180, 67, .45));
    transform: translateY(-1px);
}

.map-marker.is-selected .marker-label {
    border-color: rgba(226, 180, 67, .8);
    background: rgba(226, 180, 67, .94);
    color: #08100d;
}

.map-hover-hint {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    margin: 0;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .66);
    color: #b8c9c1;
    font-size: 11px;
    line-height: 1.2;
    pointer-events: none;
}

.hide-labels .marker-label {
    display: none;
}

.hide-notes .map-note-layer {
    display: none;
}

.marker-entry { left: 30%; top: 19%; }
.marker-service { right: 31%; top: 28%; }
.marker-player { left: 45%; top: 48%; }
.marker-counter { left: 48%; bottom: 24%; }
.marker-trainer { right: 22%; top: 52%; }
.marker-hidden { left: 17%; bottom: 26%; }

.map-note {
    position: absolute;
    display: grid;
    gap: 4px;
    width: min(180px, 32%);
    padding: 8px;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: rgba(255, 247, 216, .94);
    color: #2d332e;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .28);
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.map-note strong,
.map-note span,
.map-note small {
    display: block;
}

.map-note span {
    color: #4b514c;
    line-height: 1.35;
}

.map-note small {
    color: #66716a;
}

.map-note.is-selected {
    box-shadow: 0 0 0 2px rgba(226, 180, 67, .38), 0 12px 24px rgba(0, 0, 0, .32);
}

.bottom-deck {
    display: grid;
    grid-template-columns: minmax(300px, 2fr) minmax(180px, 1fr) minmax(220px, 1fr);
    gap: 8px;
}

.deck-panel {
    min-width: 0;
    min-height: 168px;
}

.deck-panel .panel-title-row {
    margin-bottom: 8px;
}

.subtle {
    color: #6f8178;
    font-size: 11px;
}

.encounters-panel {
    background:
        radial-gradient(circle at top left, rgba(226, 180, 67, .14), transparent 32%),
        linear-gradient(180deg, rgba(19, 41, 32, .98), rgba(11, 22, 17, .98));
}

@media (min-width: 1121px) {
    .encounters-panel {
        grid-column: span 2;
    }
}

.encounters-panel .panel-title-row {
    margin-bottom: 6px;
}

.encounter-tabs,
.time-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.encounter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.time-tabs {
    flex-wrap: nowrap;
    margin-bottom: 8px;
}

.encounter-tabs::-webkit-scrollbar {
    display: none;
}

.encounter-tabs button,
.time-tabs button {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 88px;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid rgba(53, 86, 70, .9);
    border-radius: 999px;
    background: rgba(7, 16, 12, .82);
    color: #98ada2;
    font-size: 11px;
    line-height: 1.15;
    text-align: left;
}

.encounter-tabs button {
    flex: 0 0 auto;
    min-width: auto;
    max-width: 100%;
}

.encounter-tabs button.is-selected,
.time-tabs button.is-selected {
    border-color: rgba(226, 180, 67, .55);
    background: linear-gradient(180deg, rgba(226, 180, 67, .22), rgba(226, 180, 67, .1));
    color: #f2d78a;
}

.encounter-tabs button span,
.time-tabs button span {
    font-weight: 700;
}

.encounter-tabs button small,
.time-tabs button small {
    display: none;
    color: #7f968b;
    font-size: 10px;
}

.encounter-tabs button.is-selected small,
.time-tabs button.is-selected small {
    color: #e9d7a1;
}

.encounter-shell {
    display: grid;
    gap: 7px;
}

.encounter-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.encounter-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    min-height: 28px;
    padding: 5px 7px;
    border: 1px solid rgba(56, 89, 73, .8);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(7, 16, 12, .88), rgba(10, 20, 15, .78));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.encounter-stat span,
.encounter-stat strong {
    min-width: 0;
}

.encounter-stat span {
    color: #7e9489;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.encounter-stat strong {
    color: #f5f0d6;
    font-size: 13px;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.encounter-rows {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.encounter-card,
.empty-encounter {
    min-width: 0;
    border-radius: 8px;
}

.encounter-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 6px;
    min-height: 58px;
    padding: 6px;
    border: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .02), transparent 48%),
        linear-gradient(180deg, rgba(7, 16, 12, .72), rgba(10, 18, 14, .64));
    box-shadow: none;
    overflow: hidden;
}

.encounter-card.has-pokedex-link {
    cursor: pointer;
}

.encounter-card.has-pokedex-link:focus-visible {
    outline: 1px solid rgba(226, 180, 67, .85);
    outline-offset: 2px;
}

.encounter-card.rare {
    background:
        linear-gradient(135deg, rgba(226, 180, 67, .08), transparent 52%),
        linear-gradient(180deg, rgba(7, 16, 12, .76), rgba(10, 18, 14, .66));
}

.encounter-card-top {
    display: contents;
}

.encounter-avatar {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #08100d;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: none;
    overflow: visible;
}

.encounter-avatar-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25));
    transform: scale(1.05);
}

.encounter-rarity {
    display: none;
}

.encounter-species {
    grid-column: 2;
    grid-row: 1;
    display: block;
    color: #f7faf8;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.encounter-meta {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    margin-top: 0;
}

.encounter-rate {
    color: var(--gold-2);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.encounter-level {
    color: #8ea49a;
    font-size: 10px;
    text-align: left;
    white-space: nowrap;
}

.encounter-extra {
    display: none;
    color: #6c8176;
    font-size: 10px;
    line-height: 1.35;
}

.empty-encounter {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    gap: 4px;
    min-height: 92px;
    padding: 12px;
    border: 1px dashed rgba(82, 119, 100, .78);
    background: rgba(8, 16, 12, .7);
    text-align: center;
}

.empty-encounter span,
.empty-encounter strong {
    display: block;
}

.empty-encounter span {
    color: #cfddd6;
    font-size: 13px;
}

.empty-encounter strong {
    color: var(--gold);
    font-size: 28px;
    line-height: 1;
}

.encounter-footnote {
    margin: 0;
    color: #7a9084;
    font-size: 10px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    color: #c4d2cb;
    font-size: 12px;
}

.legend-grid span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.activity-panel ul {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0 0 10px;
    list-style: none;
    color: #c5d2cb;
    font-size: 12px;
}

.activity-panel li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.activity-panel li span {
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
}

.deck-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.deck-actions button {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.stat-list {
    display: grid;
    gap: 7px;
    margin: 0;
}

.stat-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stat-list dt {
    color: #879990;
}

.stat-list dd {
    margin: 0;
    color: #e7f1ec;
    text-align: right;
}

.mini-map {
    position: relative;
    height: 120px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background:
        linear-gradient(90deg, rgba(120, 211, 255, .08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(120, 211, 255, .08) 1px, transparent 1px),
        #0b1612;
    background-size: 22px 22px;
}

.mini-region {
    position: absolute;
    inset: 18px 24px;
    border-radius: 46% 54% 48% 52%;
    background:
        linear-gradient(135deg, #163e2b 0 45%, #193752 45% 63%, #345f3e 63% 100%);
    opacity: .82;
}

.mini-focus {
    position: absolute;
    left: 45%;
    top: 42%;
    width: 54px;
    height: 34px;
    border: 2px solid var(--red);
    background: rgba(225, 83, 83, .16);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .08);
}

.mini-map button {
    position: absolute;
    right: 8px;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 5px;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    cursor: pointer;
}

.mini-map button:first-of-type {
    bottom: 36px;
}

.mini-map button:last-of-type {
    bottom: 9px;
}

.detail-panel {
    min-height: 320px;
}

.marker-detail-shell {
    display: grid;
    gap: 10px;
}

.detail-chip-row,
.detail-jump-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-chip,
.detail-jump-button,
.detail-pill {
    border: 1px solid rgba(150, 173, 161, .22);
    border-radius: 999px;
    background: rgba(11, 22, 18, .92);
    color: #d7e4dd;
    font-size: 11px;
    font-weight: 700;
}

.detail-chip,
.detail-pill {
    padding: 6px 10px;
}

.detail-chip.tone-gold {
    border-color: rgba(226, 180, 67, .44);
    color: #f0d474;
}

.detail-chip.tone-orange {
    border-color: rgba(240, 145, 79, .42);
    color: #f2b174;
}

.detail-chip.tone-blue {
    border-color: rgba(107, 170, 255, .42);
    color: #9ec6ff;
}

.detail-chip.tone-green {
    border-color: rgba(95, 191, 121, .42);
    color: #a4ddb4;
}

.detail-chip.tone-pink {
    border-color: rgba(225, 119, 180, .42);
    color: #f0a9d4;
}

.marker-detail-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(226, 180, 67, .18);
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(226, 180, 67, .12), transparent 38%),
        linear-gradient(180deg, rgba(15, 33, 26, .96), rgba(9, 19, 15, .98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.detail-copy-block {
    min-width: 0;
}

.detail-kicker {
    margin: 0 0 6px;
    color: #7e9589;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.marker-detail-card h3,
.npc-summary h3 {
    margin: 0;
    color: var(--gold);
    font-size: 16px;
}

.marker-detail-card p,
.npc-summary p {
    margin: 5px 0 0;
    color: #a8bab1;
    font-size: 12px;
    line-height: 1.45;
}

.detail-emblem,
.npc-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background-color: #163127;
    border: 1px solid rgba(226, 180, 67, .22);
    color: transparent;
    font-size: 0;
    background-size: 72%;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .18));
}

.detail-emblem {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

.detail-emblem.has-marker-image {
    background-image: none !important;
}

.detail-emblem.has-portrait {
    width: 76px;
    height: 76px;
    border-color: rgba(226, 180, 67, .34);
    background:
        radial-gradient(circle at 50% 18%, rgba(226, 180, 67, .22), transparent 44%),
        linear-gradient(180deg, rgba(25, 54, 42, .96), rgba(10, 21, 17, .98));
    background-image: none !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 12px 24px rgba(0, 0, 0, .24);
}

.detail-emblem-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.detail-emblem.has-portrait .detail-emblem-image {
    width: 66px;
    height: 66px;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .28));
}

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

.detail-stat-card {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(11, 22, 18, .9);
}

.detail-stat-card span {
    color: #6e8479;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.detail-stat-card strong {
    color: #edf6f1;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-jump-button {
    padding: 7px 11px;
    cursor: pointer;
    transition: border-color .14s ease, color .14s ease, transform .14s ease;
}

.detail-jump-button:hover {
    border-color: rgba(226, 180, 67, .38);
    color: var(--gold);
    transform: translateY(-1px);
}

.detail-sections {
    display: grid;
    gap: 8px;
}

.detail-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(11, 22, 18, .92);
    overflow: hidden;
}

.detail-section summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.detail-section summary::-webkit-details-marker,
.detail-party-card summary::-webkit-details-marker {
    display: none;
}

.detail-section summary span {
    color: #edf6f1;
    font-size: 13px;
    font-weight: 800;
}

.detail-section summary small {
    color: #7c9287;
    font-size: 11px;
    text-align: right;
}

.detail-section[open] summary {
    border-bottom: 1px solid rgba(150, 173, 161, .16);
}

.detail-section-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.detail-section-copy,
.detail-inline-note {
    margin: 0;
    color: #9fb2a9;
    font-size: 12px;
    line-height: 1.5;
}

.detail-row-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.detail-row-list div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.detail-row-list dt {
    color: #6c8377;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.detail-row-list dd {
    margin: 0;
    color: #edf6f1;
    font-size: 12px;
    line-height: 1.45;
}

.detail-dialogue-list,
.detail-party-grid,
.detail-related-grid {
    display: grid;
    gap: 8px;
}

.detail-dialogue-card,
.detail-party-card {
    border: 1px solid rgba(150, 173, 161, .16);
    border-radius: 10px;
    background: rgba(19, 41, 32, .8);
}

.detail-dialogue-card {
    padding: 10px;
}

.detail-dialogue-card strong {
    display: block;
    margin-bottom: 5px;
    color: var(--gold);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.detail-dialogue-card p {
    margin: 0;
    color: #d6e2db;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.detail-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.detail-pill {
    color: #dce7e2;
}

.detail-party-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-party-card {
    padding: 9px;
}

.detail-party-card summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.detail-party-card > strong,
.detail-party-card > small {
    display: block;
}

.detail-party-card > strong {
    margin-top: 8px;
    color: #edf6f1;
    font-size: 13px;
}

.detail-party-card > small {
    margin-top: 4px;
    color: #90a39b;
    font-size: 11px;
}

.detail-party-copy {
    min-width: 0;
}

.detail-party-copy strong,
.detail-party-copy small {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
}

.detail-party-copy strong {
    color: #edf6f1;
    font-size: 13px;
    line-height: 1.3;
}

.detail-party-copy small {
    margin-top: 3px;
    color: #90a39b;
    font-size: 11px;
    line-height: 1.4;
}

.detail-party-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(226, 180, 67, .16), rgba(255, 255, 255, .04)),
        rgba(11, 22, 18, .95);
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
}

.detail-party-avatar img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    image-rendering: pixelated;
}

.detail-party-body {
    margin-top: 9px;
}

.detail-related {
    display: grid;
    gap: 8px;
}

.detail-related-title {
    margin: 0;
    color: #7b9086;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.detail-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-related-grid button {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(11, 22, 18, .9);
    color: #d8e4de;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color .14s ease, color .14s ease;
}

.detail-related-grid button:hover {
    border-color: rgba(226, 180, 67, .38);
    color: var(--gold);
}

.split-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.npc-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

#trainers {
    display: grid;
    gap: 12px;
    align-content: start;
}

#trainers .panel-title-row {
    margin-bottom: 0;
}

#trainers .npc-summary {
    align-items: flex-start;
    padding: 11px;
    border: 1px solid rgba(226, 180, 67, .14);
    border-radius: 10px;
    background:
        radial-gradient(circle at top right, rgba(226, 180, 67, .12), transparent 42%),
        linear-gradient(180deg, rgba(18, 37, 29, .95), rgba(10, 21, 17, .98));
}

#trainers .npc-summary h3 {
    font-size: 15px;
    line-height: 1.35;
}

#trainers .npc-summary p {
    line-height: 1.45;
}

.npc-avatar {
    width: 52px;
    height: 52px;
    font-size: 24px;
}

.dialog-note {
    margin: 12px 0 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #0b1612;
    color: #a7b8b0;
    font-size: 12px;
}

.dialog-note strong {
    color: var(--gold);
}

#trainers .dialog-note {
    margin: 0;
    border-radius: 10px;
}

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

#trainers .party-grid {
    gap: 8px;
}

.party-grid div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 7px;
    align-items: center;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #0b1612;
}

#trainers .party-grid div {
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
}

.party-grid strong,
.party-grid small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.party-grid strong {
    color: #fff;
    font-size: 12px;
}

.party-grid small {
    grid-column: 2;
    color: #7c8f86;
    font-size: 11px;
}

.type-bolt,
.type-fire,
.type-water,
.type-plain {
    grid-row: span 2;
    width: 13px;
    height: 13px;
    border-radius: 50%;
}

.type-bolt { background: #e5ca47; }
.type-fire { background: #f37a4a; }
.type-water { background: #69b6ff; }
.type-plain { background: #a5aeb8; }

.address-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    max-height: calc(100vh - 82px);
    min-height: 0;
    overflow: hidden;
}

.address-rail [data-address-list] {
    display: grid;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(113, 134, 123, .7) rgba(9, 18, 14, .45);
}

.address-rail [data-address-list]::-webkit-scrollbar {
    width: 8px;
}

.address-rail [data-address-list]::-webkit-scrollbar-track {
    background: rgba(9, 18, 14, .45);
    border-radius: 999px;
}

.address-rail [data-address-list]::-webkit-scrollbar-thumb {
    background: rgba(113, 134, 123, .7);
    border-radius: 999px;
}

.address-rail-title {
    margin: 0 0 2px;
    padding-bottom: 10px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--line);
    color: #dce7e1;
    font-size: 13px;
    font-weight: 850;
    text-align: left;
    line-height: 1.2;
}

.address-rail-title span {
    display: block;
    margin-top: 4px;
    color: #75877d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.pc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-top: 1px solid var(--line);
    background: #0b1612;
    color: #8fa199;
    font-size: 13px;
}

.pc-footer strong {
    color: #fff;
}

.pc-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.pc-footer a {
    color: #b6c6be;
}

.pc-footer a:hover {
    color: var(--gold);
}

.list-hero {
    width: min(1120px, calc(100% - 24px));
    margin: 24px auto 18px;
    padding: 32px;
}

.hero-kicker {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.list-hero h1,
.article-header h1 {
    margin: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1.12;
}

.list-hero p:last-child {
    max-width: 720px;
    margin: 10px 0 0;
    color: #a9bab2;
}

.section-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: min(920px, calc(100% - 24px));
    margin: 0 auto 18px;
}

.section-search input {
    height: 44px;
    padding: 0 14px;
}

.section-search button {
    min-width: 112px;
    background: var(--gold);
    border-color: var(--gold);
    color: #08100d;
    font-weight: 850;
}

.search-summary,
.empty-state {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto 16px;
    color: #a9bab2;
}

.empty-state-panel {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto 28px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.empty-state-panel .empty-state {
    width: auto;
    margin: 0;
    color: #fff;
}

.empty-state-detail {
    margin: 10px 0 0;
    color: #a9bab2;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.empty-state-actions a {
    text-decoration: none;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto 28px;
}

.post-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.post-card a {
    display: block;
    height: 100%;
}

.post-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #0b1612;
}

.post-card-body {
    padding: 14px;
}

.post-card h2 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;
}

.post-card p {
    margin: 8px 0 0;
    color: #9fb0a8;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto 32px;
}

.page-link,
.page-label {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: #c3d2cb;
}

.page-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.article-shell {
    width: min(960px, calc(100% - 24px));
    margin: 24px auto 34px;
    overflow: hidden;
}

.article-hero img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #0b1612;
}

.article-header,
.article-body {
    padding: 24px;
}

.article-header {
    border-bottom: 1px solid var(--line);
}

.article-body {
    color: #c6d5ce;
    font-size: 16px;
}

.article-body h2,
.article-body h3 {
    color: #fff;
    line-height: 1.2;
}

.article-body a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (max-width: 1320px) {
    .map-workbench {
        grid-template-columns: minmax(220px, 250px) minmax(430px, 1fr) minmax(230px, 270px);
    }

    .address-rail {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: none;
    }

    .address-rail [data-address-list] {
        grid-column: 1 / -1;
    }

    .address-rail [data-address-list] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .address-rail-title {
        margin: 0;
    }
}

@media (max-width: 1120px) {
    .pc-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .pc-topbar-left,
    .pc-topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .pc-nav {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .pc-search {
        width: min(100%, 420px);
    }

    .map-workbench {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .right-rail,
    .address-rail {
        grid-column: 1 / -1;
        max-height: none;
    }

    .right-rail {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bottom-deck {
        grid-template-columns: 1fr;
    }

    .encounter-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .encounter-rows {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .pc-topbar-left,
    .pc-topbar-right {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .pc-brand {
        min-width: 0;
    }

    .pc-nav {
        width: 100%;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .pc-nav-link {
        flex: 0 0 auto;
        white-space: normal;
    }

    .pc-search {
        width: 100%;
        min-width: 0;
    }

    .map-workbench {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .map-stage-column {
        order: 1;
    }

    .left-rail {
        order: 2;
    }

    .right-rail {
        order: 3;
    }

    .address-rail {
        order: 4;
    }

    .left-rail,
    .right-rail {
        max-height: none;
    }

    .map-stage-column {
        grid-template-rows: auto auto auto;
    }

    .map-toolbar {
        top: 124px;
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar-actions,
    .breadcrumb-strip {
        width: 100%;
        flex-wrap: wrap;
    }

    .map-note {
        width: 132px;
    }

    .right-rail {
        grid-template-columns: 1fr;
    }

    .address-rail {
        grid-template-columns: 1fr;
    }

    .address-rail [data-address-list] {
        grid-column: 1 / -1;
    }

    .address-rail [data-address-list] {
        grid-template-columns: 1fr;
    }

    .address-rail-title {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .encounter-rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .encounter-summary {
        grid-template-columns: 1fr;
    }

    .detail-stat-row,
    .detail-party-grid,
    .detail-related-grid {
        grid-template-columns: 1fr;
    }

    .detail-row-list div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .section-search {
        grid-template-columns: 1fr;
    }

    .list-hero,
    .article-header,
    .article-body {
        padding: 20px;
    }

    .list-hero h1,
    .article-header h1 {
        font-size: 28px;
    }

    .pc-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}


@media (max-width: 520px) {
    .map-canvas {
        min-height: 380px;
        height: min(56vh, 520px);
    }

    .map-overview {
        right: 10px;
        bottom: 10px;
        width: min(144px, calc(100% - 20px));
        padding: 6px;
    }

    .map-overview-meta {
        margin-bottom: 6px;
        font-size: 10px;
    }

    .map-overview-frame {
        height: 92px;
    }

    .marker-label {
        display: -webkit-box;
        max-width: 84px;
        overflow: hidden;
        white-space: normal;
        line-height: 1.15;
        overflow-wrap: anywhere;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .map-marker {
        max-width: 120px;
    }

    .marker-entry { left: 14%; top: 15%; }
    .marker-service { right: 8%; top: 26%; }
    .marker-player { left: 38%; top: 49%; }
    .marker-counter { left: 36%; bottom: 28%; }
    .marker-trainer { right: 8%; top: 58%; }
    .marker-hidden { left: 8%; bottom: 18%; }

    .map-note {
        display: none;
    }

    .party-grid,
    .deck-actions,
    .legend-grid {
        grid-template-columns: 1fr;
    }

    .marker-detail-card {
        padding: 12px;
    }

    .detail-emblem {
        width: 48px;
        height: 48px;
    }

    .detail-emblem.has-portrait {
        width: 64px;
        height: 64px;
    }

    .detail-emblem-image {
        width: 34px;
        height: 34px;
    }

    .detail-emblem.has-portrait .detail-emblem-image {
        width: 56px;
        height: 56px;
    }

    .detail-chip-row,
    .detail-jump-menu {
        gap: 5px;
    }

    .detail-chip,
    .detail-pill,
    .detail-jump-button {
        font-size: 10px;
    }
}

/* Guides Layout and Ad Integration */
.guides-workbench {
    width: min(1240px, calc(100% - 24px));
    margin: 0 auto;
    padding: 24px 0 34px;
}

.guides-workbench .article-shell {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
}

.guides-workbench .list-hero,
.guides-workbench .card-grid,
.guides-workbench .pagination-nav,
.guides-workbench .empty-state-panel {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Ad Unit Styles */
.ad-unit {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px auto;
    width: 100%;
    clear: both;
}

.ad-unit.header-ad {
    margin: 16px auto 8px;
    max-width: 1240px;
    width: calc(100% - 24px);
}

.ad-unit.footer-ad {
    margin: 8px auto 16px;
    max-width: 1240px;
    width: calc(100% - 24px);
}

.ad-unit.content-ad {
    margin: 24px auto;
    width: 100%;
}

@media (max-width: 640px) {
    .guides-workbench {
        width: calc(100% - 16px);
        padding: 16px 0;
    }
}


