:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #eef2ef;
    color: #16201d;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        linear-gradient(180deg, rgba(238, 242, 239, 0.98), rgba(230, 236, 232, 0.94)),
        #eef2ef;
}

button,
input,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.app-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    width: min(1440px, calc(100vw - 32px));
    min-height: 58px;
    margin: 0 auto;
    padding: 10px 0;
    background: rgba(238, 242, 239, 0.92);
    backdrop-filter: blur(14px);
}

.brand-link {
    color: #28745d;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links,
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav-links {
    justify-content: center;
    flex-wrap: wrap;
}

.nav-user {
    justify-content: flex-end;
}

.nav-links a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    border-radius: 8px;
    color: #34413d;
    padding: 0 12px;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
}

.nav-links a.active {
    background: #101817;
    color: #ffffff;
}

.nav-muted {
    color: #66736f;
    font-size: 0.82rem;
    font-weight: 800;
}

.nav-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 8px;
    background: #e9f3ee;
    color: #28745d;
    padding: 0 9px;
    font-size: 0.76rem;
    font-weight: 900;
}

.app-shell {
    width: min(1440px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 14px 0 20px;
}

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

.eyebrow {
    margin: 0 0 4px;
    color: #28745d;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #101817;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-picker,
.secondary-action,
.profile-link {
    position: relative;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 16px;
    text-decoration: none;
    font-weight: 800;
}

.secondary-action.is-disabled {
    opacity: 0.62;
}

.file-picker {
    min-width: 144px;
    border: 1px solid #101817;
    background: #101817;
    color: #ffffff;
    cursor: pointer;
}

.secondary-action,
.profile-link {
    border: 1px solid rgba(16, 24, 23, 0.16);
    background: rgba(251, 250, 246, 0.88);
    color: #182421;
}

.profile-link {
    color: #28745d;
}

.file-picker input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.notice {
    margin: 0 0 14px;
    border: 1px solid #bd4d35;
    border-radius: 8px;
    background: #fff4ef;
    color: #7d291a;
    padding: 12px 14px;
    font-weight: 700;
}

.admin-layout {
    display: block;
}

.admin-workbench {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-sidebar {
    display: grid;
    gap: 18px;
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(248, 249, 247, 0.9);
    padding: 12px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.1);
}

.admin-main {
    min-width: 0;
}

.admin-nav-group {
    display: grid;
    gap: 5px;
}

.admin-nav-group > span {
    color: #66736f;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 0 8px 3px;
}

.admin-nav-group button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #25312e;
    padding: 0 10px;
    text-align: left;
    font-weight: 850;
}

.admin-nav-group button:hover,
.admin-nav-group button:focus-visible {
    background: rgba(40, 116, 93, 0.08);
    outline: none;
}

.admin-nav-group button.is-active {
    background: #28745d;
    color: #ffffff;
}

.admin-panel {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.admin-table {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 150px 120px 160px 140px;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.82);
    padding: 12px;
}

.admin-row-head {
    background: transparent;
    color: #66736f;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-row strong,
.admin-row span {
    display: block;
}

.admin-row span {
    color: #66736f;
    font-size: 0.86rem;
}

.admin-row select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(16, 24, 23, 0.18);
    border-radius: 8px;
    background: #ffffff;
    color: #16201d;
    padding: 0 10px;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    min-height: 30px;
    align-items: center;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 0.82rem;
    font-weight: 900;
}

.status-pill.is-ok {
    background: #e9f3ee;
    color: #28745d;
}

.status-pill.is-danger {
    background: #fff4ef;
    color: #bd4d35;
}

.admin-progress {
    display: grid;
    gap: 2px;
}

.admin-actions .secondary-action {
    width: 100%;
}

.segmented-control {
    display: inline-flex;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.88);
}

.segmented-control button {
    min-width: 120px;
    border: 0;
    background: transparent;
    color: #34413d;
    padding: 0 14px;
    font-weight: 900;
}

.segmented-control button.is-active {
    background: #101817;
    color: #ffffff;
}

.segmented-control.compact {
    min-height: 38px;
}

.segmented-control.compact button {
    min-width: 96px;
}

