:root {
    --bg: #101619;
    --bg-soft: #162126;
    --panel: #f7fbf8;
    --panel-strong: #ffffff;
    --ink: #17211d;
    --muted: #6a7772;
    --line: #d6e1dc;
    --green: #19a77d;
    --green-dark: #0d6b55;
    --cyan: #41bfd2;
    --amber: #f4bd44;
    --coral: #e75d4f;
    --shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(65, 191, 210, .14), transparent 34%),
        linear-gradient(180deg, #111b20 0, #102019 46%, #f1f6f1 46%, #eef4ef 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

button,
input {
    font: inherit;
}

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

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 100;
    transform: translateY(-72px);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 10px 14px;
    color: #17211d;
    background: var(--amber);
    box-shadow: 0 8px 20px rgba(17, 33, 27, .22);
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    transition: transform .16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: none;
}

.pal-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.pal-page:focus {
    outline: none;
}

.pal-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: end;
    gap: 24px;
    margin-bottom: 18px;
    padding: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(25, 167, 125, .92), rgba(23, 43, 50, .96) 54%, rgba(14, 19, 23, .98)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 22px);
    color: #fff;
    box-shadow: var(--shadow);
}

.pal-header > div:first-child {
    grid-row: span 2;
}

.pal-header::after {
    content: "";
    position: absolute;
    inset: auto 22px 18px auto;
    width: 160px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--amber), var(--cyan));
    opacity: .95;
}

.eyebrow {
    margin: 0 0 8px;
    color: #baf7df;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-summary {
    max-width: 680px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
    line-height: 1.55;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
}

h2 {
    font-size: 21px;
}

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

.header-stats span {
    min-height: 72px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    padding: 12px 10px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .76);
    text-align: center;
    backdrop-filter: blur(8px);
}

.global-pal-search {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
}

.global-pal-search span {
    color: #baf7df;
    font-size: 12px;
    font-weight: 950;
}

.global-pal-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    padding: 0 13px;
    color: #101a16;
    background: #fff;
    font-weight: 850;
    outline: none;
}

.global-pal-search input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(244, 189, 68, .22);
}

.global-search-hint {
    color: rgba(255, 255, 255, .76);
    font-size: 11px;
    font-weight: 800;
}

.global-search-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 5px;
    margin-right: 4px;
    color: #173d2f;
    background: #fff;
    font-size: 12px;
    font-weight: 950;
}

.header-stats b {
    display: block;
    color: #fff;
    font-size: 24px;
    line-height: 1.1;
}

.tool-shell,
.dex-shell,
.tier-shell,
.info-shell,
.special-box {
    border: 1px solid rgba(20, 40, 32, .18);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(17, 33, 27, .13);
}

.tool-shell {
    overflow: hidden;
}

.pal-source-nav {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
    gap: 6px;
    margin: 0 0 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    padding: 6px;
    background: rgba(16, 24, 28, .88);
    backdrop-filter: blur(12px);
}

.pal-source-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 0 8px;
    color: rgba(255, 255, 255, .82);
    background: rgba(20, 35, 42, .88);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.pal-source-nav a:hover,
.pal-source-nav a:focus,
.pal-source-nav a.is-active {
    color: #17211d;
    background: var(--amber);
}

.pal-source-nav a:focus-visible,
.pal-source-nav a.is-active {
    border-color: rgba(255, 244, 178, .85);
    box-shadow: 0 0 0 2px rgba(255, 244, 178, .28);
    outline: none;
}

.home-quick-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid rgba(25, 167, 125, .24);
    border-radius: 8px;
    padding: 18px;
    color: #12362a;
    background: linear-gradient(135deg, #eef8f4, #fff7df);
    box-shadow: 0 10px 24px rgba(17, 33, 27, .08);
}

.home-quick-panel small {
    display: inline-flex;
    margin-bottom: 4px;
    border-radius: 999px;
    padding: 4px 9px;
    color: #fff;
    background: #173d2f;
    font-size: 11px;
    font-weight: 950;
}

.home-quick-panel h2 {
    margin: 0;
    color: #101a16;
    font-size: 22px;
}

.home-quick-panel p {
    margin: 6px 0 0;
    color: #30473d;
    font-size: 13px;
    font-weight: 800;
}

.home-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.home-quick-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid #173d2f;
    border-radius: 8px;
    padding: 0 14px;
    color: #fff;
    background: #173d2f;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.home-quick-button.secondary {
    border-color: #0d6b55;
    background: #0d6b55;
}

.home-quick-button.ghost {
    color: #173d2f;
    background: #fff;
}

