: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;
}

.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-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 {
    display: grid;
    gap: 12px;
}

.character-stats-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 {
    margin: 2px 0 4px;
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: 0;
}

.character-stats-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));
}

.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;
}

.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;
}

.friend-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.friend-toolbar .inline-form {
    margin-bottom: 0;
}

.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.notification-detail-dialog {
    width: min(680px, 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);
}

.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,
.items-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);
}

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

.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,
.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);
}

.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: 760px) {
    .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;
    }
}

.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-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;
}

.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 {
    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-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;
}

.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-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) minmax(160px, 0.9fr) minmax(150px, 0.8fr) minmax(140px, 0.75fr) minmax(220px, 1.2fr);
    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-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%);
}

.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-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: 760px) {
    .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;
}

.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;
    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;
}

.hunt-group-main-toggle span {
    font-size: 12px;
    line-height: 1;
}

.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-start-dialog {
    width: min(540px, calc(100vw - 32px));
}

.hunt-group-actions-panel {
    width: 100%;
}

.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;
}

.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;
    justify-content: flex-end;
}

.character-activity-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.character-activity-sort select {
    min-width: 118px;
}

.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);
}

.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);
}

.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-toolbar {
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) max-content max-content;
}

.metadata-toolbar .metadata-class-filter {
    min-width: 0;
}

.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-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-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(980px, calc(100% - 24px));
    max-height: min(90vh, 860px);
}

.metadata-editor-panel {
    max-height: min(90vh, 860px);
}

.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: 5px 0 3px;
    font-size: 24px;
    line-height: 1.18;
}

.metadata-modal-heading p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.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-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-checkbox {
    width: fit-content;
}

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

.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-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-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-selection {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.metadata-map-point {
    pointer-events: auto;
}

.metadata-map-point:not([data-map-number="0"]) {
    cursor: pointer;
}

.metadata-map-selection {
    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-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: 760px) {
    .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);
    }
}

.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;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.settings-search {
    width: 100%;
}

.settings-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.setting-tab {
    min-height: 34px;
    background: #ece4d6;
    color: var(--ink);
}

.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-section,
.sharing-resource-group,
.sharing-resource-list,
.sharing-table-block {
    display: grid;
    gap: 14px;
}

.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-resource-heading {
    color: var(--ink);
    font-weight: 800;
}

.sharing-resource-list {
    grid-template-columns: minmax(0, 1fr);
}

.sharing-resource-card {
    display: grid;
    gap: 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(280px, 0.72fr) minmax(560px, 1.28fr);
    gap: 14px;
    align-items: start;
}

.template-character-pane,
.template-editor-shell {
    min-width: 0;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 118px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.template-character-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
}

.template-character-search-field {
    min-width: 0;
}

.template-character-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

button.template-character-row {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px;
    background: var(--panel);
    color: var(--ink);
    text-align: left;
}

button.template-character-row:hover,
button.template-character-row:focus {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    background: var(--panel-hover);
}

button.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-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: 12px;
    font-weight: 700;
}

.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 > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.template-editor-heading strong,
.template-editor-heading span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-name-field {
    min-width: 0;
}

.template-editor-shell > .template-editor-panel {
    padding: 14px;
}

.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-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 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: none;
    }

    .template-character-list {
        overflow: visible;
    }
}

.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) max-content;
    gap: 8px;
    align-items: end;
}

.user-search-field {
    min-width: 0;
}

.user-search-field input {
    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);
}

.speed-condition-field,
.speed-grant-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.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 {
    padding: 1px 6px;
    font-size: 11px;
}

.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;
    }
}

.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: 760px) {
    .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,
    .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-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-ranger-watch-form,
    .user-row {
        grid-template-columns: 1fr;
    }

    .user-list-pane,
    .user-editor {
        position: static;
        max-height: none;
    }

    .user-list {
        max-height: none;
        overflow: visible;
    }

    .user-editor-heading {
        top: 0;
    }

    .character-stat-badges {
        justify-content: stretch;
    }

    .character-stat-badge {
        flex: 1 1 120px;
    }

    .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;
    }

    .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;
    }

    .friend-toolbar {
        display: grid;
        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%;
    }

    .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: 760px) {
    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,
    .friend-toolbar,
    .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-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 {
        justify-content: flex-start;
        min-width: 0;
    }

    .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";
    }

    .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-section-heading,
    .sharing-resource-heading,
    .sharing-friend-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .sharing-friend-summary span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .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-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("/assets/bootstrap/icons/house.svg"); }