.achievement-admin {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.achievement-list-panel,
.achievement-editor-panel {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.category-admin {
    grid-template-columns: minmax(320px, 380px) minmax(420px, 1fr);
}

.category-tree-panel {
    padding: 0;
    overflow: hidden;
}

.category-tree-panel > .panel-head {
    margin: 0;
    padding: 16px 16px 10px;
}

.category-editor-panel {
    display: block;
}

.category-editor-panel .achievement-form {
    max-width: 720px;
}

.category-tree-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 16px 12px;
}

.category-tree-toolbar input {
    min-width: 0;
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 6px;
    background: #fff;
    padding: 9px 10px;
    color: #101817;
}

.category-tree-actions {
    display: flex;
    gap: 12px;
    border-block: 1px solid rgba(16, 24, 23, 0.09);
    background: #f5f7f5;
    padding: 7px 16px;
}

.category-tree-actions button {
    border: 0;
    background: transparent;
    color: #52605c;
    padding: 2px 0;
    font-size: 0.76rem;
    font-weight: 800;
}

.category-tree-actions button:hover,
.category-tree-actions button:focus-visible {
    color: #28745d;
    outline: none;
}

.category-tree,
.category-tree-group {
    display: grid;
}

.category-tree {
    max-height: 620px;
    overflow: auto;
    background: #ffffff;
}

.category-tree-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto 10px 28px;
    gap: 6px;
    align-items: center;
    min-height: 46px;
    border-bottom: 1px solid rgba(16, 24, 23, 0.07);
    border-left: 3px solid transparent;
    background: #ffffff;
    padding: 5px 7px 5px var(--tree-indent);
}

.category-tree-row:hover,
.category-tree-row:focus-within {
    background: #f3f7f5;
}

.category-tree-row.is-selected {
    border-left-color: #28745d;
    background: #eaf4ef;
}

.category-tree-row.is-disabled {
    color: #79847f;
}

.category-tree-toggle,
.category-tree-toggle-spacer {
    width: 24px;
    height: 24px;
}

.category-tree-toggle {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 0;
}

.category-tree-toggle:hover,
.category-tree-toggle:focus-visible {
    background: rgba(40, 116, 93, 0.1);
    outline: none;
}

.category-tree-toggle span {
    width: 7px;
    height: 7px;
    border-right: 2px solid #63706c;
    border-bottom: 2px solid #63706c;
    transform: rotate(-45deg);
    transition: transform 120ms ease;
}

.category-tree-toggle.is-expanded span {
    transform: rotate(45deg) translate(-1px, -1px);
}

.category-tree-label {
    display: grid;
    gap: 2px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
}

.category-tree-label strong,
.category-tree-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-tree-label strong {
    font-size: 0.88rem;
}

.category-tree-label span {
    color: #74807c;
    font-size: 0.72rem;
}

.category-tree-count {
    min-width: 20px;
    color: #6a7772;
    text-align: right;
    font-size: 0.72rem;
    font-weight: 800;
}

.category-tree-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aeb6b2;
}

.category-tree-status.is-active {
    background: #2f8a68;
}

.category-tree-delete {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #a9402b;
    padding: 0;
    font-size: 1.15rem;
    opacity: 0;
}

.category-tree-row:hover .category-tree-delete,
.category-tree-row:focus-within .category-tree-delete,
.category-tree-delete:focus-visible {
    opacity: 1;
}

.category-tree-delete:hover,
.category-tree-delete:focus-visible {
    background: #fff0eb;
    outline: none;
}

.achievement-editor-panel {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 16px;
}

.admin-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.admin-search input,
.achievement-form input,
.achievement-form textarea {
    width: 100%;
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 8px;
    background: #ffffff;
    color: #16201d;
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
}

.achievement-form textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.4;
}

.achievement-list,
.achievement-form {
    display: grid;
    gap: 10px;
}

.achievement-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 36px;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 10px;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.achievement-row.is-selected,
.achievement-row:hover,
.achievement-row:focus-within {
    border-color: rgba(157, 106, 32, 0.42);
    background: #fff8e5;
    transform: translateY(-1px);
}

.achievement-row-main {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
}

.achievement-row-main strong,
.achievement-row-main span {
    overflow-wrap: anywhere;
}