.home-quick-button:hover,
.home-quick-button:focus {
    border-color: var(--green);
    box-shadow: 0 6px 14px rgba(18, 48, 36, .12);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.home-card {
    min-height: 116px;
    border: 1px solid #d2dfd8;
    border-radius: 8px;
    padding: 16px;
    color: var(--ink);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 22px rgba(14, 31, 25, .07);
    text-decoration: none;
}

.home-card.is-local {
    border-color: rgba(25, 167, 125, .38);
    background: linear-gradient(180deg, #f1fbf6, #fff);
}

.home-card strong,
.home-card span {
    display: block;
}

.home-card strong {
    margin-bottom: 8px;
    font-size: 18px;
}

.home-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.dex-shell,
.tier-shell,
.info-shell {
    margin-bottom: 18px;
    padding: 20px;
}

.inline-control {
    width: min(280px, 100%);
}

.inline-control span {
    margin-bottom: 6px;
}

.inline-control input,
.inline-control select {
    width: 100%;
    height: 42px;
}

.inline-control select {
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    padding: 0 38px 0 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
    font-weight: 800;
}

.dex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.type-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.type-filter {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid rgba(16, 26, 22, .1);
    border-radius: 999px;
    padding: 0 12px;
    color: #fff;
    background: #173d2f;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

.type-filter.is-all {
    color: #173d2f;
    background: #fff;
}

.type-filter.is-active {
    outline: 3px solid rgba(43, 183, 129, .24);
    box-shadow: 0 0 0 1px #173d2f;
}

.dex-summary,
.search-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 12px;
    color: #30473d;
    font-size: 13px;
    font-weight: 850;
}

.dex-summary strong,
.search-summary strong {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    color: #fff;
    background: #173d2f;
    font-size: 12px;
}

.search-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    color: #173d2f;
    background: #eef8f4;
    font-size: 12px;
    font-weight: 900;
}

.dex-card {
    position: relative;
    min-height: 66px;
    border: 1px solid #c7d8d0;
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
}

.dex-card-link {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 66px;
    padding: 8px 42px 8px 8px;
    color: var(--ink);
    text-decoration: none;
}

.dex-favorite {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border: 1px solid #d8c376;
    border-radius: 999px;
    color: #8a6200;
    background: #fff8dc;
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.dex-favorite:hover,
.dex-favorite:focus {
    border-color: #a05d00;
    background: #fff1b8;
}

.dex-favorite.is-active {
    color: #fff;
    border-color: #a05d00;
    background: #a05d00;
}

.dex-card:hover,
.dex-card:focus {
    border-color: var(--green);
    box-shadow: 0 8px 18px rgba(18, 48, 36, .12);
}

.dex-card .pal-icon {
    width: 46px;
    height: 46px;
}

.dex-card .pal-icon img {
    width: 42px;
    height: 42px;
}

.dex-card-text {
    min-width: 0;
}

.dex-card-text small,
.dex-card-text b,
.dex-card-text span {
    display: block;
}

.dex-card-text .chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.dex-card-text .type-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(16, 26, 22, .14);
    padding: 4px 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}

.dex-card-text small {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 4px;
    border-radius: 999px;
    padding: 2px 7px;
    color: #ffffff;
    background: var(--green-dark);
    font-size: 11px;
    font-weight: 900;
}

.dex-card-text b {
    overflow: hidden;
    color: #101a16;
    font-size: 15px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dex-card-text span {
    overflow: hidden;
    color: #2f4039;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dex-card-text .dex-meta {
    color: #173d2f;
    font-size: 11px;
    font-weight: 900;
}

.dex-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 66px;
    border: 1px dashed #b9cbc2;
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .62);
    font-size: 13px;
    font-weight: 900;
}

.more-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

button.dex-more,
.load-more {
    width: 100%;
    cursor: pointer;
}

button.dex-more.is-secondary {
    width: auto;
    min-width: 112px;
    border-style: solid;
    color: #173d2f;
    background: #fff;
}

button.dex-more:hover,
button.dex-more:focus,
.load-more:hover,
.load-more:focus {
    border-color: var(--green);
    color: var(--green-dark);
    background: #eef8f4;
}

.tier-list {
    display: grid;
    gap: 12px;
}

.tier-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 10px 12px;
    color: #31483f;
    background: #f8fbf9;
    font-size: 13px;
    font-weight: 850;
}

.tier-summary strong,
.tier-summary a,
.tier-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
}

.tier-summary strong {
    color: #fff;
    background: #173d2f;
}

.tier-summary a {
    border: 1px solid #b9d8ca;
    color: #12362a;
    background: #fff;
    text-decoration: none;
}

.tier-summary a:hover,
.tier-summary a:focus {
    border-color: var(--green);
    color: var(--green-dark);
    background: #eef8f4;
}

.tier-band {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.tier-band > strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    border-radius: 8px;
    color: #17211d;
    background: var(--amber);
    font-size: 24px;
    font-weight: 950;
}