.icon-share { --icon-url: url("/assets/bootstrap/icons/share.svg"); }
.icon-diagram { --icon-url: url("/assets/bootstrap/icons/diagram-3.svg"); }
.icon-people { --icon-url: url("/assets/bootstrap/icons/people.svg"); }
.icon-collection { --icon-url: url("/assets/bootstrap/icons/collection.svg"); }
.icon-binoculars { --icon-url: url("/assets/bootstrap/icons/binoculars.svg"); }
.icon-sliders { --icon-url: url("/assets/bootstrap/icons/sliders.svg"); }
.icon-database { --icon-url: url("/assets/bootstrap/icons/database.svg"); }
.icon-map { --icon-url: url("/assets/bootstrap/icons/map.svg"); }
.icon-person { --icon-url: url("/assets/bootstrap/icons/person-circle.svg"); }
.icon-speedometer { --icon-url: url("/assets/bootstrap/icons/speedometer2.svg"); }
.icon-download { --icon-url: url("/assets/bootstrap/icons/download.svg"); }
.icon-repeat { --icon-url: url("/assets/bootstrap/icons/arrow-clockwise.svg"); }
.icon-bell { --icon-url: url("/assets/bootstrap/icons/bell.svg"); }
.icon-chat { --icon-url: url("/assets/bootstrap/icons/chat-left-text.svg"); }
.icon-megaphone { --icon-url: url("/assets/bootstrap/icons/megaphone.svg"); }
.icon-items { --icon-url: url("/assets/bootstrap/icons/backpack-fill.svg"); }
.icon-gear { --icon-url: url("/assets/bootstrap/icons/gear.svg"); }
.icon-journal { --icon-url: url("/assets/bootstrap/icons/journal-text.svg"); }
.icon-lightbulb { --icon-url: url("/assets/bootstrap/icons/lightbulb.svg"); }
.icon-window-plus { --icon-url: url("/assets/bootstrap/icons/window-plus.svg"); }
.icon-signout { --icon-url: url("/assets/bootstrap/icons/box-arrow-right.svg"); }
.icon-list { --icon-url: url("/assets/bootstrap/icons/list.svg"); }
.icon-eye { --icon-url: url("/assets/bootstrap/icons/eye.svg"); }
.icon-arrow-left { --icon-url: url("/assets/bootstrap/icons/arrow-left.svg"); }
.icon-filter { --icon-url: url("/assets/bootstrap/icons/funnel.svg"); }
.icon-x { --icon-url: url("/assets/bootstrap/icons/x-lg.svg"); }
.icon-stop { --icon-url: url("/assets/bootstrap/icons/stop-fill.svg"); }
.icon-moon-stars { --icon-url: url("/assets/bootstrap/icons/moon-stars.svg"); }
.icon-sun { --icon-url: url("/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;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

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

.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;
    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;
}

.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;
}

.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;
}

.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: 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: #0b100d;
    color: #f7fbf4;
}

body.hunt-widget-mode .shell,
body.hunt-widget-mode #toast-region {
    display: none !important;
}

.hunt-widget-root {
    --widget-bg: #0b100d;
    --widget-panel: rgba(18, 28, 23, 0.92);
    --widget-panel-strong: rgba(29, 43, 34, 0.94);
    --widget-line: rgba(158, 191, 164, 0.28);
    --widget-ink: #f7fbf4;
    --widget-muted: #b9c9be;
    --widget-green: #83e4a4;
    --widget-gold: #f0c46b;
    --widget-copper: #d98f5f;
    min-height: 100vh;
    padding: 10px;
    background:
        linear-gradient(140deg, rgba(14, 24, 18, 0.96) 0%, rgba(18, 31, 25, 0.94) 58%, rgba(43, 34, 21, 0.96) 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
    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: 8px;
    padding: 9px;
    background: rgba(9, 16, 13, 0.86);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.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 rgba(131, 228, 164, 0.14), 0 0 18px rgba(131, 228, 164, 0.72);
}

.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 rgba(131, 228, 164, 0.28);
    border-radius: 7px;
    padding: 0;
    background: rgba(255, 255, 255, 0.07);
    color: var(--widget-green);
}

.hunt-widget-icon-button:hover,
.hunt-widget-icon-button:focus {
    border-color: rgba(240, 196, 107, 0.58);
    background: rgba(240, 196, 107, 0.13);
    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: 8px;
    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: 8px;
    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: 8px;
    background: rgba(12, 20, 16, 0.82);
}

.hunt-widget-member {
    display: grid;
    gap: 4px;
    padding: 9px;
    border-left: 3px solid rgba(185, 201, 190, 0.32);
}

.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: rgba(131, 228, 164, 0.12);
    color: var(--widget-green);
    font-size: 11px;
    font-weight: 850;
}

.hunt-widget-member.is-offline .hunt-widget-member-top span {
    background: rgba(185, 201, 190, 0.12);
    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: rgba(240, 196, 107, 0.64);
    background: rgba(38, 48, 35, 0.92);
}

.hunt-widget-card-top span {
    background: rgba(240, 196, 107, 0.13);
    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: 8px;
    padding: 10px;
    color: var(--widget-muted);
    background: rgba(12, 20, 16, 0.62);
}

.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: 7px;
    background: var(--widget-green);
    color: #082014;
}

.hunt-widget-error {
    border-color: rgba(217, 143, 95, 0.44);
}

.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: 760px) {
    .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;
    }
}

@media (max-width: 430px) {
    .brand-title {
        font-size: 20px;
    }

    .brand-powered {
        justify-self: start;
    }

    .app-navbar .navbar-actions {
        gap: 5px;
    }
}

@media (max-width: 760px) {
    .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 {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .world-shouts-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .world-shouts-table thead {
        display: none;
    }

    .world-shouts-table tbody {
        display: grid;
        gap: 10px;
    }

    .world-shouts-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 {
        background: var(--panel);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
    }

    .world-shouts-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 {
        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: 760px) {
    .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: 760px) {
    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: 48px;
        position: sticky;
        top: 0;
        z-index: 95;
        margin: 0 0 10px;
        padding: 0;
        border: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .app-navbar-inner {
        min-height: 48px;
        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: center;
        width: auto;
        max-width: 100%;
        min-height: 38px;
        display: inline-flex !important;
        gap: 7px;
        overflow: hidden;
    }

    .brand-home-button.navbar-brand img {
        width: 26px;
        height: 26px;
    }

    .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: 16px;
        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;
    }

    .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"] button.template-character-row,
html[data-theme="dark"] .notification-toolbar,
html[data-theme="dark"] .dashboard-table-wrap,
html[data-theme="dark"] .chat-history-toolbar,
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"] .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"] .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"] 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: 760px) {
    html[data-theme="dark"] .topbar.app-navbar {
        background: transparent;
    }

    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 {
        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"] .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;
}