.achievement-row-main span {
    color: #66736f;
    font-size: 0.8rem;
    font-weight: 800;
}

.status-pill.is-muted {
    background: #ecefed;
    color: #5c6a66;
}

.achievement-form label {
    display: grid;
    gap: 6px;
    color: #26332f;
    font-size: 0.86rem;
    font-weight: 900;
}

.achievement-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.check-line {
    display: inline-flex !important;
    grid-auto-flow: column;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: fit-content;
}

.check-line input {
    width: 18px;
    height: 18px;
}

.hex-editor {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.72);
    padding: 12px;
}

.panel-head.slim {
    margin-bottom: 0;
}

.hex-chip-list {
    display: flex;
    min-height: 42px;
    flex-wrap: wrap;
    gap: 6px;
}

.hex-chip {
    min-height: 30px;
    border: 1px solid rgba(157, 106, 32, 0.28);
    border-radius: 8px;
    background: #fff8e5;
    color: #6d4713;
    padding: 0 9px;
    font-size: 0.78rem;
    font-weight: 900;
}

.hex-chip.is-warning {
    border-color: rgba(189, 77, 53, 0.38);
    background: #fff4ef;
    color: #7d291a;
}

.resolution-warning {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(157, 106, 32, 0.28);
    border-radius: 8px;
    background: #fff8e5;
    color: #6d4713;
    padding: 10px;
    font-size: 0.86rem;
    font-weight: 800;
}

.achievement-map-shell {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border-radius: 8px;
    background: #dce8dd;
}

.achievement-map {
    height: 640px;
}

.location-search {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 600;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    max-width: 560px;
}

.location-search input {
    min-height: 42px;
    border: 1px solid rgba(16, 24, 23, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #16201d;
    padding: 0 12px;
    font: inherit;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(16, 24, 23, 0.14);
}

.location-search .secondary-action {
    min-width: 96px;
    background: rgba(251, 250, 246, 0.96);
    box-shadow: 0 10px 30px rgba(16, 24, 23, 0.14);
}

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

.viewer,
.summary {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.viewer {
    min-height: 760px;
    overflow: hidden;
}

.map-panel {
    position: relative;
    min-height: 760px;
    background: #dce8dd;
}

.track-map {
    width: 100%;
    height: 760px;
}

.leaflet-container {
    font-family: inherit;
    background: #dce8dd;
}

.leaflet-control-attribution {
    font-size: 0.68rem;
}

.map-status-panel {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 500;
    display: inline-flex;
    max-width: min(520px, calc(100% - 32px));
    min-height: 38px;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(16, 24, 23, 0.18);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.94);
    color: #25312e;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 750;
    box-shadow: 0 10px 30px rgba(16, 24, 23, 0.14);
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f4c95d;
    box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.22);
}

.status-dot.is-ready {
    background: #28745d;
    box-shadow: 0 0 0 4px rgba(40, 116, 93, 0.18);
}

.map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 500;
    display: grid;
    grid-auto-flow: column;
    gap: 8px;
}

.map-controls button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(16, 24, 23, 0.2);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.96);
    color: #182421;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 10px 30px rgba(16, 24, 23, 0.12);
}

.map-controls button.is-active {
    border-color: rgba(40, 116, 93, 0.55);
    background: #28745d;
    color: #ffffff;
}

.empty-view {
    position: absolute;
    inset: 0;
    z-index: 450;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    background:
        linear-gradient(rgba(35, 69, 60, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(35, 69, 60, 0.08) 1px, transparent 1px),
        rgba(232, 239, 230, 0.9);
    background-size: 54px 54px;
    color: #53625d;
    pointer-events: none;
}

.empty-mark {
    width: 112px;
    height: 112px;
    border: 2px solid rgba(40, 116, 93, 0.35);
    clip-path: polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0 50%);
    background:
        linear-gradient(90deg, transparent 47%, rgba(225, 90, 61, 0.75) 49%, rgba(225, 90, 61, 0.75) 51%, transparent 53%),
        linear-gradient(30deg, transparent 46%, rgba(40, 116, 93, 0.55) 48%, rgba(40, 116, 93, 0.55) 52%, transparent 54%);
}

.empty-view h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0;
}