.rank-s > strong {
    background: linear-gradient(135deg, #f8d86a, #f08a4b);
}

.rank-a > strong {
    background: linear-gradient(135deg, #62d8a7, #41bfd2);
}

.rank-b > strong {
    background: #cfe6dc;
}

.rank-c > strong {
    background: #e2e9e5;
}

.rank-d > strong {
    color: #62716b;
    background: #eef2ef;
}

.tier-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.tier-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 78px;
    border: 1px solid #e1ebe6;
    border-radius: 8px;
    padding: 8px;
    color: var(--ink);
    background: #fbfdfb;
    text-decoration: none;
}

.tier-card:hover,
.tier-card:focus {
    border-color: #b9d8ca;
    box-shadow: 0 6px 14px rgba(18, 48, 36, .09);
}

.tier-card .pal-icon {
    width: 46px;
    height: 46px;
}

.tier-card .pal-icon img {
    width: 42px;
    height: 42px;
}

.tier-card b,
.tier-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tier-card b {
    font-size: 14px;
}

.tier-card small {
    color: var(--muted);
    font-size: 11px;
}

.tier-meta {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
    border-radius: 999px;
    padding: 3px 8px;
    color: #244239;
    background: #edf7f2;
    font-size: 11px;
    font-weight: 900;
}

.tier-card em {
    min-width: 46px;
    border-radius: 999px;
    padding: 5px 8px;
    color: var(--green-dark);
    background: #eaf7f0;
    font-size: 12px;
    font-style: normal;
    font-weight: 950;
    text-align: center;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.type-chip,
.work-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border-radius: 999px;
    padding: 2px 7px;
    color: #fff;
    background: var(--green-dark);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.type-neutral {
    background: #39433f;
}

.type-fire {
    background: #d7533d;
}

.type-water {
    background: #2c8eca;
}

.type-grass {
    background: #3d9c62;
}

.type-electric {
    background: #9a6d00;
}

.type-ice {
    background: #087d98;
}

.type-ground {
    background: #a9763a;
}

.type-dark {
    background: #4c4d69;
}

.type-dragon {
    background: #7c5cc4;
}

.work-chip {
    color: #244239;
    background: #edf7f2;
    border: 1px solid #cfe5da;
}

.info-grid,
.item-grid,
.ranch-grid,
.raid-grid,
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.technology-grid {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(123, 178, 164, .18);
    border-radius: 8px;
    background:
        radial-gradient(circle at 10% 0%, rgba(50, 158, 125, .16), transparent 30%),
        linear-gradient(180deg, #10201e, #091412);
}

.info-card,
.item-card,
.ranch-card,
.wiki-card,
.technology-card {
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(14, 31, 25, .06);
}

.info-card {
    display: grid;
    gap: 10px;
}

.info-card .pal-link {
    min-height: 58px;
    padding: 0;
}

.technology-planner,
.technology-filters,
.tech-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.technology-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.technology-filter-title {
    display: none;
    margin-top: 8px;
}

.technology-filters {
    display: none;
}

.tech-stat-grid div {
    border: 1px solid #d3e4dc;
    border-radius: 8px;
    padding: 12px;
    background: linear-gradient(180deg, #f5fbf7, #fff);
}

.tech-stat-grid dt {
    color: #587066;
    font-size: 12px;
    font-weight: 950;
}

.tech-stat-grid dd {
    margin: 4px 0 2px;
    color: #101a16;
    font-size: 20px;
    font-weight: 950;
}

.tech-stat-grid small {
    color: #65786f;
    font-size: 12px;
    line-height: 1.45;
}

.technology-card {
    display: grid;
    position: relative;
    min-height: 112px;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 4px;
    padding: 10px 8px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .58), rgba(0, 0, 0, .76)),
        rgba(7, 17, 16, .82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 18px rgba(0, 0, 0, .2);
    transition: border-color .16s ease, transform .16s ease, background .16s ease, filter .16s ease;
}

.technology-card.is-ancient {
    border-color: rgba(188, 139, 255, .72);
    background:
        linear-gradient(180deg, rgba(72, 45, 103, .98), rgba(31, 22, 46, .98)),
        #2b1b3d;
}

.technology-card.is-checked {
    border-color: #33d38d;
    box-shadow: 0 0 0 1px rgba(51, 211, 141, .28), 0 12px 24px rgba(5, 15, 20, .2);
}

.technology-card:hover {
    transform: translateY(-2px);
}

.technology-level-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 16px;
    border: 1px solid rgba(140, 183, 170, .18);
    border-radius: 6px;
    padding: 14px;
    background:
        linear-gradient(90deg, rgba(22, 43, 39, .92), rgba(11, 23, 21, .94)),
        radial-gradient(circle at 0 0, rgba(45, 189, 133, .12), transparent 42%);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.technology-level-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 8px;
    color: #dff8ec;
    background: transparent;
}

.technology-level-head span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 2px solid #76f0b7;
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(30, 185, 126, .95), rgba(16, 72, 61, .96));
    box-shadow: 0 0 0 4px rgba(37, 219, 144, .12), 0 8px 18px rgba(0, 0, 0, .28);
    transform: rotate(45deg);
}

