:root {
    color-scheme: light;
    --bg: #f4f1ea;
    --panel: #fffdf8;
    --panel-soft: #fbf7ef;
    --panel-muted: #f7f1e7;
    --panel-hover: #f1e8da;
    --panel-hover-strong: #eee5d8;
    --field-bg: #ffffff;
    --ink: #1d2522;
    --muted: #63706b;
    --line: #d8d0c2;
    --accent: #167a5a;
    --accent-strong: #0f5d45;
    --gold: #a36a1d;
    --danger: #a6332b;
    --secondary-bg: #ece4d6;
    --secondary-hover: #dfd3c1;
    --active-soft: #edf6f0;
    --active-soft-hover: #e8f4ec;
    --active-border: #9ac6aa;
    --danger-soft: #efe2dd;
    --danger-soft-hover: #e4cac2;
    --warning-soft: #fff7df;
    --warning-hover: #ffefbd;
    --warning-line: #d4b45b;
    --warning-ink: #7a5a12;
    --info-soft: #edf7ff;
    --info-hover: #dff0ff;
    --info-line: #8db5d7;
    --info-ink: #245273;
    --selection-bg: #eaf5ee;
    --selection-line: #a8cfb5;
    --table-head: #f8f2e8;
    --table-hover: #fffaf0;
    --code-bg: #12221d;
    --code-ink: #dcebe5;
    --badge-bg: #eadcc5;
    --badge-ink: #5b3b13;
    --mark-bg: #ffe6a8;
    --mark-ink: #4b3000;
    --shadow: 0 18px 50px rgba(38, 31, 22, 0.12);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b100e;
    --panel: #151d19;
    --panel-soft: #1d2923;
    --panel-muted: #22322a;
    --panel-hover: #2b4035;
    --panel-hover-strong: #345041;
    --field-bg: #101815;
    --ink: #f7fbf8;
    --muted: #c1d0c9;
    --line: #40524a;
    --accent: #2b8758;
    --accent-strong: #9df6c0;
    --gold: #f2c76f;
    --danger: #ff9d92;
    --secondary-bg: #25352d;
    --secondary-hover: #32483d;
    --active-soft: #1a422d;
    --active-soft-hover: #235c3d;
    --active-border: #57a876;
    --danger-soft: #341c1b;
    --danger-soft-hover: #462320;
    --warning-soft: #3f301c;
    --warning-hover: #533d20;
    --warning-line: #a47b31;
    --warning-ink: #ffe09c;
    --info-soft: #1b3347;
    --info-hover: #244963;
    --info-line: #4d85ab;
    --info-ink: #bde3ff;
    --selection-bg: #1c4a31;
    --selection-line: #68bb85;
    --table-head: #24332b;
    --table-hover: #1e2e27;
    --code-bg: #09100d;
    --code-ink: #b7f7cd;
    --badge-bg: #4a371c;
    --badge-ink: #ffe3a4;
    --mark-bg: #5a4216;
    --mark-ink: #ffe3a4;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.download-acumen-button,
.tab,
.subtab,
.detail-tab,
.setting-tab {
    touch-action: manipulation;
}

button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    padding: 0 14px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 650;
}

button:hover {
    background: var(--accent-strong);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tab:focus-visible,
.subtab:focus-visible,
.detail-tab:focus-visible,
.setting-tab:focus-visible,
.profile-button:focus-visible,
.nav-icon-button:focus-visible,
.nav-icon-toggle:focus-within {
    outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
    outline-offset: 2px;
}

button.secondary {
    background: var(--secondary-bg);
    color: var(--ink);
}

button.secondary:hover {
    background: var(--secondary-hover);
}

.danger-button {
    background: var(--danger-soft);
    color: var(--danger);
}

.danger-button:hover {
    background: var(--danger-soft-hover);
}

button.retry-button,
button.secondary.retry-button {
    background: #b45f17;
    color: #fff;
}

button.retry-button:hover,
button.retry-button:focus,
button.secondary.retry-button:hover,
button.secondary.retry-button:focus {
    background: #8f4710;
}

button:disabled,
button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    background: #d7d1c7;
    color: #736a5f;
}

.download-acumen-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0 14px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.download-acumen-button:hover,
.download-acumen-button:focus {
    background: var(--accent-strong);
    color: white;
}

.shell {
    min-height: 100vh;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-row img {
    image-rendering: pixelated;
}

.brand-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.brand-powered {
    justify-self: end;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.brand-home-button {
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.brand-home-button:hover {
    background: transparent;
    color: var(--accent-strong);
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 24px;
    line-height: 1.05;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 14px;
}

.brand-row p,
label span,
.muted {
    color: var(--muted);
}

label {
    display: grid;
    gap: 6px;
    margin-top: 18px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--field-bg);
    color: var(--ink);
}

input,
select {
    min-height: 38px;
    padding: 0 10px;
}

textarea {
    min-height: 460px;
    padding: 12px;
    font: 13px/1.45 "Cascadia Mono", Consolas, monospace;
    resize: vertical;
}

.login-panel button {
    width: 100%;
    margin-top: 22px;
}

.login-panel .theme-toggle {
    width: 40px;
    min-width: 40px;
    margin: 0 0 0 auto;
    padding: 0;
}

.theme-toggle {
    position: relative;
}

.theme-toggle .bootstrap-icon {
    transition: transform 0.16s ease, color 0.16s ease;
}

.theme-toggle:hover .bootstrap-icon,
.theme-toggle:focus .bootstrap-icon {
    transform: rotate(-10deg) scale(1.04);
}

.error-line {
    min-height: 20px;
    margin-top: 12px;
    color: var(--danger);
}

.app-view {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px 16px 40px;
}

.maintenance-banner {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(1180px, calc(100% - 32px));
    margin: 12px auto 0;
    padding: 10px 14px;
    border: 1px solid var(--warning-line);
    border-radius: 8px;
    background: var(--warning-soft);
    color: var(--warning-ink);
    box-shadow: 0 8px 24px rgba(80, 56, 16, 0.12);
}

.maintenance-banner .bootstrap-icon {
    flex: 0 0 auto;
}

.maintenance-banner-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    min-width: 0;
}

.maintenance-banner-copy strong,
.maintenance-banner-copy span {
    overflow-wrap: anywhere;
}

.maintenance-banner-copy span {
    color: color-mix(in srgb, var(--warning-ink) 78%, var(--muted));
    font-size: 13px;
}

#main-panels,
.detail-view,
.tab-panel,
.dashboard-panel,
.modal-panel,
.card {
    min-width: 0;
}

.topbar {
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, white);
    backdrop-filter: blur(12px);
}

.sidebar-toggle {
    display: none;
}

.brand-home-button {
    grid-column: 1;
}

.navbar-actions {
    grid-column: 3;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}

.primary-nav {
    min-width: 0;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.primary-nav .tab {
    min-height: 38px;
    border-color: transparent;
    background: transparent;
}

.primary-nav .tab:hover {
    border-color: var(--line);
    background: #f1e8da;
}

.primary-nav .tab.active {
    border-color: var(--ink);
}

.navbar-actions {
    position: relative;
}

.nav-icon-button,
.nav-icon-toggle {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
}

.nav-icon-button svg,
.nav-icon-toggle svg,
.profile-button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.nav-icon-button path,
.nav-icon-toggle path,
.profile-button path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-icon-button.download-acumen-button {
    width: auto;
}

.nav-icon-button.notification-button {
    position: relative;
    color: var(--ink);
}

.nav-icon-button.notification-button.active {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.nav-icon-toggle {
    position: relative;
}

.nav-icon-toggle input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nav-icon-toggle.is-on {
    border-color: #9ac6aa;
    background: #e8f4ec;
    color: var(--accent-strong);
    box-shadow: inset 0 0 0 1px rgba(22, 122, 90, 0.12);
}

.auto-refresh-state {
    min-width: 28px;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e5ded1;
    color: var(--muted);
    padding: 0 7px;
    font-size: 11px;
    font-weight: 900;
}

.auto-refresh-toggle.is-on .auto-refresh-state {
    background: var(--accent);
    color: white;
}

.profile-menu-wrap {
    position: relative;
}

.profile-button {
    max-width: 240px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.profile-avatar {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.profile-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: min(260px, calc(100vw - 24px));
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.profile-menu-item:hover {
    background: #f1e8da;
    color: var(--ink);
}

.danger-menu-item {
    color: var(--danger);
}

.danger-menu-item:hover {
    background: #f6e9e5;
    color: var(--danger);
}

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

.content-shell {
    min-width: 0;
    padding-top: 16px;
}

.side-nav {
    position: sticky;
    top: 82px;
    min-width: 0;
    align-self: start;
    min-height: calc(100vh - 104px);
    padding: 16px 12px 24px 0;
    border-right: 1px solid var(--line);
}

.side-nav-list {
    display: grid;
    align-content: start;
    gap: 6px;
    margin: 0;
    overflow: visible;
}

.side-nav .tab {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-color: transparent;
    border-radius: 6px;
    padding: 0 12px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    white-space: normal;
}

.side-nav .tab:hover {
    background: #f1e8da;
}

.side-nav .tab.active {
    border-color: #b9d5c5;
    background: var(--accent);
    color: white;
    box-shadow: 0 8px 20px rgba(15, 93, 69, 0.16);
}

.side-nav .tab:focus-visible {
    outline: 2px solid #8db5d7;
    outline-offset: 2px;
}

.side-nav-backdrop {
    display: none;
}

.friends-summary-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.friends-summary-button .pill {
    min-width: 28px;
    min-height: 22px;
    background: var(--panel);
}

.auto-refresh-toggle {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.auto-refresh-toggle:not(.is-on) svg {
    opacity: 0.62;
}

.auto-refresh-toggle.is-on {
    border-color: #8fc6a3;
    background: #e8f4ec;
    color: var(--accent-strong);
}

.auto-refresh-toggle input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.auto-refresh-toggle.nav-icon-toggle input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tabs {
    display: flex;
    gap: 4px;
    margin: 14px 0;
    overflow-x: auto;
}

.tab {
    min-height: 32px;
    flex: 0 0 auto;
    padding: 0 10px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    font-size: 13px;
    white-space: nowrap;
}

.tab.active {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

.site-settings-tab {
    white-space: nowrap;
}

.active-hunt-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 12px;
    min-width: 0;
}

.active-hunt-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.active-hunt-list {
    min-width: 0;
    display: flex;
    flex: 1;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

button.active-hunt-chip {
    width: auto;
    min-height: 32px;
    height: 32px;
    max-height: 32px;
    max-width: min(100%, 330px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    border: 1px solid #9ac6aa;
    border-radius: 999px;
    background: #eef8f1;
    color: var(--ink);
    padding: 0 8px;
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
    text-align: left;
    white-space: nowrap;
}

button.active-hunt-chip:hover {
    border-color: var(--accent);
    background: #e4f3e9;
    color: var(--accent-strong);
}

.active-hunt-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--accent);
}

.active-hunt-leader,
.active-hunt-route,
.active-hunt-rate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-hunt-leader {
    max-width: 130px;
    flex: 0 1 auto;
    font-weight: 800;
}

.active-hunt-route {
    width: 5ch;
    flex: 0 0 5ch;
    color: var(--muted);
}

.active-hunt-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.active-hunt-meta svg {
    width: 15px;
    height: 15px;
    max-width: 15px;
    max-height: 15px;
    flex: 0 0 15px;
}

.active-hunt-meta svg path,
.active-hunt-meta svg circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.active-hunt-rate {
    color: var(--accent-strong);
    font-weight: 800;
}

.active-hunt-people-icon {
    width: 16px;
    height: 14px;
    display: inline-block;
    flex: 0 0 16px;
    position: relative;
}

.active-hunt-people-icon::before,
.active-hunt-people-icon span::before {
    content: "";
    position: absolute;
    top: 1px;
    width: 5px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: transparent;
}

.active-hunt-people-icon::after,
.active-hunt-people-icon span::after {
    content: "";
    position: absolute;
    bottom: 1px;
    width: 8px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.active-hunt-people-icon::before {
    left: 2px;
}

.active-hunt-people-icon::after {
    left: 0;
}

.active-hunt-people-icon span::before {
    right: 2px;
}

.active-hunt-people-icon span::after {
    right: 0;
}

.subtabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
}

.subtab {
    background: #ece4d6;
    color: var(--ink);
}

.subtab.active {
    background: var(--accent);
    color: white;
}

.dashboard-meta {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
}

.dashboard-status-bar {
    position: fixed;
    left: 16px;
    right: 12px;
    bottom: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.2;
    pointer-events: none;
    text-shadow: 0 1px 0 var(--bg);
}

.dashboard-updated {
    flex: 0 0 auto;
    color: #7b756b;
    font-size: inherit;
    line-height: inherit;
}

.dashboard-updated:empty {
    display: none;
}

.status-line {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    color: var(--gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-line:empty {
    display: none;
}

.tab-panel {
    display: none;
}

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

.dashboard-panel {
    display: none;
}

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

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

.detail-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.detail-header button {
    min-width: 82px;
}

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

.detail-grid-fragment {
    display: contents;
}

.character-status-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: 14px;
    align-items: stretch;
}

.character-status-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-status-copy .card-actions {
    margin-top: auto;
}

.character-status-paperdoll {
    min-width: 0;
    min-height: 148px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 6px 7px;
    background:
        radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 64%),
        color-mix(in srgb, var(--panel-soft) 82%, transparent);
    color: var(--muted);
}

.character-status-paperdoll:hover {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background-color: color-mix(in srgb, var(--accent) 8%, var(--panel-soft));
}

.character-status-paperdoll img {
    width: 220px;
    max-width: none;
    height: 150px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.48));
}

.character-status-paperdoll small {
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.character-status-paperdoll-fallback {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 50%;
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 24px;
}

.character-status-paperdoll.has-sprite .character-status-paperdoll-fallback {
    display: none;
}

.character-detail {
    display: grid;
    gap: 12px;
}

.detail-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.detail-tab {
    background: #ece4d6;
    color: var(--ink);
}

.detail-tab.active {
    background: var(--ink);
    color: white;
}

.character-detail-panel {
    display: none;
}

.character-detail-panel.active {
    display: block;
}

.character-stats-page,
.character-books-page {
    display: grid;
    gap: 12px;
}

.character-stats-hero,
.character-books-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--panel) 0%, var(--active-soft) 54%, var(--warning-soft) 100%);
}

.character-stats-hero h3,
.character-books-hero h3 {
    margin: 2px 0 4px;
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: 0;
}

.character-stats-hero p,
.character-books-hero p,
.character-stat-section-title,
.stat-kicker,
.stat-tile span,
.character-stat-badge small,
.stat-vital span,
.stat-vital small {
    color: var(--muted);
}

.stat-kicker,
.character-stat-section-title,
.stat-tile span,
.character-stat-badge small,
.stat-vital span {
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.character-stat-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.character-stat-badge,
.stat-tile,
.stat-vital,
.character-stat-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.character-stat-badge {
    display: grid;
    gap: 2px;
    min-width: 92px;
    padding: 8px 10px;
}

.character-stat-badge strong,
.stat-vital strong,
.stat-tile strong {
    color: var(--ink);
}

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

.stat-vital {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.stat-vital > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.stat-bar {
    position: relative;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel-hover);
}

.stat-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.stat-bar em {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    color: var(--ink);
    font-size: 10px;
    font-style: normal;
    font-weight: 850;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
    white-space: nowrap;
}

html[data-theme="dark"] .stat-bar em {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.stat-vital.hp .stat-bar span {
    background: #b8443b;
}

.stat-vital.mp .stat-bar span {
    background: #346da8;
}

.stat-vital.exp .stat-bar span {
    background: var(--gold);
}

.stat-vital.ap .stat-bar span {
    background: #6f5aa8;
}

.character-stat-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.character-stat-section {
    display: grid;
    gap: 10px;
    padding: 12px;
}

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

.stat-tile {
    display: grid;
    gap: 2px;
    min-height: 64px;
    padding: 8px 10px;
}

.stat-tile strong {
    overflow: hidden;
    font-size: 1.08rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-stat-record-section .stat-tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.character-book-section {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.character-book-section.skill {
    box-shadow: inset 3px 0 0 var(--accent);
}

.character-book-section.spell {
    box-shadow: inset 3px 0 0 #6f5aa8;
}

.character-book-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.character-book-heading h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 1rem;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.character-book-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) max-content;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-hover);
}

.character-book-slot {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 850;
}

.character-book-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.character-book-main strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-book-main small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-book-empty {
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.wide-card {
    grid-column: 1 / -1;
}

.packet-console-card {
    gap: 12px;
}

.packet-console-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
    gap: 14px;
    align-items: start;
}

.packet-console-main {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.packet-console-form {
    display: grid;
    gap: 10px;
}

.packet-console-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(90px, 120px) minmax(110px, 150px);
    gap: 10px;
    align-items: end;
}

.packet-console-controls label {
    margin-top: 0;
}

#packet-console-text {
    min-height: 190px;
    max-height: 46vh;
    background: #fbfaf6;
    font-size: 12px;
}

.packet-log-panel {
    min-width: 0;
    display: grid;
    gap: 8px;
}

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

.packet-log-toolbar strong,
.packet-log-toolbar small {
    display: block;
}

.packet-log-toolbar small {
    color: var(--muted);
    font-size: 12px;
}

.packet-toggle {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
    font-weight: 800;
}

.packet-console-result {
    min-width: 0;
}

.packet-console-placeholder,
.packet-console-error {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
    color: var(--muted);
}

.packet-console-error {
    border-color: #d7a49e;
    background: #fff2ef;
    color: var(--danger);
    font-weight: 700;
}

.packet-inspector-panel {
    min-width: 0;
    display: grid;
    gap: 10px;
    align-self: start;
    position: sticky;
    top: 86px;
}

.packet-inspector-empty {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
    color: var(--muted);
    font-weight: 700;
}

.packet-line-list {
    display: grid;
    align-content: start;
    gap: 6px;
    max-height: 560px;
    overflow: auto;
}

button.packet-line-button {
    min-height: 66px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    border: 1px solid var(--line);
    background: #f7f0e5;
    color: var(--ink);
    padding: 8px 10px;
    text-align: left;
}

button.packet-line-button:hover {
    background: #eee4d5;
}

button.packet-line-button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: white;
}

button.packet-line-button.has-error {
    border-color: #d7a49e;
    color: var(--danger);
}

button.packet-line-button .packet-line-number {
    color: inherit;
    font: 700 12px/1 "Cascadia Mono", Consolas, monospace;
}

.packet-line-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

button.packet-line-button strong,
button.packet-line-button small,
button.packet-line-button code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.packet-line-button small {
    color: inherit;
    font-size: 11px;
    opacity: 0.72;
}

button.packet-line-button code {
    font: 11px/1.35 "Cascadia Mono", Consolas, monospace;
    opacity: 0.82;
}

.packet-line-detail {
    min-width: 0;
    display: grid;
    gap: 10px;
}

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

.packet-summary-grid > div {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
}

.packet-summary-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.packet-summary-grid strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.packet-preview-command,
.packet-raw-line {
    margin: 0;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 6px;
    background: #12221d;
    color: #dcebe5;
    font: 12px/1.5 "Cascadia Mono", Consolas, monospace;
    white-space: pre-wrap;
}

.packet-field-groups {
    display: grid;
    gap: 10px;
}

.packet-field-group {
    display: grid;
    gap: 6px;
}

.packet-field-group h3 {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.packet-field-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.packet-field-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) minmax(160px, 260px);
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: #fffdf8;
    border-bottom: 1px solid var(--line);
}

.packet-field-row:last-child {
    border-bottom: 0;
}

.packet-field-row span,
.packet-field-row small {
    color: var(--muted);
}

.packet-field-row strong,
.packet-field-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.packet-field-row small,
.packet-hex-row {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.packet-hex-table {
    display: grid;
    gap: 1px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--line);
}

.packet-hex-row {
    min-width: 680px;
    display: grid;
    grid-template-columns: 54px minmax(410px, 1fr) 150px;
    gap: 10px;
    padding: 6px 10px;
    background: #fffdf8;
}

.packet-hex-row span,
.packet-hex-row small {
    color: var(--muted);
}

.packet-hex-row code {
    color: var(--ink);
}

.panel-header {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.panel-title h2 {
    margin: 0;
}

.panel-help {
    margin: 0 0 12px;
    max-width: 880px;
    line-height: 1.45;
}

.sort-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.sort-control select {
    min-width: 140px;
}

.dashboard-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1.45fr) repeat(6, minmax(112px, 0.65fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--panel);
}

.dashboard-search-field,
.dashboard-control-field {
    min-width: 0;
    display: grid;
    gap: 5px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-search-field input,
.dashboard-control-field select,
.dashboard-control-field input {
    min-width: 0;
    font-size: 14px;
    font-weight: 550;
}

.dashboard-control-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 78px;
    white-space: nowrap;
}

.icon-text-button .bootstrap-icon,
.saved-friends-button .bootstrap-icon {
    width: 15px;
    height: 15px;
}

.info-band {
    display: grid;
    gap: 4px;
    margin: 0 0 14px;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.info-band strong {
    color: var(--ink);
}

.section-header {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.search-row {
    margin-bottom: 12px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 320px) max-content;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.saved-friends-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.saved-friends-button .pill {
    min-width: 28px;
    min-height: 22px;
    background: var(--panel);
}

.compact-header {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.friend-list {
    display: grid;
    gap: 8px;
    max-height: min(54vh, 460px);
    overflow: auto;
    padding: 0 18px 18px;
}

.friends-dialog-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 18px 4px;
}

.friends-dialog-stat {
    min-height: 70px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.friends-dialog-stat strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.friends-dialog-stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.friends-dialog-stat.good {
    border-color: #b7d4bf;
    background: #f1f8f3;
}

.friends-dialog-stat.pending {
    border-color: #dec58f;
    background: #fff7df;
}

.friend-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.friend-row.is-mutual {
    border-color: #b7d4bf;
    background: #f8fcf9;
}

.friend-row.is-pending {
    background: #fffaf0;
}

.friend-summary {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.friend-name-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.friend-status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 999px;
    background: #c9b98f;
}

.friend-row.is-mutual .friend-status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px #e8f4ec;
}

.friend-row.is-pending .friend-status-dot {
    background: #c99528;
    box-shadow: 0 0 0 4px #fff1c6;
}

.friend-name-line strong,
.friend-nickname,
.friend-summary > .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-name-line strong {
    min-width: 0;
}

.friend-nickname {
    min-width: 0;
    color: var(--muted);
    font-weight: 650;
}

.friend-row-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.friend-row-actions .tags {
    justify-content: flex-end;
}

.friend-empty-state {
    min-height: 110px;
    display: grid;
    place-items: center;
    border: 1px dashed #cfc2ae;
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--muted);
    font-weight: 700;
}

.overlord-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: min(82vh, 720px);
    border: 0;
    border-radius: 10px;
    padding: 0;
    background: transparent;
    color: var(--ink);
}

.overlord-dialog.chat-dialog {
    width: min(780px, calc(100% - 24px));
}

.overlord-dialog.friends-dialog {
    width: min(720px, calc(100% - 32px));
}

.overlord-dialog.login-character-dialog {
    width: min(680px, calc(100% - 32px));
}

.overlord-dialog.notification-detail-dialog {
    width: min(680px, calc(100% - 32px));
}

.overlord-dialog.sharing-detail-dialog {
    width: min(760px, calc(100% - 32px));
}

.overlord-dialog::backdrop {
    background: rgba(29, 37, 34, 0.42);
}

.modal-panel {
    display: grid;
    gap: 12px;
    max-height: min(82vh, 720px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-character-panel {
    gap: 14px;
}

.login-character-body {
    display: grid;
    gap: 14px;
}

.login-character-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f0e5;
}

.login-character-mode-button {
    min-height: 36px;
    justify-content: center;
}

.login-character-mode-button.active {
    border-color: #9ac4a8;
    background: var(--accent);
    color: white;
}

.login-character-form {
    display: grid;
    gap: 12px;
}

.login-character-jeremy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 12px;
    align-items: end;
}

.login-character-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.login-character-suggestion {
    min-height: 32px;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.login-character-suggestion.is-online {
    border-color: #9ac4a8;
    background: color-mix(in srgb, var(--accent) 16%, var(--panel));
    color: var(--accent-strong);
}

.login-character-actions {
    display: flex;
    justify-content: flex-end;
}

.login-character-actions button {
    min-width: 180px;
}

.login-character-empty {
    min-height: 48px;
    display: grid;
    place-items: center;
    border: 1px dashed #cfc2ae;
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--muted);
    font-weight: 750;
}

.login-character-status {
    min-height: 20px;
    margin: 0;
    color: var(--accent-strong);
    font-weight: 750;
}

.login-character-status.is-error {
    color: var(--danger);
}

.acumen-download-panel {
    gap: 16px;
}

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

.acumen-download-details > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.acumen-download-details span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.acumen-download-details strong {
    font-size: 16px;
    line-height: 1.25;
}

.acumen-download-actions {
    display: flex;
    justify-content: flex-end;
}

.friends-panel {
    gap: 0;
    overflow: hidden;
    padding: 0;
}

.friends-panel .modal-header {
    padding: 16px 18px;
    background: #fbf7ef;
}

.friends-panel .modal-header h2 {
    font-size: 20px;
}

.friends-panel .modal-header button {
    min-height: 34px;
}

.friends-dialog-form {
    grid-template-columns: minmax(0, 1fr) max-content;
    margin: 0;
    padding: 12px 18px 4px;
}

.shared-friends-panel {
    width: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.shared-friends-content,
.shared-friends-list {
    display: grid;
    gap: 10px;
}

.shared-friends-content {
    min-height: 0;
    overflow: auto;
    padding: 14px 18px 18px;
}

.shared-friends-section {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.shared-friends-section + .shared-friends-section {
    margin-top: 2px;
}

.shared-friends-section-title,
.shared-friend-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shared-friends-section-title {
    justify-content: space-between;
}

.shared-friends-section-title {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #fbf7ef;
    font-weight: 800;
}

.shared-friends-list {
    padding: 12px;
}

.shared-friend-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.shared-friend-row > div:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.shared-friend-row strong,
.shared-friend-row .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-friend-row-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    color: var(--accent-strong);
    font-weight: 800;
}

.shared-friends-section .empty-card {
    min-height: 92px;
    display: grid;
    place-items: center;
    padding: 18px;
    color: var(--muted);
}

.modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-panel {
    grid-template-rows: auto auto minmax(220px, 1fr) auto;
    overflow: hidden;
}

.chat-log {
    min-height: min(46vh, 420px);
    max-height: min(54vh, 520px);
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.chat-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.2fr) minmax(150px, 210px) max-content;
    gap: 10px;
    align-items: end;
}

.chat-toolbar-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
}

.chat-filter-wrap {
    position: relative;
}

.chat-filter-toggle {
    width: 38px;
    min-height: 36px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.chat-filter-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 5;
    min-width: 190px;
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.chat-filter-panel[hidden] {
    display: none;
}

.chat-filter-panel label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.2;
}

.chat-filter-panel input {
    width: auto;
}

.chat-mode-toggle {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f4ecdf;
}

.chat-mode-button {
    min-height: 32px;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
}

.chat-mode-button:hover {
    background: #e9ddcc;
}

.chat-mode-button.active {
    background: var(--accent);
    color: white;
}

.chat-order-field {
    margin: 0;
}

.chat-search-field {
    margin: 0;
}

.chat-search-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) max-content;
    gap: 6px;
}

.chat-search-row button {
    min-height: 36px;
}

.chat-entry {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--panel);
}

.chat-entry.is-outgoing {
    border-color: #9ac6aa;
    background: #eef8f1;
}

.chat-entry.chat-kind-say {
    border-color: #d7c8b4;
    border-left-color: #9b8263;
    background: #fffdf8;
}

.chat-entry.chat-kind-shout {
    border-color: #efc37a;
    border-left-color: #d17c24;
    background: #fff6e5;
}

.chat-entry.chat-kind-whisper {
    border-color: #9bb9e7;
    border-left-color: #4f7dc8;
    background: #eef5ff;
}

.chat-entry.chat-source-own {
    border-left-color: #4b9a68;
    background: #eef8f1;
}

.chat-entry.chat-source-creature {
    border-left-color: #9a6b39;
}

.chat-entry.chat-source-npc {
    border-left-color: #8b6fc2;
}

.chat-entry.chat-source-object,
.chat-entry.chat-source-system,
.chat-entry.chat-source-unknown {
    border-left-color: #7f8b93;
}

.chat-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.chat-meta strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-kind-tag,
.chat-source-tag {
    border-color: rgba(29, 37, 34, 0.14);
    background: rgba(255, 255, 255, 0.62);
}

.chat-entry.chat-kind-whisper .chat-kind-tag {
    color: #285d9d;
}

.chat-entry.chat-kind-shout .chat-kind-tag {
    color: #9a4f12;
}

.chat-entry.chat-source-creature .chat-source-tag,
.chat-entry.chat-source-npc .chat-source-tag,
.chat-entry.chat-source-object .chat-source-tag,
.chat-entry.chat-source-system .chat-source-tag,
.chat-entry.chat-source-unknown .chat-source-tag {
    color: #5d6570;
}

.chat-text {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-text mark,
.chat-meta mark {
    border-radius: 3px;
    padding: 0 2px;
    background: #ffe6a8;
    color: #4b3000;
}

.chat-location {
    color: var(--muted);
    font-size: 12px;
}

.chat-form {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.chat-history-layout,
.world-shouts-layout,
.recordings-layout,
.items-layout,
.storage-manager-layout,
.metafiles-layout {
    display: grid;
    gap: 12px;
    align-items: start;
}

.chat-history-toolbar {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(140px, 0.6fr) minmax(240px, 1fr);
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel);
}

.world-shouts-toolbar {
    grid-template-columns: minmax(140px, 0.45fr) minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(110px, 0.35fr);
}

.recordings-toolbar {
    grid-template-columns: minmax(150px, 0.35fr) minmax(260px, 1fr);
}

.items-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.8fr) repeat(2, minmax(130px, 0.45fr)) max-content;
}

.storage-manager-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.42fr) minmax(160px, 0.42fr) minmax(140px, 0.34fr) max-content;
}