.summary {
    padding: 16px;
}

.summary-head {
    display: grid;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(16, 24, 23, 0.12);
}

.summary-head span,
.metric span,
.details dt {
    color: #66736f;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.summary-head strong {
    overflow-wrap: anywhere;
}

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

.metric {
    min-height: 86px;
    display: grid;
    align-content: space-between;
    gap: 10px;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 12px;
}

.metric strong {
    color: #101817;
    font-size: 1.18rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.details div {
    display: grid;
    gap: 4px;
}

.details dd {
    margin: 0;
    color: #25312e;
    overflow-wrap: anywhere;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.profile-panel {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.profile-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.avatar {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 8px;
    background: #28745d;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 850;
}

.profile-card h2,
.profile-panel h2 {
    margin: 4px 0 4px;
    color: #101817;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.profile-card p,
.muted {
    margin: 0;
    color: #5c6a66;
}

.panel-label,
.profile-fields span,
.track-row span,
.track-stat small {
    color: #66736f;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.profile-fields {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.profile-fields div {
    display: grid;
    gap: 5px;
    border-top: 1px solid rgba(16, 24, 23, 0.1);
    padding-top: 12px;
}

.profile-fields strong {
    overflow-wrap: anywhere;
}

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

.level-card {
    display: grid;
    gap: 9px;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    padding: 12px;
    background: rgba(251, 250, 246, 0.72);
}

.level-card div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.level-card strong {
    color: #101817;
}

.level-card span,
.level-card small {
    color: #5c6a66;
}

.level-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 24, 23, 0.1);
}

.level-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #28745d;
}

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

.track-list {
    display: grid;
    gap: 10px;
}

.track-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 12px;
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.activity-type-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 2px solid rgba(16, 24, 23, 0.72);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(16, 24, 23, 0.13);
    color: #101817;
    font-size: 2rem;
    font-weight: 950;
    line-height: 1;
}

.track-row .activity-type-icon {
    font-size: 2rem;
}

.track-achievement-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.track-achievement-summary > span {
    border-radius: 999px;
    background: rgba(225, 90, 61, 0.1);
    color: #6d382d;
    padding: 3px 7px;
    font-size: 0.76rem;
    font-weight: 800;
}

.track-link {
    display: grid;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    outline: none;
}

.track-row:hover,
.track-row:focus-within {
    border-color: rgba(40, 116, 93, 0.34);
    background: #f3f8f2;
    transform: translateY(-1px);
}

.track-link:focus-visible strong {
    color: #28745d;
}

.track-main {
    min-width: 0;
}

.track-side {
    display: grid;
    grid-template-columns: auto 36px;
    gap: 10px;
    align-items: center;
}

.track-row strong {
    overflow-wrap: anywhere;
}

.track-stat {
    display: grid;
    min-width: 58px;
    justify-items: end;
    color: #101817;
}

.track-stat span {
    color: #101817;
    font-size: 1.05rem;
}

.icon-danger {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(189, 77, 53, 0.24);
    border-radius: 8px;
    background: #fff8f4;
    color: #bd4d35;
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1;
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.icon-danger:hover,
.icon-danger:focus-visible {
    border-color: rgba(189, 77, 53, 0.52);
    background: #fff0e8;
    outline: none;
    transform: translateY(-1px);
}

.icon-danger:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 24, 23, 0.48);
}

.confirm-dialog {
    width: min(460px, 100%);
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 20px;
    box-shadow: 0 22px 70px rgba(16, 24, 23, 0.28);
}