.technology-level-head span strong {
    transform: rotate(-45deg);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    font-weight: 950;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}

.technology-level-head em {
    display: block;
    color: rgba(214, 241, 231, .72);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.technology-slots {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(132px, 1fr);
    gap: 12px;
    align-items: stretch;
}

.technology-regular-slots {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.technology-ancient-slots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border-left: 1px solid rgba(180, 134, 255, .28);
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(105, 65, 151, .12), transparent);
}

.technology-slot {
    min-height: 112px;
    border: 1px dashed rgba(255, 255, 255, .12);
    border-radius: 4px;
    padding: 10px;
    color: transparent;
    background: rgba(0, 0, 0, .44);
}

.technology-ancient-slots .technology-slot {
    border-color: rgba(255, 169, 224, .32);
    background:
        linear-gradient(180deg, rgba(117, 56, 102, .58), rgba(65, 33, 75, .7)),
        rgba(88, 39, 84, .66);
}

.technology-slot span,
.technology-slot strong {
    display: none;
}

.technology-slot span {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 950;
}

.technology-slot strong {
    font-size: 14px;
    line-height: 1.35;
}

.technology-card label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: center;
    justify-items: center;
    cursor: pointer;
    text-align: center;
}

.technology-card input {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #17895e;
}

.technology-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(169, 221, 207, .18);
    border-radius: 4px;
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .13), transparent 54%),
        rgba(5, 14, 13, .44);
}

.technology-icon img {
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
}

.technology-card strong,
.technology-card small {
    display: block;
}