.storage-manager-export-field {
    min-height: 42px;
    display: flex;
    align-items: flex-end;
}

.storage-manager-edit-bar {
    min-width: 0;
    display: grid;
    grid-template-columns: max-content minmax(260px, 1fr) minmax(120px, 0.24fr) max-content;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--panel);
}

.storage-manager-edit-title {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding-right: 4px;
}

.storage-manager-edit-title strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.storage-manager-add-button {
    min-width: 104px;
}

.metafiles-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(170px, 0.55fr) minmax(130px, 0.36fr) minmax(150px, 0.42fr) max-content;
}

.items-search-field,
.items-character-field,
.items-source-field,
.items-location-sort-field,
.items-all-field,
.storage-manager-search-field,
.storage-manager-class-field,
.storage-manager-character-field,
.storage-manager-status-field,
.storage-manager-add-name-field,
.storage-manager-add-need-field,
.metafiles-search-field,
.metafiles-file-field,
.metafiles-status-field,
.metafiles-sort-field {
    min-width: 0;
}

.items-all-field {
    align-self: end;
    min-height: 42px;
    justify-content: center;
}

.metafiles-current-button {
    align-self: end;
    min-height: 42px;
    white-space: nowrap;
}

.items-summary {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.items-summary span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.items-summary strong {
    color: var(--ink);
}

.storage-supply-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.storage-supply-card {
    min-width: 0;
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--panel);
}

.storage-supply-card.needs-bank {
    border-color: var(--warning-line);
    background: color-mix(in srgb, var(--warning-soft) 48%, var(--panel));
}

.storage-supply-card-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.storage-supply-card-head strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-supply-card-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.storage-supply-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.storage-supply-card-stats span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 6px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.storage-supply-card-stats strong {
    color: var(--ink);
}

.storage-list-editor {
    min-width: 0;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel);
}

.storage-list-editor-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.storage-list-editor-head > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.storage-list-editor-head strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.storage-list-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1fr);
    gap: 10px;
    align-items: end;
}

.storage-list-name-field,
.storage-list-items-field {
    min-width: 0;
}

.storage-list-items-field textarea {
    min-height: 132px;
    resize: vertical;
}

.storage-list-editor-standalone .storage-list-items-field textarea {
    min-height: 220px;
}

.storage-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.storage-list-actions code,
.storage-list-card code {
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
}

.storage-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.storage-list-card {
    min-width: 0;
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--panel-soft);
}

.storage-list-card.active {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.storage-list-card.empty-list-card {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.storage-list-card-head,
.storage-list-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.storage-list-card-head strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-list-card-actions {
    justify-content: flex-start;
}

.dashboard-table.storage-manager-table {
    min-width: 1240px;
    table-layout: fixed;
}

.storage-manager-table th:nth-child(1) {
    width: 250px;
}

.storage-manager-table th:nth-child(2) {
    width: 115px;
}

.storage-manager-table th:nth-child(3),
.storage-manager-table th:nth-child(4),
.storage-manager-table th:nth-child(5) {
    width: 86px;
}

.storage-manager-table th:nth-child(7) {
    width: 260px;
}

.storage-manager-table th:nth-child(8) {
    width: 165px;
}

.storage-status-missing td:first-child {
    box-shadow: inset 3px 0 0 var(--danger);
}

.storage-status-low td:first-child {
    box-shadow: inset 3px 0 0 var(--warning);
}

.storage-status-stocked td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.storage-row-expanded {
    background: var(--active-soft);
}

.storage-item-cell {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.storage-item-sprite {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    overflow: hidden;
}

.storage-item-sprite img {
    max-width: 32px;
    max-height: 32px;
    image-rendering: pixelated;
}

.storage-item-sprite.missing-sprite::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 1px solid var(--muted);
    border-radius: 3px;
    opacity: 0.55;
}

.storage-item-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.storage-item-main a,
.storage-item-main strong {
    min-width: 0;
    overflow: hidden;
    color: var(--accent-strong);
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-item-main small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-need-value {
    min-width: 0;
    display: grid;
    gap: 2px;
    justify-items: start;
}

.storage-need-value small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.storage-need-editor {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.storage-need-editor input {
    width: 100%;
    min-width: 0;
}

.storage-need-editor span,
.storage-item-actions {
    display: grid;
    gap: 6px;
}

.storage-item-actions .compact-button,
.storage-need-editor .compact-button {
    width: 100%;
    justify-content: center;
}

.storage-status-badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.storage-status-badge small {
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    opacity: 0.78;
}

.storage-status-badge.missing {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    background: var(--danger-soft);
    color: var(--danger);
}

.storage-status-badge.low {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning-ink);
}

.storage-status-badge.stocked {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 14%, var(--panel));
    color: var(--accent-strong);
}

.storage-location-cell,
.storage-used-by-cell {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.storage-used-by-cell span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-detail-toggle {
    justify-self: start;
    width: max-content;
    margin-top: 2px;
}

.storage-detail-line {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(80px, 0.45fr) minmax(0, 1fr) max-content;
    gap: 8px;
    align-items: baseline;
}

.storage-detail-line.source-line {
    grid-template-columns: minmax(80px, 0.45fr) minmax(0, 1fr);
}

.storage-detail-line.storage-supply-line {
    grid-template-columns: minmax(0, 1fr) max-content;
}

.storage-detail-line strong,
.storage-detail-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-detail-line strong {
    color: var(--ink);
}

.storage-detail-line span {
    color: var(--muted);
    font-size: 12px;
}

.storage-detail-line em {
    color: var(--accent-strong);
    font-style: normal;
    font-weight: 900;
}

.storage-detail-row td {
    padding: 0;
    background: color-mix(in srgb, var(--active-soft) 58%, var(--panel));
}

.storage-manager-details {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.storage-manager-details > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.storage-manager-details > div > span:first-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.storage-manager-details strong {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--ink);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.storage-detail-chip {
    display: inline-flex;
    min-height: 24px;
    max-width: 100%;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-command-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
    gap: 12px;
    align-items: stretch;
}

.tasks-command-panel {
    min-width: 0;
    display: grid;
    gap: 10px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel);
}

.tasks-panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.tasks-panel-heading span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
}

.tasks-panel-heading strong {
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-filter-controls,
.tasks-launch-controls {
    display: grid;
    gap: 10px;
    align-items: end;
}

.tasks-filter-controls {
    grid-template-columns: minmax(180px, 1fr) max-content;
}

.tasks-launch-controls {
    grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr) max-content;
}

.tasks-launch-buttons {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}

.tasks-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tasks-summary span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.tasks-summary strong {
    color: var(--ink);
}

.dashboard-table.tasks-table {
    min-width: 980px;
    table-layout: fixed;
}

.dashboard-table.tasks-table th:nth-child(1) {
    width: 120px;
}

.dashboard-table.tasks-table th:nth-child(2) {
    width: 220px;
}

.dashboard-table.tasks-table th:nth-child(3) {
    width: 260px;
}

.dashboard-table.tasks-table th:nth-child(4) {
    width: 170px;
}

.dashboard-table.tasks-table th:nth-child(5) {
    width: 260px;
}

.tasks-table .task-title-cell {
    display: grid;
    gap: 2px;
    min-width: 160px;
}

.tasks-table .task-title-cell strong {
    color: var(--ink);
}

.tasks-table .task-title-cell span,
.task-step-line {
    font-size: 12px;
}

.tasks-table .task-step-line {
    margin-top: 4px;
}

.tasks-table tr.task-row-expanded {
    background: var(--active-soft);
}

.tasks-table .task-detail-row td {
    padding: 0;
    background: color-mix(in srgb, var(--active-soft) 58%, var(--panel));
}

.task-detail-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.task-detail-panel > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.task-detail-panel > div > span:first-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.task-detail-panel strong {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--ink);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.task-detail-panel code {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.task-wait-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid var(--warning-line);
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--warning-soft);
    color: var(--warning-ink);
    font-size: 12px;
    font-weight: 850;
}

@media (max-width: 960px) {
    .tasks-command-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .tasks-filter-controls,
    .tasks-launch-controls {
        grid-template-columns: 1fr;
    }

    .tasks-launch-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tasks-launch-buttons button,
    #tasks-clear-filter-button {
        width: 100%;
    }

    .task-detail-panel > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .storage-manager-toolbar,
    .storage-manager-edit-bar,
    .storage-list-controls,
    .storage-manager-details > div {
        grid-template-columns: 1fr;
    }

    .storage-manager-export-field {
        min-height: auto;
    }

    .storage-manager-export-field .compact-button {
        width: 100%;
    }
}

.items-table {
    min-width: 860px;
    table-layout: fixed;
}

.metafiles-table {
    min-width: 980px;
}

.metafiles-table th:nth-child(1) {
    width: 30%;
}

.metafiles-table th:nth-child(2) {
    width: 130px;
}

.metafiles-table th:nth-child(3) {
    width: 150px;
}

.metafiles-table th:nth-child(4) {
    width: 150px;
}

.metafiles-table th:nth-child(5) {
    width: 210px;
}

.metafiles-table tr.metafile-new-row {
    background: color-mix(in srgb, var(--warning-soft) 55%, var(--panel));
}

.metafile-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.metafile-title-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.metafile-details-toggle {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    flex: 0 0 auto;
}

.metafile-details-toggle svg {
    transition: transform 0.16s ease;
}

.metafile-expanded-row .metafile-details-toggle svg {
    transform: rotate(180deg);
}

.metafile-details-row td {
    padding-top: 0;
    background: color-mix(in srgb, var(--panel-soft) 72%, transparent);
}

.metafile-details-panel {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel);
}

.metafile-details-grid,
.metafile-fields-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.metafile-fields-list {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.metafile-details-grid > div,
.metafile-fields-list > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.metafile-details-grid span,
.metafile-fields-list span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.metafile-details-grid strong,
.metafile-fields-list strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.metafile-name-cell .metafile-description {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

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

.metafile-stat-list span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.items-table th:nth-child(1) {
    width: 28%;
}

.items-table th:nth-child(2) {
    width: 110px;
}

.items-table th:nth-child(3) {
    width: 120px;
}

.item-name-cell,
.item-location-list {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.item-name-cell strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.item-location {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.item-location:last-child {
    border-bottom: 0;
}

.item-location-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.item-location-main strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-location-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.item-location-toggle {
    justify-self: start;
    width: max-content;
}

.item-quantity {
    color: var(--accent-strong);
    font-weight: 900;
}

.world-shouts-table {
    min-width: 640px;
    table-layout: fixed;
}

.world-shouts-table th:nth-child(1) {
    width: 150px;
}

.world-shouts-table th:nth-child(2) {
    width: 180px;
}

.world-shouts-table tbody tr {
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.world-shouts-table tbody tr:hover {
    background: #fff7e9;
    box-shadow: inset 3px 0 0 #d17c24;
}

.world-shout-time {
    color: var(--muted);
    font-size: 13px;
}

.world-shout-speaker {
    display: table-cell;
    min-width: 0;
}

.world-shout-speaker strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-shout-message {
    color: var(--ink);
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
}

.world-shouts-table mark {
    border-radius: 3px;
    padding: 0 2px;
    background: #ffe6a8;
    color: #4b3000;
}

.recordings-table {
    min-width: 980px;
    table-layout: fixed;
}

.recordings-table th:nth-child(1) {
    width: 260px;
}

.recordings-table th:nth-child(2) {
    width: 140px;
}

.recordings-table th:nth-child(3) {
    width: 170px;
}

.recordings-table th:nth-child(4) {
    width: 150px;
}

.recordings-table th:nth-child(5) {
    width: 120px;
}

.recordings-table th:nth-child(7) {
    width: 150px;
}

.recording-share-list {
    display: grid;
    gap: 5px;
    max-height: 150px;
    overflow: auto;
}

.recording-share-option {
    justify-content: flex-start;
    min-width: 0;
}

.recording-share-option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-history-character-field,
.chat-history-date-field,
.chat-history-order-field,
.chat-history-search-field,
.chat-history-filter-field,
.world-shouts-character-field,
.world-shouts-order-field,
.world-shouts-page-size-field,
.world-shouts-search-field,
.recordings-scope-field,
.recordings-search-field {
    min-width: 0;
}

.chat-history-filter-field {
    grid-column: 1 / -1;
}

.chat-history-search-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) max-content;
    gap: 6px;
}

.chat-history-character-search {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) max-content;
    gap: 6px;
}

.chat-history-character-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    display: grid;
    gap: 2px;
    max-height: 300px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 16px 28px rgba(39, 28, 16, 0.18);
}

.chat-history-character-results[hidden] {
    display: none;
}

.chat-history-character-option {
    width: 100%;
    min-height: 36px;
    display: grid;
    gap: 1px;
    justify-items: start;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.chat-history-character-option:hover,
.chat-history-character-option:focus-visible,
.chat-history-character-option.is-selected {
    background: #efe2ca;
}

.chat-history-character-option small,
.chat-history-character-empty {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-history-character-empty {
    padding: 8px 9px;
}

.chat-history-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-history-filter-option {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf7ef;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.chat-history-filter-option input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.chat-history-filter-option span {
    color: var(--ink);
}

.chat-history-log {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.chat-history-pager {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-history-pager-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-layout {
    display: grid;
    gap: 12px;
    align-items: start;
}

.admin-panel-nav {
    margin-bottom: 12px;
}

.admin-panel-section {
    display: none;
}

.admin-panel-section.active {
    display: block;
}

.admin-data-export-form,
.admin-data-export-panel,
.admin-data-export-result {
    display: grid;
    gap: 12px;
}

.admin-data-export-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.admin-data-export-field {
    min-width: 0;
}

.admin-data-export-map-field {
    grid-row: span 2;
}

.admin-data-export-select {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    font: inherit;
}

.admin-data-export-map-field .admin-data-export-select {
    min-height: 332px;
}

.admin-export-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.admin-export-link {
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
}

.admin-export-link:hover,
.admin-export-link:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    color: var(--accent);
}

.admin-export-link span {
    color: var(--muted);
    font-size: 12px;
}

.admin-data-export-history table {
    min-width: 1180px;
}

.admin-data-export-history td {
    vertical-align: top;
}

.admin-data-export-table {
    border-collapse: collapse;
    border: 1px solid var(--line);
}

.admin-data-export-table th,
.admin-data-export-table td {
    padding: 9px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.admin-data-export-table th:last-child,
.admin-data-export-table td:last-child {
    border-right: 0;
}

.admin-data-export-table thead th {
    background: var(--panel-soft);
    white-space: nowrap;
}

.admin-data-export-select-cell {
    width: 42px;
    text-align: center;
}

.admin-data-export-export-cell {
    width: 360px;
}

.admin-data-export-details-cell {
    min-width: 420px;
}

.admin-data-export-bulk-actions {
    gap: 6px;
}

.admin-data-export-selection-label {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-data-export-actions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-data-export-actions .compact-button {
    white-space: nowrap;
}

.admin-asset-pack-table {
    min-width: 1320px;
}

.admin-da-asset-browser-toolbar,
.admin-da-asset-browser-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-da-asset-browser-toolbar {
    margin: 10px 0;
}

.admin-da-asset-browser-button-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
}

.admin-da-asset-browser-toggle.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.admin-da-asset-browser-search,
.admin-da-asset-browser-per-page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-da-asset-browser-search input {
    width: min(360px, 48vw);
}

.admin-da-asset-browser-summary {
    margin: 8px 0;
}

.admin-da-asset-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.admin-da-asset-browser-card {
    position: relative;
    display: grid;
    grid-template-rows: 104px minmax(128px, auto);
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
}

.admin-da-asset-browser-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.admin-da-asset-browser-card-check {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.admin-da-asset-browser-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
    background-color: var(--panel-soft);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.admin-da-asset-browser-thumb img {
    max-width: 100%;
    max-height: 84px;
    image-rendering: pixelated;
    object-fit: contain;
}

.admin-da-asset-browser-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 9px;
}

.admin-da-asset-browser-card-body strong,
.admin-da-asset-browser-card-body .admin-path {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-asset-pack-preview-cell {
    width: 118px;
}

.admin-asset-pack-preview-cell img,
.admin-asset-pack-preview-empty {
    display: block;
    width: 96px;
    height: 64px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background:
        linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
    background-color: var(--panel);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.admin-asset-pack-pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.admin-asset-pack-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.admin-asset-pack-flow span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}

.admin-asset-pack-flow strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
}

.tag.success-tag {
    border-color: #9ac6aa;
    color: var(--accent-strong);
    background: #e8f4ec;
}

.link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    text-decoration: underline;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.admin-stat-card {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.admin-stat-card span,
.admin-growth-grid span,
.admin-stat-card small,
.admin-path {
    color: var(--muted);
    font-size: 12px;
}

.admin-stat-card strong {
    color: var(--ink);
    font-size: 22px;
    line-height: 1.1;
}

.admin-growth-card,
.admin-table-card {
    min-height: 0;
}

.admin-growth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.admin-growth-grid > div {
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.admin-growth-grid strong {
    color: var(--ink);
    font-size: 18px;
}

.admin-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 13px;
}

.admin-logs-table {
    min-width: 920px;
}

.admin-ranger-watch-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 220px) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.admin-ranger-watch-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.admin-ranger-watch-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-table th,
.admin-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.admin-sort-button {
    min-height: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-transform: inherit;
    letter-spacing: inherit;
}

.admin-sort-button:hover,
.admin-sort-button:focus-visible {
    background: transparent;
    color: var(--accent);
}

.admin-sort-indicator {
    min-width: 14px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.admin-sort-button.active .admin-sort-indicator {
    color: var(--accent);
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

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

.admin-path {
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.admin-character-search {
    max-width: 360px;
}

.admin-character-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(130px, 0.75fr)) repeat(2, minmax(105px, 0.55fr)) minmax(130px, 0.7fr) minmax(210px, 1.15fr);
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.admin-character-toolbar .setting-field {
    min-width: 0;
    margin: 0;
}

.admin-character-toolbar select,
.admin-character-toolbar input {
    min-width: 0;
    width: 100%;
}

.admin-character-registration-card {
    display: grid;
    gap: 12px;
}

.admin-character-registration-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(170px, 0.85fr) auto;
    gap: 10px;
    align-items: end;
}

.admin-character-registration-grid .setting-field {
    min-width: 0;
    margin: 0;
}

.admin-character-registration-grid select,
.admin-character-registration-grid input,
.admin-character-registration-grid textarea {
    width: 100%;
    min-width: 0;
}

.admin-character-registration-names {
    align-self: stretch;
}

.admin-character-registration-names textarea {
    min-height: 86px;
    resize: vertical;
}

.admin-character-registration-actions {
    display: flex;
    align-items: end;
}

.admin-character-browser-table {
    min-width: 1240px;
}

.admin-character-action-row {
    min-width: 170px;
}

.admin-action-row {
    min-width: 240px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-egress-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
}

.inline-egress-control select {
    min-width: 160px;
    max-width: min(260px, 100%);
}

.admin-hunting-routes-workspace {
    display: grid;
    grid-template-columns: minmax(330px, 0.75fr) minmax(0, 1.65fr);
    gap: 14px;
    align-items: start;
}

.admin-route-list-pane,
.admin-route-detail-pane {
    min-width: 0;
}

.admin-route-list-pane {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 10px;
}

.admin-route-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.admin-route-toolbar .setting-field {
    min-width: 0;
}

.admin-route-toolbar input {
    width: 100%;
}

.admin-route-list {
    max-height: min(760px, calc(100vh - 220px));
    overflow: auto;
    display: grid;
    gap: 8px;
    padding: 1px 4px 1px 0;
    scrollbar-gutter: stable;
}

.admin-route-list-button {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 6px;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 74px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    text-align: left;
    white-space: normal;
}

.admin-route-list-button:hover,
.admin-route-list-button:focus-visible,
.admin-route-list-button.selected {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.admin-route-list-button.disabled-route {
    opacity: 0.62;
}

.admin-route-list-main,
.admin-route-list-main strong,
.admin-route-list-main small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-route-list-main strong {
    line-height: 1.25;
}

.admin-route-list-main small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.admin-route-list-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    align-self: stretch;
    align-content: center;
    max-width: 112px;
}

.route-access-tag {
    white-space: nowrap;
}

.route-access-specific {
    border-color: color-mix(in srgb, var(--warning-line) 55%, var(--line));
    background: color-mix(in srgb, var(--warning-line) 12%, var(--panel-soft));
}

.route-access-everyone {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, var(--panel-soft));
}

.admin-hunting-route-detail {
    gap: 14px;
}

.admin-route-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

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

.admin-route-detail-heading h3 {
    margin: 2px 0 8px;
    font-size: 22px;
    line-height: 1.15;
}

.admin-route-editor-section {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.admin-route-editor-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px);
    gap: 10px;
    align-items: end;
}

.admin-route-default-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 0.45fr)) minmax(180px, 1fr);
    gap: 10px;
    align-items: end;
}

.admin-route-map-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 130px)) minmax(220px, 1fr);
    gap: 10px;
    align-items: start;
}

.admin-route-map-list-field textarea {
    min-height: 92px;
    resize: vertical;
}

.admin-route-step-list {
    display: grid;
    gap: 10px;
}

.admin-route-step-editor {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.admin-route-step-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.admin-route-step-fields,
.admin-route-action-editor {
    display: grid;
    grid-template-columns: minmax(90px, 130px) minmax(150px, 1fr);
    gap: 8px;
    align-items: end;
}

.admin-route-step-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-route-action-list {
    display: grid;
    gap: 8px;
}

.admin-route-action-editor {
    grid-template-columns: minmax(190px, 1.2fr) minmax(110px, 0.65fr) minmax(110px, 0.65fr) auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.admin-route-editor-section input,
.admin-route-editor-section select,
.admin-route-editor-section textarea {
    width: 100%;
    min-width: 0;
}

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

.admin-route-access-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    cursor: pointer;
}

.admin-route-access-option.selected {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.admin-route-access-option input {
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.admin-route-access-option strong,
.admin-route-access-option small {
    display: block;
}

.admin-route-access-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.admin-route-users {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.admin-route-users.is-disabled {
    opacity: 0.72;
}

.admin-route-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.admin-route-user-choice {
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.admin-route-user-choice strong,
.admin-route-user-choice small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-route-user-choice small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.admin-route-user-choice.disabled-user {
    opacity: 0.62;
}

.admin-route-preview {
    display: grid;
    gap: 10px;
}

.admin-route-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.admin-route-preview-grid > div {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.admin-route-preview-grid span {
    color: var(--muted);
    font-size: 12px;
}

.admin-route-preview-grid strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.admin-route-preview-table {
    min-width: 680px;
}

.panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.overlord-dialog.admin-prune-dialog {
    width: min(560px, calc(100vw - 24px));
    max-width: none;
}

.modal-panel.admin-prune-panel {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
}

.admin-prune-form {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 16px;
}

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

.admin-prune-checks .setting-checkbox {
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--ink);
}

.admin-prune-checks .setting-checkbox span,
.admin-download-deleted span {
    min-width: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.admin-download-deleted {
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.admin-prune-form .confirm-actions {
    margin: 0 -16px -16px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: #fbf7ef;
}

@media (max-width: 430px) {
    .admin-prune-checks {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-prune-form .confirm-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-prune-form .confirm-actions button {
        width: 100%;
    }
}

.admin-log-delete-dialog {
    max-width: min(960px, calc(100vw - 24px));
}

.admin-log-delete-panel {
    width: min(960px, calc(100vw - 24px));
}

.admin-log-delete-toolbar {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.admin-log-delete-toolbar .setting-field {
    min-width: 210px;
    max-width: 260px;
}

.admin-log-delete-content {
    min-height: 140px;
}

.admin-log-delete-table-wrap {
    max-height: min(58vh, 560px);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-log-delete-table {
    min-width: 720px;
}

.admin-log-delete-table th:first-child,
.admin-log-delete-table td:first-child {
    width: 72px;
    text-align: center;
}

.chat-recipient-field {
    display: grid;
    grid-template-columns: minmax(160px, 1fr);
}

.chat-compose-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 42px max-content;
    gap: 8px;
    align-items: end;
}

.chat-message-field,
.chat-recipient-field label,
.chat-form label {
    margin-top: 0;
}

.chat-message-field input {
    min-height: 38px;
}

.chat-counter {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: #faf6ee;
    font-weight: 700;
}

.chat-counter.is-low {
    border-color: #d9aaa3;
    color: var(--danger);
    background: #f6e9e5;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eadcc5;
    color: #5b3b13;
    font-weight: 700;
}

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

.hunt-group-section-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
    color: var(--ink);
    font-weight: 800;
}

.hunt-group-section-heading:not(:first-child) {
    margin-top: 6px;
}

.hunt-group-section-empty {
    grid-column: 1 / -1;
    color: var(--muted);
}

.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
    min-height: 150px;
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.empty-card {
    min-height: 76px;
    color: var(--muted);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
}

.title-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.title-main > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mine-claim-control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.title-main > [data-character-field="mine-toggle"] {
    flex: 0 0 auto;
    overflow: visible;
}

.mine-toggle {
    width: auto;
    min-width: 64px;
    height: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
    border-radius: 6px;
    padding: 0 10px;
    background: #fffdf8;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.mine-toggle:hover {
    background: #e8f4ec;
}

.mine-toggle.is-on {
    border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
    background: #fff5f2;
    color: var(--danger);
}

.mine-toggle.is-on:hover {
    background: #f1ded8;
}

.pin-toggle {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0;
    background: white;
    color: var(--muted);
}

.pin-toggle:hover,
.pin-toggle:focus {
    border-color: #d4b45b;
    background: #fff7df;
    color: #8b6118;
}

.pin-toggle.is-on {
    border-color: #d4b45b;
    background: #fff7df;
    color: #a36a1d;
}

.pin-toggle svg {
    width: 18px;
    height: 18px;
}

.pin-toggle path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.pin-toggle.is-on path {
    fill: currentColor;
}

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

.tag {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    color: var(--muted);
    background: #faf6ee;
    font-size: 12px;
}

.tag.online {
    border-color: #9ac6aa;
    color: var(--accent-strong);
    background: #e8f4ec;
}

.tag.busy {
    border-color: #9eb8d4;
    color: #245271;
    background: #e9f2fb;
}

.tag.hold {
    border-color: #d4b45b;
    color: #7a5a12;
    background: #fff7df;
}

.tag.pinned {
    border-color: #d4b45b;
    color: #7a5a12;
    background: #fff7df;
}

.tag.danger {
    border-color: #d9aaa3;
    color: var(--danger);
    background: #f6e9e5;
}

.metric-line {
    color: var(--accent-strong);
    font-weight: 700;
}

.metric-line span {
    margin-left: 8px;
    color: var(--muted);
    font-weight: 500;
}

.table-metric {
    display: inline-grid;
    gap: 2px;
    line-height: 1.2;
}

.table-metric span {
    margin-left: 0;
    font-size: 0.84rem;
}

.hunt-group-busy-live-metric {
    color: #245271;
}

.hunt-group-busy-live-metric span {
    color: #52738f;
}

.hunt-member-character-stats .table-metric {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.card-actions button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.patch-notes-layout {
    width: 100%;
    display: grid;
    gap: 14px;
}

.patch-notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 420px));
    justify-content: start;
}

.patch-note-card {
    min-height: 0;
    gap: 12px;
}

.patch-note-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.patch-note-details {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.patch-note-details li {
    padding-left: 2px;
    line-height: 1.45;
}

.patch-note-details strong {
    color: var(--ink);
}

.tips-layout {
    width: 100%;
    display: grid;
    gap: 14px;
}

.tips-hero-card {
    min-height: 0;
    border-left: 4px solid var(--accent);
    background: #fffdf8;
}

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

.tips-hero-copy {
    display: grid;
    gap: 10px;
}

.tips-hero-aside {
    display: grid;
    gap: 6px;
    border: 1px solid #c7decf;
    border-radius: 8px;
    padding: 12px;
    background: #eef8f1;
    color: var(--accent-strong);
}

.tips-hero-aside strong {
    color: var(--ink);
}

.tips-hero-aside span {
    line-height: 1.35;
}

.tips-hero-card p,
.tips-grid .card p {
    color: var(--muted);
    line-height: 1.5;
}

.tips-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tips-steps span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8cbb8;
    border-radius: 6px;
    padding: 0 10px;
    background: #fbf7ef;
    color: var(--accent-strong);
    font-weight: 800;
}

.tips-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: stretch;
}

.tips-grid .card {
    min-height: 0;
    gap: 12px;
}

.tips-feature-card {
    border-color: #9ac6aa;
    background: #f7fbf6;
}

.tips-feature-card .card-title > span:first-child {
    color: var(--accent-strong);
}

@media (max-width: 820px) {
    .tips-hero-content {
        grid-template-columns: 1fr;
    }
}

.sharing-button {
    border-color: #d4b45b;
    background: #fff7df;
    color: #7a5a12;
    font-weight: 800;
}

.sharing-button:hover,
.sharing-button:focus {
    border-color: #b78a21;
    background: #ffefbd;
    color: #5d4109;
}

.sharing-link-settings {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    padding: 10px;
}

.sharing-link-settings-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    color: var(--ink);
    font-weight: 850;
}

.sharing-link-settings-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.account-share-link-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.account-share-link-control .setting-field {
    min-width: 0;
    margin: 0;
}

.account-share-link-control input {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.automation-button {
    border-color: #8db5d7;
    background: #edf7ff;
    color: #245273;
    font-weight: 800;
}

.automation-button:hover,
.automation-button:focus {
    border-color: #5f98c5;
    background: #dff0ff;
    color: #183e59;
}

.hunt-group-controls-card {
    min-height: 0;
    gap: 8px;
}

.hunt-group-summary {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    color: var(--muted);
    font-size: 13px;
}

.hunt-group-summary span {
    min-width: 0;
}

.hunt-group-summary strong {
    color: var(--ink);
}

.hunt-group-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hunt-group-main-toggles {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.hunt-group-main-toggle.setting-checkbox {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--ink);
    font-weight: 700;
}

button.hunt-group-main-toggle.setting-checkbox {
    appearance: none;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

button.hunt-group-main-toggle.setting-checkbox:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.hunt-group-main-ranger-control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 28px;
    height: 28px;
    padding: 0 7px 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--ink);
    font-weight: 700;
}

.hunt-group-main-toggle span {
    font-size: 12px;
    line-height: 1;
}

.hunt-group-main-ranger-control select {
    width: 178px;
    max-width: 46vw;
    min-width: 0;
    min-height: 22px;
    height: 22px;
    padding: 0 22px 0 7px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.hunt-group-main-toggle input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.hunt-group-controls-card .card-actions {
    min-width: 0;
    gap: 6px;
    margin-top: 0;
}

.hunt-group-controls-card .card-actions button {
    min-height: 28px;
    padding: 0 9px;
}

.hunt-group-controls-card .setting-field span {
    font-size: 12px;
}

.hunt-group-automation-card {
    gap: 10px;
}

.hunt-group-automation-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .9fr) repeat(3, minmax(88px, .55fr));
    gap: 10px;
    align-items: end;
}

.hunt-group-graph-card {
    min-height: 0;
}

.overlord-dialog.hunt-group-actions-dialog {
    width: min(520px, calc(100vw - 32px));
}

.overlord-dialog.hunt-group-route-dialog {
    width: min(560px, calc(100vw - 32px));
}

.overlord-dialog.hunt-group-start-dialog {
    width: min(540px, calc(100vw - 32px));
}

.hunt-group-actions-panel {
    width: 100%;
}

.hunt-group-route-panel {
    width: 100%;
}

.hunt-group-route-content,
.hunt-group-route-form {
    display: grid;
    gap: 12px;
}

.hunt-group-route-form .setting-field select {
    width: 100%;
}

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

.hunt-group-start-panel {
    width: 100%;
}

.hunt-group-actions-content {
    display: grid;
    gap: 12px;
}

.hunt-group-start-content {
    display: grid;
    gap: 12px;
}

.hunt-group-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hunt-group-start-actions {
    display: grid;
    gap: 10px;
}

.hunt-group-start-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
}

.hunt-group-start-action-row > div:first-child {
    display: grid;
    gap: 3px;
}

.hunt-group-start-action-row small,
.hunt-group-start-member small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.hunt-group-start-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.hunt-group-start-action-buttons button {
    min-width: 112px;
}

.hunt-group-start-members {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.hunt-group-start-members-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.hunt-group-start-member-list {
    display: grid;
    gap: 6px;
    max-height: min(34vh, 260px);
    overflow: auto;
}

.hunt-group-start-member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #d8cbb8;
    border-radius: 8px;
    background: #fffefa;
}

.hunt-group-start-member.is-offline {
    background: #f6f1e8;
}

.hunt-group-start-member > span:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hunt-group-actions-content .hunt-group-map-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 0;
    padding-top: 12px;
}

.hunt-group-actions-content .manage-actions button {
    flex: 1 1 150px;
}

.manage-panel {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.manage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.manage-actions button {
    min-height: 34px;
}

.hunt-group-map-panel {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.ascii-map {
    overflow: auto;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #171b18;
    color: #b8f7b8;
    font: 13px/1.05 "Cascadia Mono", Consolas, monospace;
}

.legend-line,
.nearby-list {
    color: var(--muted);
    font-size: 13px;
}

.nearby-list {
    display: grid;
    gap: 4px;
}

.exp-graph {
    display: block;
    width: 100%;
    min-width: 680px;
    height: auto;
    aspect-ratio: 920 / 300;
    color: var(--accent);
    overflow: visible;
    touch-action: pan-x pan-y;
}

.exp-graph-scroll {
    position: relative;
    overflow-x: auto;
    padding: 8px 10px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, white) 0%, var(--panel) 100%),
        color-mix(in srgb, var(--accent) 3%, var(--panel));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.exp-graph-wrap {
    position: relative;
    display: grid;
    gap: 12px;
}

.graph-plot {
    fill: color-mix(in srgb, var(--accent) 4%, var(--panel));
    stroke: color-mix(in srgb, var(--accent) 10%, transparent);
    stroke-width: 1;
}

.graph-grid {
    fill: none;
    stroke: rgba(99, 112, 107, 0.2);
    stroke-dasharray: 4 8;
    stroke-width: 1;
}

.graph-axis {
    fill: none;
    stroke: color-mix(in srgb, var(--muted) 28%, var(--line));
    stroke-width: 1.25;
}

.graph-area {
    pointer-events: none;
}

.graph-line-shadow {
    fill: none;
    stroke: color-mix(in srgb, var(--accent) 30%, transparent);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .34;
    pointer-events: none;
}

.graph-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 2px rgba(15, 93, 69, 0.14));
    pointer-events: none;
}