.confirm-dialog h2 {
    margin: 6px 0 10px;
    color: #101817;
    font-size: 1.32rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.confirm-dialog p {
    margin: 0;
    color: #4f5f5a;
    line-height: 1.45;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.danger-action {
    min-height: 40px;
    border: 1px solid rgba(189, 77, 53, 0.38);
    border-radius: 8px;
    background: #bd4d35;
    color: #ffffff;
    padding: 0 16px;
    font-weight: 900;
}

.danger-action:hover,
.danger-action:focus-visible {
    background: #a9402b;
    outline: none;
}

.danger-action:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.profile-login {
    width: fit-content;
    margin-top: 16px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}

.content-panel,
.settings-panel,
.achievement-card {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.content-panel h2,
.settings-panel h2,
.achievement-card h2 {
    margin: 5px 0 8px;
    color: #101817;
    font-size: 1.16rem;
    letter-spacing: 0;
}

.language-select {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    color: #45534f;
    font-size: 0.82rem;
    font-weight: 700;
}

.language-select select {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(16, 24, 23, 0.2);
    border-radius: 6px;
    background: #fff;
    padding: 8px 10px;
    color: #101817;
    font: inherit;
}

.language-status {
    margin: 10px 0 0;
    color: #28745d;
    font-size: 0.82rem;
}

.language-status.is-error {
    color: #a9402b;
}

.translation-editor {
    display: grid;
    gap: 12px;
    border-block: 1px solid rgba(16, 24, 23, 0.12);
    padding-block: 14px;
}

.translation-editor .segmented-control {
    width: auto;
}

.empty-state {
    display: grid;
    min-height: 260px;
    align-content: center;
    justify-items: start;
    gap: 12px;
    border: 1px dashed rgba(40, 116, 93, 0.28);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.7);
    padding: 24px;
}

.empty-state h2,
.empty-state p {
    margin: 0;
}

.empty-state p {
    color: #5c6a66;
}

.roadmap-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.roadmap-list li {
    border-left: 3px solid #28745d;
    background: rgba(251, 250, 246, 0.72);
    padding: 9px 10px;
    color: #25312e;
}

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

.world-preview {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
    min-height: 520px;
    align-content: center;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(220, 232, 221, 0.85), rgba(205, 221, 213, 0.88)),
        #dce8dd;
    padding: 28px;
    overflow: hidden;
}

.world-cell {
    aspect-ratio: 1.12;
    clip-path: polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0 50%);
    background: rgba(16, 24, 23, 0.55);
}

.world-cell.is-known {
    background: rgba(40, 116, 93, 0.32);
}

.world-cell.is-open {
    background: #f4c95d;
    box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.18);
}

.achievement-grid,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-nav {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 8px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.1);
}

.settings-nav a {
    border-radius: 6px;
    color: #45534f;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.settings-nav a:hover,
.settings-nav a:focus-visible {
    background: rgba(40, 116, 93, 0.08);
    color: #101817;
    outline: none;
}

.settings-nav a.active {
    background: #101817;
    color: #ffffff;
}

.settings-layout .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.settings-section {
    display: grid;
    gap: 16px;
}

.settings-section-heading {
    border-bottom: 1px solid rgba(16, 24, 23, 0.13);
    padding: 4px 2px 16px;
}

.settings-section-heading h2 {
    margin: 5px 0 8px;
}

.settings-section-heading p {
    margin: 0;
}

.integration-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.integration-mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 8px;
    background: #101817;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 900;
}

.integration-mark.is-strava {
    background: #fc4c02;
}

.integration-copy {
    display: grid;
    gap: 7px;
}

.integration-copy p,
.integration-title-row h3 {
    margin: 0;
}

.integration-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.integration-title-row h3 {
    color: #101817;
    font-size: 1rem;
}

.integration-status {
    border-radius: 999px;
    background: rgba(244, 201, 93, 0.3);
    color: #675117;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 900;
}

.integration-status.is-connected {
    background: rgba(40, 116, 93, 0.14);
    color: #1f674f;
}

.integration-note {
    color: #687570;
    font-size: 0.8rem;
}

.integration-action:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.integration-action.is-strava {
    border-color: #fc4c02;
    background: #fc4c02;
    color: #ffffff;
}

.integration-action.is-strava:hover,
.integration-action.is-strava:focus-visible {
    border-color: #d83f00;
    background: #d83f00;
}

.achievement-grid.in-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.achievement-card {
    display: grid;
    gap: 16px;
    align-content: start;
}

.achievement-card.is-active {
    border-color: rgba(40, 116, 93, 0.34);
    background: rgba(238, 247, 241, 0.86);
}

.achievement-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.achievement-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 8px;
    background: #101817;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 900;
}

.achievement-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.achievement-card p,
.settings-panel p {
    margin: 0;
}