.technology-card strong {
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

.technology-card small,
.technology-card p {
    display: none;
    color: rgba(240, 247, 244, .72);
    font-size: 11px;
    line-height: 1.5;
}

.technology-card p {
    display: none;
}

.tech-tags {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.tech-tags em {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    color: #dff8ef;
    background: rgba(34, 120, 86, .22);
    border: 1px solid rgba(163, 223, 195, .2);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
}

.info-body {
    border-top: 1px solid #edf2ef;
    padding-top: 10px;
}

.info-body strong,
.item-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.ranch-card {
    display: grid;
    gap: 12px;
}

.ranch-card .pal-link {
    width: 100%;
}

.raid-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 14px;
    color: inherit;
    background: #fff;
    text-decoration: none;
}

.raid-card:hover,
.raid-card:focus {
    border-color: var(--green);
    box-shadow: 0 8px 18px rgba(18, 48, 36, .12);
}

.raid-card .pal-icon {
    width: 58px;
    height: 58px;
}

.raid-card .pal-icon img {
    width: 52px;
    height: 52px;
}

.raid-title small {
    display: inline-flex;
    margin-bottom: 6px;
    border-radius: 999px;
    padding: 3px 8px;
    color: #fff;
    background: #173d2f;
    font-size: 11px;
    font-weight: 950;
}

.raid-title strong {
    display: block;
    color: #101a16;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.35;
}

.raid-body {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.raid-body p {
    margin: 0;
    color: #243a32;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.55;
}

.pal-detail-shell {
    display: grid;
    gap: 14px;
}

.detail-actions {
    display: flex;
    justify-content: flex-start;
}

.back-link,
.source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid #cfe0d7;
    border-radius: 8px;
    padding: 0 12px;
    color: #173d2f;
    background: #fff;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.source-link {
    margin-top: 10px;
    background: #173d2f;
    color: #fff;
}

.detail-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.detail-link-row .source-link {
    margin-top: 0;
}

.source-link.secondary {
    background: #0d6b55;
}

.source-link.route {
    color: #10231b;
    background: #dff3ea;
    border-color: #83c7a9;
}

.source-link.ghost {
    color: #173d2f;
    background: #fff;
}

.source-link.favorite-toggle {
    color: #173d2f;
    background: #fff7df;
    border-color: #e6c762;
}

.source-link.favorite-toggle.is-active {
    color: #fff;
    background: #a05d00;
    border-color: #a05d00;
}

.pal-detail-card {
    display: grid;
    gap: 16px;
}

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

.detail-neighbor {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 72px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 10px;
    color: var(--ink);
    background: #fbfdfb;
    text-decoration: none;
}

.detail-neighbor:hover,
.detail-neighbor:focus {
    border-color: var(--green);
    box-shadow: 0 6px 14px rgba(18, 48, 36, .09);
}

.detail-neighbor .pal-icon {
    width: 48px;
    height: 48px;
}

.detail-neighbor .pal-icon img {
    width: 42px;
    height: 42px;
}

.detail-neighbor small,
.detail-neighbor b,
.detail-neighbor em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-neighbor small {
    color: #587066;
    font-size: 11px;
    font-weight: 900;
}

.detail-neighbor b {
    margin-top: 2px;
    color: #101a16;
    font-size: 14px;
    font-weight: 950;
}

.detail-neighbor em {
    margin-top: 2px;
    color: #30473d;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.detail-neighbor.is-center {
    grid-template-columns: 1fr;
    text-align: center;
    background: #eef8f4;
}

.detail-neighbor.is-empty {
    grid-template-columns: 1fr;
    color: #819087;
    background: #f4f7f5;
}

.pal-detail-hero {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.pal-detail-hero .pal-icon {
    width: 112px;
    height: 112px;
}

.pal-detail-hero .pal-icon img {
    width: 98px;
    height: 98px;
}

.pal-detail-hero small {
    display: inline-flex;
    margin-bottom: 6px;
    border-radius: 999px;
    padding: 3px 9px;
    color: #fff;
    background: #173d2f;
    font-size: 12px;
    font-weight: 950;
}

.pal-detail-hero h2 {
    margin: 0;
    color: #101a16;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.08;
}

.pal-detail-hero p,
.detail-panel p {
    margin: 8px 0 0;
    color: #243a32;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.6;
}

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

.detail-panel {
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.detail-panel h3 {
    margin: 0 0 10px;
    color: #101a16;
    font-size: 16px;
}

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

.stat-grid div {
    border-radius: 8px;
    padding: 10px;
    background: #f3f8f5;
}

.stat-grid dt {
    color: #587066;
    font-size: 11px;
    font-weight: 900;
}

.stat-grid dd {
    margin: 3px 0 0;
    color: #101a16;
    font-size: 17px;
    font-weight: 950;
}

.info-body p,
.wiki-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.mini-pal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.mini-pal-list a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-height: 42px;
    border: 1px solid #e1ebe6;
    border-radius: 8px;
    padding: 4px;
    color: var(--ink);
    background: #fbfdfb;
    text-decoration: none;
}

.favorite-pal-panel,
.recent-pal-panel {
    display: block;
    margin-bottom: 18px;
}

.favorite-pal-panel.panel,
.recent-pal-panel.panel {
    display: block;
    padding: 16px;
}

.favorite-pal-panel[hidden],
.recent-pal-panel[hidden] {
    display: none !important;
}

.recent-pal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.recent-pal-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 66px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 9px;
    color: inherit;
    background: #fff;
    text-decoration: none;
}

.recent-pal-card:hover,
.recent-pal-card:focus {
    border-color: var(--green);
    box-shadow: 0 6px 14px rgba(18, 48, 36, .09);
}

.recent-pal-card .pal-icon {
    width: 46px;
    height: 46px;
}

.recent-pal-card .pal-icon img {
    width: 40px;
    height: 40px;
}

.recent-pal-card b,
.recent-pal-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-pal-card b {
    color: #101a16;
    font-size: 14px;
    font-weight: 950;
}

.recent-pal-card small {
    margin-top: 2px;
    color: #587066;
    font-size: 11px;
    font-weight: 850;
}

.mini-pal-list .pal-icon {
    width: 34px;
    height: 34px;
}

.mini-pal-list .pal-icon img {
    width: 30px;
    height: 30px;
}

.mini-pal-list span {
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.wiki-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.wiki-card header {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.wiki-card h3 {
    margin: 0;
    font-size: 18px;
}

.wiki-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.wiki-card h3 a:hover,
.wiki-card h3 a:focus {
    color: var(--green-dark);
    text-decoration: underline;
}

.wiki-card small,
.wiki-card header span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.drop-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.drop-list span {
    border: 1px solid #e5dbc1;
    border-radius: 999px;
    padding: 4px 8px;
    color: #65460e;
    background: #fff6df;
    font-size: 11px;
    font-weight: 900;
}

.work-layout {
    display: grid;
    grid-template-columns: minmax(260px, .42fr) minmax(0, 1fr);
    gap: 14px;
}

.work-level-box,
.work-pal-box {
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.work-level-box h3,
.work-pal-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

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

.work-level-card {
    border: 1px solid #e1ebe6;
    border-radius: 8px;
    padding: 10px;
    background: #fbfdfb;
}

.work-level-card strong,
.work-level-card span {
    display: block;
}

.work-level-card strong {
    color: var(--green-dark);
    font-size: 13px;
}

.work-level-card span {
    margin-top: 4px;
    color: #101a16;
    font-size: 16px;
    font-weight: 950;
}

.work-pal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.work-pal-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 68px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 8px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}

.work-pal-card:hover,
.work-pal-card:focus {
    border-color: var(--green);
    box-shadow: 0 6px 14px rgba(18, 48, 36, .09);
}

.work-pal-card .pal-icon {
    width: 48px;
    height: 48px;
}

.work-pal-card .pal-icon img {
    width: 42px;
    height: 42px;
}

.work-pal-card b,
.work-pal-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-pal-card b {
    color: #101a16;
    font-size: 14px;
}

.work-pal-card small {
    color: var(--muted);
    font-size: 11px;
}

.work-pal-card em {
    border-radius: 999px;
    padding: 5px 8px;
    color: #fff;
    background: var(--green-dark);
    font-size: 12px;
    font-style: normal;
    font-weight: 950;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    padding: 8px;
    background: #14232a;
}

.tab {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    font-weight: 900;
}

.tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.tab.is-active {
    border-color: rgba(244, 189, 68, .8);
    background: linear-gradient(135deg, var(--amber), #f08a4b);
    color: #17211d;
}

.panel {
    display: none;
    padding: 22px;
}

.panel.is-active {
    display: block;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 10px 12px;
    color: #30473d;
    background: #f8fbf9;
    font-size: 13px;
    font-weight: 850;
}

.panel-clear,
.panel-share,
.panel-swap {
    min-height: 32px;
    border: 1px solid #b9d8ca;
    border-radius: 8px;
    padding: 0 12px;
    color: #173d2f;
    background: #fff;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
}

.panel-share {
    color: #fff;
    background: #173d2f;
    border-color: #173d2f;
}

.panel-swap {
    color: #173d2f;
    background: #e8f5ef;
}

.panel-clear:hover,
.panel-clear:focus,
.panel-share:hover,
.panel-share:focus,
.panel-swap:hover,
.panel-swap:focus {
    border-color: var(--green);
    background: #eef8f4;
    color: #173d2f;
}

.control-grid {
    display: grid;
    gap: 12px;
}

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

.control-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-row {
    margin-top: 12px;
}

.control-row {
    display: flex;
    align-items: end;
    gap: 12px;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: #34443d;
    font-size: 13px;
    font-weight: 900;
}

label.wide {
    flex: 1;
}

input[type="text"],
input:not([type]),
select {
    width: 100%;
    height: 52px;
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

input::placeholder {
    color: #9aa8a2;
}

input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(25, 167, 125, .18);
}

.switch {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 14px;
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    background: #fff;
    white-space: nowrap;
}

.switch span {
    margin: 0;
    color: var(--ink);
}

.result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
    gap: 12px;
    min-height: 160px;
    margin-top: 18px;
}

.result-list.compact {
    grid-template-columns: 1fr;
}

.result-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #d4e1da;
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: 0 8px 18px rgba(14, 31, 25, .07);
}

.result-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    border-radius: 999px;
    padding: 4px 9px;
    color: #fff;
    background: var(--green-dark);
    font-size: 11px;
    font-weight: 900;
}

.badge.special {
    background: var(--coral);
}

.combo-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.05fr);
    align-items: center;
    gap: 12px;
    padding: 38px 12px 12px;
}