.graph-average {
    fill: none;
    stroke: var(--gold);
    stroke-dasharray: 7 8;
    stroke-linecap: round;
    stroke-width: 2;
    opacity: .92;
    pointer-events: none;
}

.graph-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 550;
    letter-spacing: 0;
    pointer-events: none;
}

.graph-average-label {
    fill: var(--gold);
    font-weight: 700;
    paint-order: stroke;
    stroke: var(--panel);
    stroke-width: 4px;
}

.graph-point {
    outline: none;
    cursor: pointer;
    pointer-events: none;
}

.graph-interaction-layer {
    fill: transparent;
    cursor: pointer;
    pointer-events: all;
}

.graph-point-guide {
    opacity: 0;
    stroke: color-mix(in srgb, var(--accent) 38%, transparent);
    stroke-dasharray: 4 5;
    stroke-width: 1.5;
    pointer-events: none;
}

.graph-point-ring {
    fill: color-mix(in srgb, var(--accent) 18%, transparent);
    opacity: 0;
    pointer-events: none;
}

.graph-point-dot {
    fill: var(--panel);
    stroke: var(--accent);
    stroke-width: 2;
    filter: drop-shadow(0 1px 1px rgba(29, 37, 34, 0.16));
    pointer-events: none;
}

.graph-point.dense:not(.selected):not(.latest):not(.peak) .graph-point-dot {
    opacity: .72;
}

.graph-point.latest .graph-point-dot {
    fill: var(--accent);
}

.graph-point.peak:not(.latest) .graph-point-dot {
    fill: color-mix(in srgb, var(--gold) 20%, var(--panel));
    stroke: var(--gold);
}

.graph-point:focus .graph-point-dot,
.graph-point.selected .graph-point-dot {
    fill: var(--accent-strong);
    stroke: var(--panel);
    stroke-width: 2.4;
}

.graph-point:focus .graph-point-guide,
.graph-point.selected .graph-point-guide {
    opacity: 1;
}

.graph-point:focus .graph-point-ring,
.graph-point.selected .graph-point-ring {
    opacity: 1;
}

.graph-point:focus-visible .graph-point-dot {
    outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
    outline-offset: 3px;
}

.graph-tooltip {
    position: fixed;
    z-index: 95;
    display: grid;
    max-width: min(300px, calc(100vw - 20px));
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 253, 248, 0.16);
    border-radius: 8px;
    background: rgba(29, 37, 34, 0.96);
    color: var(--panel);
    box-shadow: 0 14px 34px rgba(29, 37, 34, 0.24);
    pointer-events: none;
}

.graph-tooltip-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.graph-tooltip-title strong {
    color: #fffdf8;
    font-size: 14px;
    white-space: nowrap;
}

.graph-tooltip-title span,
.graph-tooltip-meta,
.graph-tooltip-map {
    color: rgba(255, 253, 248, 0.72);
    font-size: 12px;
}

.graph-tooltip-map {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (hover: none), (pointer: coarse) {
    .graph-tooltip {
        position: static;
        max-width: none;
        border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
        background: color-mix(in srgb, var(--accent) 7%, var(--panel));
        color: var(--ink);
        box-shadow: none;
        pointer-events: auto;
    }

    .graph-tooltip-title strong {
        color: var(--ink);
    }

    .graph-tooltip-title span,
    .graph-tooltip-meta,
    .graph-tooltip-map {
        color: var(--muted);
    }
}

.graph-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.graph-metric {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 84%, var(--bg));
}

.graph-metric span,
.graph-metric small {
    color: var(--muted);
    font-size: 12px;
}

.graph-metric strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-selected-sample {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel));
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 52%, transparent);
}

.graph-selected-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
}

.graph-selected-title strong {
    font-size: 15px;
}

.graph-selected-title span,
.graph-selected-grid span,
.graph-selected-grid small {
    color: var(--muted);
    font-size: 12px;
}

.graph-selected-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 10px;
}

.graph-selected-grid div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.graph-selected-grid strong {
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-selected-map {
    grid-column: 1 / -1;
}

.graph-selected-map strong {
    white-space: normal;
}

.history-sample-list {
    display: grid;
    gap: 6px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.history-sample-row {
    display: grid;
    grid-template-columns: 70px minmax(120px, 1.1fr) minmax(100px, 0.8fr) minmax(170px, 1.4fr) minmax(70px, 0.7fr);
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.public-history-sample-row {
    grid-template-columns: 70px minmax(120px, 1.1fr) minmax(100px, 0.8fr) minmax(70px, 0.7fr);
}

.history-sample-row strong {
    color: var(--ink);
}

.hunt-history-panel {
    display: grid;
    gap: 18px;
}

.hunt-history-section {
    display: grid;
    gap: 12px;
}

.hunt-history-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, max-content);
    gap: 12px;
    align-items: start;
}

.hunt-history-header h3 {
    margin: 0;
    font-size: 16px;
}

.hunt-history-header p {
    margin: 3px 0 0;
    color: var(--muted);
}

.hunt-run-select {
    min-height: 36px;
    max-width: 420px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 10px;
}

.hunt-run-panel {
    display: grid;
    gap: 12px;
}

.hunt-run-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 13px;
}

.hunt-run-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.hunt-run-summary div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hunt-run-summary span,
.hunt-run-summary small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-run-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-activity-panel {
    display: grid;
    gap: 14px;
}

.character-activity-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.character-activity-summary div {
    display: grid;
    gap: 2px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    padding: 10px 12px;
}

.character-activity-summary span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.character-activity-summary strong {
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-activity-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: flex-end;
}

.character-activity-control {
    display: grid;
    gap: 4px;
    min-width: 124px;
    color: var(--muted);
    font-size: 13px;
}

.character-activity-control > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-activity-control select,
.character-activity-control input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 10px;
}

.character-activity-date {
    min-width: 150px;
}

.character-activity-reset {
    align-self: flex-end;
    min-height: 36px;
}

.character-activity-list {
    display: grid;
    gap: 7px;
}

.character-activity-row {
    display: grid;
    grid-template-columns: 126px minmax(110px, 0.9fr) minmax(180px, 1.2fr) minmax(120px, 0.8fr) minmax(190px, 1.4fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: var(--panel);
    padding: 8px 10px;
    color: var(--muted);
    font-size: 13px;
}

.character-activity-row.buy_hp {
    border-left-color: var(--danger);
}

.character-activity-row.buy_mp {
    border-left-color: var(--info-line);
}

.character-activity-row.death {
    border-left-color: var(--danger);
}

.public-character-activity-row {
    grid-template-columns: 126px minmax(110px, 0.9fr) minmax(180px, 1.3fr) minmax(120px, 0.8fr);
}

.character-activity-row > span,
.character-activity-row > strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-activity-row > strong,
.character-activity-row span strong {
    color: var(--ink);
}

.character-tracking-panel {
    display: grid;
    gap: 14px;
}

.character-tracking-summary,
.tracking-calculator-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.character-tracking-summary div,
.tracking-calculator-summary div {
    display: grid;
    gap: 2px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    padding: 10px 12px;
}

.character-tracking-summary span,
.tracking-calculator-summary span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.character-tracking-summary strong,
.tracking-calculator-summary strong {
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-tracking-summary small,
.tracking-calculator-summary small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracking-calendar-section,
.tracking-calculator {
    display: grid;
    gap: 12px;
}

.tracking-calendar-toolbar,
.tracking-calculator-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.tracking-calendar-month {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tracking-calendar-month label {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.tracking-calendar-month input {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 10px;
}

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

.tracking-calendar-weekday {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tracking-calendar-day {
    display: grid;
    grid-template-rows: auto auto auto minmax(18px, auto);
    gap: 1px;
    min-width: 0;
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    padding: 7px;
}

.tracking-calendar-day.outside {
    border-color: transparent;
    background: transparent;
}

.tracking-calendar-day.today {
    border-color: var(--accent);
}

.tracking-calendar-day.has-gain {
    background: var(--active-soft);
}

.tracking-calendar-day time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.tracking-calendar-day strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracking-calendar-day small {
    color: var(--muted);
    font-size: 11px;
}

.tracking-calendar-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-content: start;
    min-height: 18px;
}

.tracking-calendar-stats b {
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    padding: 1px 5px;
    font-size: 11px;
    font-weight: 750;
}

.tracking-calculator {
    border: 1px solid var(--line-strong, var(--line));
    border-radius: 8px;
    background: linear-gradient(180deg, var(--panel-soft), var(--panel));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    padding: 12px;
}

.tracking-calculator-header h3 {
    margin: 0;
    font-size: 16px;
}

.tracking-calculator-pills,
.tracking-calculator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tracking-calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.tracking-calculator-actions span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.tracking-goal-countdown {
    display: grid;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    padding: 14px;
}

.tracking-goal-countdown.is-ready {
    border-color: color-mix(in srgb, var(--active-border) 70%, var(--line));
    background: color-mix(in srgb, var(--active-soft) 70%, var(--panel));
}

.tracking-goal-countdown-copy {
    display: grid;
    gap: 2px;
}

.tracking-goal-countdown-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.tracking-goal-countdown-copy strong {
    color: var(--ink);
    font-size: 34px;
    line-height: 1;
}

.tracking-goal-countdown-copy small {
    color: var(--muted);
    font-size: 13px;
}

.tracking-goal-progress {
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 80%, black);
}

.tracking-goal-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 12px;
}

.settings-page {
    display: grid;
    gap: 12px;
}

.web-sessions-card {
    gap: 12px;
}

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

.web-session-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.web-session-row.is-current {
    border-color: #c9b27c;
    background: #fff8e7;
}

.web-session-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.web-session-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.web-session-title strong,
.web-session-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.egress-card {
    gap: 12px;
}

.egress-form {
    display: grid;
    gap: 12px;
}

.egress-admin-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.egress-section-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.egress-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.9fr) max-content;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.egress-route-row {
    grid-template-columns: minmax(260px, 1fr) max-content;
}

.egress-row.is-disabled {
    background: #f6f1e8;
}

.egress-row-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.egress-row-main strong,
.egress-row-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.egress-form-actions {
    display: flex;
    align-items: end;
}

.egress-instructions {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.metadata-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.metadata-category-tabs .setting-tab {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.metadata-category-tabs .setting-tab span {
    color: var(--muted);
    font-size: 12px;
}

.metadata-class-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.metadata-class-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.metadata-class-tab span {
    color: var(--muted);
    font-size: 11px;
}

.metadata-class-tab:hover,
.metadata-class-tab:focus,
.metadata-class-tab.active {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--panel) 82%, var(--accent) 18%);
    color: var(--accent-strong);
}

.metadata-toolbar {
    grid-template-columns: minmax(180px, 1fr) max-content max-content;
}

.metadata-toolbar .metadata-class-filter {
    min-width: 0;
}

.settings-grid,
.metadata-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

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

.metadata-editor-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.metadata-list-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.metadata-list-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.metadata-list-header strong {
    color: var(--ink);
    font-size: 16px;
}

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

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

.metadata-learnable-class-section {
    display: grid;
    gap: 8px;
}

.metadata-learnable-class-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.metadata-learnable-class-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
}

.metadata-learnable-class-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metadata-learnable-grid {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
}

.metadata-learnable-grid-head,
.metadata-learnable-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) minmax(92px, 0.38fr) minmax(360px, 2fr) minmax(160px, 0.8fr) max-content;
    gap: 12px;
    align-items: center;
}