.achievement-card-meta,
.achievement-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.achievement-card-meta span,
.achievement-card-stats span {
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.72);
    color: #4f5f5a;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 800;
}

.achievement-browser {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
}

.achievement-browser-main,
.achievement-category-panel {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 14px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.12);
}

.achievement-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.achievement-toolbar input {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 8px;
    background: #ffffff;
    color: #16201d;
    padding: 0 12px;
    font: inherit;
    font-weight: 750;
}

.achievement-list-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    color: #66736f;
    font-size: 0.82rem;
    font-weight: 850;
}

.achievement-compact-list {
    display: grid;
    gap: 6px;
}

.achievement-compact-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) minmax(120px, 180px) auto;
    gap: 10px;
    align-items: center;
    min-height: 62px;
    border: 1px solid rgba(16, 24, 23, 0.09);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.68);
    color: inherit;
    padding: 8px 10px;
    text-decoration: none;
    transition: opacity 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
    opacity: 0.54;
}

.achievement-compact-row:hover,
.achievement-compact-row:focus-visible {
    border-color: rgba(40, 116, 93, 0.35);
    background: rgba(247, 249, 245, 0.95);
    opacity: 0.82;
    transform: translateY(-1px);
    outline: none;
}

.achievement-compact-row.is-unlocked {
    border-color: rgba(40, 116, 93, 0.28);
    background: rgba(238, 247, 241, 0.72);
    opacity: 1;
}

.achievement-compact-row:not(.is-unlocked) .achievement-small-mark img {
    filter: grayscale(0.88) saturate(0.35);
}

.achievement-small-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: #182421;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
}

.achievement-small-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.achievement-row-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.achievement-row-copy strong {
    color: #101817;
    overflow-wrap: anywhere;
}

.achievement-row-copy span,
.achievement-row-category {
    color: #5c6a66;
    font-size: 0.84rem;
    line-height: 1.35;
}

.achievement-row-status {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.achievement-row-status time {
    color: #66736f;
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
}

.activity-type-editor {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin: 14px 0;
}

.activity-type-editor .activity-type-icon {
    grid-row: 1 / span 2;
    align-self: center;
}

.activity-type-editor label {
    grid-column: 2 / -1;
    color: #5c6a66;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.activity-type-editor select {
    min-width: 0;
    height: 38px;
    border: 1px solid rgba(16, 24, 23, 0.16);
    border-radius: 8px;
    background: #ffffff;
    padding: 0 10px;
    font: inherit;
}

.activity-type-editor .secondary-action {
    min-height: 38px;
}

.inline-status {
    margin: -6px 0 12px;
    color: #28745d;
    font-size: 0.82rem;
    font-weight: 800;
}

.track-achievements {
    display: grid;
    gap: 7px;
    margin-top: 18px;
}

.track-achievement-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    border: 1px solid rgba(16, 24, 23, 0.09);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 7px;
}

.track-achievement-card img,
.track-achievement-card > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 7px;
    object-fit: cover;
}

.track-achievement-card div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.track-achievement-card small {
    color: #66736f;
}

.achievement-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 18px;
    align-items: start;
}

.achievement-detail-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.achievement-detail-hero,
.achievement-track-section {
    border: 1px solid rgba(16, 24, 23, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    padding: 18px;
    box-shadow: 0 18px 60px rgba(30, 48, 41, 0.1);
}

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

.achievement-detail-hero.is-locked {
    opacity: 0.68;
}

.achievement-detail-icon {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border-radius: 16px;
    background: #182421;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 950;
    overflow: hidden;
}

.achievement-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.achievement-detail-copy {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.achievement-detail-copy h2,
.achievement-track-section h2 {
    margin: 0;
}

.achievement-detail-copy p,
.achievement-statistics p {
    margin: 0;
    color: #5c6a66;
    line-height: 1.5;
}

.achievement-detail-facts {
    display: grid;
    gap: 8px;
    min-width: 170px;
}

.achievement-detail-facts div {
    display: grid;
    gap: 3px;
    border: 1px solid rgba(16, 24, 23, 0.09);
    border-radius: 8px;
    background: #fbfaf6;
    padding: 10px;
}

.achievement-detail-facts span {
    color: #66736f;
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.achievement-track-section {
    display: grid;
    gap: 12px;
}

.achievement-track-map {
    min-height: 520px;
}

.achievement-statistics {
    display: grid;
    gap: 12px;
}

.achievement-percentage {
    color: #28745d;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 1;
}

.achievement-stat-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 24, 23, 0.1);
}

.achievement-stat-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #28745d;
}