.parents-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
}

.combo-pal {
    min-width: 0;
    border: 1px solid #e2ebe6;
    border-radius: 8px;
    background: #fbfdfb;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.combo-pal:hover {
    border-color: #b9d8ca;
    box-shadow: 0 6px 14px rgba(18, 48, 36, .09);
    transform: translateY(-1px);
}

.result-pal {
    position: relative;
    min-height: 158px;
    border-color: rgba(25, 167, 125, .56);
    background:
        linear-gradient(180deg, rgba(25, 167, 125, .1), transparent 56%),
        #ffffff;
    box-shadow: inset 0 0 0 1px rgba(25, 167, 125, .1);
}

.result-pal::after {
    content: "RESULT";
    position: absolute;
    right: 8px;
    top: 7px;
    color: rgba(13, 107, 85, .62);
    font-size: 10px;
    font-weight: 950;
}

.result-pal .pal-link {
    min-height: 156px;
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 18px 14px;
}

.result-pal .pal-icon {
    width: 78px;
    height: 78px;
}

.result-pal .pal-icon img {
    width: 70px;
    height: 70px;
}

.result-pal .pal-name {
    font-size: 20px;
}

.pal-link {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 68px;
    padding: 8px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.pal-link:hover .pal-name,
.pal-link:focus .pal-name {
    color: var(--green-dark);
    text-decoration: underline;
}

.pal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid #d7e7df;
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff, #eef8f2);
}

.pal-icon img {
    width: 47px;
    height: 47px;
    object-fit: contain;
    filter: drop-shadow(0 5px 7px rgba(22, 31, 28, .18));
}

.pal-icon.is-empty::before {
    content: "?";
    color: var(--muted);
    font-weight: 900;
}

.pal-text {
    min-width: 0;
}