.metadata-learnable-grid-head {
    padding: 9px 12px;
    background: color-mix(in srgb, var(--panel-soft) 86%, var(--accent) 14%);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.metadata-learnable-row {
    min-width: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.metadata-learnable-row:hover,
.metadata-learnable-row:focus-within,
.metadata-learnable-row.selected-row {
    background: color-mix(in srgb, var(--panel) 86%, var(--accent) 14%);
}

.metadata-learnable-name {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.metadata-learnable-name small {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-learnable-rank {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.metadata-learnable-rank span,
.metadata-learnable-req-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 800;
}

.metadata-learnable-rank span {
    padding: 3px 8px;
    color: var(--ink);
}

.metadata-learnable-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.metadata-learnable-req-chip {
    gap: 5px;
    max-width: 260px;
    padding: 3px 8px;
    color: var(--muted);
    text-decoration: none;
}

.metadata-learnable-item-chip {
    color: var(--ink);
}

.metadata-learnable-item-chip:hover,
.metadata-learnable-item-chip:focus {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.metadata-learnable-item-chip img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
}

.metadata-learnable-item-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-learnable-resource-chip {
    color: var(--accent-strong);
}

.metadata-learnable-prereq-chip {
    color: var(--ink);
}

.metadata-learnable-more-chip,
.metadata-learnable-empty-req {
    color: var(--muted);
}

.metadata-learnable-origin {
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-record-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 240px) max-content;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
}

.metadata-record-row:hover,
.metadata-record-row:focus-within,
.metadata-record-row.selected-row {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--panel) 86%, var(--accent) 14%);
}

.metadata-record-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.metadata-record-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.metadata-record-id {
    min-width: 0;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-record-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.metadata-record-meta span,
.metadata-record-meta small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-table th:last-child,
.metadata-table td:last-child {
    width: 1%;
    white-space: nowrap;
}

.metadata-table tr[data-metadata-row] {
    cursor: pointer;
}

.metadata-record-name {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.metadata-record-title {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    color: var(--accent);
    font-weight: 800;
    text-align: left;
    text-decoration: none;
}

.metadata-record-title:hover,
.metadata-record-title:focus {
    color: var(--accent-strong);
    text-decoration: underline;
}

.metadata-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.metadata-detail-chips span {
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metadata-detail-text {
    color: var(--muted);
    line-height: 1.35;
}

.metadata-map-fix-warning {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--warning, #c9902f) 55%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-soft) 80%, #c9902f 20%);
}

.metadata-map-fix-warning strong {
    color: var(--ink);
    font-size: 13px;
}

.metadata-map-fix-warning span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.metadata-record-action,
a.compact-button {
    text-decoration: none;
}

a.secondary.compact-button {
    background: var(--secondary-bg);
    color: var(--ink);
}

a.secondary.compact-button:hover,
a.secondary.compact-button:focus {
    background: var(--secondary-hover);
}

.metadata-editor-card {
    min-width: 0;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 118px);
    overflow: auto;
}

.metadata-editor-dialog {
    width: min(1280px, calc(100% - 24px));
    max-height: min(94vh, 940px);
}

.metadata-editor-panel {
    max-height: min(94vh, 940px);
    padding: 12px;
}

.metadata-modal-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: start;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.metadata-modal-heading h2 {
    margin: 3px 0 2px;
    font-size: 21px;
    line-height: 1.18;
}

.metadata-modal-heading p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.metadata-modal-actions {
    display: inline-flex;
    align-items: start;
    gap: 8px;
}

.metadata-delete-icon {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
}

.metadata-record-form {
    display: grid;
    gap: 10px;
}

.metadata-record-form textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.metadata-editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    gap: 10px;
    align-items: start;
}

.metadata-editor-main,
.metadata-editor-side {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.metadata-editor-section {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-editor-section h3 {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.2;
}

.metadata-editor-section > div {
    min-width: 0;
}

.metadata-editor-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-editor-details summary {
    cursor: pointer;
    padding: 10px 12px;
    color: var(--ink);
    font-weight: 800;
}

.metadata-editor-details > div {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.metadata-requirements-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-requirements-panel > strong {
    color: var(--ink);
    font-size: 13px;
}

.metadata-requirements-panel p {
    margin: 0;
    color: var(--muted);
}

.metadata-requirement-group {
    display: grid;
    gap: 6px;
}

.metadata-requirement-group > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metadata-requirement-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.metadata-requirement-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.metadata-requirement-chip span {
    color: var(--muted);
}

.metadata-requirement-link:hover,
.metadata-requirement-link:focus {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.metadata-checkbox {
    width: fit-content;
}

.metadata-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.metadata-requirement-editors {
    display: grid;
    gap: 8px;
}

.metadata-req-editor {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.metadata-req-editor-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.metadata-req-editor-heading strong {
    color: var(--ink);
    font-size: 12px;
    text-transform: uppercase;
}

.metadata-req-list {
    display: grid;
    gap: 6px;
}

.metadata-req-row {
    display: grid;
    gap: 6px;
    align-items: end;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.metadata-req-row-items {
    grid-template-columns: 96px minmax(150px, 1.15fr) minmax(68px, 0.3fr) minmax(132px, 0.7fr) minmax(170px, 0.95fr) max-content max-content;
}

.metadata-req-row-dependency {
    grid-template-columns: minmax(180px, 1fr) minmax(78px, 0.28fr) minmax(220px, 1fr) max-content max-content;
}

.metadata-req-open {
    align-self: end;
}

.metadata-learnable-form .setting-field {
    gap: 4px;
}

.metadata-learnable-form .setting-field > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metadata-req-sprite-field {
    min-width: 0;
}

.metadata-req-sprite-control {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.metadata-req-sprite-preview {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
}

.metadata-req-sprite-preview img {
    max-width: 30px;
    max-height: 30px;
    image-rendering: pixelated;
}

.metadata-req-empty {
    padding: 9px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1180px) {
    .metadata-editor-body,
    .metadata-record-row,
    .metadata-learnable-row {
        grid-template-columns: 1fr;
    }

    .metadata-learnable-grid-head {
        display: none;
    }

    .metadata-learnable-row {
        gap: 8px;
    }

    .metadata-record-action {
        width: fit-content;
    }

    .metadata-editor-grid-4,
    .metadata-editor-grid-5,
    .metadata-req-row-items,
    .metadata-req-row-dependency {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .metadata-editor-dialog {
        width: calc(100% - 12px);
    }

    .metadata-editor-grid,
    .metadata-editor-grid-4,
    .metadata-editor-grid-5,
    .metadata-req-row-items,
    .metadata-req-row-dependency {
        grid-template-columns: 1fr;
    }
}

.metadata-relations {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.metadata-map-workspace {
    display: grid;
    gap: 12px;
    margin: 8px 0 18px;
    padding: 14px 0 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.metadata-map-workspace-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: space-between;
}

.metadata-map-workspace-heading h3 {
    margin: 5px 0 0;
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1.08;
}

.metadata-map-workspace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.metadata-map-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.metadata-map-facts span {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-map-facts strong {
    color: var(--ink);
    font-size: 15px;
}

.metadata-map-facts small,
.metadata-map-file {
    color: var(--muted);
}

.metadata-map-automation {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-map-automation-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1.3fr);
    gap: 12px;
    align-items: end;
}

.metadata-map-idle-toggle {
    min-height: 42px;
}

.metadata-map-idle-toggle span {
    display: grid;
    gap: 2px;
}

.metadata-map-idle-toggle small,
.metadata-map-automation-status {
    color: var(--muted);
}

.metadata-map-automation-status {
    display: grid;
    gap: 4px;
    font-size: 13px;
}

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

@media (max-width: 720px) {
    .metadata-map-automation-grid {
        grid-template-columns: 1fr;
    }
}

.metadata-map-preview {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-map-preview-full {
    padding: 0;
    border: 0;
    background: transparent;
}

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

.metadata-map-stage {
    min-height: 220px;
    max-height: 560px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #050807;
}

.metadata-map-stage-full {
    width: 100%;
    max-height: min(78vh, 900px);
}

.metadata-map-stage-inner {
    position: relative;
    width: max-content;
}

.metadata-map-stage img {
    display: block;
    max-width: none;
    image-rendering: pixelated;
    user-select: none;
}

.metadata-map-loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    color: var(--muted);
}

.metadata-map-overlay,
.metadata-map-staged-layer,
.metadata-map-hover-layer,
.metadata-map-selection {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.metadata-map-staged-layer {
    z-index: 2;
}

.metadata-map-hover-layer {
    z-index: 3;
}

.metadata-map-overlay {
    z-index: 4;
}

.metadata-map-point {
    pointer-events: auto;
}

.metadata-map-point:not([data-map-number="0"]) {
    cursor: pointer;
}

.metadata-map-selection {
    z-index: 5;
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.72), 0 0 16px rgba(88, 212, 170, 0.65);
    transform: translate(-50%, -50%) rotate(45deg);
}

.metadata-map-staged-asset,
.metadata-map-hover-asset {
    position: absolute;
    image-rendering: pixelated;
    pointer-events: none;
}

.metadata-map-staged-asset {
    opacity: 0.96;
    filter: drop-shadow(0 0 5px rgba(78, 218, 166, 0.95)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.75));
}

.metadata-map-hover-asset {
    opacity: 0.58;
    filter: drop-shadow(0 0 4px rgba(241, 200, 91, 0.95)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}

.metadata-map-hover-asset[data-invalid="1"] {
    opacity: 0.36;
    filter: drop-shadow(0 0 4px rgba(238, 95, 95, 0.95));
}

.metadata-map-tile-editor {
    display: grid;
    gap: 8px;
}

.metadata-map-tile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.metadata-map-asset-panel {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.metadata-map-asset-toolbar {
    display: grid;
    grid-template-columns: auto auto minmax(180px, 1fr) repeat(3, auto);
    gap: 8px;
    align-items: end;
}

.metadata-map-asset-segments {
    display: inline-flex;
    min-height: 36px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.metadata-map-asset-segments button {
    min-width: 58px;
    padding: 7px 10px;
    border: 0;
    border-radius: 0;
    color: var(--muted);
    background: transparent;
}

.metadata-map-asset-segments button.active {
    color: var(--ink);
    background: var(--active-soft);
}

.metadata-map-asset-search {
    min-width: 0;
}

.metadata-map-brush-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.metadata-map-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    padding: 2px;
}

.metadata-map-asset-card {
    display: grid;
    gap: 5px;
    align-content: start;
    min-height: 148px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--panel);
    text-align: left;
}

button.metadata-map-asset-card {
    cursor: pointer;
}

.metadata-map-asset-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--active-soft);
}

.metadata-map-asset-card-disabled {
    opacity: 0.66;
}

.metadata-map-asset-thumb {
    display: grid;
    width: 100%;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #050807;
}

.metadata-map-asset-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.metadata-map-asset-card strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.metadata-map-asset-assign {
    align-self: end;
    justify-self: stretch;
    min-height: 32px;
}

.metadata-map-asset-empty {
    display: grid;
    min-height: 120px;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.metadata-map-custom-id-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 8px;
}

@media (max-width: 820px) {
    .metadata-map-asset-toolbar,
    .metadata-map-custom-id-row {
        grid-template-columns: 1fr;
    }

    .metadata-map-asset-segments {
        width: 100%;
    }

    .metadata-map-asset-segments button {
        flex: 1 1 0;
    }
}

.metadata-relation-group {
    display: grid;
    gap: 6px;
}

.metadata-relation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.metadata-relation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: inherit;
    text-align: left;
}

.metadata-relation-row span,
.metadata-relation-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .metadata-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .metadata-editor-card {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .metadata-modal-heading {
        grid-template-columns: minmax(0, 1fr);
    }

    .metadata-modal-heading .modal-close-button {
        justify-self: start;
    }

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

#play-client-button > img,
.side-nav-list .nav-link > img {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    filter: invert(78%) sepia(20%) saturate(719%) hue-rotate(5deg) brightness(91%);
}

.egress-instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.egress-instruction-grid > div {
    display: grid;
    gap: 3px;
}

.egress-instruction-grid span {
    color: var(--muted);
    font-size: 12px;
}

.egress-command-block {
    overflow-x: auto;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #1d2522;
    color: #fffdf8;
    font-size: 12px;
    line-height: 1.45;
}

.setting-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.settings-action-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) max-content max-content;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.settings-search {
    width: 100%;
}

.settings-search-count {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.settings-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.setting-tab {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ece4d6;
    color: var(--ink);
}

.setting-tab small {
    min-width: 20px;
    border-radius: 999px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.65);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.35;
}

.setting-tab.active {
    background: var(--accent);
    color: white;
}

.grouped-settings-form {
    display: block;
}

.setting-group-panel {
    display: none;
}

.setting-group-panel.active {
    display: block;
}

.grouped-settings-form.is-searching .setting-group-panel {
    display: block;
}

.grouped-settings-form.is-searching .setting-group-panel[hidden],
[hidden] {
    display: none !important;
}

.notification-settings {
    margin-top: 2px;
}

.setting-field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.setting-checkbox {
    min-height: 38px;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 8px;
}

.setting-checkbox input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.field-label-row {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
}

.info-tip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.info-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 30;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(280px, calc(100vw - 40px));
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink);
    color: var(--card);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.bot-logic-setting {
    grid-column: 1 / -1;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.bot-logic-json-setting {
    display: none;
}

.bot-logic-header,
.bot-logic-rule-head,
.bot-logic-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-logic-header,
.bot-logic-rule-head {
    justify-content: space-between;
}

.bot-logic-title {
    display: block;
    color: var(--ink);
    font-weight: 800;
}

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

.bot-logic-rule-list {
    display: grid;
    gap: 10px;
}

.bot-logic-rule-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
}

.bot-logic-rule-head {
    display: grid;
    grid-template-columns: minmax(110px, max-content) minmax(180px, 1fr) minmax(90px, 120px) max-content;
}

.bot-logic-rule-grid,
.bot-logic-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px 12px;
}

.bot-logic-actions {
    padding-top: 2px;
    align-items: end;
}

.bot-logic-action-check,
.bot-logic-enabled {
    min-height: 36px;
}

.bot-logic-import-export {
    display: grid;
    gap: 8px;
}

.bot-logic-import-export summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
}

.bot-logic-json {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.45;
}

.share-setting {
    margin-top: 6px;
    color: var(--ink);
    font-weight: 700;
}

.sharing-control,
.sharing-selected,
.share-friend-list {
    display: grid;
    gap: 10px;
}

.sharing-selected {
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
    align-items: center;
}

.share-chip {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d4b45b;
    border-radius: 999px;
    background: #fff7df;
    color: #7a5a12;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
}

.share-chip strong {
    color: #9b251e;
    font-size: 11px;
}

.share-friend-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.share-friend-row {
    min-height: 42px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.share-friend-row.is-selected {
    border-color: #d4b45b;
    background: #fff7df;
}

.share-friend-row input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.share-friend-row span {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.share-friend-row strong,
.share-friend-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-friend-row small {
    color: var(--muted);
    font-size: 11px;
}

.sharing-page,
.sharing-overview,
.sharing-section,
.sharing-resource-group,
.sharing-resource-list,
.sharing-table-block,
.sharing-person-list,
.sharing-detail-content {
    display: grid;
    gap: 14px;
}

.sharing-overview {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.sharing-metric-card {
    display: grid;
    gap: 2px;
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.sharing-metric-card strong {
    color: var(--accent-strong);
    font-size: 26px;
    line-height: 1;
}

.sharing-metric-card span {
    color: var(--ink);
    font-weight: 800;
}

.sharing-metric-card small {
    color: var(--muted);
    font-size: 12px;
}

.sharing-section {
    padding-bottom: 10px;
}

.sharing-section + .sharing-section {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.sharing-section-heading,
.sharing-resource-heading,
.sharing-friend-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.sharing-section-heading h3 {
    margin: 0;
    font-size: 18px;
}

.sharing-mode-toggle {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 78%, var(--bg));
}

.sharing-mode-button {
    min-height: 30px;
    border-radius: 6px;
}

.sharing-mode-button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.sharing-resource-heading {
    color: var(--ink);
    font-weight: 800;
}

.sharing-resource-group.sharing-collapsible {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 86%, var(--bg));
}

.sharing-resource-group > .sharing-collapsible-summary {
    padding: 10px 12px;
}

.sharing-resource-group[open] > .sharing-collapsible-summary {
    border-bottom: 1px solid var(--line);
}

.sharing-resource-group > .sharing-resource-list {
    padding: 10px;
}

.sharing-collapsible {
    overflow: hidden;
}

.sharing-collapsible-summary {
    cursor: pointer;
    list-style: none;
}

.sharing-collapsible-summary::-webkit-details-marker {
    display: none;
}

.sharing-collapsible-summary::after {
    content: "+";
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 900;
}

.sharing-collapsible[open] > .sharing-collapsible-summary::after {
    content: "-";
}

.sharing-collapsible-summary > span:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sharing-collapsible-summary small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sharing-resource-list {
    grid-template-columns: minmax(0, 1fr);
}

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

.compact-sharing-list {
    gap: 10px;
}

.sharing-summary-card,
.sharing-person-card,
.sharing-modal-resource {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.sharing-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px;
}

.sharing-summary-main {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.sharing-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.sharing-card-meta > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sharing-card-meta strong {
    color: var(--ink);
}

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

.sharing-person-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sharing-person-card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 12px;
}

.sharing-person-card > .sharing-collapsible-summary {
    margin: -12px;
    padding: 12px;
}

.sharing-person-card[open] > .sharing-collapsible-summary {
    border-bottom: 1px solid var(--line);
}

.sharing-person-heading,
.sharing-person-resource-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.sharing-person-heading h4 {
    margin: 0;
    font-size: 15px;
}

.sharing-person-resource-section,
.sharing-mini-list,
.sharing-person-body {
    display: grid;
    gap: 8px;
}

.sharing-person-resource-heading {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.sharing-mini-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 82%, var(--bg));
}

.sharing-mini-row > span,
.sharing-mini-row strong,
.sharing-mini-row small {
    min-width: 0;
}

.sharing-mini-row strong,
.sharing-mini-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sharing-mini-row small {
    color: var(--muted);
    font-size: 11px;
}

.sharing-detail-panel {
    gap: 14px;
}

.sharing-modal-resource {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.sharing-friend-summary {
    min-height: 34px;
    justify-content: flex-start;
    border: 1px solid #ead8a8;
    border-radius: 8px;
    background: #fffaf0;
    padding: 8px 10px;
    color: #7a5a12;
}

.sharing-friend-summary strong {
    flex: 0 0 auto;
    min-width: 26px;
    color: var(--ink);
}

.sharing-friend-summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-editor-panel {
    display: grid;
    gap: 12px;
}

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

.template-character-pane,
.template-editor-shell {
    min-width: 0;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 112px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.template-character-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
}

.template-character-search-field {
    min-width: 0;
}

.template-character-search-field > span {
    font-size: 12px;
}

.template-character-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    overflow: auto;
    padding-right: 2px;
}

.template-character-row {
    min-width: 0;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
}

.template-character-main {
    min-width: 0;
    display: grid;
    gap: 4px;
    border: 0;
    border-radius: inherit;
    padding: 7px 8px;
    background: transparent;
    color: inherit;
    text-align: left;
}

.template-character-row:hover,
.template-character-row:focus-within {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    background: var(--panel-hover);
}

.template-character-row.is-selected {
    border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
    background: var(--active-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

.template-character-main:hover,
.template-character-main:focus {
    background: transparent;
}

.template-oak-button {
    align-self: stretch;
    min-width: 42px;
    min-height: 0;
    border-width: 0 0 0 1px;
    border-radius: 0 6px 6px 0;
    padding: 0 8px;
    font-size: 12px;
}

.template-character-row-head,
.template-character-footer {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.template-character-row-head strong,
.template-character-meta,
.template-character-location,
.template-character-footer span,
.template-character-footer small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-character-meta,
.template-character-location,
.template-character-footer {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.template-character-row-head strong {
    font-size: 13px;
}

.template-character-row-head .tag {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 11px;
}

.template-character-location {
    font-weight: 650;
}

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

.template-vital {
    min-width: 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 6px;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.template-vital strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-vital em {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 72%, transparent);
}

.template-vital i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.template-vital.hp i {
    background: #c75a4b;
}

.template-vital.mp i {
    background: #376fa8;
}

.template-editor-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
}

.template-editor-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 12px;
    align-items: end;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.template-editor-heading-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.template-editor-titlebar {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.template-editor-title-text {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-editor-title-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.template-editor-title-actions .compact-button {
    min-height: 28px;
    padding: 5px 9px;
}

.template-editor-heading .setting-field > span,
#template-editor-subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-name-field {
    min-width: 0;
}

.template-name-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.template-name-controls > button {
    min-height: 39px;
    white-space: nowrap;
}

.template-editor-shell > .template-editor-panel {
    padding: 10px 12px 12px;
}

.template-editor-panel .settings-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 10px;
}

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

.settings-section {
    display: grid;
    gap: 8px;
    border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
    padding-top: 10px;
}

.settings-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink);
}

.settings-section-heading strong {
    font-size: 13px;
    font-weight: 900;
}

.settings-section-heading span {
    min-width: 22px;
    border-radius: 999px;
    padding: 1px 7px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.settings-section-description {
    margin: -2px 0 0;
    font-size: 12px;
    line-height: 1.35;
}

.template-editor-panel .setting-field {
    gap: 5px;
}

.template-editor-panel .setting-checkbox {
    min-height: 32px;
    border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
    border-radius: 6px;
    padding: 5px 8px;
    background: color-mix(in srgb, var(--panel-soft) 58%, transparent);
}

.template-editor-panel .setting-checkbox:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: var(--active-soft);
}

.template-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, max-content);
    gap: 8px;
}

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

.template-member-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.hunt-member-list {
    display: grid;
    gap: 0;
}

.hunt-member-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(230px, 1.1fr) minmax(230px, 0.95fr) minmax(178px, max-content);
    gap: 18px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding: 10px 0 12px;
}

.action-row,
.action-row :where(td, div, span, strong, small) {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.hunt-member-row.action-row {
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
}

.hunt-member-row.action-row:hover {
    background: #fff7e9;
}

.hunt-member-row.action-row.is-selected {
    border-color: #a8cfb5;
    background: #eaf5ee;
    outline: 1px solid #a8cfb5;
    outline-offset: -1px;
    box-shadow: inset 3px 0 0 var(--accent), 0 1px 0 rgba(22, 104, 68, 0.08);
}

.hunt-member-row.action-row:hover .hunt-member-main strong,
.hunt-member-row.action-row.is-selected .hunt-member-main strong {
    color: var(--accent-strong);
}

.hunt-member-row:first-child {
    padding-top: 0;
}

.hunt-member-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.hunt-member-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.hunt-member-name-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.hunt-member-name-line strong {
    min-width: 0;
}

.hunt-member-grouped-star {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #d6a33c;
    border-radius: 50%;
    background: #fff4d8;
    color: #96680d;
}

.hunt-member-grouped-star svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: currentColor;
    stroke-width: 1.8;
}

.hunt-member-main strong,
.hunt-member-main span,
.hunt-member-location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-member-location {
    color: var(--muted);
    padding-top: 3px;
}

.hunt-member-stats {
    min-width: 0;
    display: grid;
    gap: 2px;
    font-size: 13px;
    line-height: 1.28;
}

.hunt-member-rate {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.hunt-member-stats .hunt-member-rate-busy strong {
    color: #245271;
}

.hunt-member-boxed-exp {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.hunt-member-boxed-exp strong {
    color: #7b5620;
}

.hunt-member-stats strong {
    color: var(--ink);
}

.hunt-member-stats span,
.hunt-member-stats small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-member-side {
    min-width: 178px;
    display: grid;
    justify-items: end;
    gap: 8px;
}

.hunt-member-side .hunt-member-tags {
    min-width: 160px;
    justify-content: flex-end;
    align-items: flex-start;
}

.hunt-member-side .hunt-member-tags .tag {
    white-space: nowrap;
}

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

.compact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.hunt-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.hunt-stat-grid > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.hunt-stat-event {
    overflow: visible;
}

.hunt-stat-event > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

button.hunt-stat-info {
    position: relative;
    width: 15px;
    min-width: 15px;
    height: 15px;
    min-height: 15px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    display: inline-grid;
    place-items: center;
    color: var(--gold);
    cursor: help;
    line-height: 1;
}

button.hunt-stat-info:hover,
button.hunt-stat-info:focus,
button.hunt-stat-info.is-open {
    background: transparent;
    color: var(--accent-strong);
}

button.hunt-stat-info:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hunt-stat-info svg {
    width: 15px;
    height: 15px;
}

.hunt-stat-info circle,
.hunt-stat-info path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hunt-stat-tooltip {
    position: fixed;
    z-index: 1000;
    max-width: min(320px, calc(100vw - 16px));
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: #1d2522;
    color: #fffdf8;
    box-shadow: 0 10px 28px rgba(29, 37, 34, 0.24);
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-line;
    pointer-events: none;
}

.hunt-stat-tooltip[hidden] {
    display: none;
}

.hunt-stat-grid span,
.hunt-stat-grid small {
    color: var(--muted);
    font-size: 12px;
}

.hunt-stat-grid strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.icon-button svg {
    width: 18px;
    height: 18px;
}

.icon-button path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.navbar-actions .icon-button.nav-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    display: inline-flex;
}

.danger-icon {
    background: #efe2dd;
    color: var(--danger);
}

.danger-icon:hover {
    background: #e4cac2;
}

.template-controls {
    display: grid;
    grid-template-columns: minmax(160px, 0.8fr) repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 960px) {
    .template-workspace {
        grid-template-columns: 1fr;
    }

    .template-character-pane,
    .template-editor-shell {
        position: static;
        max-height: calc(100vh - 96px);
    }

    .template-character-list {
        overflow: auto;
    }
}

.xanadu-users-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(560px, 1.28fr);
    gap: 14px;
    align-items: start;
}

.user-list-pane,
.user-editor {
    min-width: 0;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 118px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.user-list-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
}

.user-list-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.42fr) max-content;
    gap: 8px;
    align-items: end;
}

.user-search-field,
.user-sort-field {
    min-width: 0;
}

.user-search-field input,
.user-sort-field select {
    min-width: 0;
}

.user-editor {
    display: grid;
    gap: 12px;
    align-content: start;
    overflow: auto;
    margin: 0;
    padding: 14px;
    padding-bottom: 0;
}

.user-editor-heading {
    position: sticky;
    top: -14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -14px -14px 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.user-editor-heading > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.user-editor-heading strong,
.user-editor-heading span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-editor-section {
    min-width: 0;
    display: grid;
    gap: 8px;
}

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

.user-form-grid label,
.feature-grid label {
    margin-top: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 6px;
    padding-top: 2px;
}

.user-editor .setting-checkbox {
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 8px;
    background: var(--panel-soft);
}

.user-editor .play-da-capability {
    border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, var(--panel-soft));
    font-weight: 750;
}

.user-editor .play-da-capability:has(input:checked) {
    border-color: var(--accent);
    box-shadow: inset 3px 0 var(--accent), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.user-editor .browser-client-access-section {
    border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.user-editor .browser-client-access-section .play-da-capability {
    width: min(100%, 420px);
}

.user-editor .browser-client-access-help {
    margin: 7px 0 0;
    font-size: 0.82rem;
}

.speed-condition-field,
.speed-grant-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.shadow-tactics-options {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 6px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.login-character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 6px;
    max-height: 146px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.login-character-extra {
    display: grid;
    gap: 6px;
    margin-top: 0;
}

.web-section-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#xu-web-sections.feature-grid {
    max-height: 174px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.user-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    margin: 0 -14px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.user-editor-actions button {
    min-width: 150px;
}

.user-list {
    min-height: 0;
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

.user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
}

.user-row:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
    outline-offset: 2px;
}

.user-row.is-selected {
    border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
    background: var(--active-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

.user-row.is-disabled {
    background: #f6f1e8;
}

.user-summary {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.user-summary strong,
.user-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row .tags {
    gap: 4px;
    max-height: 50px;
    overflow: hidden;
}

.user-row .tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 1px 6px;
    font-size: 11px;
}

.user-row .egress-tag {
    border-color: #9eb8d4;
    color: #245271;
    background: #e9f2fb;
}

.user-actions {
    display: flex;
    gap: 8px;
    justify-content: stretch;
}

.user-actions button {
    flex: 1;
    min-height: 34px;
}

@media (max-width: 960px) {
    .xanadu-users-layout {
        grid-template-columns: 1fr;
    }

    .user-list-pane,
    .user-editor {
        position: static;
        max-height: none;
    }

    .user-list {
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .user-list-toolbar {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .user-search-field {
        grid-column: 1 / -1;
    }
}

.notifications-layout {
    display: grid;
    gap: 12px;
    align-items: start;
}

.notification-toolbar {
    min-width: 0;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-filter-field {
    width: min(280px, 100%);
}

.notification-page-size-field {
    width: 96px;
}

.notification-bulk-actions {
    min-width: min(560px, 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-selection-count {
    min-width: 72px;
    color: var(--muted);
    font-weight: 850;
    white-space: nowrap;
}

.dashboard-table.notification-table {
    min-width: 900px;
    table-layout: fixed;
}

.notification-table th:first-child,
.notification-table td:first-child {
    width: 42px;
}

.notification-table th:nth-child(2) {
    width: 86px;
}

.notification-table th:nth-child(4) {
    width: 118px;
}

.notification-table th:nth-child(5) {
    width: 124px;
}

.notification-table th:nth-child(6) {
    width: 146px;
}

.notification-table th:nth-child(7) {
    width: 160px;
}

.notification-table th:nth-child(8) {
    width: 72px;
}

.notification-select-column {
    text-align: center !important;
}

.notification-select-column input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.notification-table tbody tr.is-unread {
    background: #fffdf8;
}

.notification-table tbody tr.is-unread .notification-table-title strong::after {
    content: "";
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-left: 7px;
    border-radius: 999px;
    background: var(--danger);
    vertical-align: middle;
}

.notification-table-title {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.notification-table-title strong,
.notification-table-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-table-title span {
    color: var(--muted);
}

.dashboard-table.notification-table .tag,
.dashboard-table.notification-table .compact-button {
    white-space: nowrap;
}

.dashboard-table.notification-table td {
    overflow-wrap: normal;
}

.dashboard-table.notification-table td[data-label="Notification"],
.dashboard-table.notification-table td[data-label="Location"] {
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .dashboard-table-wrap.notification-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .dashboard-table.notification-table {
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .dashboard-table.notification-table thead {
        display: none;
    }

    .dashboard-table.notification-table tbody {
        display: grid;
        gap: 10px;
    }

    .dashboard-table.notification-table tbody tr {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) max-content;
        gap: 7px 10px;
        align-items: start;
        border: 1px solid var(--line);
        border-left: 4px solid transparent;
        border-radius: 8px;
        padding: 12px;
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .dashboard-table.notification-table tbody tr.is-unread {
        border-left-color: var(--danger);
        background: #fffdf8;
    }

    .dashboard-table.notification-table tbody tr:hover {
        background: var(--panel);
    }

    .dashboard-table.notification-table tbody tr.is-unread:hover {
        background: #fffdf8;
    }

    .dashboard-table.notification-table th,
    .dashboard-table.notification-table td {
        border-bottom: 0;
        padding: 0;
    }

    .dashboard-table.notification-table th:first-child,
    .dashboard-table.notification-table td:first-child {
        width: auto;
    }

    .dashboard-table.notification-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .dashboard-table.notification-table .notification-select-column {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        padding-top: 2px;
        text-align: left !important;
    }

    .dashboard-table.notification-table .notification-select-column::before,
    .dashboard-table.notification-table td[data-label="Notification"]::before,
    .dashboard-table.notification-table td[data-label="Actions"]::before {
        content: none;
    }

    .dashboard-table.notification-table td[data-label="Notification"] {
        grid-column: 2;
        grid-row: 1;
    }

    .dashboard-table.notification-table td[data-label="Actions"] {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .dashboard-table.notification-table td[data-label="Status"],
    .dashboard-table.notification-table td[data-label="Type"],
    .dashboard-table.notification-table td[data-label="Character"],
    .dashboard-table.notification-table td[data-label="Time"],
    .dashboard-table.notification-table td[data-label="Location"] {
        grid-column: 2 / -1;
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 8px;
        align-items: start;
    }

    .dashboard-table.notification-table td[data-label="Status"] {
        padding-top: 1px;
    }

    .dashboard-table.notification-table .tag {
        justify-self: start;
    }

    .dashboard-table.notification-table .notification-table-title strong,
    .dashboard-table.notification-table .notification-table-title span {
        white-space: normal;
    }
}

@media (max-width: 560px) {
    .dashboard-table.notification-table tbody tr {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .dashboard-table.notification-table td[data-label="Actions"] {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-self: stretch;
    }

    .dashboard-table.notification-table td[data-label="Actions"] .notification-row-actions {
        justify-content: stretch;
    }

    .dashboard-table.notification-table td[data-label="Actions"] .compact-button {
        width: 100%;
        min-height: 36px;
    }
}

.notification-pager {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-pager-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-list {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.notification-row {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
        "main actions"
        "meta actions";
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid transparent;
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    text-align: left;
}

.notification-row:hover {
    border-color: #b9cfc3;
    border-left-color: var(--accent);
    background: #f8fcf9;
}

.notification-row.is-unread .notification-row-main strong::after {
    content: "";
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-left: 7px;
    border-radius: 999px;
    background: var(--danger);
    vertical-align: middle;
}

.notification-row-main,
.notification-row-meta {
    min-width: 0;
    gap: 3px;
}

.notification-row-main {
    grid-area: main;
    display: grid;
}

.notification-row-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.notification-row-main strong,
.notification-row-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-row-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
}

.notification-detail-panel,
.notification-detail-content {
    min-width: 0;
}

.notification-detail-panel {
    gap: 14px;
}

.notification-detail-content {
    display: grid;
    gap: 12px;
}

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

.notification-detail {
    min-height: 260px;
}

.notification-body {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.notification-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.notification-detail-grid > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.notification-detail-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.notification-detail-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.notification-empty-card {
    max-width: 720px;
}

@media (max-width: 820px) {
    .app-view {
        width: min(100% - 20px, 1320px);
    }

    .topbar {
        grid-template-columns: max-content minmax(0, 1fr) max-content;
        align-items: center;
    }

    .sidebar-toggle {
        display: inline-grid;
        grid-column: 1;
        grid-row: 1;
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }

    .brand-home-button {
        grid-column: 2;
        grid-row: 1;
    }

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

    .panel-header button {
        width: 100%;
    }

    .panel-header button {
        flex: 1;
    }

    .app-layout {
        display: block;
    }

    .navbar-actions {
        grid-column: 3;
        grid-row: 1;
        width: auto;
    }

    .content-shell {
        padding-top: 12px;
    }

    .side-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        width: min(280px, 86vw);
        min-height: 100dvh;
        padding: calc(70px + env(safe-area-inset-top)) 12px 16px;
        border-right: 1px solid var(--line);
        background: var(--panel);
        box-shadow: var(--shadow);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }

    .app-view.side-nav-open .side-nav {
        transform: translateX(0);
    }

    .side-nav-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: block;
        background: rgba(29, 37, 34, 0.32);
    }

    .shared-friend-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .shared-friend-row-actions {
        justify-content: space-between;
    }

    .panel-title,
    .sort-control {
        width: 100%;
        justify-content: space-between;
    }

    .sort-control select {
        min-width: 0;
        flex: 1;
    }

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

    .template-editor-heading {
        grid-template-columns: 1fr;
    }

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

    .settings-action-buttons {
        justify-content: stretch;
    }

    .settings-action-buttons > button {
        flex: 1 1 130px;
    }

    .bot-logic-rule-head {
        grid-template-columns: 1fr;
    }

    .detail-grid,
    .character-stats-hero,
    .character-books-hero,
    .character-book-grid,
    .stat-vitals-grid,
    .character-stat-sections,
    .template-toolbar,
    .chat-toolbar,
    .chat-history-toolbar,
    .world-shouts-toolbar,
    .items-toolbar,
    .metafiles-toolbar,
    .chat-compose-row,
    .chat-search-row,
    .chat-history-character-search,
    .chat-history-search-row,
    .notifications-layout,
    .xanadu-users-layout,
    .user-form-grid,
    .feature-grid,
    .packet-console-controls,
    .packet-console-workspace,
    .packet-log-toolbar,
    .packet-summary-grid,
    .packet-field-row,
    .admin-character-toolbar,
    .admin-character-registration-grid,
    .admin-ranger-watch-form,
    .admin-hunting-routes-workspace,
    .admin-route-toolbar,
    .admin-route-access-grid,
    .admin-route-editor-grid,
    .admin-route-default-grid,
    .admin-route-map-grid,
    .admin-route-step-head,
    .admin-route-step-fields,
    .admin-route-action-editor,
    .user-row {
        grid-template-columns: 1fr;
    }

    .user-list-pane,
    .user-editor,
    .admin-route-list-pane {
        position: static;
        max-height: none;
    }

    .user-list,
    .admin-route-list {
        max-height: none;
        overflow: visible;
    }

    .admin-route-list-button {
        grid-template-columns: 1fr;
        align-items: start;
        min-height: 0;
    }

    .admin-route-list-meta {
        justify-content: flex-start;
        align-self: auto;
        max-width: none;
    }

    .admin-route-detail-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-route-detail-heading button {
        justify-self: stretch;
    }

    .admin-route-heading-actions,
    .admin-route-step-actions {
        justify-content: stretch;
    }

    .admin-route-heading-actions > button,
    .admin-route-step-actions > button,
    .admin-route-action-editor > button {
        width: 100%;
    }

    .user-editor-heading {
        top: 0;
    }

    .character-stat-badges {
        justify-content: stretch;
    }

    .character-stat-badge {
        flex: 1 1 120px;
    }

    .character-book-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .character-book-row .tag {
        grid-column: 2;
        justify-self: start;
    }

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

    .chat-toolbar-actions {
        justify-content: stretch;
    }

    .chat-toolbar-actions .danger-button {
        flex: 1;
    }

    .chat-history-pager,
    .chat-history-pager-buttons {
        justify-content: stretch;
    }

    .chat-history-pager-buttons .compact-button {
        flex: 1;
    }

    .user-actions {
        justify-content: stretch;
    }

    .user-actions button {
        flex: 1;
    }

    .hunt-history-header {
        grid-template-columns: 1fr;
    }

    .hunt-run-select {
        width: 100%;
        max-width: none;
    }

    .history-sample-row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--line);
    }

    .character-activity-summary,
    .character-activity-row {
        grid-template-columns: 1fr;
    }

    .character-activity-toolbar {
        align-items: stretch;
        justify-content: stretch;
    }

    .character-activity-control,
    .character-activity-reset {
        flex: 1 1 160px;
    }

    .tracking-calendar-month,
    .tracking-calendar-month label {
        width: 100%;
    }

    .tracking-calendar-month input {
        flex: 1 1 150px;
        min-width: 0;
    }

    .tracking-goal-countdown-copy strong {
        font-size: 28px;
    }

    .tracking-calendar-grid {
        gap: 4px;
    }

    .tracking-calendar-day {
        min-height: 76px;
        padding: 5px;
    }

    .tracking-calendar-day strong {
        font-size: 12px;
    }

    .tracking-calendar-stats b {
        padding: 1px 3px;
        font-size: 10px;
    }

    .exp-graph-scroll {
        padding: 7px;
    }

    .exp-graph {
        min-width: 620px;
    }

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

    .inline-form {
        grid-template-columns: 1fr;
    }

    .saved-friends-button {
        justify-content: center;
    }

    .friend-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .friend-row-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        justify-content: stretch;
        align-items: center;
        gap: 8px;
    }

    .friend-row-actions .tags {
        justify-content: flex-start;
    }

    .modal-header {
        display: grid;
    }

    .acumen-download-details {
        grid-template-columns: 1fr;
    }

    .acumen-download-actions,
    .acumen-download-actions .download-acumen-button {
        width: 100%;
    }

    .login-character-actions,
    .login-character-actions button {
        width: 100%;
    }

    .login-character-jeremy-row {
        grid-template-columns: 1fr;
    }

    .hunt-member-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 6px;
    }

    .hunt-member-location {
        padding-top: 0;
    }

    .hunt-member-side {
        min-width: 0;
        justify-items: start;
    }

    .hunt-member-side .hunt-member-tags {
        min-width: 0;
        justify-content: flex-start;
    }

    .hunt-member-actions {
        justify-content: flex-start;
    }

    .hunt-group-actions-content .hunt-group-map-panel {
        grid-template-columns: 1fr;
    }

    .hunt-group-start-action-row,
    .hunt-group-start-member {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .hunt-group-start-action-buttons {
        justify-content: stretch;
    }

    .hunt-group-start-action-buttons button {
        flex: 1 1 140px;
    }

    .active-hunt-strip {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .active-hunt-list {
        width: 100%;
    }

    .active-hunt-chip {
        max-width: calc(100vw - 20px);
    }

    .active-hunt-route {
        max-width: 5ch;
    }

    .dashboard-meta {
        width: 100%;
        margin-left: 0;
        white-space: normal;
    }

    .dashboard-status-bar {
        left: 8px;
        right: 8px;
        bottom: 6px;
        font-size: 11px;
    }
}

@media (max-width: 820px) {
    body {
        font-size: 15px;
    }

    button,
    .download-acumen-button,
    input,
    select {
        min-height: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    textarea {
        min-height: 300px;
    }

    .login-view {
        align-items: start;
        padding: 18px 12px;
    }

    .login-panel {
        padding: 18px;
    }

    .app-view {
        width: 100%;
        padding: 10px 10px calc(28px + env(safe-area-inset-bottom));
    }

    .topbar {
        min-height: 0;
        grid-template-columns: max-content minmax(0, 1fr) max-content;
        gap: 12px;
        padding-bottom: 12px;
    }

    .brand-home-button {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
    }

    .sidebar-toggle {
        display: inline-grid;
        grid-column: 1;
        grid-row: 1;
    }

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

    .brand-copy h1 {
        font-size: 22px;
    }

    .brand-copy p,
    .brand-copy h1 {
        overflow-wrap: anywhere;
    }

    .top-actions {
        grid-column: 3;
        grid-row: 1;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 6px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .top-actions > *,
    .top-actions button,
    .top-actions .download-acumen-button,
    .auto-refresh-toggle {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
    }

    .top-actions .download-acumen-button {
        grid-column: auto;
    }

    .top-actions button,
    .top-actions .download-acumen-button,
    .auto-refresh-toggle {
        min-height: 40px;
        padding-right: 10px;
        padding-left: 10px;
        text-align: center;
        white-space: nowrap;
    }

    .nav-action-label,
    .profile-name {
        display: none;
    }

    .profile-button {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .profile-button svg {
        display: none;
    }

    .friends-summary-button,
    .auto-refresh-toggle {
        justify-content: center;
    }

    #download-acumen-button {
        order: 1;
    }

    .auto-refresh-toggle {
        order: 2;
    }

    #refresh-button {
        order: 3;
    }

    #notifications-button {
        order: 4;
    }

    .profile-menu-wrap {
        order: 5;
    }

    #friends-summary-button {
        order: initial;
    }

    #site-settings-button {
        order: initial;
    }

    #logout-button {
        order: initial;
    }

    .app-layout {
        display: block;
    }

    .content-shell {
        padding-top: 12px;
    }

    .side-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        width: min(280px, 86vw);
        min-height: 100dvh;
        padding: calc(70px + env(safe-area-inset-top)) 12px 16px;
        border-right: 1px solid var(--line);
        background: var(--panel);
        box-shadow: var(--shadow);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }

    .app-view.side-nav-open .side-nav {
        transform: translateX(0);
    }

    .side-nav-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: block;
        background: rgba(29, 37, 34, 0.32);
    }

    .tabs {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 0 -10px 12px;
        padding: 8px 10px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
        -webkit-overflow-scrolling: touch;
    }

    .primary-nav {
        position: static;
        top: auto;
        z-index: auto;
        grid-column: 1 / -1;
        width: auto;
        justify-content: flex-start;
        margin: 0 -10px;
        padding: 8px 10px 0;
        border-bottom: 0;
        background: transparent;
    }

    .tabs .tab {
        width: auto;
        min-width: max-content;
        min-height: 40px;
        flex: 0 0 auto;
        padding: 0 12px;
        line-height: 1.15;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .side-nav-list {
        position: static;
        display: grid;
        gap: 6px;
        margin: 0;
        padding: 0;
        overflow: visible;
        border-bottom: 0;
        background: transparent;
        scroll-snap-type: none;
    }

    .side-nav-list .tab {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        flex: initial;
        justify-content: flex-start;
        padding: 0 12px;
        line-height: 1.2;
        white-space: normal;
        scroll-snap-align: none;
    }

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

    .subtab {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 0 8px;
        font-size: 12px;
        line-height: 1.15;
        white-space: nowrap;
    }

    .dashboard-meta {
        grid-column: 1 / -1;
        padding-top: 2px;
    }

    .active-hunt-strip {
        margin: 0 0 12px;
    }

    .active-hunt-list {
        gap: 8px;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
    }

    button.active-hunt-chip {
        min-width: min(92vw, 310px);
        scroll-snap-align: start;
    }

    .status-line {
        min-height: 0;
        margin: 0;
    }

    .dashboard-updated {
        position: static;
        margin: 0;
        text-align: right;
        text-shadow: inherit;
    }

    .panel-header {
        min-height: 0;
        gap: 8px;
        margin-bottom: 10px;
    }

    .panel-header h2 {
        font-size: 17px;
    }

    .panel-header > *,
    .panel-title {
        min-width: 0;
    }

    .panel-title h2 {
        overflow-wrap: anywhere;
    }

    .grid,
    .compact-grid,
    .settings-form,
    .egress-row,
    .egress-route-row,
    .share-friend-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .packet-console-controls,
    .packet-console-workspace,
    .packet-log-toolbar,
    .packet-summary-grid,
    .packet-field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .packet-inspector-panel {
        position: static;
    }

    .packet-line-list {
        max-height: none;
    }

    .grid {
        gap: 10px;
    }

    .notification-toolbar {
        align-items: stretch;
        justify-content: stretch;
    }

    .notification-filter-field,
    .notification-page-size-field {
        width: 100%;
    }

    .notification-bulk-actions,
    .notification-pager,
    .notification-pager-buttons {
        justify-content: stretch;
    }

    .notification-bulk-actions .compact-button,
    .notification-pager-buttons .compact-button {
        flex: 1;
    }

    .notification-row {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "main"
            "meta"
            "actions";
    }

    .notification-row-meta {
        gap: 5px;
    }

    .notification-row-actions {
        justify-content: stretch;
    }

    .notification-row-actions button {
        flex: 1;
    }

    .card {
        min-height: 0;
        gap: 8px;
        padding: 12px;
    }

    .empty-card:not(.card) {
        min-height: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--panel);
    }

    .card-title,
    .compact-header,
    .manage-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .card-title {
        gap: 8px;
    }

    .card-title .tags {
        justify-content: flex-start;
    }

    .title-main,
    .title-main > span,
    .card-title > span:first-child,
    .panel-title,
    .metric-line,
    .muted {
        min-width: 0;
    }

    .title-main > span,
    .card-title > span:first-child,
    .metric-line,
    .muted {
        overflow-wrap: anywhere;
    }

    .title-main > span,
    .hunt-member-main strong,
    .hunt-member-main span,
    .hunt-member-location,
    .hunt-member-stats span,
    .hunt-member-stats small,
    .hunt-run-summary span,
    .hunt-run-summary small,
    .hunt-run-summary strong {
        white-space: normal;
    }

    .tags {
        max-width: 100%;
    }

    .tag {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .metric-line span {
        display: block;
        margin: 2px 0 0;
    }

    .card-actions,
    .manage-actions,
    .hunt-member-actions,
    .user-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .card-actions button,
    .manage-actions button,
    .hunt-member-actions button,
    .user-actions button {
        width: 100%;
        min-width: 0;
    }

    .egress-row button,
    .egress-row select,
    .egress-admin-summary button,
    .egress-form-actions button {
        width: 100%;
        min-width: 0;
    }

    .egress-admin-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .sort-control {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .inline-form,
    .template-controls,
    .template-toolbar,
    .xanadu-users-layout,
    .user-form-grid,
    .feature-grid {
        gap: 8px;
    }

    .detail-header {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        min-height: 0;
        gap: 8px;
    }

    .detail-header button {
        width: auto;
        min-width: 0;
    }

    .detail-header h2,
    .detail-header p {
        overflow-wrap: anywhere;
    }

    .detail-tabs,
    .setting-tabs {
        gap: 6px;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
    }

    .detail-tab,
    .setting-tab {
        min-height: 40px;
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .overlord-dialog,
    .overlord-dialog.chat-dialog,
    .overlord-dialog.notification-detail-dialog,
    .overlord-dialog.hunt-group-actions-dialog,
    .overlord-dialog.hunt-group-route-dialog,
    .overlord-dialog.hunt-group-start-dialog {
        width: calc(100vw - 12px);
        max-width: none;
        max-height: calc(100dvh - 12px);
    }

    .modal-panel {
        max-height: calc(100dvh - 12px);
        padding: 12px;
        border-radius: 8px;
    }

    .modal-header {
        gap: 10px;
    }

    .modal-header button {
        width: 100%;
    }

    .modal-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .shared-friends-panel {
        width: 100%;
    }

    .shared-friends-section-title,
    .shared-friend-row,
    .shared-friend-row-actions {
        align-items: stretch;
    }

    .shared-friend-row-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .chat-panel {
        grid-template-rows: auto auto minmax(170px, 1fr) auto;
        overflow: hidden;
    }

    .chat-log {
        min-height: 32dvh;
        max-height: 42dvh;
        padding: 8px;
    }

    .chat-mode-toggle {
        width: 100%;
    }

    .chat-toolbar-actions {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 8px;
    }

    .chat-toolbar-actions .danger-button {
        width: 100%;
    }

    .chat-filter-panel {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: 12px;
        top: auto;
        z-index: 60;
        max-height: 65dvh;
        overflow: auto;
    }

    .chat-compose-row {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .chat-message-field {
        grid-column: 1 / -1;
    }

    .chat-counter {
        grid-column: 1 / 2;
    }

    .chat-compose-row button {
        grid-column: 2 / 3;
        width: 100%;
    }

    .chat-counter {
        min-height: 40px;
    }

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

    .hunt-group-control-row,
    .hunt-group-controls-card .card-actions {
        width: 100%;
    }

    .hunt-group-main-toggles {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        width: 100%;
    }

    .hunt-group-main-toggle.setting-checkbox,
    .hunt-group-main-ranger-control {
        justify-content: flex-start;
        min-width: 0;
    }

    .hunt-group-main-ranger-control {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        width: 100%;
    }

    .hunt-group-main-ranger-control select {
        width: 100%;
        max-width: none;
    }

    .hunt-group-automation-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hunt-member-row {
        gap: 8px;
    }

    .hunt-member-list {
        gap: 8px;
    }

    .hunt-member-list .hunt-member-row {
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: white;
    }

    .hunt-member-side {
        width: 100%;
    }

    .hunt-member-side .hunt-member-tags {
        width: 100%;
        justify-content: flex-start;
    }

    .hunt-history-header {
        gap: 8px;
    }

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

    .history-sample-row {
        gap: 4px;
    }

    .character-activity-row {
        gap: 4px;
    }

    .history-sample-row > span,
    .history-sample-row > strong,
    .character-activity-row > span,
    .character-activity-row > strong {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
    }

    .history-sample-row > span::before,
    .history-sample-row > strong::before,
    .character-activity-row > span::before,
    .character-activity-row > strong::before {
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .history-sample-row > :nth-child(1)::before {
        content: "Time";
    }

    .history-sample-row > :nth-child(2)::before {
        content: "Rate";
    }

    .history-sample-row > :nth-child(3)::before {
        content: "Gain";
    }

    .history-sample-row > :nth-child(4)::before {
        content: "Map";
    }

    .history-sample-row > :nth-child(5)::before {
        content: "Kills";
    }

    .public-history-sample-row > :nth-child(4)::before {
        content: "Kills";
    }

    .character-activity-row > :nth-child(1)::before {
        content: "Time";
    }

    .character-activity-row > :nth-child(2)::before {
        content: "Action";
    }

    .character-activity-row > :nth-child(3)::before {
        content: "Detail";
    }

    .character-activity-row > :nth-child(4)::before {
        content: "Cost/Source";
    }

    .character-activity-row > :nth-child(5)::before {
        content: "Map";
    }

    .ascii-map {
        max-height: 56dvh;
        font-size: 12px;
    }

    .sharing-selected {
        grid-template-columns: minmax(0, 1fr);
    }

    .sharing-overview,
    .sharing-person-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .sharing-section-heading,
    .sharing-resource-heading,
    .sharing-friend-summary,
    .sharing-summary-card,
    .sharing-mini-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .sharing-summary-card,
    .sharing-mini-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .sharing-mode-toggle {
        width: 100%;
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sharing-friend-summary span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .sharing-row-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .share-chip {
        width: 100%;
    }

    .share-friend-row {
        min-height: 48px;
    }

    .setting-checkbox {
        min-height: 44px;
    }

    .user-editor {
        padding: 12px;
    }

    .user-row {
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .topbar {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .navbar-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

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

    .auto-refresh-toggle {
        min-width: 76px;
    }
}

@media (max-width: 430px) {
    .app-view {
        padding-right: 8px;
        padding-left: 8px;
    }

    .tabs {
        margin-right: -8px;
        margin-left: -8px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .side-nav-list {
        margin: 0;
        padding: 0;
    }

    .card-actions,
    .manage-actions,
    .hunt-member-actions,
    .user-actions,
    .hunt-run-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .brand-row {
        gap: 10px;
    }

    .brand-powered {
        justify-self: start;
    }

    .shared-friend-row-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-tile-grid {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .chat-counter,
    .chat-compose-row button {
        grid-column: 1 / -1;
    }

    button.active-hunt-chip {
        min-width: calc(100vw - 24px);
    }

    .overlord-dialog,
    .overlord-dialog.chat-dialog,
    .overlord-dialog.notification-detail-dialog,
    .overlord-dialog.hunt-group-actions-dialog,
    .overlord-dialog.hunt-group-route-dialog,
    .overlord-dialog.hunt-group-start-dialog {
        width: calc(100vw - 8px);
        max-height: calc(100dvh - 8px);
    }

    .modal-panel {
        max-height: calc(100dvh - 8px);
        padding: 10px;
    }
}

.bootstrap-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask: var(--icon-url) center / contain no-repeat;
    mask: var(--icon-url) center / contain no-repeat;
}

.icon-house { --icon-url: url("/hunt/assets/bootstrap/icons/house.svg"); }
.icon-share { --icon-url: url("/hunt/assets/bootstrap/icons/share.svg"); }
.icon-copy { --icon-url: url("/hunt/assets/bootstrap/icons/copy.svg"); }
.icon-diagram { --icon-url: url("/hunt/assets/bootstrap/icons/diagram-3.svg"); }
.icon-people { --icon-url: url("/hunt/assets/bootstrap/icons/people.svg"); }
.icon-collection { --icon-url: url("/hunt/assets/bootstrap/icons/collection.svg"); }
.icon-binoculars { --icon-url: url("/hunt/assets/bootstrap/icons/binoculars.svg"); }
.icon-sliders { --icon-url: url("/hunt/assets/bootstrap/icons/sliders.svg"); }
.icon-database { --icon-url: url("/hunt/assets/bootstrap/icons/database.svg"); }
.icon-map { --icon-url: url("/hunt/assets/bootstrap/icons/map.svg"); }
.icon-person { --icon-url: url("/hunt/assets/bootstrap/icons/person-circle.svg"); }
.icon-login { --icon-url: url("/hunt/assets/bootstrap/icons/box-arrow-in-right.svg"); }
.icon-speedometer { --icon-url: url("/hunt/assets/bootstrap/icons/speedometer2.svg"); }
.icon-download { --icon-url: url("/hunt/assets/bootstrap/icons/download.svg"); }
.icon-repeat { --icon-url: url("/hunt/assets/bootstrap/icons/arrow-clockwise.svg"); }
.icon-bell { --icon-url: url("/hunt/assets/bootstrap/icons/bell.svg"); }
.icon-chat { --icon-url: url("/hunt/assets/bootstrap/icons/chat-left-text.svg"); }
.icon-megaphone { --icon-url: url("/hunt/assets/bootstrap/icons/megaphone.svg"); }
.icon-film { --icon-url: url("/hunt/assets/bootstrap/icons/film.svg"); }
.icon-items { --icon-url: url("/hunt/assets/bootstrap/icons/backpack-fill.svg"); }
.icon-gear { --icon-url: url("/hunt/assets/bootstrap/icons/gear.svg"); }
.icon-journal { --icon-url: url("/hunt/assets/bootstrap/icons/journal-text.svg"); }
.icon-lightbulb { --icon-url: url("/hunt/assets/bootstrap/icons/lightbulb.svg"); }
.icon-window-plus { --icon-url: url("/hunt/assets/bootstrap/icons/window-plus.svg"); }
.icon-signout { --icon-url: url("/hunt/assets/bootstrap/icons/box-arrow-right.svg"); }
.icon-list { --icon-url: url("/hunt/assets/bootstrap/icons/list.svg"); }
.icon-eye { --icon-url: url("/hunt/assets/bootstrap/icons/eye.svg"); }
.icon-arrow-left { --icon-url: url("/hunt/assets/bootstrap/icons/arrow-left.svg"); }
.icon-arrow-down { --icon-url: url("/hunt/assets/bootstrap/icons/arrow-down.svg"); }
.icon-arrow-up { --icon-url: url("/hunt/assets/bootstrap/icons/arrow-up.svg"); }
.icon-filter { --icon-url: url("/hunt/assets/bootstrap/icons/funnel.svg"); }
.icon-x { --icon-url: url("/hunt/assets/bootstrap/icons/x-lg.svg"); }
.icon-play { --icon-url: url("/hunt/assets/bootstrap/icons/play-fill.svg"); }
.icon-stop { --icon-url: url("/hunt/assets/bootstrap/icons/stop-fill.svg"); }
.icon-moon-stars { --icon-url: url("/hunt/assets/bootstrap/icons/moon-stars.svg"); }
.icon-sun { --icon-url: url("/hunt/assets/bootstrap/icons/sun.svg"); }

.topbar.app-navbar {
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 35;
    display: block;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, white);
    backdrop-filter: blur(12px);
    padding: 8px 0;
}

.app-navbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.brand-home-button.navbar-brand {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    text-decoration: none;
}

.brand-home-button.navbar-brand:hover,
.brand-home-button.navbar-brand:focus {
    background: color-mix(in srgb, var(--panel) 74%, transparent);
    color: var(--accent-strong);
}

.brand-home-button.navbar-brand:focus-visible {
    outline: 2px solid #8db5d7;
    outline-offset: 2px;
}

.brand-title {
    font-size: 24px;
    font-weight: 850;
    line-height: 1.05;
}

.app-navbar-collapse {
    min-width: 0;
    gap: 12px;
}

.app-navbar .primary-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0;
    padding: 0 0 0 8px;
    overflow: visible;
    border-bottom: 0;
    background: transparent;
}

.app-navbar .primary-nav .tab.nav-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
}

.app-navbar .primary-nav .tab.nav-link:hover,
.app-navbar .primary-nav .tab.nav-link:focus {
    background: #f1e8da;
    color: var(--accent-strong);
}

.app-navbar .primary-nav .tab.nav-link.active {
    background: var(--accent);
    color: white;
}

.app-navbar .navbar-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 7px;
    margin-left: auto;
}

.app-navbar .nav-icon-button,
.app-navbar .nav-icon-toggle {
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    line-height: 1;
    white-space: nowrap;
}

.app-navbar .download-acumen-button {
    background: var(--accent);
    color: white;
}

.app-navbar .download-acumen-button:hover,
.app-navbar .download-acumen-button:focus {
    background: var(--accent-strong);
    color: white;
}

.app-navbar .icon-button.nav-icon-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.app-navbar .notification-button {
    position: relative;
    background: #ece4d6;
    color: var(--ink);
}

.app-navbar .notification-button.active {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.app-navbar .tab.nav-icon-button.active {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.app-navbar-toggler.navbar-toggler {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    background: #ece4d6;
    color: var(--ink);
}

.app-navbar-toggler.navbar-toggler:hover,
.app-navbar-toggler.navbar-toggler:focus {
    background: #dfd3c1;
    box-shadow: none;
}

.profile-menu-wrap.dropdown {
    position: relative;
}

.profile-button.dropdown-toggle {
    max-width: 250px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px 0 8px;
    background: var(--panel);
    color: var(--ink);
}

.profile-button.dropdown-toggle:hover,
.profile-button.dropdown-toggle:focus,
.profile-button.dropdown-toggle.show {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.profile-menu.dropdown-menu {
    width: min(260px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.profile-menu.dropdown-menu:not(.show) {
    display: none;
}

.profile-menu.dropdown-menu.show {
    display: grid;
    gap: 4px;
}

.profile-menu .profile-menu-item.dropdown-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: var(--ink);
    font-weight: 750;
}

.profile-menu .profile-menu-item.dropdown-item > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-menu .profile-menu-item.dropdown-item:hover,
.profile-menu .profile-menu-item.dropdown-item:focus {
    background: #f1e8da;
    color: var(--ink);
}

.profile-menu .danger-menu-item.dropdown-item {
    color: var(--danger);
}

.profile-menu .danger-menu-item.dropdown-item:hover,
.profile-menu .danger-menu-item.dropdown-item:focus {
    background: #f6e9e5;
    color: var(--danger);
}

.content-shell {
    min-width: 0;
    padding-top: 16px;
}

.btn-close {
    min-width: 0;
    min-height: 0;
    background-color: transparent;
}

.btn-close:hover,
.btn-close:focus {
    background-color: transparent;
}

.toast-container {
    z-index: 1080;
}

.overlord-toast {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.overlord-toast .toast-header {
    gap: 8px;
    border-bottom-color: var(--line);
    background: #fbf7ef;
    color: var(--ink);
}

.overlord-toast-error {
    border-color: #d9aaa3;
}

.overlord-toast-error .toast-header {
    background: #f6e9e5;
    color: var(--danger);
}

@media (max-width: 991.98px) {
    .app-navbar-inner {
        align-items: flex-start;
    }

    .app-navbar-collapse {
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .app-navbar .primary-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 6px;
        padding: 0;
    }

    .app-navbar .primary-nav .tab.nav-link {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        white-space: normal;
    }

    .app-navbar .navbar-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        margin: 10px 0 0;
    }
}

@media (max-width: 560px) {
    .brand-title {
        font-size: 21px;
    }

    .app-navbar .nav-action-label,
    .profile-name {
        display: none;
    }

    .profile-button.dropdown-toggle {
        width: 42px;
        padding: 0;
        justify-content: center;
    }
}

/* App shell: top toolbar plus left section navigation. */
.topbar.app-navbar {
    min-height: 60px;
    padding: 8px 0;
}

.app-navbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-navbar .navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    margin-left: auto;
}

.app-navbar .sidebar-toggle {
    display: inline-flex;
}

.app-navbar .nav-icon-button,
.app-navbar .nav-icon-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0;
    background: #f7f1e7;
    color: var(--ink);
}

.app-navbar .nav-icon-button .bootstrap-icon,
.app-navbar .nav-icon-toggle .bootstrap-icon {
    width: 18px;
    height: 18px;
}

.app-navbar .nav-icon-button:hover,
.app-navbar .nav-icon-button:focus,
.app-navbar .nav-icon-toggle:hover,
.app-navbar .nav-icon-toggle:focus {
    border-color: #c9bfae;
    background: #eee5d8;
    color: var(--accent-strong);
}

.app-navbar .download-acumen-button {
    background: #f7f1e7;
    color: var(--ink);
}

.app-navbar .download-acumen-button:hover,
.app-navbar .download-acumen-button:focus {
    background: #eee5d8;
    color: var(--accent-strong);
}

.app-navbar .nav-action-label {
    display: none;
}

.app-navbar .auto-refresh-toggle {
    width: auto;
    min-width: 70px;
    gap: 6px;
    padding: 0 7px;
}

.app-navbar .auto-refresh-toggle.is-on {
    border-color: #8fc6a3;
    background: #e8f4ec;
    color: var(--accent-strong);
}

.app-navbar .auto-refresh-state {
    min-width: 26px;
    min-height: 18px;
    padding: 0 6px;
    font-size: 10px;
}

.app-navbar .profile-button.dropdown-toggle {
    min-height: 40px;
    max-width: 230px;
}

.app-navbar .friends-summary-button,
.app-navbar .notification-button {
    position: relative;
}

.app-navbar button.nav-icon-button.active,
.app-navbar button.nav-icon-button.active:hover,
.app-navbar button.nav-icon-button.active:focus {
    border-color: var(--accent);
    background: #edf6f0;
    color: var(--accent-strong);
}

.app-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 0;
    align-items: start;
    border-top: 1px solid var(--line);
    transition: grid-template-columns 0.18s ease;
}

.side-nav {
    position: sticky;
    top: 77px;
    min-height: calc(100vh - 80px);
    align-self: start;
    border-right: 1px solid var(--line);
    padding: 16px 12px 24px 0;
    background: transparent;
}

.side-nav-list {
    position: static;
    top: auto;
    z-index: auto;
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    overscroll-behavior: auto;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: auto;
}

.side-nav .tab.nav-link {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    flex: none;
    line-height: 1.15;
    min-width: 0;
    scroll-snap-align: none;
    text-align: left;
    text-decoration: none;
    white-space: normal;
}

.side-nav .tab.nav-link:hover,
.side-nav .tab.nav-link:focus {
    background: #f1e8da;
    color: var(--accent-strong);
}

.side-nav .tab.nav-link.active {
    background: var(--accent);
    color: white;
}

.side-nav .bootstrap-icon {
    width: 16px;
    height: 16px;
}

.content-shell {
    min-width: 0;
    padding: 16px 0 0 18px;
    transition: padding-left 0.18s ease;
}

.detail-back-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.detail-back-button .bootstrap-icon {
    width: 16px;
    height: 16px;
}

.side-nav-backdrop {
    display: none;
}

.app-view.side-nav-collapsed .app-layout {
    grid-template-columns: 0 minmax(0, 1fr);
}

.app-view.side-nav-collapsed .side-nav {
    min-width: 0;
    overflow: hidden;
    padding-right: 0;
    padding-left: 0;
    border-right: 0;
}

.app-view.side-nav-collapsed .side-nav-list {
    visibility: hidden;
}

.app-view.side-nav-collapsed .content-shell {
    padding-left: 0;
}

.overlord-dialog {
    border: 0;
    border-radius: 12px;
    padding: 0;
    background: transparent;
    color: var(--ink);
}

.overlord-dialog::backdrop {
    background: rgba(29, 37, 34, 0.46);
    backdrop-filter: blur(2px);
}

.modal-panel {
    border: 1px solid color-mix(in srgb, var(--line) 82%, #9b8d78);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(29, 37, 34, 0.24);
}

.modal-header {
    min-height: 58px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    background: #fbf7ef;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-header .muted {
    margin-top: 2px;
    font-size: 12px;
}

.modal-close-button,
.modal-header button.modal-close-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0;
    background: #f4ecdf;
    color: var(--ink);
}

.modal-close-button:hover,
.modal-close-button:focus {
    border-color: #cdbfae;
    background: #eadfce;
    color: var(--danger);
}

.modal-close-button .bootstrap-icon {
    width: 14px;
    height: 14px;
}

.modal-header-actions {
    align-items: center;
}

.modal-header-actions .modal-close-button {
    width: 36px;
}

.confirm-dialog {
    width: min(500px, calc(100vw - 32px));
}

.confirm-panel {
    gap: 14px;
}

.confirm-message {
    color: var(--ink);
    line-height: 1.45;
}

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

.confirm-actions button {
    min-width: 108px;
}

.new-template-dialog {
    width: min(420px, calc(100vw - 32px));
}

.new-template-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.new-template-status {
    min-height: 18px;
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.new-template-status:empty {
    display: none;
}

.new-template-status.is-error {
    color: var(--danger);
}

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

.new-template-actions button {
    min-width: 112px;
}

.acumen-download-details {
    padding: 0 2px;
}

.friends-dialog-form {
    align-items: end;
}

.active-hunt-strip {
    margin: 0 0 12px;
}

.active-hunt-summary {
    min-height: 38px;
    width: auto;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #c9ddcf;
    border-radius: 10px;
    padding: 6px 7px 6px 10px;
    background: linear-gradient(180deg, #fbfefb 0%, #eef7f1 100%);
    color: var(--ink);
    font-size: 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.active-hunt-summary-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-strong);
}

.active-hunt-summary-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.active-hunt-summary-copy strong {
    color: var(--ink);
    line-height: 1.1;
}

.active-hunt-summary-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.active-hunt-view-button,
.active-hunt-widget-button {
    min-height: 30px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #bcd5c4;
    border-radius: 8px;
    padding: 0 9px;
    background: #fffdf8;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
}

.active-hunt-view-button:hover,
.active-hunt-view-button:focus,
.active-hunt-widget-button:hover,
.active-hunt-widget-button:focus {
    border-color: var(--accent);
    background: #e7f3eb;
}

.active-hunt-view-button .bootstrap-icon,
.active-hunt-widget-button .bootstrap-icon,
.widget-button .bootstrap-icon {
    width: 15px;
    height: 15px;
}

.widget-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dashboard-active-hunts {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

#online-grid,
#friends-grid,
#characters-grid,
#all-grid {
    display: block;
}

.compact-panel-header {
    min-height: 34px;
}

.dashboard-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.dashboard-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    vertical-align: middle;
}

.dashboard-table th {
    background: #f8f2e8;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.table-sort-button {
    min-height: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 4px;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.25;
    text-align: left;
    text-transform: inherit;
}

.table-sort-button:hover,
.table-sort-button:focus {
    background: transparent;
    color: var(--accent-strong);
}

.table-sort-button.active {
    color: var(--accent-strong);
}

.table-sort-indicator {
    min-width: 30px;
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.table-sort-indicator:empty {
    display: none;
}

.dashboard-table tr:last-child td {
    border-bottom: 0;
}

.dashboard-table tbody tr:hover {
    background: #fffaf0;
}

.dashboard-table tbody tr.action-row:hover {
    background: #fff7e9;
}

.dashboard-table tbody tr.action-row.is-selected {
    background: #eaf5ee;
    outline: 1px solid #a8cfb5;
    outline-offset: -1px;
    box-shadow: inset 3px 0 0 var(--accent);
}

.dashboard-table tbody tr.action-row:hover td:first-child strong,
.dashboard-table tbody tr.action-row.is-selected td:first-child strong {
    color: var(--accent-strong);
}

.entity-link {
    color: #075c45;
    font-weight: 850;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: color 120ms ease, background-color 120ms ease;
}

.entity-link:hover,
.entity-link:focus {
    color: #043f30;
    background: #e8f4ed;
    text-decoration: none;
}

.entity-link:focus-visible {
    outline: 2px solid rgba(32, 126, 84, 0.3);
    outline-offset: 2px;
    border-radius: 4px;
}

.table-title-cell {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.character-avatar {
    position: relative;
    width: 38px;
    min-width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%),
        var(--panel-muted);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bg) 70%, transparent);
    vertical-align: middle;
}

.character-avatar.is-large {
    width: 48px;
    min-width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.character-avatar img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45));
    transform: translateY(-3px) scale(1.2);
    transform-origin: center;
}

.character-avatar-fallback {
    position: relative;
    z-index: 1;
    color: var(--accent-strong);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 700;
}

.character-avatar.has-image .character-avatar-fallback {
    opacity: 0;
}

.character-title-with-avatar,
.shared-friend-character-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.shared-friend-character-main > div,
.character-title-with-avatar > span:last-child {
    min-width: 0;
    display: grid;
}

.table-title-cell strong,
.table-title-cell .entity-link,
.dashboard-table td {
    overflow-wrap: anywhere;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.table-actions .compact-button,
.dashboard-table .compact-button {
    min-height: 28px;
    padding: 0 9px;
    font-size: 12px;
}

.table-metric {
    display: grid;
    gap: 1px;
}

.table-metric span {
    margin-left: 0;
    font-size: 11px;
}

.character-stat-quick {
    width: min(260px, 100%);
}

.character-stat-quick > .quick-vitals {
    display: grid;
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    gap: 5px;
    margin-left: 0;
}

.quick-vital {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 22px;
    overflow: hidden;
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.quick-vital::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.96;
}

.quick-vital.hp::before {
    background: linear-gradient(90deg, #7e1f1a, #c94d42);
}

.quick-vital.mp::before {
    background: linear-gradient(90deg, #244e92, #4d82c6);
}

.quick-vital span {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-empty {
    min-height: 54px;
}

@media (max-width: 1320px) {
    .dashboard-controls {
        grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(128px, 1fr));
    }

    .dashboard-control-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 1120px) {
    .character-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .character-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 14px;
    }

    .character-table thead {
        display: none;
    }

    .character-table tbody {
        display: grid;
        gap: 10px;
    }

    .character-table tr.action-row {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 12px;
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .character-table tbody tr:hover,
    .character-table tbody tr.action-row:hover {
        background: var(--panel);
    }

    .character-table tbody tr.action-row.is-selected {
        background: #eaf5ee;
        outline: 1px solid #a8cfb5;
        outline-offset: -1px;
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .character-table td {
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(76px, 0.28fr) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        border-bottom: 0;
        padding: 0;
        overflow-wrap: anywhere;
    }

    .character-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .character-table td:first-child,
    .character-table td[data-label="Actions"] {
        width: 100%;
        display: block;
    }

    .character-table td:first-child::before,
    .character-table td[data-label="Actions"]::before {
        content: none;
    }

    .character-table .table-title-cell {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .character-table .table-title-cell strong {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 17px;
        line-height: 1.2;
    }

    .character-table .mine-claim-control {
        max-width: 100%;
        margin-left: auto;
    }

    .character-table .tags {
        justify-content: flex-start;
    }

    .character-table .character-stat-quick {
        width: 100%;
        max-width: 280px;
    }

    .character-table .table-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        width: 100%;
        gap: 8px;
    }

    .character-table .table-actions .compact-button {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 0 8px;
    }
}

#hunt-groups-grid,
#friend-hunt-groups-grid,
#all-hunt-groups-grid {
    grid-template-columns: 1fr;
}

.hunt-group-list-section {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.hunt-group-list-section + .hunt-group-list-section {
    margin-top: 6px;
}

.hunt-group-table {
    min-width: 920px;
}

.hunt-group-table th:first-child,
.hunt-group-table td:first-child {
    width: 23%;
}

.hunt-group-table-title,
.hunt-group-member-cell,
.hunt-group-route-cell {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.hunt-group-table-title .title-main {
    align-items: center;
}

.hunt-group-table-title strong,
.hunt-group-table-title .entity-link,
.hunt-group-route-cell strong,
.hunt-group-member-cell > .muted,
.hunt-group-route-cell > .muted {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-group-table .pin-toggle {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
}

.hunt-group-table .pin-toggle svg {
    width: 15px;
    height: 15px;
}

.hunt-group-table .tags {
    gap: 4px;
}

.hunt-group-table .tag {
    padding: 2px 7px;
    font-size: 11px;
}

.active-hunts-dialog {
    width: min(860px, calc(100vw - 32px));
}

.active-hunts-dialog-content {
    display: grid;
    gap: 10px;
}

body.hunt-widget-mode {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
}

body.hunt-widget-mode .shell,
body.hunt-widget-mode #toast-region {
    display: none !important;
}

.hunt-widget-root {
    --widget-bg: var(--bg);
    --widget-panel: color-mix(in srgb, var(--panel) 94%, transparent);
    --widget-panel-strong: color-mix(in srgb, var(--panel-soft) 96%, transparent);
    --widget-line: var(--line);
    --widget-ink: var(--ink);
    --widget-muted: var(--muted);
    --widget-green: var(--accent-strong);
    --widget-gold: var(--gold);
    --widget-copper: var(--danger);
    min-height: 100vh;
    padding: 10px;
    background:
        radial-gradient(circle at 92% 2%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 18rem),
        radial-gradient(circle at 3% 88%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 20rem),
        linear-gradient(color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px),
        var(--widget-bg);
    background-size: auto, auto, 32px 32px, 32px 32px, auto;
    color: var(--widget-ink);
}

.hunt-widget-shell {
    width: min(100%, 430px);
    min-width: 0;
    display: grid;
    gap: 10px;
    margin: 0 auto;
}

.hunt-widget-header {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--widget-line);
    border-radius: 14px;
    padding: 10px;
    background: color-mix(in srgb, var(--panel) 84%, transparent);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px) saturate(1.16);
}

.hunt-widget-title-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hunt-widget-live-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--widget-green);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 65%, transparent);
}

.hunt-widget-title-block p,
.hunt-widget-title-block h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-widget-title-block p {
    color: var(--widget-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hunt-widget-title-block h1 {
    color: var(--widget-ink);
    font-size: 18px;
    line-height: 1.15;
}

.hunt-widget-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hunt-widget-icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--widget-line);
    border-radius: 9px;
    padding: 0;
    background: color-mix(in srgb, var(--panel-soft) 84%, transparent);
    color: var(--widget-green);
}

.hunt-widget-icon-button:hover,
.hunt-widget-icon-button:focus {
    border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
    background: color-mix(in srgb, var(--gold) 13%, var(--panel));
    color: var(--widget-gold);
}

.hunt-widget-group,
.hunt-widget-overview {
    display: grid;
    gap: 10px;
}

.hunt-widget-route,
.hunt-widget-empty,
.hunt-widget-loading {
    border: 1px solid var(--widget-line);
    border-radius: 12px;
    padding: 10px;
    background: var(--widget-panel);
}

.hunt-widget-route {
    display: grid;
    gap: 3px;
}

.hunt-widget-route span,
.hunt-widget-route strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-widget-route span {
    color: var(--widget-muted);
    font-size: 12px;
}

.hunt-widget-route strong {
    color: var(--widget-gold);
    font-size: 15px;
}

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

.hunt-widget-overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hunt-widget-metric {
    min-width: 0;
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 3px;
    border: 1px solid var(--widget-line);
    border-radius: 12px;
    padding: 9px;
    background: var(--widget-panel-strong);
}

.hunt-widget-metric span,
.hunt-widget-metric small,
.hunt-widget-card-route,
.hunt-widget-card-stats,
.hunt-widget-member small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-widget-metric span,
.hunt-widget-metric small {
    color: var(--widget-muted);
    font-size: 11px;
}

.hunt-widget-metric strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--widget-ink);
    font-size: 20px;
    line-height: 1.05;
}

.hunt-widget-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--widget-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.hunt-widget-members,
.hunt-widget-groups {
    display: grid;
    gap: 7px;
}

.hunt-widget-member,
.hunt-widget-group-card {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--widget-line);
    border-radius: 12px;
    background: var(--widget-panel);
}

.hunt-widget-member {
    display: grid;
    gap: 4px;
    padding: 9px;
    border-left: 3px solid color-mix(in srgb, var(--muted) 36%, var(--line));
}

.hunt-widget-member.is-running {
    border-left-color: var(--widget-green);
}

.hunt-widget-member.is-online {
    border-left-color: var(--widget-gold);
}

.hunt-widget-member.is-busy {
    border-left-color: var(--widget-copper);
}

.hunt-widget-member-top,
.hunt-widget-card-top,
.hunt-widget-card-stats {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hunt-widget-member-top strong,
.hunt-widget-card-top strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-widget-member-top span,
.hunt-widget-card-top span {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 2px 7px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--widget-green);
    font-size: 11px;
    font-weight: 850;
}

.hunt-widget-member.is-offline .hunt-widget-member-top span {
    background: color-mix(in srgb, var(--muted) 12%, transparent);
    color: var(--widget-muted);
}

.hunt-widget-member small,
.hunt-widget-card-route,
.hunt-widget-card-stats {
    color: var(--widget-muted);
    font-size: 12px;
}

.hunt-widget-group-card {
    min-height: 92px;
    display: grid;
    gap: 5px;
    padding: 10px;
    color: var(--widget-ink);
    text-align: left;
}

.hunt-widget-group-card:hover,
.hunt-widget-group-card:focus {
    border-color: color-mix(in srgb, var(--gold) 64%, var(--line));
    background: color-mix(in srgb, var(--gold) 9%, var(--panel));
}

.hunt-widget-card-top span {
    background: color-mix(in srgb, var(--gold) 13%, transparent);
    color: var(--widget-gold);
}

.hunt-widget-empty,
.hunt-widget-loading {
    min-height: 160px;
    display: grid;
    place-items: center;
    gap: 10px;
    color: var(--widget-muted);
    text-align: center;
}

.hunt-widget-empty-line {
    border: 1px solid var(--widget-line);
    border-radius: 12px;
    padding: 10px;
    color: var(--widget-muted);
    background: var(--widget-panel);
}

.hunt-widget-empty .bootstrap-icon {
    width: 34px;
    height: 34px;
    color: var(--widget-gold);
}

.hunt-widget-empty strong {
    max-width: 32ch;
    color: var(--widget-ink);
}

.hunt-widget-empty button {
    min-height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
}

.hunt-widget-error {
    border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.tab-panel.active {
    display: grid;
    align-content: start;
    gap: 12px;
}

.dashboard-panel.active {
    display: grid;
    align-content: start;
    gap: 12px;
}

.tab-panel > .panel-header {
    min-height: 42px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.tab-panel > .info-band {
    margin: -2px 0 2px;
    border: 1px solid #ded1bd;
    border-radius: 8px;
    padding: 12px;
    background: #fbf7ef;
}

.template-controls,
.notification-toolbar {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel);
}

.settings-page > .card,
.template-editor-panel,
.xanadu-users-layout > .user-editor {
    border-color: #d8cbb8;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

@media (max-width: 820px) {
    .app-view {
        width: 100%;
        padding: 10px 10px calc(28px + env(safe-area-inset-bottom));
    }

    .topbar.app-navbar {
        padding-bottom: 10px;
    }

    .brand-home-button.navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-navbar .navbar-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: 0;
    }

    .app-navbar .profile-button.dropdown-toggle {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .profile-name {
        display: none;
    }

    .app-layout {
        display: block;
        border-top: 1px solid var(--line);
    }

    .app-view.side-nav-collapsed .app-layout {
        display: block;
    }

    .content-shell {
        padding: 12px 0 0;
    }

    .side-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        width: min(284px, 86vw);
        min-height: 100dvh;
        padding: calc(76px + env(safe-area-inset-top)) 12px 16px;
        border-right: 1px solid var(--line);
        background: var(--panel);
        box-shadow: var(--shadow);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }

    .app-view.side-nav-open .side-nav {
        transform: translateX(0);
    }

    .app-view.side-nav-collapsed .side-nav {
        width: min(284px, 86vw);
        min-height: 100dvh;
        padding: calc(76px + env(safe-area-inset-top)) 12px 16px;
        border-right: 1px solid var(--line);
    }

    .app-view.side-nav-collapsed .side-nav-list {
        visibility: visible;
    }

    .app-view.side-nav-collapsed .content-shell {
        padding-left: 0;
    }

    .side-nav-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: block;
        background: rgba(29, 37, 34, 0.32);
    }

    .active-hunt-summary {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        padding: 7px;
    }

    .active-hunt-summary-copy span {
        white-space: normal;
    }

    .active-hunt-view-button span:last-child,
    .active-hunt-widget-button span:last-child {
        display: none;
    }

    .dashboard-table {
        min-width: 680px;
    }

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

    .dashboard-search-field,
    .dashboard-control-actions {
        grid-column: 1 / -1;
    }

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

    .dashboard-control-actions > button {
        width: 100%;
        min-width: 0;
    }

    #dashboard-manage-friends-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 430px) {
    .brand-title {
        font-size: 20px;
    }

    .brand-powered {
        justify-self: start;
    }

    .app-navbar .navbar-actions {
        gap: 5px;
    }

    .dashboard-controls {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 820px) {
    .topbar.app-navbar {
        padding: 8px 0 10px;
    }

    .app-navbar-inner {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
    }

    .app-navbar .sidebar-toggle {
        grid-column: 1;
        grid-row: 1;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .brand-home-button.navbar-brand {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }

    .brand-home-button.navbar-brand img {
        width: 30px;
        height: 30px;
    }

    .app-navbar .navbar-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
        justify-content: stretch;
        margin: 0;
    }

    .app-navbar .navbar-actions > *,
    .app-navbar .profile-menu-wrap {
        min-width: 0;
    }

    .app-navbar .icon-button.nav-icon-button,
    .app-navbar .nav-icon-button,
    .app-navbar .nav-icon-toggle,
    .app-navbar .profile-button.dropdown-toggle {
        width: 100%;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        padding: 0;
    }

    .app-navbar .auto-refresh-toggle {
        grid-column: span 2;
        gap: 5px;
        padding: 0 4px;
    }

    .app-navbar .auto-refresh-state {
        min-width: 24px;
        padding: 0 5px;
    }

    #friends-summary-button {
        order: 1;
    }

    #chat-history-button {
        order: 2;
    }

    #download-acumen-button {
        order: 3;
    }

    .auto-refresh-toggle {
        order: 4;
    }

    #notifications-button {
        order: 5;
    }

    .profile-menu-wrap {
        order: 6;
    }

    .character-table-wrap,
    .active-hunt-table-wrap,
    .hunt-group-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .character-table,
    .active-hunt-table,
    .hunt-group-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 14px;
    }

    .character-table thead,
    .active-hunt-table thead,
    .hunt-group-table thead {
        display: none;
    }

    .character-table tbody,
    .active-hunt-table tbody,
    .hunt-group-table tbody {
        display: grid;
        gap: 10px;
    }

    .character-table tr.action-row,
    .active-hunt-table tr.action-row,
    .hunt-group-table tr.action-row {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 12px;
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .character-table tbody tr:hover,
    .active-hunt-table tbody tr:hover,
    .hunt-group-table tbody tr:hover,
    .character-table tbody tr.action-row:hover,
    .active-hunt-table tbody tr.action-row:hover,
    .hunt-group-table tbody tr.action-row:hover {
        background: var(--panel);
    }

    .character-table tbody tr.action-row.is-selected,
    .active-hunt-table tbody tr.action-row.is-selected,
    .hunt-group-table tbody tr.action-row.is-selected {
        background: #eaf5ee;
        outline: 1px solid #a8cfb5;
        outline-offset: -1px;
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .character-table td,
    .active-hunt-table td,
    .hunt-group-table td {
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(76px, 0.35fr) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        border-bottom: 0;
        padding: 0;
        overflow-wrap: anywhere;
    }

    .character-table td::before,
    .active-hunt-table td::before,
    .hunt-group-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .character-table td:first-child,
    .active-hunt-table td:first-child,
    .hunt-group-table td:first-child,
    .character-table td[data-label="Actions"],
    .active-hunt-table td[data-label="Actions"],
    .hunt-group-table td[data-label="Actions"] {
        width: 100%;
        display: block;
    }

    .character-table td:first-child::before,
    .active-hunt-table td:first-child::before,
    .hunt-group-table td:first-child::before,
    .character-table td[data-label="Actions"]::before,
    .active-hunt-table td[data-label="Actions"]::before,
    .hunt-group-table td[data-label="Actions"]::before {
        content: none;
    }

    .character-table .table-title-cell {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .character-table .table-title-cell strong,
    .active-hunt-table td:first-child strong,
    .hunt-group-table-title .entity-link {
        min-width: 0;
        font-size: 17px;
        line-height: 1.2;
    }

    .character-table .mine-claim-control {
        max-width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .character-table .tags,
    .active-hunt-table .tags,
    .hunt-group-table .tags {
        justify-content: flex-start;
    }

    .character-table .table-actions,
    .active-hunt-table .table-actions,
    .hunt-group-table .table-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .character-table .table-actions .compact-button,
    .active-hunt-table .compact-button,
    .hunt-group-table .table-actions .compact-button {
        width: 100%;
        min-width: 0;
        min-height: 38px;
    }

    .hunt-group-table-title,
    .hunt-group-member-cell,
    .hunt-group-route-cell {
        gap: 3px;
    }

    .hunt-group-table-title .title-main {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hunt-group-table-title strong,
    .hunt-group-table-title .entity-link,
    .hunt-group-route-cell strong,
    .hunt-group-member-cell > .muted,
    .hunt-group-route-cell > .muted {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .hunt-group-table .pin-toggle {
        flex: 0 0 auto;
    }

    .hunt-group-member-cell .entity-link,
    .active-hunt-table .entity-link {
        overflow-wrap: anywhere;
    }

    .active-hunt-summary {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) 44px;
        align-items: center;
    }

    .active-hunt-view-button,
    .active-hunt-widget-button {
        width: 44px;
        min-width: 44px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    .world-shouts-table-wrap,
    .recordings-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .world-shouts-table,
    .recordings-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .world-shouts-table thead,
    .recordings-table thead {
        display: none;
    }

    .world-shouts-table tbody,
    .recordings-table tbody {
        display: grid;
        gap: 10px;
    }

    .world-shouts-table tr,
    .recordings-table tr {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-left: 4px solid #d17c24;
        border-radius: 8px;
        padding: 12px;
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .world-shouts-table tbody tr:hover,
    .recordings-table tbody tr:hover {
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .world-shouts-table td,
    .recordings-table td {
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(78px, 0.32fr) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        border-bottom: 0;
        padding: 0;
        overflow-wrap: anywhere;
    }

    .world-shouts-table td::before,
    .recordings-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .world-shout-speaker strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .world-shout-message {
        font-size: 15px;
    }
}

@media (max-width: 430px) {
    .app-navbar-inner {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
    }

    .brand-home-button.navbar-brand {
        gap: 8px;
    }

    .brand-title {
        font-size: 20px;
    }

    .app-navbar .navbar-actions {
        gap: 5px;
    }

    .app-navbar .icon-button.nav-icon-button,
    .app-navbar .nav-icon-button,
    .app-navbar .nav-icon-toggle,
    .app-navbar .profile-button.dropdown-toggle {
        height: 42px;
        min-height: 42px;
    }

    .character-table .table-actions,
    .active-hunt-table .table-actions,
    .hunt-group-table .table-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

.mobile-nav-actions {
    display: none;
}

@media (max-width: 820px) {
    .topbar.app-navbar {
        min-height: 56px;
        padding: 6px 0;
    }

    .app-navbar-inner {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 8px;
    }

    .brand-home-button.navbar-brand {
        display: none;
    }

    .app-navbar .sidebar-toggle {
        grid-column: 1;
        grid-row: 1;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .app-navbar .navbar-actions {
        display: contents;
        width: auto;
        margin: 0;
    }

    .app-navbar .navbar-actions > :not(.profile-menu-wrap) {
        display: none;
    }

    .app-navbar .profile-menu-wrap {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        width: 44px;
        min-width: 44px;
    }

    .app-navbar .profile-button.dropdown-toggle {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
    }

    .app-navbar .profile-button.dropdown-toggle::after {
        display: none;
    }

    .side-nav,
    .app-view.side-nav-collapsed .side-nav {
        display: grid;
        align-content: start;
        gap: 12px;
        padding: calc(64px + env(safe-area-inset-top)) 12px 16px;
        overflow-y: auto;
    }

    .mobile-nav-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 2px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--line);
    }

    .mobile-nav-actions:empty {
        display: none;
    }

    .mobile-nav-actions .nav-icon-button,
    .mobile-nav-actions .nav-icon-toggle {
        width: 100%;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 0 10px;
        background: #f7f1e7;
        color: var(--ink);
        text-align: left;
    }

    .mobile-nav-actions .nav-icon-button:hover,
    .mobile-nav-actions .nav-icon-button:focus,
    .mobile-nav-actions .nav-icon-toggle:hover,
    .mobile-nav-actions .nav-icon-toggle:focus {
        border-color: #c9bfae;
        background: #eee5d8;
        color: var(--accent-strong);
    }

    .mobile-nav-actions .nav-icon-button.active {
        border-color: var(--accent);
        background: #edf6f0;
        color: var(--accent-strong);
    }

    .mobile-nav-actions .auto-refresh-toggle {
        grid-column: 1 / -1;
    }

    .mobile-nav-actions .nav-action-label {
        display: inline;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 850;
    }

    .mobile-nav-actions .auto-refresh-state {
        margin-left: auto;
    }

    .mobile-nav-actions .bootstrap-icon {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-actions .notification-badge {
        top: -5px;
        right: -5px;
        border-color: var(--panel);
    }
}

@media (max-width: 430px) {
    .app-navbar-inner {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
    }

    .app-navbar .sidebar-toggle,
    .app-navbar .profile-menu-wrap,
    .app-navbar .profile-button.dropdown-toggle {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }
}

/* Final mobile shell pass: keep the top bar compact and the drawer usable. */
@media (max-width: 820px) {
    body.mobile-side-nav-overlay-open,
    body.mobile-profile-overlay-open {
        overflow: hidden;
    }

    body.mobile-profile-overlay-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(29, 37, 34, 0.42);
        backdrop-filter: blur(2px);
    }

    .app-view {
        padding: 8px 10px calc(24px + env(safe-area-inset-bottom));
    }

    .topbar.app-navbar {
        min-height: 56px;
        position: sticky;
        top: 0;
        z-index: 95;
        margin: -8px -10px 12px;
        padding: calc(6px + env(safe-area-inset-top)) 10px 6px;
        border: 0;
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--bg) 94%, white);
        backdrop-filter: blur(12px);
    }

    .app-navbar-inner {
        min-height: 44px;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) 40px !important;
        align-items: center;
        gap: 8px;
        padding: 0 !important;
    }

    .app-navbar .sidebar-toggle {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
        border-radius: 6px;
        background: var(--panel);
    }

    .app-navbar .sidebar-toggle .bootstrap-icon {
        width: 17px;
        height: 17px;
    }

    .brand-home-button.navbar-brand {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: stretch;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-height: 40px;
        display: inline-flex !important;
        gap: 8px;
        padding: 0 10px;
        background: color-mix(in srgb, var(--panel) 72%, transparent);
        overflow: hidden;
    }

    .brand-home-button.navbar-brand img {
        width: 28px;
        height: 28px;
    }

    .brand-home-button.navbar-brand .brand-copy {
        min-width: 0;
    }

    .brand-home-button.navbar-brand .brand-powered {
        display: none;
    }

    .brand-title {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 17px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .app-navbar .navbar-actions {
        display: contents !important;
        width: auto;
        margin: 0;
    }

    .app-navbar .navbar-actions > :not(.profile-menu-wrap) {
        display: none !important;
    }

    .app-navbar .profile-menu-wrap {
        grid-column: 3 !important;
        grid-row: 1 !important;
        justify-self: end;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px;
    }

    .app-navbar .profile-button.dropdown-toggle {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        justify-content: center;
        padding: 0 !important;
        border-radius: 6px;
        background: var(--panel);
    }

    .app-navbar .profile-button.dropdown-toggle::after,
    .profile-name {
        display: none !important;
    }

    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .profile-menu.dropdown-menu.show {
        position: fixed !important;
        inset: auto 10px auto 10px !important;
        top: calc(58px + env(safe-area-inset-top)) !important;
        right: 10px !important;
        left: 10px !important;
        z-index: 110;
        width: auto;
        max-height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        display: grid;
        gap: 6px;
        padding: 10px;
        border-radius: 8px;
        transform: none !important;
    }

    .profile-menu .profile-menu-item.dropdown-item {
        min-height: 44px;
        padding: 0 12px;
        font-size: 15px;
    }

    .app-layout {
        display: block;
        border-top: 1px solid var(--line);
    }

    .content-shell {
        padding: 12px 0 0;
    }

    .side-nav,
    .app-view.side-nav-collapsed .side-nav {
        position: fixed;
        top: calc(58px + env(safe-area-inset-top));
        bottom: auto;
        left: 0;
        z-index: 80;
        width: min(320px, calc(100vw - 54px));
        height: calc(100vh - 58px - env(safe-area-inset-top));
        height: calc(100dvh - 58px - env(safe-area-inset-top));
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-right: 1px solid var(--line);
        background: var(--panel);
        box-shadow: 12px 0 30px rgba(38, 31, 22, 0.14);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }

    .app-view.side-nav-open .side-nav {
        transform: translateX(0);
    }

    .app-view.side-nav-collapsed .side-nav-list {
        visibility: visible;
    }

    .side-nav-backdrop:not([hidden]) {
        position: fixed;
        inset: calc(58px + env(safe-area-inset-top)) 0 0;
        z-index: 70;
        display: block;
        background: rgba(29, 37, 34, 0.32);
    }

    .mobile-nav-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 0;
        padding: 0 0 10px;
        border-bottom: 1px solid var(--line);
    }

    .mobile-nav-actions:empty {
        display: none;
    }

    .mobile-nav-actions #friends-summary-button {
        order: 1;
    }

    .mobile-nav-actions #chat-history-button {
        order: 2;
    }

    .mobile-nav-actions #download-acumen-button {
        order: 3;
    }

    .mobile-nav-actions #notifications-button {
        order: 4;
    }

    .mobile-nav-actions .auto-refresh-toggle {
        grid-column: 1 / -1;
        order: 5;
    }

    .mobile-nav-actions .nav-icon-button,
    .mobile-nav-actions .nav-icon-toggle {
        width: 100%;
        min-width: 0;
        height: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        position: relative;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 0 9px;
        background: #f7f1e7;
        color: var(--ink);
        text-align: left;
    }

    .mobile-nav-actions .nav-icon-button.active {
        border-color: var(--accent);
        background: #edf6f0;
        color: var(--accent-strong);
    }

    .mobile-nav-actions .nav-action-label {
        min-width: 0;
        display: inline;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 13px;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-nav-actions .auto-refresh-state {
        margin-left: auto;
    }

    .mobile-nav-actions .bootstrap-icon {
        width: 16px;
        height: 16px;
    }

    .mobile-nav-actions .notification-badge {
        top: -4px;
        right: -4px;
        border-color: var(--panel);
    }

    .side-nav-list {
        min-height: 0;
        display: grid;
        align-content: start;
        gap: 2px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .side-nav .tab.nav-link {
        width: 100%;
        min-height: 38px;
        display: flex;
        align-items: center;
        gap: 9px;
        border-radius: 6px;
        padding: 0 10px;
        font-size: 14px;
        font-weight: 750;
        line-height: 1.1;
        text-align: left;
        white-space: nowrap;
    }

    .side-nav .tab.nav-link.active {
        box-shadow: none;
    }

    .side-nav .nav-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .side-nav .bootstrap-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 430px) {
    .app-navbar-inner {
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    }

    .brand-home-button.navbar-brand {
        min-height: 38px;
        padding: 0 8px;
    }

    .app-navbar .sidebar-toggle,
    .app-navbar .profile-menu-wrap,
    .app-navbar .profile-button.dropdown-toggle {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }

    .profile-avatar {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

html[data-theme="dark"] body {
    background: var(--bg);
}

html[data-theme="dark"] ::selection {
    background: color-mix(in srgb, var(--accent) 34%, transparent);
    color: var(--ink);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .hunt-run-select {
    border-color: var(--line);
    background: var(--field-bg);
    color: var(--ink);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: color-mix(in srgb, var(--muted) 76%, transparent);
}

html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .subtab,
html[data-theme="dark"] .detail-tab,
html[data-theme="dark"] .setting-tab,
html[data-theme="dark"] .app-navbar-toggler.navbar-toggler,
html[data-theme="dark"] .app-navbar .nav-icon-button,
html[data-theme="dark"] .app-navbar .nav-icon-toggle,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle {
    border-color: var(--line);
    background: var(--secondary-bg);
    color: var(--ink);
}

html[data-theme="dark"] button.secondary:hover,
html[data-theme="dark"] button.secondary:focus,
html[data-theme="dark"] .subtab:hover,
html[data-theme="dark"] .detail-tab:hover,
html[data-theme="dark"] .setting-tab:hover,
html[data-theme="dark"] .app-navbar .nav-icon-button:hover,
html[data-theme="dark"] .app-navbar .nav-icon-button:focus,
html[data-theme="dark"] .app-navbar .nav-icon-toggle:hover,
html[data-theme="dark"] .app-navbar .nav-icon-toggle:focus,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button:hover,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button:focus,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle:hover,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle:focus {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    background: var(--secondary-hover);
    color: var(--accent-strong);
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] button[aria-disabled="true"] {
    background: #18211e;
    color: #65756e;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .topbar.app-navbar {
    border-color: var(--line);
    background: color-mix(in srgb, var(--bg) 88%, var(--panel-soft));
}

html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .profile-menu,
html[data-theme="dark"] .profile-menu.dropdown-menu,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .template-controls,
html[data-theme="dark"] .template-character-pane,
html[data-theme="dark"] .template-editor-shell,
html[data-theme="dark"] .template-editor-heading,
html[data-theme="dark"] .template-character-row,
html[data-theme="dark"] .notification-toolbar,
html[data-theme="dark"] .dashboard-controls,
html[data-theme="dark"] .dashboard-table-wrap,
html[data-theme="dark"] .chat-history-toolbar,
html[data-theme="dark"] .chat-history-character-results,
html[data-theme="dark"] .world-shouts-toolbar,
html[data-theme="dark"] .items-toolbar,
html[data-theme="dark"] .metafiles-toolbar,
html[data-theme="dark"] .tasks-command-panel,
html[data-theme="dark"] .admin-stat-card,
html[data-theme="dark"] .user-list-pane,
html[data-theme="dark"] .user-editor,
html[data-theme="dark"] .user-editor-heading,
html[data-theme="dark"] .user-editor-actions,
html[data-theme="dark"] .user-row,
html[data-theme="dark"] .egress-row,
html[data-theme="dark"] .share-friend-row,
html[data-theme="dark"] .shared-friends-section,
html[data-theme="dark"] .notification-row,
html[data-theme="dark"] .chat-filter-panel {
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .friends-panel .modal-header,
html[data-theme="dark"] .overlord-toast .toast-header,
html[data-theme="dark"] .packet-toggle,
html[data-theme="dark"] .packet-console-placeholder,
html[data-theme="dark"] .packet-inspector-empty,
html[data-theme="dark"] .packet-summary-grid > div,
html[data-theme="dark"] .friends-dialog-stat,
html[data-theme="dark"] .friend-empty-state,
html[data-theme="dark"] .acumen-download-details > div,
html[data-theme="dark"] .shared-friends-section-title,
html[data-theme="dark"] .chat-log,
html[data-theme="dark"] .items-summary span,
html[data-theme="dark"] .tasks-summary span,
html[data-theme="dark"] .chat-history-filter-option,
html[data-theme="dark"] .chat-history-log,
html[data-theme="dark"] .admin-growth-grid > div,
html[data-theme="dark"] .template-vital em,
html[data-theme="dark"] .user-editor .setting-checkbox,
html[data-theme="dark"] .shadow-tactics-options,
html[data-theme="dark"] .login-character-mode-tabs,
html[data-theme="dark"] .login-character-empty,
html[data-theme="dark"] .login-character-grid,
html[data-theme="dark"] #xu-web-sections.feature-grid,
html[data-theme="dark"] .admin-prune-checks .setting-checkbox,
html[data-theme="dark"] .admin-download-deleted,
html[data-theme="dark"] .admin-prune-form .confirm-actions,
html[data-theme="dark"] .hunt-group-start-action-row,
html[data-theme="dark"] .tips-steps span,
html[data-theme="dark"] .hunt-group-start-member,
html[data-theme="dark"] .graph-metric,
html[data-theme="dark"] .tab-panel > .info-band {
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--ink);
}

html[data-theme="dark"] .login-character-mode-button.active {
    border-color: #78bd91;
    background: #2d8b5b;
    color: #ffffff;
}

html[data-theme="dark"] .chat-history-character-option:hover,
html[data-theme="dark"] .chat-history-character-option:focus-visible,
html[data-theme="dark"] .chat-history-character-option.is-selected {
    background: #2f271e;
}

html[data-theme="dark"] .profile-menu-item:hover,
html[data-theme="dark"] .profile-menu .profile-menu-item.dropdown-item:hover,
html[data-theme="dark"] .profile-menu .profile-menu-item.dropdown-item:focus,
html[data-theme="dark"] .primary-nav .tab:hover,
html[data-theme="dark"] .app-navbar .primary-nav .tab.nav-link:hover,
html[data-theme="dark"] .app-navbar .primary-nav .tab.nav-link:focus,
html[data-theme="dark"] .side-nav .tab:hover,
html[data-theme="dark"] .side-nav .tab.nav-link:hover,
html[data-theme="dark"] .side-nav .tab.nav-link:focus {
    background: var(--panel-hover);
    color: var(--accent-strong);
}

html[data-theme="dark"] .profile-button,
html[data-theme="dark"] .profile-button.dropdown-toggle,
html[data-theme="dark"] .app-navbar .profile-button.dropdown-toggle {
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
}

html[data-theme="dark"] .profile-button:hover,
html[data-theme="dark"] .profile-button[aria-expanded="true"],
html[data-theme="dark"] .profile-button.dropdown-toggle:hover,
html[data-theme="dark"] .profile-button.dropdown-toggle:focus,
html[data-theme="dark"] .profile-button.dropdown-toggle.show {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    background: var(--active-soft);
    color: var(--accent-strong);
}

html[data-theme="dark"] .profile-avatar {
    background: color-mix(in srgb, var(--accent) 18%, #050807);
    color: var(--accent-strong);
}

html[data-theme="dark"] .theme-toggle.is-dark {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning-ink);
}

html[data-theme="dark"] .theme-toggle.is-dark:hover,
html[data-theme="dark"] .theme-toggle.is-dark:focus {
    background: var(--warning-hover);
    color: var(--warning-ink);
}

html[data-theme="dark"] .notification-badge {
    border-color: var(--bg);
}

html[data-theme="dark"] .nav-icon-button.notification-button.active,
html[data-theme="dark"] .app-navbar .notification-button.active,
html[data-theme="dark"] .app-navbar .tab.nav-icon-button.active,
html[data-theme="dark"] .app-navbar button.nav-icon-button.active,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button.active,
html[data-theme="dark"] .auto-refresh-toggle.is-on,
html[data-theme="dark"] .nav-icon-toggle.is-on,
html[data-theme="dark"] .chat-entry.is-outgoing,
html[data-theme="dark"] .chat-entry.chat-source-own,
html[data-theme="dark"] .friends-dialog-stat.good,
html[data-theme="dark"] .friend-row.is-mutual,
html[data-theme="dark"] .tips-feature-card,
html[data-theme="dark"] .tips-hero-aside,
html[data-theme="dark"] button.active-hunt-chip,
html[data-theme="dark"] .active-hunt-summary,
html[data-theme="dark"] .tag.online {
    border-color: var(--active-border);
    background: var(--active-soft);
    color: var(--accent-strong);
}

html[data-theme="dark"] .user-row.is-disabled {
    background: #1d2521;
}

html[data-theme="dark"] .tag.busy {
    border-color: color-mix(in srgb, #8bb9e2 46%, var(--line));
    background: color-mix(in srgb, #8bb9e2 16%, var(--panel));
    color: #9ec8ee;
}

html[data-theme="dark"] .hunt-group-busy-live-metric,
html[data-theme="dark"] .hunt-member-stats .hunt-member-rate-busy strong {
    color: #9ec8ee;
}

html[data-theme="dark"] .hunt-member-grouped-star {
    border-color: color-mix(in srgb, #d8af54 55%, var(--line));
    background: color-mix(in srgb, #d8af54 18%, var(--panel));
    color: #f1cf79;
}

html[data-theme="dark"] .hunt-member-boxed-exp strong {
    color: #f1cf79;
}

html[data-theme="dark"] .hunt-group-busy-live-metric span {
    color: #a9b8c6;
}

html[data-theme="dark"] button.active-hunt-chip:hover,
html[data-theme="dark"] .active-hunt-view-button:hover,
html[data-theme="dark"] .active-hunt-view-button:focus,
html[data-theme="dark"] .active-hunt-widget-button:hover,
html[data-theme="dark"] .active-hunt-widget-button:focus,
html[data-theme="dark"] .mine-toggle:hover {
    background: var(--active-soft-hover);
    color: var(--accent-strong);
}

html[data-theme="dark"] .active-hunt-view-button,
html[data-theme="dark"] .active-hunt-widget-button,
html[data-theme="dark"] .mine-toggle {
    border-color: var(--active-border);
    background: var(--panel);
    color: var(--accent-strong);
}

html[data-theme="dark"] .danger-button,
html[data-theme="dark"] .danger-icon,
html[data-theme="dark"] .tag.danger,
html[data-theme="dark"] .chat-counter.is-low,
html[data-theme="dark"] .packet-console-error,
html[data-theme="dark"] .mine-toggle.is-on,
html[data-theme="dark"] .overlord-toast-error .toast-header {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    background: var(--danger-soft);
    color: var(--danger);
}

html[data-theme="dark"] .danger-button:hover,
html[data-theme="dark"] .danger-button:focus,
html[data-theme="dark"] .danger-icon:hover,
html[data-theme="dark"] .danger-menu-item:hover,
html[data-theme="dark"] .profile-menu .danger-menu-item.dropdown-item:hover,
html[data-theme="dark"] .profile-menu .danger-menu-item.dropdown-item:focus,
html[data-theme="dark"] .mine-toggle.is-on:hover {
    background: var(--danger-soft-hover);
    color: var(--danger);
}

html[data-theme="dark"] .chat-entry.chat-kind-shout,
html[data-theme="dark"] .friends-dialog-stat.pending,
html[data-theme="dark"] .friend-row.is-pending,
html[data-theme="dark"] .tag.hold,
html[data-theme="dark"] .tag.pinned,
html[data-theme="dark"] .sharing-button,
html[data-theme="dark"] .share-chip,
html[data-theme="dark"] .share-friend-row.is-selected,
html[data-theme="dark"] .sharing-friend-summary,
html[data-theme="dark"] .pin-toggle:hover,
html[data-theme="dark"] .pin-toggle:focus,
html[data-theme="dark"] .pin-toggle.is-on,
html[data-theme="dark"] .world-shouts-table tbody tr:hover,
html[data-theme="dark"] .hunt-member-row.action-row:hover {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning-ink);
}

html[data-theme="dark"] .sharing-button:hover,
html[data-theme="dark"] .sharing-button:focus,
html[data-theme="dark"] .pin-toggle:hover,
html[data-theme="dark"] .pin-toggle:focus {
    background: var(--warning-hover);
    color: var(--warning-ink);
}

html[data-theme="dark"] .chat-entry.chat-kind-whisper,
html[data-theme="dark"] .automation-button {
    border-color: var(--info-line);
    background: var(--info-soft);
    color: var(--info-ink);
}

html[data-theme="dark"] .automation-button:hover,
html[data-theme="dark"] .automation-button:focus {
    background: var(--info-hover);
    color: var(--info-ink);
}

html[data-theme="dark"] .chat-entry.chat-kind-say,
html[data-theme="dark"] .packet-field-row,
html[data-theme="dark"] .packet-hex-row,
html[data-theme="dark"] .friend-row,
html[data-theme="dark"] .shared-friend-row,
html[data-theme="dark"] .tips-hero-card,
html[data-theme="dark"] .notification-table tbody tr.is-unread,
html[data-theme="dark"] .dashboard-table.notification-table tbody tr.is-unread,
html[data-theme="dark"] .dashboard-table.notification-table tbody tr.is-unread:hover {
    background: var(--panel);
    color: var(--ink);
}

html[data-theme="dark"] .dashboard-table th,
html[data-theme="dark"] .admin-table th {
    background: var(--table-head);
    color: var(--muted);
}

html[data-theme="dark"] .dashboard-table tbody tr:hover,
html[data-theme="dark"] .dashboard-table tbody tr.action-row:hover {
    background: var(--table-hover);
}

html[data-theme="dark"] .dashboard-table tbody tr.action-row.is-selected,
html[data-theme="dark"] .character-table tbody tr.action-row.is-selected,
html[data-theme="dark"] .active-hunt-table tbody tr.action-row.is-selected,
html[data-theme="dark"] .hunt-group-table tbody tr.action-row.is-selected,
html[data-theme="dark"] .hunt-member-row.action-row.is-selected {
    background: var(--selection-bg);
    outline-color: var(--selection-line);
    box-shadow: inset 3px 0 0 var(--accent);
}

html[data-theme="dark"] .entity-link {
    color: var(--accent-strong);
}

html[data-theme="dark"] .entity-link:hover,
html[data-theme="dark"] .entity-link:focus {
    background: var(--active-soft);
    color: #baf5d4;
}

html[data-theme="dark"] .pill {
    background: var(--badge-bg);
    color: var(--badge-ink);
}

html[data-theme="dark"] .tag,
html[data-theme="dark"] .chat-counter {
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--muted);
}

html[data-theme="dark"] .pin-toggle,
html[data-theme="dark"] .chat-kind-tag,
html[data-theme="dark"] .chat-source-tag {
    border-color: var(--line);
    background: color-mix(in srgb, var(--panel-soft) 84%, transparent);
    color: var(--muted);
}

html[data-theme="dark"] .chat-entry.chat-kind-shout .chat-kind-tag,
html[data-theme="dark"] .sharing-friend-summary,
html[data-theme="dark"] .share-chip strong {
    color: var(--warning-ink);
}

html[data-theme="dark"] .chat-entry.chat-kind-whisper .chat-kind-tag {
    color: var(--info-ink);
}

html[data-theme="dark"] .chat-entry.chat-source-creature .chat-source-tag,
html[data-theme="dark"] .chat-entry.chat-source-npc .chat-source-tag,
html[data-theme="dark"] .chat-entry.chat-source-object .chat-source-tag,
html[data-theme="dark"] .chat-entry.chat-source-system .chat-source-tag,
html[data-theme="dark"] .chat-entry.chat-source-unknown .chat-source-tag {
    color: var(--muted);
}

html[data-theme="dark"] .chat-text mark,
html[data-theme="dark"] .chat-meta mark,
html[data-theme="dark"] .world-shouts-table mark {
    background: var(--mark-bg);
    color: var(--mark-ink);
}

html[data-theme="dark"] .packet-preview-command,
html[data-theme="dark"] .packet-raw-line,
html[data-theme="dark"] .ascii-map,
html[data-theme="dark"] .egress-command-block {
    background: var(--code-bg);
    color: var(--code-ink);
}

html[data-theme="dark"] .exp-graph-scroll {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, #21352b) 0%, var(--panel) 100%),
        color-mix(in srgb, var(--accent) 6%, var(--panel));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .graph-grid {
    stroke: color-mix(in srgb, var(--muted) 22%, transparent);
}

html[data-theme="dark"] .graph-point-dot {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.42));
}

html[data-theme="dark"] .graph-tooltip {
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
    background: rgba(8, 13, 11, 0.96);
    color: var(--ink);
}

html[data-theme="dark"] .overlord-dialog::backdrop,
html[data-theme="dark"] body.mobile-profile-overlay-open::before,
html[data-theme="dark"] .side-nav-backdrop:not([hidden]) {
    background: rgba(0, 0, 0, 0.58);
}

@media (max-width: 1120px) {
    html[data-theme="dark"] .character-table tr.action-row {
        background: var(--panel);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
}

html[data-theme="dark"] .side-nav,
html[data-theme="dark"] .app-view.side-nav-collapsed .side-nav {
    background: var(--panel);
}

html[data-theme="dark"] .mobile-nav-actions .notification-badge {
    border-color: var(--panel);
}

@media (max-width: 820px) {
    html[data-theme="dark"] .topbar.app-navbar {
        border-bottom-color: var(--line);
        background: color-mix(in srgb, var(--bg) 88%, var(--panel-soft));
    }

    html[data-theme="dark"] .tabs {
        background: var(--bg);
    }

    html[data-theme="dark"] .hunt-member-list .hunt-member-row,
    html[data-theme="dark"] .character-table tr.action-row,
    html[data-theme="dark"] .active-hunt-table tr.action-row,
    html[data-theme="dark"] .hunt-group-table tr.action-row,
    html[data-theme="dark"] .world-shouts-table tr,
    html[data-theme="dark"] .recordings-table tr {
        background: var(--panel);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .mobile-nav-actions #theme-toggle {
        grid-column: 1 / -1;
        order: 5;
    }

    .mobile-nav-actions .auto-refresh-toggle {
        order: 6;
    }
}

html[data-theme="dark"] .app-navbar .nav-icon-button,
html[data-theme="dark"] .app-navbar .nav-icon-toggle,
html[data-theme="dark"] .app-navbar .download-acumen-button,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle,
html[data-theme="dark"] .mobile-nav-actions .download-acumen-button,
html[data-theme="dark"] .profile-button.dropdown-toggle,
html[data-theme="dark"] .modal-close-button {
    border-color: #51655b;
    background: #26372f;
    color: #f8fcf9;
}

html[data-theme="dark"] .app-navbar .nav-icon-button:hover,
html[data-theme="dark"] .app-navbar .nav-icon-button:focus,
html[data-theme="dark"] .app-navbar .nav-icon-toggle:hover,
html[data-theme="dark"] .app-navbar .nav-icon-toggle:focus,
html[data-theme="dark"] .app-navbar .download-acumen-button:hover,
html[data-theme="dark"] .app-navbar .download-acumen-button:focus,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button:hover,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-button:focus,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle:hover,
html[data-theme="dark"] .mobile-nav-actions .nav-icon-toggle:focus,
html[data-theme="dark"] .mobile-nav-actions .download-acumen-button:hover,
html[data-theme="dark"] .mobile-nav-actions .download-acumen-button:focus,
html[data-theme="dark"] .profile-button.dropdown-toggle:hover,
html[data-theme="dark"] .profile-button.dropdown-toggle:focus,
html[data-theme="dark"] .profile-button.dropdown-toggle.show {
    border-color: #73b58c;
    background: #314b3d;
    color: #ffffff;
}

html[data-theme="dark"] .auto-refresh-state {
    background: #101815;
    color: #e1eee8;
}

html[data-theme="dark"] .auto-refresh-toggle.is-on .auto-refresh-state {
    background: #83dfa7;
    color: #08110d;
}

html[data-theme="dark"] .dashboard-table th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .character-table th,
html[data-theme="dark"] .active-hunt-table th,
html[data-theme="dark"] .hunt-group-table th,
html[data-theme="dark"] .world-shouts-table th,
html[data-theme="dark"] .items-table th,
html[data-theme="dark"] .notification-table th {
    border-color: #4b5d54;
    background: #27382f;
    color: #edf7f2;
}

html[data-theme="dark"] .dashboard-table td,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .character-table td,
html[data-theme="dark"] .active-hunt-table td,
html[data-theme="dark"] .hunt-group-table td,
html[data-theme="dark"] .world-shouts-table td,
html[data-theme="dark"] .items-table td,
html[data-theme="dark"] .notification-table td {
    border-color: #314239;
}

html[data-theme="dark"] .entity-link,
html[data-theme="dark"] .hunt-group-table-title .entity-link,
html[data-theme="dark"] .active-hunt-table .entity-link,
html[data-theme="dark"] .character-table .entity-link {
    color: #82e9ad;
}

html[data-theme="dark"] .entity-link:hover,
html[data-theme="dark"] .entity-link:focus {
    background: #1d4a32;
    color: #d6ffe4;
}

html[data-theme="dark"] .compact-button,
html[data-theme="dark"] .dashboard-table .compact-button,
html[data-theme="dark"] .table-actions .compact-button,
html[data-theme="dark"] .notification-row-actions .compact-button {
    border: 1px solid #4a5f55;
    background: #26382f;
    color: #f8fcf9;
}

html[data-theme="dark"] .compact-button:hover,
html[data-theme="dark"] .dashboard-table .compact-button:hover,
html[data-theme="dark"] .table-actions .compact-button:hover,
html[data-theme="dark"] .notification-row-actions .compact-button:hover {
    border-color: #78bd91;
    background: #335242;
    color: #ffffff;
}

html[data-theme="dark"] button:not(.secondary):not(.danger-button):not(.tab):not(.nav-link):not(.subtab):not(.detail-tab):not(.setting-tab):not(.brand-home-button):not(.icon-button):not(.profile-button):not(.modal-close-button):not(.chat-mode-button):not(.packet-line-button):not(.pin-toggle):not(.mine-toggle):not(.hunt-stat-info):not(.compact-button):hover,
html[data-theme="dark"] .download-acumen-button:hover,
html[data-theme="dark"] .download-acumen-button:focus {
    background: #3ea873;
    color: #06110c;
}

html[data-theme="dark"] .table-sort-button:hover,
html[data-theme="dark"] .table-sort-button:focus {
    background: transparent;
    color: var(--accent-strong);
}

html[data-theme="dark"] .side-nav .tab.nav-link.active,
html[data-theme="dark"] .app-navbar .primary-nav .tab.nav-link.active,
html[data-theme="dark"] .subtab.active,
html[data-theme="dark"] .setting-tab.active {
    background: #2d8b5b;
    color: #ffffff;
}

html[data-theme="dark"] .pill {
    border: 1px solid #6f5932;
}

html[data-theme="dark"] .account-share-link-control {
    border-color: #35483e;
    background: #21342b;
}

@media (max-width: 820px) {
    .account-share-link-control {
        grid-template-columns: 1fr;
    }
}

/* 2026 command-center visual system. Keep these overrides last. */
:root {
    --overlord-radius: 14px;
    --overlord-radius-small: 9px;
    --overlord-glow: rgba(29, 181, 127, 0.18);
}

html[data-theme="dark"] {
    --bg: #080b10;
    --panel: #10161d;
    --panel-soft: #141c24;
    --panel-muted: #18232c;
    --panel-hover: #1d2b34;
    --panel-hover-strong: #243640;
    --field-bg: #0b1117;
    --ink: #f2f7f5;
    --muted: #91a29f;
    --line: #26343d;
    --accent: #1db57f;
    --accent-strong: #74e8bc;
    --gold: #e8bd72;
    --danger: #ff8d86;
    --secondary-bg: #18232b;
    --secondary-hover: #22313a;
    --active-soft: #12372b;
    --active-soft-hover: #174838;
    --active-border: #2e9c75;
    --table-head: #121d24;
    --table-hover: #15242b;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --overlord-glow: rgba(29, 181, 127, 0.2);
}

body {
    background:
        radial-gradient(circle at 82% -8%, color-mix(in srgb, var(--accent) 12%, transparent) 0, transparent 31rem),
        radial-gradient(circle at -8% 38%, color-mix(in srgb, var(--gold) 8%, transparent) 0, transparent 34rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.005em;
}

h1,
h2,
h3,
.brand-title {
    letter-spacing: -0.035em;
}

.boot-view {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 22px;
    padding: 24px;
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--accent) 14%, transparent), transparent 19rem),
        var(--bg);
    color: var(--ink);
}

.boot-sigil {
    position: relative;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
}

.boot-sigil::before,
.boot-sigil::after,
.boot-sigil > span {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    border-radius: 24px;
    transform: rotate(45deg);
    animation: boot-sigil-spin 2.2s linear infinite;
}

.boot-sigil::after {
    inset: 11px;
    border-color: color-mix(in srgb, var(--gold) 48%, transparent);
    animation-direction: reverse;
    animation-duration: 3s;
}

.boot-sigil > span {
    inset: -10px;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
    animation-duration: 8s;
}

.boot-sigil img {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 55%, transparent));
}

.boot-copy {
    display: grid;
    justify-items: center;
    gap: 2px;
    text-align: center;
}

.boot-copy span {
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.boot-copy strong {
    font-size: 24px;
    letter-spacing: -0.04em;
}

.boot-copy small {
    margin-top: 5px;
    color: var(--muted);
}

@keyframes boot-sigil-spin {
    to { transform: rotate(405deg); }
}

.login-view {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    padding: clamp(20px, 4vw, 60px);
    background:
        linear-gradient(115deg, color-mix(in srgb, var(--bg) 97%, transparent), color-mix(in srgb, var(--bg) 79%, transparent)),
        var(--bg);
}

.login-backdrop,
.login-grid-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.24;
    background-image:
        linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to right, black, transparent 76%);
}

.login-grid-glow {
    background:
        radial-gradient(circle at 23% 44%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 29rem),
        radial-gradient(circle at 72% 72%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 25rem);
}

.login-orbit {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
    border-radius: 50%;
}

.login-orbit::before,
.login-orbit::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent);
}

.orbit-one {
    width: 650px;
    height: 650px;
    left: -190px;
    top: calc(50% - 325px);
}

.orbit-one::before { right: 72px; top: 82px; }
.orbit-one::after { right: -3px; top: 50%; }

.orbit-two {
    width: 430px;
    height: 430px;
    left: -80px;
    top: calc(50% - 215px);
    border-color: color-mix(in srgb, var(--gold) 12%, transparent);
}

.orbit-two::before { right: 12px; bottom: 92px; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.orbit-two::after { display: none; }

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.75fr);
    align-items: center;
    gap: clamp(48px, 8vw, 128px);
}

.login-story {
    min-width: 0;
    display: grid;
    gap: clamp(38px, 6vh, 68px);
}

.login-story-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-story-brand img {
    width: 38px;
    height: 38px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 35%, transparent));
}

.login-story-brand > span {
    display: grid;
    line-height: 1;
}

.login-story-brand small {
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.login-story-brand strong {
    margin-top: 4px;
    font-size: 17px;
    letter-spacing: 0.08em;
}

.login-story-copy {
    display: grid;
    gap: 17px;
}

.login-eyebrow,
.dashboard-kicker,
.loadout-capture-badge {
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.login-eyebrow i,
.dashboard-kicker i {
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 13px var(--accent);
}

.login-story-copy h1 {
    max-width: 760px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(44px, 6.7vw, 82px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.login-story-copy h1 em {
    color: var(--accent-strong);
    font-weight: inherit;
}

.login-story-copy p {
    max-width: 620px;
    color: var(--muted);
    font-size: clamp(15px, 1.55vw, 19px);
    line-height: 1.7;
}

.login-feature-grid {
    max-width: 680px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.login-feature-grid > div {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 10px;
    padding: 18px 15px;
    border-right: 1px solid var(--line);
}

.login-feature-grid > div:first-child { padding-left: 0; }
.login-feature-grid > div:last-child { border-right: 0; }
.login-feature-grid .bootstrap-icon { grid-row: 1 / 3; align-self: center; color: var(--gold); font-size: 19px; }
.login-feature-grid strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.login-feature-grid small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.login-story-footnote {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-story-footnote span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.login-panel {
    width: 100%;
    padding: clamp(24px, 3.5vw, 42px);
    border: 1px solid color-mix(in srgb, var(--line) 84%, var(--accent));
    border-radius: 20px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--panel) 96%, white 4%), color-mix(in srgb, var(--panel) 99%, black 1%));
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.04);
}

.login-panel::before {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-bottom: 26px;
    background: linear-gradient(90deg, var(--accent), transparent);
    box-shadow: 0 0 15px var(--accent);
}

.login-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.login-panel-heading > div { display: grid; gap: 5px; }
.login-panel-heading h2 { font-size: 28px; }
.login-panel-heading p { color: var(--muted); font-size: 13px; }

.login-panel label {
    gap: 8px;
    margin-top: 17px;
}

.login-panel label > span {
    color: color-mix(in srgb, var(--ink) 80%, var(--muted));
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-panel input {
    min-height: 52px;
    border-color: var(--line);
    border-radius: 10px;
    padding: 0 15px;
    background: color-mix(in srgb, var(--field-bg) 94%, transparent);
}

.login-panel input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
    outline: 0;
}

.login-panel .login-submit {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    border-radius: 10px;
    padding: 0 18px;
    background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 88%, #05291c), var(--accent));
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 24%, transparent);
}

.login-panel .login-submit:hover,
.login-panel .login-submit:focus {
    background: linear-gradient(110deg, var(--accent), color-mix(in srgb, var(--accent-strong) 74%, var(--accent)));
}

.login-panel .login-theme-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel-muted);
}

.login-panel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.login-lock { color: var(--accent); font-size: 8px; }

.app-view {
    padding: 0 20px 50px;
}

.topbar.app-navbar {
    min-height: 68px;
    margin: 0 -20px;
    padding: 9px 20px;
    border-color: color-mix(in srgb, var(--line) 82%, transparent);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13);
    backdrop-filter: blur(20px) saturate(1.2);
}

.brand-home-button.navbar-brand {
    border-radius: 10px;
}

.brand-home-button.navbar-brand img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 30%, transparent));
}