.privacy-note {
    border-left: 3px solid rgba(40, 116, 93, 0.45);
    padding-left: 10px;
    font-size: 0.8rem;
}

.achievement-row-copy span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.achievement-row-category {
    overflow-wrap: anywhere;
    font-weight: 800;
}

.achievement-category-panel {
    display: grid;
    gap: 6px;
}

.achievement-category-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #25312e;
    padding: 0 10px;
    text-align: left;
}

.achievement-category-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 850;
}

.achievement-category-link strong {
    color: #66736f;
    font-size: 0.82rem;
}

.achievement-category-link:hover,
.achievement-category-link:focus-visible {
    background: rgba(40, 116, 93, 0.08);
    outline: none;
}

.achievement-category-link.is-active {
    background: #182421;
    color: #ffffff;
}

.achievement-category-link.is-active strong {
    color: rgba(255, 255, 255, 0.78);
}

.settings-list.compact {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.settings-list.compact article {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(16, 24, 23, 0.1);
    border-radius: 8px;
    background: rgba(251, 250, 246, 0.72);
    padding: 12px;
}

.settings-list.compact span {
    color: #5c6a66;
    line-height: 1.4;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: min(460px, calc(100vw - 32px));
    border: 1px solid #bd4d35;
    border-radius: 8px;
    background: #fff4ef;
    color: #7d291a;
    padding: 12px 42px 12px 14px;
    box-shadow: 0 18px 40px rgba(16, 24, 23, 0.18);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    color: inherit;
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 980px) {
    .app-nav {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .nav-links,
    .nav-user {
        justify-content: flex-start;
    }

    .workspace,
    .content-grid,
    .admin-workbench,
    .achievement-browser,
    .achievement-detail-layout,
    .achievement-admin,
    .achievement-editor-panel {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

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

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

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

    .viewer,
    .map-panel {
        min-height: 560px;
    }

    .track-map {
        height: 560px;
    }

    .achievement-map-shell {
        min-height: 560px;
    }

    .achievement-map {
        height: 560px;
    }

    .achievement-grid,
    .settings-grid,
    .roadmap-list.columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .achievement-toolbar,
    .achievement-compact-row {
        grid-template-columns: 1fr;
    }

    .settings-layout .settings-grid,
    .integration-card {
        grid-template-columns: 1fr;
    }

    .integration-action {
        width: 100%;
    }

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

    .achievement-detail-facts {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .achievement-small-mark {
        display: none;
    }

    .category-tree-delete {
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .app-shell,
    .app-nav {
        width: min(100vw - 20px, 1440px);
    }

    .app-shell {
        padding: 16px 0;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    h1 {
        font-size: 2rem;
    }

    .file-picker {
        width: 100%;
    }

    .secondary-action,
    .profile-link {
        width: 100%;
    }

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

    .achievement-detail-hero {
        grid-template-columns: 1fr;
    }

    .achievement-detail-icon {
        width: 78px;
        height: 78px;
    }

    .achievement-detail-facts {
        grid-template-columns: 1fr;
    }

    .achievement-track-map {
        min-height: 420px;
    }

    .map-controls {
        grid-auto-flow: row;
    }

    .segmented-control,
    .segmented-control button {
        width: 100%;
    }

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

    .category-tree-toolbar {
        grid-template-columns: 1fr;
    }

    .category-tree-actions {
        justify-content: space-between;
    }

    .admin-sidebar {
        grid-template-columns: 1fr;
    }

    .achievement-toolbar .segmented-control,
    .achievement-toolbar .segmented-control button {
        width: 100%;
    }

    .location-search {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .achievement-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .achievement-row .icon-danger {
        grid-column: 2;
    }

    .achievement-grid,
    .settings-grid,
    .roadmap-list.columns {
        grid-template-columns: 1fr;
    }

    .world-preview {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        min-height: 420px;
        padding: 18px;
    }
}