.pal-no {
    display: inline-block;
    margin-bottom: 4px;
    border: 1px solid #cde5d8;
    border-radius: 999px;
    padding: 2px 7px;
    color: var(--green-dark);
    background: #eaf7f0;
    font-size: 11px;
    font-weight: 900;
}

.pal-name {
    display: block;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.2;
}

.pal-en {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.operator {
    align-self: center;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #fff;
    background: #18292f;
    box-shadow: 0 7px 14px rgba(17, 32, 38, .18);
    font-weight: 950;
}

.operator.plus {
    margin: 0 auto;
}

.operator.arrow {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    color: #fff;
    font-size: 22px;
}

.empty-state {
    grid-column: 1 / -1;
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #b9cbc2;
    border-radius: 8px;
    padding: 26px;
    color: var(--muted);
    background: rgba(255, 255, 255, .62);
    text-align: center;
}

.empty-state.shortest-hint {
    gap: 10px;
}

.empty-state.shortest-hint .pal-chip {
    margin: 2px auto;
}

.empty-state.shortest-hint p {
    margin: 0;
    color: #41574d;
    font-size: 13px;
    font-weight: 700;
}

.loading-state {
    gap: 10px;
    color: #173d2f;
    background: linear-gradient(135deg, #eef8f4, #fff);
}

.loading-state span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 16px 0 0 rgba(43, 183, 129, .55), 32px 0 0 rgba(43, 183, 129, .25);
    animation: pal-loading-pulse 1s infinite ease-in-out;
}

@keyframes pal-loading-pulse {
    0%, 100% {
        opacity: .45;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-state span,
    .scroll-top-button {
        animation: none;
        transition: none;
    }
}

.render-error {
    border: 1px solid #f0c9c9;
    color: #7b2424;
    background: #fff5f5;
}

.load-more {
    grid-column: 1 / -1;
    min-height: 54px;
    border: 1px dashed #b9cbc2;
    border-radius: 8px;
    padding: 0 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 950;
}

.path-results {
    min-height: 160px;
    margin-top: 18px;
}

.path-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border: 1px solid #cfe2d9;
    border-radius: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #ffffff, #edf8f2);
}

.path-summary strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    font-size: 16px;
    font-weight: 950;
    white-space: nowrap;
}

.path-step-list {
    display: grid;
    gap: 12px;
}

.path-route-list {
    display: grid;
    gap: 14px;
}

.path-route {
    border: 1px solid #cfe2d9;
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, .72);
}

.path-route h3 {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin: 0 0 10px;
    border-radius: 999px;
    padding: 0 11px;
    color: #17211d;
    background: var(--amber);
    font-size: 13px;
    font-weight: 950;
}

.path-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.path-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: #17211d;
    background: var(--amber);
    font-weight: 950;
    box-shadow: 0 8px 16px rgba(17, 32, 38, .15);
}

.special-box {
    margin-top: 18px;
    padding: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.section-title button {
    height: 38px;
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--green-dark);
    cursor: pointer;
    font-weight: 900;
}

.section-title button:hover {
    border-color: var(--green);
}

.section-title .search-clear {
    color: #315345;
    background: #f7fbf9;
}

.section-title .search-clear:hover,
.section-title .search-clear:focus {
    color: var(--green-dark);
    background: #eef8f4;
}

.section-title .search-copy {
    color: #fff;
    border-color: #173d2f;
    background: #173d2f;
}

.section-title .search-copy:hover,
.section-title .search-copy:focus {
    color: #173d2f;
    border-color: var(--green);
    background: #eef8f4;
}

.section-title .dex-favorite-filter {
    color: #173d2f;
    border-color: #d8c376;
    background: #fff8dc;
}

.section-title .dex-favorite-filter:hover,
.section-title .dex-favorite-filter:focus,
.section-title .dex-favorite-filter.is-active {
    color: #fff;
    border-color: #a05d00;
    background: #a05d00;
}

.history-clear {
    color: #7b2424 !important;
    border-color: #e4b9b9 !important;
    background: #fff7f7 !important;
}

.history-copy,
.history-import,
.history-toggle {
    min-height: 34px;
    border: 1px solid #b9d8ca;
    border-radius: 8px;
    padding: 0 12px;
    color: #173d2f;
    background: #f7fbf9;
    cursor: pointer;
    font-weight: 900;
}

.history-copy:hover,
.history-copy:focus,
.history-import:hover,
.history-import:focus,
.history-toggle:hover,
.history-toggle:focus {
    border-color: var(--green);
    background: #eef8f4;
}

.history-import {
    border-color: #cfd6e8;
    color: #243657;
    background: #f5f7fc;
}

.history-toggle {
    border-color: #cddbcf;
    color: #315345;
    background: #f7fbf9;
}

.history-clear:hover,
.history-clear:focus {
    border-color: #bd6b6b !important;
}

.special-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 12px;
    max-height: 260px;
    overflow: hidden;
}