.brand-title {
    font-size: 22px;
}

.app-navbar .nav-icon-button,
.app-navbar .nav-icon-toggle,
.app-navbar .download-acumen-button,
.profile-button.dropdown-toggle {
    border-color: var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel) 80%, transparent);
}

.app-layout {
    grid-template-columns: 238px minmax(0, 1fr);
    border-top: 0;
}

.side-nav {
    top: 68px;
    min-height: calc(100vh - 68px);
    padding: 22px 16px 28px 0;
    border-color: var(--line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 48%, transparent), transparent 75%);
}

.side-nav-list {
    gap: 5px;
}

.side-nav .tab.nav-link {
    min-height: 43px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 13px;
    color: var(--muted);
    font-size: 13px;
}

.side-nav .tab.nav-link:hover,
.side-nav .tab.nav-link:focus {
    border-color: var(--line);
    background: var(--panel-hover);
    color: var(--ink);
}

.side-nav .tab.nav-link.active,
html[data-theme="dark"] .side-nav .tab.nav-link.active {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 28%, var(--panel)), color-mix(in srgb, var(--accent) 8%, var(--panel)));
    color: var(--accent-strong);
    box-shadow: inset 3px 0 var(--accent), 0 10px 26px color-mix(in srgb, var(--accent) 9%, transparent);
}

.content-shell {
    padding: 24px 0 0 24px;
}

.dashboard-hero {
    position: relative;
    min-height: 172px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(24px, 3vw, 38px);
    background:
        radial-gradient(circle at 83% 15%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 21rem),
        linear-gradient(128deg, color-mix(in srgb, var(--panel) 98%, black), color-mix(in srgb, var(--panel-soft) 86%, var(--accent) 14%));
    box-shadow: var(--shadow);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -75px;
    top: -150px;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 46px color-mix(in srgb, var(--accent) 3%, transparent), 0 0 0 92px color-mix(in srgb, var(--accent) 2%, transparent);
}

.dashboard-hero > div {
    position: relative;
    z-index: 1;
}

.dashboard-hero h1 {
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 500;
}

.dashboard-hero p {
    margin-top: 6px;
    color: var(--muted);
}

.dashboard-hero-signals {
    max-width: 430px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-hero-signals span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, var(--accent));
    border-radius: 999px;
    padding: 7px 11px;
    background: color-mix(in srgb, var(--panel) 76%, transparent);
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.signal-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.subtabs {
    gap: 6px;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.subtab,
.detail-tab,
.setting-tab {
    border-radius: 8px;
}

.subtab.active,
.detail-tab.active,
.setting-tab.active,
html[data-theme="dark"] .subtab.active,
html[data-theme="dark"] .detail-tab.active,
html[data-theme="dark"] .setting-tab.active {
    background: color-mix(in srgb, var(--accent) 24%, var(--panel));
    color: var(--accent-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.card,
.dashboard-active-hunts,
.dashboard-controls,
.tab-panel > .info-band {
    border-color: var(--line);
    border-radius: var(--overlord-radius);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.1);
}

.dashboard-controls {
    padding: 14px;
}

.dashboard-table-wrap,
.character-table-wrap {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--overlord-radius);
    background: var(--panel);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.dashboard-table th,
.admin-table th,
.character-table th,
html[data-theme="dark"] .dashboard-table th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .character-table th {
    background: var(--table-head);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-table tbody tr,
.character-table tbody tr {
    transition: background 0.16s ease, transform 0.16s ease;
}

.dashboard-table tbody tr:hover,
.character-table tbody tr:hover {
    background: var(--table-hover);
}

.pill,
.tag {
    border-radius: 999px;
}

.detail-tabs {
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    background: var(--panel);
}

.character-loadout-page {
    display: grid;
    grid-template-columns: minmax(280px, 0.7fr) minmax(480px, 1.3fr);
    gap: 16px;
}

.loadout-identity-card,
.loadout-equipment-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(18px, 2.2vw, 28px);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--panel) 98%, var(--accent) 2%), var(--panel));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
}