.special-grid.is-open {
    max-height: none;
}

.suggest-box {
    position: absolute;
    z-index: 50;
    display: none;
    max-height: 340px;
    overflow: auto;
    border: 1px solid #b9cfc5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(12, 24, 20, .24);
}

.suggest-box.is-open {
    display: block;
}

.suggest-box.is-inline {
    position: static;
    width: 100%;
    max-height: 238px;
    margin-top: 6px;
    box-shadow: 0 8px 18px rgba(12, 24, 20, .12);
}

.suggest-box button {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-bottom: 1px solid #e1ebe6;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.suggest-box .pal-icon {
    width: 42px;
    height: 42px;
}

.suggest-box .pal-icon img {
    width: 38px;
    height: 38px;
}

.suggest-text {
    min-width: 0;
}

.suggest-box button:last-child {
    border-bottom: 0;
}

.suggest-box button:hover,
.suggest-box button:focus {
    background: #eef8f4;
    outline: none;
}

.suggest-box b,
.suggest-box small,
.suggest-box span {
    display: block;
}

.suggest-box small {
    margin-bottom: 2px;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 900;
}

.suggest-box span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.scroll-top-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 40;
    min-width: 54px;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 0 14px;
    color: #fff;
    background: #173d2f;
    box-shadow: 0 10px 24px rgba(17, 33, 27, .24);
    font-size: 13px;
    font-weight: 950;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
    cursor: pointer;
}

.scroll-top-button.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-button:hover,
.scroll-top-button:focus {
    background: #0d6b55;
}

@media (max-width: 980px) {
    .pal-header {
        grid-template-columns: 1fr;
    }

    .pal-source-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .work-layout {
        grid-template-columns: 1fr;
    }

    .control-grid.three {
        grid-template-columns: 1fr;
    }

    .technology-planner,
    .technology-filters,
    .tech-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .technology-level-row {
        grid-template-columns: 1fr;
    }

    .technology-slots {
        grid-template-columns: 1fr;
    }

    .technology-regular-slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .technology-ancient-slots {
        border-left: 0;
        border-top: 1px solid rgba(180, 134, 255, .28);
        padding-left: 0;
        padding-top: 12px;
    }
}

@media (max-width: 760px) {
    .pal-page {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .pal-header {
        padding: 20px;
    }

    .scroll-top-button {
        right: 12px;
        bottom: 12px;
        min-width: 48px;
        min-height: 38px;
        padding: 0 12px;
    }

    .header-stats,
    .tabs,
    .home-quick-panel,
    .home-grid,
    .control-grid.two {
        grid-template-columns: 1fr;
    }

    .home-quick-actions {
        justify-content: stretch;
    }

    .home-quick-button {
        flex: 1 1 100%;
    }

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

    .control-row {
        display: block;
    }

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

    .technology-planner,
    .technology-filters,
    .tech-stat-grid {
        grid-template-columns: 1fr;
    }

    .technology-slots {
        grid-template-columns: 1fr;
    }

    .technology-regular-slots {
        grid-template-columns: 1fr;
    }

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

    .technology-icon {
        width: 48px;
        height: 48px;
    }

    .panel {
        padding: 16px;
    }

    .panel-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .panel-clear,
    .panel-share,
    .panel-swap {
        width: 100%;
    }

    .switch {
        margin-top: 10px;
        width: 100%;
    }

    .result-list,
    .result-list.compact,
    .special-grid {
        grid-template-columns: 1fr;
    }

    .more-actions {
        grid-template-columns: 1fr;
    }

    button.dex-more.is-secondary {
        width: 100%;
    }

    .tier-band {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .tier-band > strong {
        min-height: 72px;
        font-size: 20px;
    }

    .tier-items {
        grid-template-columns: 1fr;
    }

    .combo-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .path-summary,
    .path-step {
        grid-template-columns: 1fr;
    }

    .path-summary strong,
    .path-step > span {
        margin: 0 auto;
    }

    .operator.arrow {
        margin: 0 auto;
        transform: rotate(90deg);
    }

    .operator.arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .result-pal {
        min-height: 0;
    }

    .result-pal .pal-link {
        min-height: 82px;
        grid-template-columns: 58px minmax(0, 1fr);
        padding: 10px;
    }

    .result-pal .pal-icon {
        width: 58px;
        height: 58px;
    }

    .result-pal .pal-icon img {
        width: 52px;
        height: 52px;
    }

    .result-pal .pal-name {
        font-size: 16px;
    }

    .pal-detail-hero,
    .detail-layout,
    .detail-neighbor-nav {
        grid-template-columns: 1fr;
    }

    .pal-detail-hero .pal-icon {
        width: 92px;
        height: 92px;
    }

    .pal-detail-hero .pal-icon img {
        width: 80px;
        height: 80px;
    }

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