.loadout-identity-heading,
.loadout-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.loadout-identity-heading > div,
.loadout-section-heading > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.loadout-identity-heading h3,
.loadout-section-heading h3 {
    overflow: hidden;
    font-size: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loadout-identity-heading p {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loadout-capture-badge {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 9px;
    color: var(--muted);
    letter-spacing: 0.09em;
}

.loadout-capture-badge.is-ready {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent-strong);
}

.loadout-avatar-stage {
    position: relative;
    min-height: 292px;
    display: grid;
    place-items: center;
    overflow: hidden;
    margin: 20px 0 18px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, var(--accent));
    border-radius: 16px;
    background:
        linear-gradient(transparent 49%, color-mix(in srgb, var(--accent) 5%, transparent) 50%, transparent 51%),
        linear-gradient(90deg, transparent 49%, color-mix(in srgb, var(--accent) 5%, transparent) 50%, transparent 51%),
        radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
        color-mix(in srgb, var(--bg) 55%, var(--panel));
    background-size: 32px 32px, 32px 32px, auto, auto;
}

.loadout-avatar-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: 50%;
}

.loadout-avatar-ring::before,
.loadout-avatar-ring::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.loadout-avatar-ring::before { top: 19px; right: 31px; }
.loadout-avatar-ring::after { bottom: 18px; left: 34px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.loadout-avatar-ring.ring-two { width: 154px; height: 154px; border-style: dashed; opacity: 0.55; transform: rotate(28deg); }

.loadout-avatar-figure {
    position: relative;
    z-index: 2;
    width: 104px;
    height: 158px;
    filter: drop-shadow(0 18px 13px rgba(0, 0, 0, 0.4));
    transition: opacity 160ms ease;
}

.loadout-character-sprite {
    position: relative;
    z-index: 3;
    width: min(288px, 90%);
    height: 230px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 18px 13px rgba(0, 0, 0, 0.55));
}

.loadout-avatar-stage.has-rendered-sprite .loadout-avatar-figure {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.loadout-avatar-figure > span:not(.avatar-initial) {
    position: absolute;
    display: block;
}

.avatar-head {
    width: 42px;
    height: 43px;
    left: 31px;
    top: 18px;
    border: 4px solid color-mix(in srgb, hsl(var(--avatar-skin-hue) 52% 68%) 82%, #322219);
    border-radius: 42% 42% 46% 46%;
    background: hsl(var(--avatar-skin-hue) 52% 68%);
    box-shadow: inset 6px -5px rgba(55, 31, 20, 0.15);
}

.avatar-hair {
    z-index: 2;
    width: 49px;
    height: 28px;
    left: 27px;
    top: 10px;
    border-radius: 50% 50% 28% 28%;
    background: hsl(var(--avatar-hair-hue) 48% 35%);
    box-shadow: 5px 8px 0 -2px hsl(var(--avatar-hair-hue) 48% 35%), -4px 8px 0 -2px hsl(var(--avatar-hair-hue) 48% 35%);
}

.avatar-body {
    width: 60px;
    height: 67px;
    left: 22px;
    top: 58px;
    clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
    background: linear-gradient(110deg, hsl(var(--avatar-armor-hue) 48% 29%), hsl(var(--avatar-armor-hue) 54% 46%));
    box-shadow: inset 9px 0 rgba(0, 0, 0, 0.13);
}

.avatar-arm {
    width: 18px;
    height: 68px;
    top: 62px;
    border-radius: 8px;
    background: hsl(var(--avatar-armor-hue) 48% 34%);
    transform-origin: top center;
}

.avatar-arm-left { left: 12px; transform: rotate(7deg); }
.avatar-arm-right { right: 12px; transform: rotate(-7deg); }

.avatar-leg {
    width: 25px;
    height: 42px;
    top: 116px;
    background: color-mix(in srgb, hsl(var(--avatar-armor-hue) 48% 27%) 84%, black);
}

.avatar-leg-left { left: 25px; clip-path: polygon(0 0, 100% 0, 76% 100%, 0 100%); }
.avatar-leg-right { right: 25px; clip-path: polygon(0 0, 100% 0, 100% 100%, 24% 100%); }

.avatar-initial {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 79px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.42);
}

.loadout-avatar-shadow {
    position: absolute;
    width: 150px;
    height: 34px;
    left: 50%;
    bottom: 39px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5), transparent 68%);
}

.loadout-avatar-caption {
    position: absolute;
    right: 12px;
    bottom: 10px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.loadout-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-soft) 75%, transparent);
}

.loadout-summary-strip div {
    min-width: 0;
    display: grid;
    gap: 1px;
    padding: 11px 12px;
    border-right: 1px solid var(--line);
    text-align: center;
}

.loadout-summary-strip div:last-child { border-right: 0; }
.loadout-summary-strip strong { color: var(--ink); font-size: 16px; }
.loadout-summary-strip span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }

.appearance-signature {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.appearance-signature > span:not(.appearance-empty) {
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 7px;
    color: var(--accent-strong);
    font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.appearance-signature em { color: var(--muted); font-style: normal; }
.appearance-empty { color: var(--muted); font-size: 11px; line-height: 1.5; }
.loadout-recorded-at { margin-top: 12px; color: var(--muted); font-size: 10px; }

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

.loadout-slot {
    position: relative;
    min-width: 0;
    min-height: 78px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 9px 9px 9px 11px;
    background: color-mix(in srgb, var(--panel-soft) 76%, transparent);
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.loadout-slot.is-filled:hover {
    z-index: 2;
    border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel-soft));
    transform: translateY(-1px);
}

.loadout-slot.is-empty { opacity: 0.48; }

.loadout-slot-number {
    position: absolute;
    right: 7px;
    top: 5px;
    color: color-mix(in srgb, var(--muted) 38%, transparent);
    font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.loadout-slot-sprite {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 76%, var(--gold));
    border-radius: 9px;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--gold) 12%, transparent), transparent 68%),
        color-mix(in srgb, var(--bg) 50%, var(--panel));
}

.loadout-slot-sprite img {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
    image-rendering: pixelated;
}

.loadout-slot-sprite.missing-sprite::before {
    content: "◇";
    color: color-mix(in srgb, var(--gold) 58%, var(--muted));
}

.loadout-empty-rune { color: var(--muted); font-size: 18px; }

.loadout-slot-copy {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 2px;
    padding-right: 25px;
}

.loadout-slot-copy strong,
.loadout-slot-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loadout-slot-copy strong { font-size: 12px; }
.loadout-slot-copy small { color: var(--muted); font-size: 9px; }
.loadout-slot.is-filled .loadout-slot-copy small:first-child { color: var(--gold); font-weight: 750; text-transform: uppercase; }

.loadout-durability {
    position: absolute;
    right: 8px;
    bottom: 6px;
    left: 69px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loadout-durability::before {
    content: "";
    height: 2px;
    flex: 1;
    border-radius: 999px;
    background: var(--line);
}

.loadout-durability i {
    position: absolute;
    width: var(--durability);
    max-width: calc(100% - 31px);
    height: 2px;
    left: 0;
    border-radius: 999px;
    background: var(--accent);
}

.loadout-durability em {
    width: 27px;
    color: var(--muted);
    font: normal 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
}

.loadout-slot.is-warning .loadout-durability i { background: var(--gold); }
.loadout-slot.is-critical .loadout-durability i { background: var(--danger); }
.loadout-slot.is-critical { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }

@media (max-width: 1100px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
        gap: 50px;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
        border-bottom: 0;
    }

    .login-feature-grid > div,
    .login-feature-grid > div:first-child {
        padding: 11px 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .character-loadout-page {
        grid-template-columns: minmax(260px, 0.65fr) minmax(380px, 1.35fr);
    }

    .loadout-slot-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .login-view {
        place-items: start center;
        width: 100%;
        max-width: 100%;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .login-shell {
        width: calc(100% - 28px);
        max-width: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
        gap: 34px;
        margin: 18px auto 30px;
    }

    .login-story {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 26px;
    }

    .login-story-copy,
    .login-story-copy h1,
    .login-story-copy p,
    .login-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .login-story-copy p {
        overflow-wrap: anywhere;
    }

    .login-panel input {
        min-width: 0;
        max-width: 100%;
    }

    .login-story-copy h1 {
        max-width: 620px;
        font-size: clamp(40px, 11vw, 64px);
    }

    .login-feature-grid,
    .login-story-footnote {
        display: none;
    }

    .login-panel {
        max-width: 540px;
        justify-self: center;
    }

    .dashboard-hero {
        min-height: 150px;
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-signals {
        justify-content: flex-start;
    }

    .character-loadout-page {
        grid-template-columns: minmax(0, 1fr);
    }

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

@media (max-width: 560px) {
    .login-view {
        padding: 0;
    }

    .login-shell {
        width: calc(100% - 28px);
        margin: 18px auto 30px;
    }

    .login-story-brand { margin-top: 6px; }
    .login-story-copy h1 { font-size: 41px; }
    .login-story-copy p { font-size: 14px; line-height: 1.55; }
    .login-panel { padding: 24px 18px; border-radius: 16px; }
    .login-panel-heading h2 { font-size: 24px; }

    .app-view {
        padding-right: 12px;
        padding-left: 12px;
    }

    .topbar.app-navbar {
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .content-shell { padding-top: 16px; }
    .dashboard-hero { min-height: 0; padding: 22px 18px; border-radius: 14px; }
    .dashboard-hero h1 { font-size: 36px; }
    .dashboard-hero-signals span:nth-child(n + 2) { display: none; }

    .loadout-identity-card,
    .loadout-equipment-card {
        padding: 16px;
        border-radius: 14px;
    }

    .loadout-identity-heading { align-items: flex-start; flex-direction: column; }
    .loadout-avatar-stage { min-height: 260px; }
    .loadout-slot-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Keep command-center desktop spacing from offsetting the mobile canvas. */
@media (max-width: 820px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .shell,
    .app-view,
    .app-layout,
    .content-shell,
    #main-panels,
    .tab-panel,
    .detail-view,
    .character-detail {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-right: 0;
        margin-left: 0;
    }

    .app-view {
        width: auto;
        max-width: none;
        padding: 0 10px calc(24px + env(safe-area-inset-bottom));
    }

    .app-layout,
    .app-view.side-nav-collapsed .app-layout {
        display: block;
        grid-template-columns: minmax(0, 1fr);
    }

    .content-shell,
    .app-view.side-nav-collapsed .content-shell {
        padding: 14px 0 0;
    }

    .topbar.app-navbar {
        width: auto;
        max-width: none;
        margin: 0 -10px 12px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .card,
    .dashboard-hero,
    .detail-tabs,
    .subtabs,
    .character-detail-panel,
    .character-loadout-page {
        max-width: 100%;
        min-width: 0;
    }

    .detail-tabs,
    .subtabs {
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .character-status-body {
        grid-template-columns: minmax(0, 1fr) 108px;
        gap: 10px;
    }

    .character-status-paperdoll {
        min-height: 138px;
    }

    .character-status-paperdoll img {
        width: 190px;
        height: 136px;
    }
}

@media (max-width: 390px) {
    .app-view {
        padding-right: 8px;
        padding-left: 8px;
    }

    .topbar.app-navbar {
        margin-right: -8px;
        margin-left: -8px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .character-status-body {
        grid-template-columns: minmax(0, 1fr) 96px;
    }

    .character-status-paperdoll img {
        width: 176px;
    }
}

/* Compact hunt parties, mobile hunt lists, and the private hunt widget. */
.hunt-group-avatar-stack {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    padding-left: 7px;
}

.hunt-group-avatar-stack .character-avatar {
    width: 42px;
    min-width: 42px;
    height: 42px;
    flex-basis: 42px;
    margin-left: -7px;
    border-width: 2px;
    background-color: var(--panel);
    box-shadow: 0 0 0 2px var(--panel), 0 4px 10px rgba(17, 28, 22, 0.14);
}

.hunt-group-avatar-stack .character-avatar:first-child {
    margin-left: 0;
}

.hunt-group-avatar-stack .character-avatar:hover {
    z-index: 3;
    transform: translateY(-2px);
}

.hunt-group-avatar-stack.is-compact .character-avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    flex-basis: 32px;
}

.hunt-group-avatar-more {
    position: relative;
    z-index: 2;
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    margin-left: -7px;
    border: 2px solid var(--panel);
    border-radius: 50%;
    background: var(--accent-strong);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.hunt-group-avatar-stack-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.hunt-group-party-strip {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 23%, var(--line));
    border-radius: 10px;
    padding: 10px 12px;
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--accent) 8%, var(--panel)), var(--panel));
}

.hunt-group-party-strip > span:last-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.hunt-group-party-strip > span:last-child strong {
    color: var(--ink);
}

.hunt-group-table-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-hunt-table-identity {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hunt-group-table-identity .hunt-group-table-title {
    min-width: 0;
    flex: 1 1 auto;
}

.hunt-group-member-summary {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hunt-group-member-summary > strong,
.hunt-group-member-summary .hunt-group-avatar-stack {
    flex: 0 0 auto;
}

.hunt-group-member-summary .hunt-group-avatar-stack {
    padding-left: 6px;
}

.hunt-group-member-summary .hunt-group-avatar-stack .character-avatar,
.hunt-group-member-summary .hunt-group-avatar-more {
    width: 28px;
    min-width: 28px;
    height: 28px;
    flex-basis: 28px;
    margin-left: -6px;
}

.hunt-group-member-summary .hunt-group-avatar-stack .character-avatar:first-child {
    margin-left: 0;
}

.character-mobile-list,
.hunt-group-mobile-list,
.active-hunt-mobile-list {
    display: none;
}

.character-mobile-card,
.hunt-group-mobile-card,
.active-hunt-mobile-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: var(--panel);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.character-mobile-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-mobile-copy {
    min-width: 0;
    display: grid;
    flex: 1 1 auto;
    gap: 2px;
}

.character-mobile-copy strong,
.character-mobile-copy small,
.character-mobile-footer small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-mobile-copy strong {
    font-size: 14px;
}

.character-mobile-copy small,
.character-mobile-footer small {
    color: var(--muted);
    font-size: 11px;
}

.character-mobile-footer {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.character-mobile-footer .tag {
    flex: 0 0 auto;
    font-size: 9px;
}

.character-mobile-footer small {
    flex: 1 1 auto;
    text-align: right;
}

.character-mobile-card.is-selected,
.hunt-group-mobile-card.is-selected,
.active-hunt-mobile-card.is-selected {
    border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
    box-shadow: inset 3px 0 0 var(--accent);
}

.hunt-group-mobile-heading,
.hunt-group-mobile-body,
.active-hunt-mobile-card,
.active-hunt-mobile-main {
    min-width: 0;
    display: flex;
    align-items: center;
}

.hunt-group-mobile-heading {
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.hunt-group-mobile-heading .title-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hunt-group-mobile-heading strong,
.active-hunt-mobile-main strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-group-mobile-body {
    gap: 10px;
}

.hunt-group-mobile-copy,
.active-hunt-mobile-main > span,
.active-hunt-mobile-metrics {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.hunt-group-mobile-copy {
    flex: 1 1 auto;
}

.hunt-group-mobile-copy strong,
.active-hunt-mobile-metrics strong {
    color: var(--accent-strong);
    font-size: 13px;
}

.hunt-group-mobile-copy small,
.active-hunt-mobile-main small,
.active-hunt-mobile-metrics span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-hunt-mobile-card {
    gap: 10px;
}

.active-hunt-mobile-main {
    min-width: 0;
    flex: 1 1 auto;
    gap: 9px;
}

.active-hunt-mobile-main > span {
    flex: 1 1 auto;
}

.active-hunt-mobile-metrics {
    flex: 0 0 auto;
    text-align: right;
}

.hunt-widget-private-badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 999px;
    padding: 0 8px;
    background: color-mix(in srgb, var(--accent) 11%, var(--panel));
    color: var(--widget-green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hunt-widget-party-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.hunt-widget-party-heading > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.hunt-widget-party-heading small {
    min-width: 0;
    overflow: hidden;
    color: var(--widget-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hunt-widget-root .hunt-group-avatar-stack .character-avatar {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    background-color: var(--panel);
    box-shadow: 0 0 0 2px var(--panel), 0 5px 12px rgba(0, 0, 0, 0.3);
}

.hunt-widget-root .hunt-group-avatar-more {
    border-color: var(--panel);
    background: var(--widget-gold);
    color: var(--bg);
}

.hunt-widget-root .character-avatar-fallback {
    color: var(--widget-green);
}

.hunt-widget-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hunt-widget-metric {
    min-height: 64px;
    padding: 8px;
}

.hunt-widget-metric strong {
    font-size: 17px;
}

.hunt-widget-member {
    padding: 8px;
}

.hunt-widget-member-layout {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hunt-widget-member-layout > .character-avatar {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    background-color: var(--panel);
}

.hunt-widget-member-copy {
    min-width: 0;
    display: grid;
    flex: 1 1 auto;
    gap: 2px;
}

.hunt-widget-group-card {
    min-height: 108px;
}

@media (max-width: 820px) {
    .hunt-group-table-wrap,
    .active-hunt-table-wrap {
        display: none;
    }

    .character-mobile-list,
    .hunt-group-mobile-list,
    .active-hunt-mobile-list {
        display: grid;
        gap: 8px;
    }

    .character-mobile-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hunt-group-party-strip {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .hunt-group-party-strip > span:last-child {
        text-align: left;
        white-space: normal;
    }
}

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

@media (max-width: 430px) {
    .hunt-group-mobile-heading .tags .tag:nth-child(n + 2) {
        display: none;
    }

    .active-hunt-mobile-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .active-hunt-mobile-main {
        grid-column: 1 / -1;
    }

    .hunt-group-mobile-card .widget-button,
    .active-hunt-mobile-card .widget-button {
        min-height: 32px;
        padding: 0 8px;
    }
}

@media (max-width: 360px) {
    .hunt-widget-root {
        padding: 7px;
    }

    .hunt-widget-header {
        top: 5px;
        padding: 7px;
    }

    .hunt-widget-private-badge {
        display: none;
    }

    .hunt-widget-icon-button {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .hunt-widget-metrics,
    .hunt-widget-overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hunt-group-mobile-body {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .hunt-group-mobile-copy {
        min-width: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .boot-sigil::before,
    .boot-sigil::after,
    .boot-sigil > span {
        animation: none;
    }
}

.icon-bug {
    --icon-url: url("/hunt/assets/bootstrap/icons/bug.svg");
}

.issues-layout,
.issues-workspace {
    min-width: 0;
}

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

.issue-list-pane,
.issue-detail-pane {
    min-width: 0;
}

.issue-status-tabs {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.7fr);
    gap: 6px;
    margin-bottom: 10px;
}

.issue-status-tabs .issue-status-tab {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 9px;
    font-size: 13px;
    white-space: nowrap;
}

.issue-status-tabs .issue-status-tab:disabled {
    cursor: wait;
}

.issue-status-tab-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
}

.issue-status-tab.active .issue-status-tab-count {
    background: color-mix(in srgb, var(--accent) 16%, var(--panel));
    color: var(--accent-strong);
}

.issue-filters {
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(170px, 1.3fr);
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}

.issue-filters-search-only {
    grid-template-columns: minmax(0, 1fr);
}

.issue-filters .setting-field,
.issue-form .setting-field,
.issue-status-editor .setting-field {
    margin: 0;
}

.issue-filters input,
.issue-filters select,
.issue-form input,
.issue-form textarea,
.issue-status-editor input,
.issue-status-editor select,
.issue-status-editor textarea {
    width: 100%;
}

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

.issue-list-item {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    text-align: left;
    box-shadow: none;
}

.issue-list-item:hover,
.issue-list-item:focus-visible {
    border-color: var(--active-border);
    background: var(--panel-hover);
}

.issue-list-item.selected {
    border-color: var(--selection-line);
    background: var(--selection-bg);
    box-shadow: inset 3px 0 0 var(--accent);
}

.issue-list-item > strong,
.issue-list-meta,
.issue-list-comments {
    min-width: 0;
    overflow-wrap: anywhere;
}

.issue-list-item > strong {
    font-size: 15px;
    line-height: 1.35;
}

.issue-list-heading,
.issue-detail-kicker,
.issue-comment-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.issue-number {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.issue-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-muted);
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.issue-status-open {
    border-color: var(--info-line);
    background: var(--info-soft);
    color: var(--info-ink);
}

.issue-status-in-progress {
    border-color: var(--active-border);
    background: var(--active-soft);
    color: var(--accent-strong);
}

.issue-status-needs-work {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning-ink);
}

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

.issue-list-meta,
.issue-list-comments,
.issue-detail-meta,
.issue-comment-heading time {
    color: var(--muted);
    font-size: 12px;
}

.issue-list-comments {
    justify-self: start;
}

.issue-detail-card,
.issue-compose-card {
    display: grid;
    gap: 18px;
}

.issue-detail-header h3 {
    margin: 8px 0 4px;
    font-size: clamp(21px, 3vw, 29px);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.issue-detail-meta {
    margin: 0;
}

.issue-description,
.issue-comment-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.issue-description {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
    line-height: 1.6;
}

.issue-thread,
.issue-status-editor {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.issue-status-editor-grid {
    display: grid;
    grid-template-columns: minmax(140px, 0.6fr) minmax(220px, 1.4fr) auto;
    gap: 10px;
    align-items: end;
}

.issue-comments {
    display: grid;
    gap: 10px;
}

.issue-comment {
    display: grid;
    gap: 8px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}

.issue-comment-heading strong {
    overflow-wrap: anywhere;
}

.issue-comment-heading time {
    margin-left: auto;
}

.issue-agent-comment {
    border-color: var(--info-line);
    background: var(--info-soft);
}

.issue-agent-tag {
    border-color: var(--info-line);
    background: var(--info-hover);
    color: var(--info-ink);
}

.issue-status-event {
    border-style: dashed;
}

.issue-status-event p {
    margin: 0;
}

.issue-form {
    display: grid;
    gap: 14px;
}

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

.issue-empty-detail button {
    margin-top: 8px;
}

.issue-list-pane .empty-card [data-issue-status-scope] {
    justify-self: start;
    margin-top: 4px;
}

@media (max-width: 960px) {
    .issues-workspace {
        grid-template-columns: 1fr;
    }

    .issue-list {
        max-height: 420px;
        overflow: auto;
        padding-right: 2px;
    }
}

@media (max-width: 640px) {
    .issue-filters,
    .issue-status-editor-grid {
        grid-template-columns: 1fr;
    }

    .issue-status-editor-grid > button {
        width: 100%;
    }

    .issue-comment-heading time {
        width: 100%;
        margin-left: 0;
    }
}

/* Mobile template editing is a focused picker -> editor flow. */
.template-mobile-step-heading,
.template-mobile-editor-nav,
.template-mobile-save-bar {
    display: none;
}

@media (max-width: 640px) {
    #templates-tab {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    #templates-tab > .panel-header {
        gap: 8px;
    }

    #templates-tab > .panel-header .panel-actions {
        display: none;
    }

    .template-workspace {
        display: block;
    }

    .template-workspace[data-template-mobile-mode="pick"] .template-editor-shell,
    .template-workspace[data-template-mobile-mode="pick"] .template-mobile-save-bar,
    .template-workspace[data-template-mobile-mode="edit"] .template-character-pane {
        display: none;
    }

    .template-character-pane,
    .template-editor-shell {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .template-character-pane {
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .template-mobile-step-heading {
        display: grid;
        gap: 3px;
        padding: 2px 2px 6px;
    }

    .template-mobile-step-heading > div,
    .template-mobile-editor-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .template-mobile-step-heading strong {
        color: var(--ink);
        font-size: 15px;
    }

    .template-mobile-step-heading span,
    .template-mobile-editor-nav > span {
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .template-mobile-step-heading small {
        color: var(--muted);
        font-size: 12px;
    }

    .template-character-list {
        max-height: calc(100dvh - 250px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .template-character-row {
        min-height: 60px;
    }

    .template-character-main,
    .template-oak-button {
        min-height: 48px;
    }

    .template-editor-heading {
        position: static;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .template-name-controls > button {
        min-height: 44px;
    }

    .template-mobile-editor-nav {
        width: 100%;
    }

    .template-mobile-editor-nav button {
        min-height: 40px;
    }

    .template-editor-shell > .template-editor-panel {
        padding: 10px;
    }

    .template-editor-panel .settings-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .template-editor-panel :where(input, select, textarea),
    .template-character-search-field input,
    .template-name-field select {
        font-size: 16px;
    }

    .template-editor-panel .setting-checkbox {
        min-height: 44px;
    }

    .template-editor-panel .settings-action-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .template-editor-panel .settings-action-buttons > button,
    .template-editor-panel .setting-tab {
        min-height: 44px;
    }

    .template-editor-panel .setting-tabs {
        margin-right: -10px;
        margin-left: -10px;
        padding: 0 10px 4px;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .template-editor-panel .setting-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .template-mobile-save-bar {
        position: fixed;
        right: 8px;
        bottom: 0;
        left: 8px;
        z-index: 34;
        grid-template-columns: minmax(72px, 0.65fr) minmax(90px, 0.85fr) minmax(132px, 1.4fr);
        gap: 7px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
        border-bottom: 0;
        border-radius: 10px 10px 0 0;
        background: color-mix(in srgb, var(--panel) 94%, transparent);
        box-shadow: 0 -8px 24px rgba(29, 37, 34, 0.14);
        backdrop-filter: blur(12px);
    }

    .tab-panel.active .template-workspace[data-template-mobile-mode="edit"] .template-mobile-save-bar {
        display: grid;
    }

    .template-mobile-save-bar > button {
        min-width: 0;
        min-height: 44px;
        padding-right: 8px;
        padding-left: 8px;
        white-space: nowrap;
    }
}

/* Keep the main navigation reachable in every viewport height. */
.side-nav {
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.side-nav::-webkit-scrollbar,
.side-nav-list::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-thumb,
.side-nav-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 42%, transparent);
}

@media (max-width: 820px) {
    html.mobile-side-nav-overlay-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    body.mobile-side-nav-overlay-open {
        position: fixed;
        top: var(--mobile-side-nav-scroll-top, 0);
        right: 0;
        left: 0;
        width: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .side-nav,
    .app-view.side-nav-collapsed .side-nav {
        top: calc(58px + env(safe-area-inset-top));
        right: auto;
        bottom: 0;
        left: 0;
        height: auto;
        min-height: 0;
        max-height: none;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        padding: 10px 8px calc(8px + env(safe-area-inset-bottom)) 10px;
        overflow: hidden;
    }

    .mobile-nav-actions {
        flex: 0 0 auto;
    }

    .side-nav-list {
        width: 100%;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
        scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
        scrollbar-width: thin;
        scroll-padding-block: 8px;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .side-nav-backdrop:not([hidden]) {
        touch-action: none;
    }
}

/* Full-screen mobile navigation: one generous scroll surface, never a cramped inner pane. */
.mobile-nav-header {
    display: none;
}

@media (max-width: 820px) {
    .side-nav,
    .app-view.side-nav-collapsed .side-nav {
        position: fixed;
        inset: 0;
        z-index: 130;
        box-sizing: border-box;
        width: 100vw;
        width: 100dvw;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-gutter: auto;
        touch-action: pan-y;
        border: 0;
        background: var(--bg);
        box-shadow: none;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(-100%, 0, 0);
        transition:
            transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
            visibility 0s linear 0.24s;
        -webkit-overflow-scrolling: touch;
    }

    .app-view.side-nav-open .side-nav {
        visibility: visible;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
        transition-delay: 0s;
    }

    .mobile-nav-header {
        position: sticky;
        top: 0;
        z-index: 2;
        min-height: calc(64px + env(safe-area-inset-top));
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding:
            calc(10px + env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            10px
            max(14px, env(safe-area-inset-left));
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--bg) 94%, transparent);
        box-shadow: 0 8px 24px color-mix(in srgb, #000 10%, transparent);
        backdrop-filter: blur(18px) saturate(1.15);
    }

    .mobile-nav-heading {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 11px;
    }

    .mobile-nav-heading img {
        width: 34px;
        height: 34px;
        flex: 0 0 auto;
        filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 28%, transparent));
    }

    .mobile-nav-heading > span {
        min-width: 0;
        display: grid;
        gap: 1px;
    }

    .mobile-nav-heading small {
        color: var(--muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.11em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .mobile-nav-heading strong {
        overflow: hidden;
        color: var(--ink);
        font-family: Georgia, "Times New Roman", serif;
        font-size: 21px;
        font-weight: 600;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-side-nav-close {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        display: inline-grid;
        flex: 0 0 auto;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0;
        background: var(--panel);
        color: var(--ink);
    }

    .mobile-side-nav-close:hover,
    .mobile-side-nav-close:focus-visible {
        border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
        background: var(--panel-hover);
        color: var(--accent-strong);
    }

    .mobile-side-nav-close .bootstrap-icon {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-actions {
        width: auto;
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin: 0;
        padding:
            18px
            max(14px, env(safe-area-inset-right))
            16px
            max(14px, env(safe-area-inset-left));
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--panel) 42%, transparent);
    }

    .mobile-nav-actions::before,
    .side-nav-list::before {
        grid-column: 1 / -1;
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.12em;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .mobile-nav-actions::before {
        content: "Quick actions";
        margin-bottom: 1px;
    }

    .mobile-nav-actions .nav-icon-button,
    .mobile-nav-actions .nav-icon-toggle {
        height: 48px;
        min-height: 48px;
        gap: 10px;
        border-radius: 10px;
        padding: 0 12px;
        background: var(--panel);
    }

    .mobile-nav-actions .nav-action-label {
        font-size: 14px;
    }

    .mobile-nav-actions .bootstrap-icon {
        width: 18px;
        height: 18px;
    }

    .side-nav-list {
        width: auto;
        min-height: auto;
        display: grid;
        flex: 0 0 auto;
        align-content: start;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        margin: 0;
        padding:
            18px
            max(14px, env(safe-area-inset-right))
            calc(24px + env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
        overflow: visible;
        overscroll-behavior: auto;
        scrollbar-gutter: auto;
        touch-action: auto;
    }

    .side-nav-list::before {
        content: "Sections";
        margin-bottom: 3px;
    }

    .side-nav .nav-link,
    .side-nav .tab.nav-link {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 11px;
        border: 1px solid transparent;
        border-radius: 10px;
        padding: 9px 13px;
        color: var(--muted);
        font-size: 14px;
        font-weight: 750;
        line-height: 1.2;
        text-align: left;
        text-decoration: none;
        white-space: normal;
    }

    .side-nav .nav-link:hover,
    .side-nav .nav-link:focus-visible {
        border-color: var(--line);
        background: var(--panel-hover);
        color: var(--ink);
    }

    .side-nav .nav-link.active,
    .side-nav .tab.nav-link.active {
        border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
        background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 28%, var(--panel)), color-mix(in srgb, var(--accent) 8%, var(--panel)));
        color: var(--accent-strong);
        box-shadow: inset 3px 0 var(--accent);
    }

    .side-nav .nav-label {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .side-nav .nav-link > img,
    .side-nav .bootstrap-icon {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
    }

    .side-nav-backdrop:not([hidden]) {
        display: none;
    }
}

@media (min-width: 600px) and (max-width: 820px) {
    .mobile-nav-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-nav-actions #theme-toggle,
    .mobile-nav-actions .auto-refresh-toggle {
        grid-column: auto;
    }

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

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
    .side-nav,
    .app-view.side-nav-collapsed .side-nav {
        transition: none;
    }
}

/* Keep the signed-out surface intentionally anonymous and utilitarian. */
.login-view {
    min-height: 100svh;
    place-items: center;
    overflow: auto;
    padding: 24px;
    background: var(--bg);
}

.login-shell {
    width: min(380px, 100%);
    display: block;
}

.login-panel {
    width: 100%;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: none;
}

.login-panel::before {
    display: none;
}

.login-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.login-panel-heading h1 {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.login-panel label {
    gap: 7px;
    margin-top: 16px;
}

.login-panel label > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.login-panel input {
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    border-color: var(--line);
    border-radius: 6px;
    padding: 0 12px;
    background: var(--field-bg);
}

.login-panel input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
    outline: 0;
}

.login-panel .login-submit {
    min-height: 44px;
    margin-top: 22px;
    border-radius: 6px;
    padding: 0 16px;
    background: var(--accent);
    box-shadow: none;
}

.login-panel .login-submit:hover,
.login-panel .login-submit:focus {
    background: var(--accent-strong);
}

.login-panel .login-theme-toggle {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-muted);
}

@media (max-width: 560px) {
    .login-view {
        padding: 16px;
    }

    .login-shell {
        width: min(380px, 100%);
        margin: 0;
    }

    .login-panel {
        padding: 24px 20px;
        border-radius: 8px;
    }
}
