:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0d1013;
    color: #edf2f5;
    letter-spacing: 0;
    --surface: #151a1f;
    --surface-strong: #1c2329;
    --line: #303940;
    --muted: #9ca9b2;
    --accent: #a85d22;
    --accent-hover: color-mix(in srgb, var(--accent), white 14%);
    --accent-ink: #ffffff;
    --danger: #ff7b72;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #0d1013;
}

body.log-page {
    background-color: #0d1013 !important;
    background-image: none !important;
    background-attachment: scroll !important;
}

body.log-page .page-shell,
body.log-page .editor-shell,
body.log-page .workspace-section,
body.log-page .log-transcript,
body.log-page .admin-log-directory,
body.log-page .admin-log-room-list,
body.log-page .topbar,
body.log-page .footer {
    background-image: none !important;
}

a {
    color: var(--accent);
}

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

.topbar {
    min-height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    background: #111519;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--accent);
    color: var(--accent);
    box-shadow: none !important;
}

.brand-mark img {
    max-width: 24px;
    max-height: 24px;
    display: block;
    object-fit: contain;
    filter: none !important;
}

.brand.has-logo-image {
    min-height: 42px;
}

.brand-image-mark {
    width: auto;
    min-width: 0;
    height: 46px;
    border: 0;
    color: inherit;
    box-shadow: none !important;
}

.brand-image-mark img {
    width: auto;
    max-width: 230px;
    max-height: 46px;
}

.topnav .nav-plays {
    min-height: 38px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-weight: 800;
}

.topnav .nav-plays:hover {
    background: color-mix(in srgb, var(--accent-hover, var(--accent)) 22%, transparent);
    color: var(--accent-hover, var(--accent));
}

.fa-dice {
    position: relative;
    width: 18px;
    height: 18px;
    display: block;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.fa-dice::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 8px 0 currentColor, 4px 4px currentColor, 0 8px currentColor, 8px 8px currentColor;
}

.fa-location-arrow::before {
    content: "➤";
}

.fa-feather::before {
    content: "\1FAB6";
}

.fa-feather-pointed::before {
    content: "\2712";
}

.fa-cloud-sun::before {
    content: "\2600";
}

.fa-fan::before {
    content: "\2735";
}

.fa-wind::before {
    content: "\224B";
}

.fa-snowflake::before {
    content: "\2744";
}

.guestbook-private-option {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
}

.guestbook-private-option input[type="checkbox"] {
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    min-height: 1rem;
    padding: 0;
}

.fa-user-slash,
.fa-user-check {
    position: relative;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.fa-user-slash::before,
.fa-user-check::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.fa-user-slash::after,
.fa-user-check::after {
    content: "";
    position: absolute;
    left: 2px;
    bottom: 1px;
    width: 11px;
    height: 6px;
    border: 1px solid currentColor;
    border-radius: 7px 7px 2px 2px;
}

.fa-user-slash,
.fa-user-check {
    color: currentColor;
    font-size: 18px;
    font-style: normal;
    line-height: 16px;
    text-align: center;
    text-shadow: 0 0 2px var(--surface);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 14px;
}

.topnav a,
.text-button {
    color: inherit;
    text-decoration: none;
}

.topnav form {
    margin: 0;
}

.account-menu {
    position: relative;
}

.account-menu summary {
    min-height: 36px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    color: #edf2f5;
    cursor: pointer;
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu summary::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.account-menu[open] summary,
.account-menu summary:hover {
    border-color: var(--line);
    background: var(--surface-strong);
}

.account-menu-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    padding: 6px;
    border: 1px solid var(--line);
    background: #151a1f;
    box-shadow: 0 14px 32px rgb(0 0 0 / 34%);
}

.account-menu-popover a,
.account-menu-popover .text-button {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    color: #edf2f5;
    text-align: left;
}

.account-menu-popover a:hover,
.account-menu-popover .text-button:hover {
    background: #252d33;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    flex: 1;
}

.chat-page-shell {
    width: 100%;
    max-width: none;
}

.chat-page .footer {
    display: none;
}

.chat-page[data-workspace-mode="1"] .chat-app {
    height: calc(100vh - 102px);
    height: calc(100dvh - 102px);
    min-height: 0;
}

.notice {
    margin: 18px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.notice-success {
    border-color: #267b60;
}

.notice-error {
    border-color: #9e4945;
}

.auth-layout {
    min-height: calc(100vh - 134px);
    display: grid;
    place-items: center;
    padding: 44px 0;
}

.auth-panel {
    width: min(100%, 460px);
    padding: 30px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.auth-panel-wide {
    width: min(100%, 640px);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.15;
}

h2 {
    font-size: 20px;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

.form-stack {
    display: grid;
    gap: 17px;
    margin-top: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #dce5ea;
    font-size: 14px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #3a444c;
    border-radius: 4px;
    outline: none;
    background: #0f1316;
    color: #fff;
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.check-row {
    grid-template-columns: 20px 1fr;
    align-items: start;
    font-weight: 500;
    line-height: 1.45;
}

.check-row input {
    min-height: 18px;
    height: 18px;
    margin-top: 1px;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}

.primary-button,
.secondary-button,
.icon-text-button,
.danger-button {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 750;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.compact-button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
}

.secondary-button,
.icon-text-button {
    border-color: var(--line);
    background: var(--surface-strong);
    color: #edf2f5;
}

.icon-text-button {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 13px;
}

.danger-button {
    min-height: 36px;
    padding: 8px 11px;
    border-color: #75413f;
    background: transparent;
    color: #ffaaa4;
    font-size: 13px;
}

.primary-button:not(:disabled):hover,
.character-row button:not(:disabled):hover {
    background: var(--accent-hover);
}

.secondary-button:hover,
.icon-text-button:hover {
    border-color: #59656e;
    background: #252d33;
}

.danger-button:hover {
    border-color: #a35752;
    background: #281817;
}

button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.auth-links {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.auth-divider {
    margin: 22px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.banned-panel {
    width: min(520px, 100%);
}

.ban-reason {
    margin: 22px 0 12px;
    padding: 14px;
    display: grid;
    gap: 5px;
    border-left: 3px solid var(--danger);
    background: var(--surface-strong);
}

.ban-reason span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.google-button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #59636b;
    border-radius: 4px;
    background: #f5f6f7;
    color: #202124;
    font-weight: 700;
    text-decoration: none;
}

.google-button:hover {
    background: #ffffff;
}

.guest-access-button {
    width: 100%;
    margin-top: 0;
}

.guest-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.google-mark {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #4285f4;
}

.dashboard-header {
    padding: 48px 0 30px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 680px);
    align-items: end;
    gap: 24px;
    border-bottom: 1px solid var(--line);
}

.dashboard-header > div:first-child {
    min-width: 0;
    max-width: 680px;
}

.dashboard-header h1,
.dashboard-header p {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.dashboard-header .header-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    justify-self: end;
    width: min(100%, 680px);
}

.dashboard-header .header-actions > a,
.dashboard-header .header-actions > button,
.dashboard-header .header-actions > form,
.dashboard-header .header-actions > form > button {
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.dashboard-online-list {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
    max-height: 260px;
    overflow-y: auto;
}

.dashboard-online-play {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    background: var(--surface);
}

.dashboard-online-play > strong {
    padding: 12px;
    display: block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 650;
    min-width: 0;
}

.dashboard-online-play > strong span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-online-play > strong small {
    margin-top: 3px;
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-online-room-name {
    color: var(--accent);
}

.dashboard-online-play-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    align-items: stretch;
}

.dashboard-online-character {
    flex: 0 1 170px;
    max-width: 210px;
    min-width: 145px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    gap: 3px 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.dashboard-online-character > span:not(.participant-swatch) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-online-character:hover {
    background: var(--surface-strong);
}

.dolmorgul-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 12px;
}

.dolmorgul-dashboard-panel {
    padding-top: 18px;
    padding-bottom: 36px;
}

.dolmorgul-dashboard-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dolmorgul-dashboard-title img {
    width: auto;
    max-width: 140px;
    max-height: 38px;
    display: block;
    object-fit: contain;
}

.dolmorgul-dashboard-grid > article {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.dolmorgul-dashboard-grid h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.dolmorgul-dashboard-grid p {
    margin: 0;
    line-height: 1.45;
}

.dolmorgul-weather {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.dolmorgul-weather-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--accent);
    background: var(--surface-strong);
    font-family: Georgia, serif;
    font-size: 21px;
    line-height: 1;
}

.dolmorgul-weather .status-label {
    width: fit-content;
    margin-bottom: 4px;
}

.dolmorgul-appointment-list,
.dolmorgul-news-list {
    display: grid;
    gap: 7px;
}

.dolmorgul-news-list {
    max-height: 170px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}

.dolmorgul-appointment-list > div,
.dolmorgul-news-list > div {
    display: grid;
    gap: 2px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--line);
}

.dolmorgul-appointment-list > div:last-child,
.dolmorgul-news-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dolmorgul-appointment-list span,
.dolmorgul-appointment-list small,
.dolmorgul-news-list span,
.dolmorgul-news-list p,
.dolmorgul-news-body {
    color: var(--muted);
}

.dolmorgul-news-list p,
.dolmorgul-news-body p {
    margin-top: 2px;
}

.dolmorgul-news-body ul,
.dolmorgul-news-body ol {
    margin: 2px 0 0 18px;
    padding: 0;
}

.dolmorgul-news-body li + li {
    margin-top: 2px;
}

.dolmorgul-news-list a {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.dolmorgul-appointment-details {
    margin-top: 2px;
}

.dolmorgul-appointment-details summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
}

.dolmorgul-appointment-details small {
    display: block;
    margin-top: 4px;
    line-height: 1.5;
}

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

.talent-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
    gap: 12px;
    margin-bottom: 14px;
    align-items: end;
}

.talent-card {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 16px;
}

.talent-card header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.talent-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.talent-card dl {
    display: flex;
    gap: 10px;
    margin: 0;
}

.talent-card dl div {
    min-width: 56px;
    border: 1px solid var(--line);
    padding: 6px 8px;
    text-align: center;
}

.talent-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.talent-card dd {
    margin: 2px 0 0;
    font-weight: 800;
}

.talent-roll-button {
    width: auto;
    min-width: 96px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
}

.talent-modal {
    width: min(1100px, calc(100vw - 28px));
    height: min(820px, calc(100vh - 28px));
    max-width: none;
    padding: 16px;
}

.talent-modal iframe {
    display: block;
    width: 100%;
    height: calc(100% - 54px);
    border: 1px solid var(--line);
    background: var(--background);
}

.embedded-modal-page .page-shell {
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 16px;
}

.embedded-modal-page .editor-shell {
    margin: 0;
}

.talent-card p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.talent-older-levels {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.talent-older-levels summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.talent-level-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.talent-level-list article {
    border: 1px solid var(--line);
    background: var(--surface-strong);
    padding: 10px;
}

.talent-level-list span {
    color: var(--muted);
    margin-left: 8px;
}

.talent-level-list .talent-roll-button {
    margin-left: 10px;
    vertical-align: middle;
}

.talent-roll-dialog {
    max-width: min(720px, calc(100vw - 32px));
}

.talent-roll-choices {
    display: grid;
    gap: 12px;
}

.talent-roll-choice {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    align-items: start;
    gap: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    padding: 12px;
}

.talent-private-targets {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.talent-private-targets .secondary-button {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

.talent-empty {
    margin-top: 12px;
}

.drag-handle {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: grab;
    font-weight: 800;
}

.room-row.is-dragging {
    opacity: 0.55;
}

.header-actions,
.form-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions > a,
.header-actions > button,
.header-actions > form > button {
    width: 160px;
    min-height: 44px;
    font-size: 13px;
    white-space: nowrap;
}

.header-actions > form,
.row-actions > form {
    display: flex;
}

.row-actions > a,
.row-actions > button,
.row-actions > form > button {
    width: 96px;
    min-height: 38px;
}

.workspace-section {
    padding: 28px 0 60px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading span {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.section-intro {
    margin: 8px 0 0;
    color: var(--muted);
}

.section-intro a {
    font-weight: 800;
}

.admin-log-filter {
    margin-top: 18px;
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-log-filter label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    margin-top: 18px;
    padding: 28px;
    border: 1px dashed #3a454d;
    color: var(--muted);
}

.empty-state h3 {
    margin: 0 0 6px;
    color: #fff;
}

.empty-state p {
    margin: 0;
}

.character-groups {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.character-group {
    border-bottom: 1px solid var(--line);
}

.character-group.is-dragging {
    opacity: 0.55;
}

.character-groups.is-sorting .character-group > summary {
    cursor: grabbing;
}

.character-group > summary {
    min-height: 58px;
    padding: 12px 4px;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto 38px;
    align-items: center;
    gap: 10px;
    color: #edf2f5;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.character-group > summary .play-order-handle {
    width: 38px;
    height: 40px;
    flex: 0 0 38px;
    justify-self: end;
}

.character-group > summary > span:not(.play-order-handle):not(.character-group-count) {
    min-width: 0;
}

.character-group > summary::-webkit-details-marker {
    display: none;
}

.character-group > summary::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
    transition: transform 150ms ease;
}

.character-group[open] > summary::before {
    transform: rotate(45deg) translate(-2px, -2px);
}

.character-group-count {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.character-list {
    border-top: 1px solid #252d33;
}

.character-row {
    min-height: 68px;
    display: grid;
    grid-template-columns: 46px 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #252d33;
}

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

.character-avatar-small {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 18px;
    font-weight: 750;
}

.character-avatar-small img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.row-actions form {
    margin: 0;
}

.play-section {
    border-top: 1px solid var(--line);
}

.play-list {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.play-directory {
    width: min(920px, 100%);
}

.play-directory-list {
    border-top: 1px solid var(--line);
}

.play-directory-row {
    min-height: 116px;
    padding: 18px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid var(--play-theme-color, #66737c);
    padding-left: 16px;
}

.play-order-handle {
    width: 38px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    background-image:
        radial-gradient(currentColor 1.5px, transparent 1.5px),
        radial-gradient(currentColor 1.5px, transparent 1.5px);
    background-position: 12px 12px, 22px 12px;
    background-size: 8px 8px;
    background-repeat: repeat-y;
}

.play-order-handle:active {
    cursor: grabbing;
}

.play-directory-row h2,
.play-directory-row p {
    margin: 0;
}

.play-directory-row p {
    margin: 8px 0 5px;
    color: var(--muted);
    line-height: 1.5;
}

.play-directory-action,
.play-directory-action form {
    min-width: 160px;
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.play-directory-action .primary-button,
.play-directory-action .secondary-button {
    width: 160px;
}

.play-directory-action .play-action-status {
    width: 160px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.membership-request-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.membership-request-row {
    min-height: 76px;
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.membership-request-row p {
    margin: 4px 0 0;
}

.play-row {
    min-height: 88px;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--play-theme-color, #66737c);
    background: color-mix(in srgb, var(--play-theme-color, #66737c) 5%, var(--surface));
}

.play-row > div:first-child {
    position: relative;
    padding-left: 26px;
}

.play-row > div:first-child::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    width: 9px;
    height: 9px;
    border: 2px solid var(--play-theme-color, #66737c);
    color: var(--play-theme-color, #66737c);
    transform: rotate(45deg);
}

[data-play-theme="midnight"] {
    --play-theme-color: #7f8b94;
    --play-theme-surface: #151a1f;
    --play-theme-strong: #1c2329;
}

[data-play-theme="signal"] {
    --play-theme-color: #42b883;
    --play-theme-surface: #121c19;
    --play-theme-strong: #182923;
}

[data-play-theme="velvet"] {
    --play-theme-color: #c05a78;
    --play-theme-surface: #1d151a;
    --play-theme-strong: #2a1b22;
}

.play-admin-shell[data-play-theme] .editor-heading {
    padding-left: 18px;
    border-left: 3px solid var(--play-theme-color);
}

.chat-app[data-play-theme] {
    --surface: var(--play-theme-surface);
    --surface-strong: var(--play-theme-strong);
}

.theme-choice-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.theme-choice-fieldset legend {
    margin-bottom: 9px;
    font-weight: 650;
}

.theme-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.theme-choice {
    position: relative;
    min-width: 0;
    min-height: 132px;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
    gap: 6px 10px;
    border: 1px solid var(--line);
    background: var(--play-theme-surface);
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.theme-choice:hover {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
    background: color-mix(in srgb, var(--accent) 6%, var(--play-theme-surface));
    transform: translateY(-1px);
}

.theme-choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.theme-choice input {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    width: 18px;
    min-height: 18px;
    height: 18px;
}

.theme-choice-preview {
    height: 54px;
    grid-column: 1 / -1;
    background: var(--play-theme-color);
}

.theme-choice strong,
.theme-choice small {
    min-width: 0;
}

.theme-choice strong {
    font-size: 15px;
}

.layout-choice {
    --play-theme-color: var(--accent);
}

.layout-choice-preview {
    height: 58px;
    grid-column: 1 / -1;
    padding: 7px;
    display: grid;
    grid-template-columns: 24% 1fr;
    grid-template-rows: 8px 1fr;
    gap: 5px;
    border: 1px solid var(--line);
    background: #0d1013;
}

.layout-choice-preview i {
    display: block;
    background: #303940;
}

.layout-choice-preview i:first-child {
    grid-column: 1 / -1;
    background: var(--accent);
}

.layout-choice-preview i:nth-child(2) {
    grid-row: 2;
}

.layout-choice-preview i:nth-child(3) {
    grid-row: 2;
}

[data-layout-preview="parchment"] .layout-choice-preview {
    border-color: #9d7c50;
    background: #ead9b8;
}

[data-layout-preview="storyworld"] .layout-choice-preview {
    border-color: #806548;
    background: #11191d;
}

[data-layout-preview="storyworld"] .layout-choice-preview i {
    background: #40515a;
}

[data-layout-preview="storyworld"] .layout-choice-preview i:first-child {
    background: #b8733f;
}

[data-layout-preview="parchment"] .layout-choice-preview i {
    background: #6c4e31;
}

[data-layout-preview="cyberpunk"] .layout-choice-preview {
    border-color: #23d6e8;
    background: #08121c;
}

[data-layout-preview="cyberpunk"] .layout-choice-preview i {
    background: #e33acb;
}

[data-layout-preview="neon-circuit"] .layout-choice-preview {
    border-color: #f7f242;
    background:
        linear-gradient(90deg, rgb(35 188 189 / 18%) 1px, transparent 1px),
        linear-gradient(rgb(247 242 66 / 12%) 1px, transparent 1px),
        #02070b;
    background-size: 16px 100%, 100% 12px, auto;
}

[data-layout-preview="neon-circuit"] .layout-choice-preview i {
    background: #23bcbd;
}

[data-layout-preview="neon-circuit"] .layout-choice-preview i:first-child {
    background: #f7f242;
}

[data-layout-preview="magus"] .layout-choice-preview {
    border-color: #9c762d;
    background: #d5b778;
}

[data-layout-preview="magus"] .layout-choice-preview i {
    background: #284c3d;
}

[data-layout-preview="shadow"] .layout-choice-preview {
    border-color: #56645c;
    background: #050708;
}

[data-layout-preview="shadow"] .layout-choice-preview i {
    background: #6e527d;
}

[data-layout-preview="bloodred"] .layout-choice-preview {
    border-color: #7d1f27;
    background: #100607;
}

[data-layout-preview="bloodred"] .layout-choice-preview i {
    background: #a92734;
}

[data-layout-preview="fairy"] .layout-choice-preview {
    border-color: #9ab9ad;
    background: #f4f5ed;
}

[data-layout-preview="fairy"] .layout-choice-preview i {
    background: #b996c7;
}

[data-layout-preview="dragonlore"] .layout-choice-preview {
    border-color: #94713b;
    background: #2a2118;
}

[data-layout-preview="dragonlore"] .layout-choice-preview i {
    background: #d07b2d;
}

[data-layout-preview="midnight-white"] .layout-choice-preview {
    border-color: #aebed2;
    background: #f7f9fc;
}

[data-layout-preview="midnight-white"] .layout-choice-preview i {
    background: #7f92b4;
}

[data-layout-preview="pure-white"] .layout-choice-preview {
    border-color: #c6d0db;
    background: #ffffff;
}

[data-layout-preview="pure-white"] .layout-choice-preview i {
    background: #dfe6ed;
}

[data-layout-preview="pure-white"] .layout-choice-preview i:first-child {
    background: #2f6fa7;
}

[data-layout-preview="dol-morgul"] .layout-choice-preview {
    border-color: #9a7138;
    background: #153936;
}

[data-layout-preview="dol-morgul"] .layout-choice-preview i {
    background: #c28b44;
}

.theme-choice small {
    grid-column: 1;
    color: var(--muted);
    line-height: 1.4;
}

.form-actions.settings-save-actions {
    justify-content: center;
}

.closed-room-online-note {
    margin: 16px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--muted);
    font-size: 14px;
}

.play-row p {
    max-width: 680px;
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.play-meta {
    display: grid;
    justify-items: end;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

.play-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.play-admin-shell {
    width: min(1180px, 100%);
}

.play-admin-shell > .editor-heading {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: end;
}

.play-admin-shell > .editor-heading > div:first-child {
    min-width: 0;
}

.play-admin-shell > .editor-heading h1 {
    overflow-wrap: normal;
    word-break: normal;
}

.play-admin-shell > .editor-heading .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.play-character-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.play-character-row {
    min-height: 72px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: 44px minmax(160px, 1fr) auto minmax(280px, auto);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.play-character-info {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.play-character-info a {
    width: fit-content;
    text-decoration: none;
}

.play-character-info small {
    color: var(--muted);
}

.participant-profile-link,
.participant-account-note {
    width: fit-content;
    color: var(--muted);
    font-size: 12px;
}

.participant-account-note.status-danger {
    color: var(--danger);
}

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

.play-ban-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto;
    gap: 8px;
}

.play-character-actions button {
    min-height: 38px;
    white-space: nowrap;
}

.room-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.room-row {
    min-height: 88px;
    padding: 16px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid var(--line);
}

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

.room-main p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.status-label {
    padding: 3px 7px;
    border: 1px solid #485159;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.editor-shell {
    width: min(760px, 100%);
    margin: 44px auto 64px;
}

.editor-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.editor-form {
    display: grid;
    gap: 20px;
    padding-top: 24px;
}

.form-section {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.form-section h2 {
    margin: 0;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.color-control {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}

.color-control input[type="color"] {
    width: 64px;
    padding: 4px;
}

.avatar-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.form-note {
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    background: #17191b;
    color: var(--muted);
}

.form-actions {
    justify-content: flex-end;
}

.invitation-form {
    margin-top: 20px;
    padding-top: 0;
}

.invitation-list {
    border-top: 1px solid var(--line);
}

.invitation-row {
    min-height: 48px;
    display: grid;
    grid-template-columns: 20px 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 500;
}

.invitation-row input {
    min-height: 18px;
    height: 18px;
}

.log-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.log-row {
    min-height: 76px;
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, auto) auto;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.log-row p {
    margin: 4px 0 0;
    color: var(--muted);
}

.log-meta {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
}

.log-transcript {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    background: #0b0e10;
}

.character-color {
    width: 12px;
    height: 36px;
}

.character-info {
    display: grid;
    gap: 3px;
}

.character-info span {
    color: var(--muted);
    font-size: 13px;
}

.document,
.error-page {
    width: min(720px, 100%);
    margin: 48px auto;
    line-height: 1.65;
}

.legal-document h2 {
    margin-top: 34px;
}

.legal-document address {
    font-style: normal;
}

.legal-document code {
    color: #f0c19e;
}

.error-page {
    text-align: center;
}

.error-code {
    margin: 0;
    color: var(--accent);
    font-size: 56px;
    font-weight: 800;
}

.footer {
    min-height: 74px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

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

.chat-app {
    width: 100%;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    min-height: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.chat-workspace {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-rows: minmax(0, 1fr) auto;
}

.chat-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    border-right: 1px solid var(--line);
}

.message-list {
    height: 100%;
    min-height: 0;
    padding: 18px 22px;
    overflow-y: auto;
    background: var(--chat-background, #0b0e10);
    scrollbar-color: #485159 #111519;
}

.message-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.chat-room-background-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-app[data-room-background="custom"] .message-list {
    position: relative;
    z-index: 1;
    background: rgb(5 6 7 / 38%);
}

.chat-app[data-room-background="grid"] .message-list,
.room-background-option[data-room-background="grid"] .room-background-preview {
    background-image:
        linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
    background-size: 32px 32px;
}

.chat-app[data-room-background="manuscript"] .message-list,
.room-background-option[data-room-background="manuscript"] .room-background-preview {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 27px,
            rgb(230 184 92 / 9%) 28px,
            transparent 29px
        );
}

.chat-app[data-room-background="panels"] .message-list,
.room-background-option[data-room-background="panels"] .room-background-preview {
    background-image:
        linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px),
        linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px);
    background-size: 180px 100%, 100% 92px;
}

.room-background-picker {
    margin: 0;
    padding: 0;
    border: 0;
}

.room-background-picker legend {
    margin-bottom: 9px;
}

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

.room-background-option {
    min-width: 0;
    display: grid;
    gap: 7px;
    cursor: pointer;
}

.room-background-upload-preview {
    width: min(100%, 520px);
    max-height: 260px;
    display: block;
    object-fit: contain;
    border: 1px solid var(--line);
    background: #0b0e10;
}

.room-background-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.room-background-preview {
    height: 72px;
    display: block;
    border: 1px solid var(--line);
    background-color: var(--chat-background, #0b0e10);
}

.room-background-option input:checked + .room-background-preview {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.room-background-option strong {
    font-size: 13px;
    font-weight: 600;
}

.message-highlight-word {
    padding: 0 3px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--message-highlight-color, #ffd166) 28%, transparent);
    color: var(--message-highlight-color, #ffd166);
    font-weight: 750;
    text-shadow: 0 0 8px color-mix(in srgb, var(--message-highlight-color, #ffd166) 55%, transparent);
}

.chat-message.is-addressed {
    margin: 2px -8px;
    padding: 4px 8px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.settings-form {
    max-width: 760px;
}

.global-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 760px;
    margin-top: 18px;
}

.global-settings-form .global-setting-wide {
    grid-column: 1 / -1;
}

.global-settings-form .primary-button {
    align-self: end;
}

.npc-bot-form fieldset {
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
}

.npc-bot-room-grid,
.npc-bot-behavior-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.npc-bot-behavior-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.numeric-input-suffix > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.npc-bot-list {
    border-top: 1px solid var(--line);
}

.npc-bot-row {
    min-height: 70px;
    padding: 12px 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.npc-bot-row strong,
.npc-bot-row small {
    display: block;
}

.npc-bot-row small {
    margin-top: 5px;
    color: var(--muted);
}

.npc-bot-test .section-heading > div {
    min-width: 0;
}

.npc-bot-test .section-heading p,
.npc-bot-test .notice p {
    margin: 5px 0 0;
}

.npc-bot-test .notice small {
    display: block;
    margin-top: 5px;
}

.npc-bot-test-form {
    max-width: 900px;
}

.npc-bot-avatar-form {
    display: grid;
    grid-template-columns: 72px minmax(240px, 520px) auto;
    align-items: end;
    gap: 16px;
}

.npc-bot-avatar-preview {
    width: 72px;
    height: 72px;
    font-size: 24px;
}

.participant-row.is-npc-bot {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.settings-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.settings-account-form {
    align-content: start;
    margin-top: 0;
    padding: 20px;
    border: 1px solid var(--line);
    background: #12171a;
}

.settings-account-form h2,
.settings-account-form p {
    margin: 0;
}

.settings-account-form .secondary-button {
    width: 100%;
}

.settings-form input[type="color"] {
    width: 180px;
    height: 48px;
    padding: 5px;
    cursor: pointer;
}

.settings-form input[type="color"]::-webkit-color-swatch {
    border: 0;
}

.color-setting-control {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.color-setting-control input[type="color"] {
    flex: 1 1 auto;
    min-width: 96px;
}

.color-setting-control .secondary-button {
    flex: 0 0 auto;
}

.settings-options {
    display: grid;
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.field-hint {
    font-size: 12px;
    font-weight: 500;
}

.form-field {
    display: grid;
    gap: 8px;
}

.bbcode-editor {
    border: 1px solid var(--line);
    background: #101418;
}

.bbcode-toolbar {
    min-height: 42px;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
}

.bbcode-toolbar button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    color: #edf2f5;
    background: transparent;
    cursor: pointer;
}

.bbcode-toolbar select {
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-strong);
    color: var(--text);
}

.bb-color-red { color: #e67575; }
.bb-color-blue { color: #74a9f5; }
.bb-color-green { color: #75c995; }
.bb-color-gold { color: #e6b85c; }
.bb-color-violet { color: #bd8ee8; }
.bb-color-gray { color: #aab2b8; }
.bb-size-small { font-size: 0.85em; }
.bb-size-normal { font-size: 1em; }
.bb-size-large { font-size: 1.25em; }

.bb-image-anchor {
    display: block;
    width: fit-content;
    max-width: 100%;
}

.bb-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

.bb-image-sized {
    max-width: 100%;
    object-fit: contain;
}

.bbcode-toolbar button:hover,
.bbcode-toolbar button:focus-visible {
    border-color: var(--accent);
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.bbcode-editor textarea {
    width: 100%;
    display: block;
    border: 0;
    border-radius: 0;
    resize: vertical;
}

.bbcode-preview {
    padding: 12px;
    border-top: 1px solid var(--line);
}

.bbcode-preview > span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.bbcode-preview [data-bbcode-preview] {
    min-height: 24px;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.bbcode-preview blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 2px solid var(--accent);
    background: var(--surface);
}

.rules-admin-shell .bbcode-editor textarea {
    min-height: 52vh;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    line-height: 1.55;
}

.rules-document .formatted-content h2,
.bbcode-preview h2 {
    margin: 28px 0 10px;
    font-size: 1.25rem;
}

.rules-updated {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.settings-data-export {
    margin-top: 30px;
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
}

.settings-data-export h2,
.settings-data-export p {
    margin: 0;
}

.settings-data-export p {
    margin-top: 6px;
}

.settings-danger-zone {
    margin-top: 34px;
    padding: 24px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 34px;
    border-top: 1px solid #7c403d;
}

.settings-danger-zone h2,
.settings-danger-zone p {
    margin-top: 0;
}

.account-delete-form {
    margin-top: 0;
}

.chat-message {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) 24px;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    line-height: 1.48;
}

.message-report-button {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #66737c;
    opacity: 0;
    cursor: pointer;
}

.chat-message:hover .message-report-button,
.message-report-button:focus-visible,
.message-report-button:disabled {
    opacity: 1;
}

.chat-message strong {
    font-weight: 750;
}

.room-description-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    display: block;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    color: var(--muted);
}

.room-description-message .message-body {
    display: block;
}

.room-description-message a {
    color: var(--accent);
    font-weight: 750;
}

.message-author,
.whisper-label {
    font-weight: 400;
}

.chat-message-chat .message-author::after,
.chat-message-offplay .message-author::after {
    content: ":";
    color: inherit;
}

.chat-message-action,
.chat-message-system_join,
.chat-message-system_leave,
.chat-message-system_back {
    font-style: italic;
}

.chat-message-action span,
.chat-message-system_join span,
.chat-message-system_leave span,
.chat-message-system_back span {
    color: inherit;
}

.chat-message-system_join,
.chat-message-system_leave,
.chat-message-system_away,
.chat-message-system_back,
.chat-message-admin_announcement {
    color: #9ba7ae;
}

.chat-message-admin_announcement {
    font-style: italic;
}

.chat-message-admin_announcement.is-sl-announcement {
    margin: 3px 0;
    padding: 5px 8px;
    border-left: 2px solid #66737c;
    background: #14191d;
    font-style: normal;
}

.chat-message-whisper-dice {
    font-style: italic;
}

.chat-message-admin_announcement.is-sl-announcement .message-author::after {
    content: ":";
    color: inherit;
}

.chat-message-dice {
    margin: 3px 0;
    padding: 5px 8px;
    border-left: 2px solid #8b744b;
    background: #191713;
    color: #ddc796;
}

.chat-message-dice .dice-net-result {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border: 1px solid #b59555;
    background: #251f14;
    color: #ffe1a3;
    font-weight: 700;
}

.chat-message-offplay {
    margin: 3px 0;
    padding: 5px 8px;
    border-left: 2px solid #5d7f8c;
    background: #111b1f;
    color: #b8d8df;
}

.chat-message-offplay .message-author::before {
    content: "(OT) ";
    color: #86b9c7;
    font-weight: 700;
}

.chat-message-whisper {
    margin: 3px 0;
    padding: 5px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, #111519);
}

.chat-message.is-ignored-message {
    display: none;
}

.chat-message-whisper span {
    color: inherit;
}

.chat-message-whisper .message-body {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chat-message-whisper.is-whisper-alert::before {
    content: "Privat";
    display: inline-block;
    margin-right: 7px;
    padding: 1px 5px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 10px;
    font-style: normal;
    line-height: 1.3;
    text-transform: uppercase;
}

.chat-message-image_link {
    margin: 3px 0;
    padding: 5px 8px;
    border-left: 2px solid #4d7a86;
    background: #111b1e;
}

.chat-message-image_link .message-body a {
    color: #8cc3cf;
}

.chat-message-image_link .message-body {
    display: grid;
    justify-items: start;
    gap: 7px;
}

.chat-image-preview {
    width: auto;
    max-width: min(100%, 520px);
    max-height: 360px;
    display: block;
    object-fit: contain;
    border: 1px solid #35515a;
    background: #0b0e10;
}

.typing-line {
    display: none;
}

.chat-compose {
    grid-column: 1 / -1;
    width: 100%;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.chat-tabbar {
    min-height: 42px;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    background: #0b0e10;
}

.chat-tabbar a,
.workspace-chat-tab a {
    min-width: 150px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
}

.chat-tabbar a:hover {
    color: var(--text);
    background: var(--surface);
}

.chat-tabbar a[aria-current="page"] {
    border-top: 2px solid var(--accent);
    color: var(--text);
    background: var(--surface);
}

.workspace-tab-anchor {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
}

.workspace-chat-tab {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    border-right: 1px solid var(--line);
    cursor: grab;
}

.workspace-chat-tab a {
    padding-right: 42px;
    border-right: 0;
}

.workspace-tab-unread {
    min-width: 20px;
    height: 20px;
    margin-left: 8px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.workspace-chat-tab.is-dragging {
    opacity: .45;
    cursor: grabbing;
}

.workspace-tab-close {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.workspace-tab-close:hover {
    color: var(--accent-hover);
}

.chat-compose textarea {
    width: 100%;
    min-height: 82px;
    max-height: 240px;
    border-color: var(--character-color, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--character-color, var(--accent)) 38%, transparent);
    caret-color: currentColor;
}

.chat-compose textarea:focus {
    border-color: var(--character-color, var(--accent));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--character-color, var(--accent)) 26%, transparent),
        0 0 22px color-mix(in srgb, var(--character-color, var(--accent)) 20%, transparent);
}

body[data-layout="dol-morgul"] .chat-compose textarea[data-chat-input] {
    border-color: var(--character-color, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--character-color, var(--accent)) 38%, transparent);
}

body[data-layout="dol-morgul"] .chat-compose textarea[data-chat-input]:focus {
    border-color: var(--character-color, var(--accent));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--character-color, var(--accent)) 26%, transparent),
        0 0 22px color-mix(in srgb, var(--character-color, var(--accent)) 20%, transparent);
}

.compose-actions {
    margin-top: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.compose-actions span {
    color: var(--muted);
    font-size: 12px;
}

.compose-buttons {
    display: flex;
    gap: 8px;
}

.compose-buttons > button,
.compose-buttons > a {
    min-width: 108px;
}

.chat-compose .field-error:empty {
    display: none;
}

.whisper-suggestions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.whisper-suggestions:empty {
    display: none;
}

.whisper-suggestion {
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--line));
    border-radius: 3px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: color-mix(in srgb, var(--accent) 35%, white);
    cursor: pointer;
}

.participant-panel {
    padding: 18px;
    display: flex;
    min-height: 0;
    flex-direction: column;
    background: #111519;
}

.participant-panel .section-heading {
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.participant-list {
    display: grid;
    align-content: start;
    flex: 1;
    overflow-y: auto;
}

.participant-room-switch {
    margin-top: auto;
    padding-top: 16px;
    display: grid;
    gap: 9px;
    border-top: 1px solid var(--line);
}

.participant-room-switch .room-switch {
    display: grid;
    gap: 6px;
}

.participant-room-switch .room-switch select {
    width: 100%;
}

.participant-row {
    min-height: 40px;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #232a30;
    font-size: 14px;
}

.participant-actions {
    display: flex;
    align-items: center;
}

.participant-row.is-away {
    opacity: 0.65;
}

.participant-row.is-muted .online-avatar {
    opacity: .45;
}

.participant-row small {
    min-width: 0;
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-details {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.participant-name-line > a,
.participant-name-line > span {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-name-line > a:hover {
    color: var(--accent);
}

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

.participant-typing-icon {
    flex: 0 0 auto;
    color: var(--accent-hover);
    font-size: 13px;
}

.participant-row.is-own-character {
    font-weight: 400;
}

.participant-swatch {
    width: 8px;
    height: 22px;
}

.participant-row .online-avatar {
    width: 32px;
    height: 32px;
}

.participant-action,
.participant-whisper {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.participant-action:hover,
.participant-action:focus-visible,
.participant-whisper:hover,
.participant-whisper:focus-visible {
    border-color: var(--accent);
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.participant-bot-triggers {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    font-size: 16px;
    font-weight: 800;
}

.character-profile {
    --profile-accent: var(--accent);
    width: min(760px, 100%);
    margin: 38px auto;
}

.character-profile .eyebrow,
.character-profile a {
    color: var(--profile-accent);
}

.profile-header {
    min-height: 160px;
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 2px solid var(--profile-accent);
}

.profile-avatar {
    width: 128px;
    height: 128px;
    flex: 0 0 128px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.profile-avatar-placeholder {
    display: grid;
    place-items: center;
    background: var(--surface);
    font-size: 48px;
    font-weight: 800;
}

.profile-content {
    padding: 24px 0;
    line-height: 1.7;
}

.profile-content blockquote {
    margin: 18px 0;
    padding: 10px 16px;
    border-left: 2px solid var(--profile-accent);
    background: var(--surface);
}

.guestbook-section {
    padding: 12px 0 30px;
    border-top: 1px solid var(--line);
}

.guestbook-form {
    margin: 18px 0 24px;
    padding: 16px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
}

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

.guestbook-entry {
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: #101417;
    line-height: 1.6;
}

.guestbook-entry header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.guestbook-entry header a {
    font-weight: 750;
    text-decoration: none;
}

.guestbook-entry blockquote {
    margin: 12px 0;
    padding-left: 12px;
    border-left: 2px solid var(--profile-accent);
}

.guestbook-private-label {
    margin-left: auto;
}

.profile-theme-dossier {
    width: min(820px, 100%);
    margin-top: 28px;
    padding: 28px 34px;
    background: #e7e9e8;
    color: #1b2226;
    border: 1px solid #aeb5b8;
}

.profile-theme-dossier .profile-header {
    min-height: 140px;
}

.profile-theme-dossier .profile-avatar,
.profile-theme-dossier .guestbook-entry,
.profile-theme-dossier .guestbook-form {
    border-color: #aeb5b8;
}

.profile-theme-dossier .profile-avatar-placeholder,
.profile-theme-dossier .guestbook-entry,
.profile-theme-dossier .guestbook-form,
.profile-theme-dossier .profile-content blockquote {
    background: #f5f6f5;
}

.profile-theme-dossier .muted,
.profile-theme-dossier .field-hint {
    color: #59656b;
}

.profile-theme-dossier input,
.profile-theme-dossier select,
.profile-theme-dossier textarea {
    background: #fff;
    color: #1b2226;
    border-color: #939da2;
}

.profile-theme-velvet {
    width: min(820px, 100%);
    padding: 24px 30px;
    background: #171318;
    border-top: 4px solid var(--profile-accent);
}

.profile-theme-velvet .profile-header {
    min-height: 190px;
    justify-content: center;
    text-align: center;
    border-bottom-width: 1px;
}

.profile-theme-velvet .profile-avatar {
    width: 148px;
    height: 148px;
    flex-basis: 148px;
}

.profile-theme-velvet .guestbook-entry,
.profile-theme-velvet .guestbook-form,
.profile-theme-velvet .profile-content blockquote {
    background: #211b22;
    border-color: #403442;
}

.moderation-list {
    border-top: 1px solid var(--line);
}

.blacklist-add-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin: 18px 0;
}

.blacklist-word-list {
    border-top: 1px solid var(--line);
}

.blacklist-word-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.migration-result-list {
    margin: 18px 0;
    border-top: 1px solid var(--line);
}

.migration-result-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-bottom: 1px solid var(--line);
}

.migration-result-row code {
    overflow-wrap: anywhere;
}

.admin-recent-log {
    border-top: 1px solid var(--line);
}

.admin-recent-message {
    display: grid;
    grid-template-columns: minmax(210px, 0.35fr) minmax(0, 1fr);
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.admin-recent-context {
    display: grid;
    align-content: start;
    gap: 2px;
    color: var(--muted);
    font-size: 12px;
}

.admin-recent-context strong {
    color: var(--text);
}

.admin-recent-message .chat-message {
    min-width: 0;
}

.admin-log-directory {
    display: grid;
    gap: 18px;
}

.admin-log-room-list {
    border-top: 1px solid var(--line);
}

.admin-log-room-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.admin-log-room-row > div {
    display: grid;
    gap: 3px;
}

.admin-log-room-row small {
    color: var(--muted);
    font-size: 12px;
}

.admin-room-log .chat-message {
    grid-template-columns: max-content minmax(0, 1fr);
}

.admin-room-log .message-body {
    min-width: 0;
    overflow-wrap: anywhere;
}

.log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}

.moderator-form {
    margin-top: 16px;
}

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

.report-row {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.report-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.report-row blockquote {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 2px solid var(--accent);
    background: #0d1114;
}

.report-row p,
.report-row small {
    margin: 8px 0 0;
}

.report-row small {
    color: var(--muted);
}

.moderation-row {
    padding: 13px 0;
    display: grid;
    gap: 5px;
    border-bottom: 1px solid var(--line);
}

.moderation-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.moderation-row p,
.moderation-row small {
    margin: 0;
}

.moderation-row small {
    color: var(--muted);
}

.admin-user-list {
    border-top: 1px solid var(--line);
}

.admin-account-search {
    margin: 14px 0 18px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: end;
    gap: 10px;
}

.admin-account-search label,
.admin-account-search input {
    width: 100%;
}

.play-ban-notice {
    display: grid;
    justify-items: end;
    gap: 5px;
    max-width: 320px;
    text-align: right;
}

.play-ban-notice small {
    color: var(--muted);
}

.admin-metrics {
    margin: 22px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
}

.admin-metrics > div {
    min-height: 78px;
    padding: 14px;
    display: grid;
    align-content: center;
    gap: 3px;
    border-right: 1px solid var(--line);
}

.admin-metrics > div:last-child {
    border-right: 0;
}

.admin-metrics strong {
    font-size: 22px;
}

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

.reward-summary-grid {
    margin: 0 0 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    border: 1px solid var(--line);
}

.reward-summary-grid > div {
    min-height: 70px;
    padding: 12px;
    display: grid;
    align-content: center;
    gap: 3px;
    border-right: 1px solid var(--line);
}

.reward-summary-grid > div:last-child {
    border-right: 0;
}

.reward-summary-grid strong {
    font-size: 20px;
}

.reward-summary-grid span {
    color: var(--muted);
    font-size: 12px;
}

.admin-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
}

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

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

.admin-data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

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

.reward-table td:nth-child(4),
.reward-table td:nth-child(5),
.reward-table td:nth-child(6) {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.admin-activity-grid {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-activity-grid > div {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.admin-activity-grid h3 {
    margin: 0 0 16px;
    font-size: 15px;
}

.activity-bars {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 190px;
    display: grid;
    grid-template-columns: repeat(7, minmax(30px, 1fr));
    align-items: end;
    gap: 8px;
}

.activity-bar-column {
    height: 100%;
    display: grid;
    grid-template-rows: 22px minmax(0, 1fr) 20px;
    align-items: end;
    gap: 5px;
    text-align: center;
}

.activity-bar-column strong,
.activity-bar-column small {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
}

.activity-bar {
    width: min(32px, 80%);
    height: var(--activity-height);
    min-height: 4px;
    justify-self: center;
    border-top: 2px solid var(--accent-hover);
    background: var(--accent);
}

.admin-ranking ol {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-ranking li {
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.admin-ranking li:last-child {
    border-bottom: 0;
}

.admin-ranking li span,
.admin-ranking li small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.health-alert {
    padding: 14px 16px;
    border-left: 4px solid #b9842d;
    background: color-mix(in srgb, #b9842d 12%, var(--surface));
}

.health-alert-error {
    border-left-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 11%, var(--surface));
}

.health-alert p {
    margin: 5px 0;
}

.admin-ranking li small {
    margin-top: 2px;
    color: var(--muted);
}

@media (max-width: 980px) and (min-width: 681px) {
    .dashboard-header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .dashboard-header .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

    .admin-activity-chart {
        grid-column: 1 / -1;
    }
}

.admin-user-row {
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.admin-user-row p,
.admin-user-row small {
    margin: 5px 0 0;
}

.inline-admin-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.admin-account-controls,
.admin-role-form {
    display: grid;
    gap: 8px;
}

.admin-account-controls > button,
.admin-account-controls > a,
.admin-account-controls > form > button,
.admin-role-form button {
    width: 100%;
    min-height: 42px;
}

.admin-role-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.admin-role-form select {
    min-height: 40px;
}

.status-danger {
    border-color: #8b4542;
    color: var(--danger);
}

.system-status-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.system-status-row {
    min-height: 52px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: 72px 190px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.system-status-indicator {
    width: 62px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-align: center;
    text-transform: uppercase;
}

.system-status-indicator.status-ready {
    border-color: #267b60;
    color: #79c9aa;
}

.system-status-indicator.status-warning,
.system-status-indicator.status-local {
    border-color: #8b744b;
    color: #ddc796;
}

.system-status-indicator.status-error {
    border-color: #8b4542;
    color: var(--danger);
}

.chat-room-bar {
    min-height: 58px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    background: #0e1215;
}

.chat-room-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.chat-room-context,
.room-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-switch {
    color: var(--muted);
    font-size: 12px;
}

.room-switch select {
    width: 170px;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
}

.command-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: min(760px, calc(100vh - 40px));
    padding: 22px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #151a1f;
    color: #edf2f5;
}

.command-dialog::backdrop {
    background: rgb(0 0 0 / 68%);
}

.command-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.command-dialog-heading h2,
.command-dialog h3 {
    margin: 0;
}

.command-dialog h3 {
    margin-top: 24px;
    font-size: 16px;
}

.dialog-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-strong);
    color: #edf2f5;
    font-size: 23px;
    cursor: pointer;
}

.command-list {
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
    gap: 0;
}

.npc-trigger-dialog-content h3 {
    margin-bottom: 8px;
}

.npc-trigger-dialog-content > p {
    margin: 8px 0 18px;
}

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

.npc-trigger-list li {
    min-width: 0;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.npc-trigger-list code {
    overflow-wrap: anywhere;
}

.npc-trigger-list span {
    color: var(--muted);
    font-size: 12px;
}

.command-help {
    width: min(860px, 100%);
}

.command-help .command-list {
    margin-bottom: 30px;
}

.command-help-link {
    margin: 0 0 16px;
    font-size: 13px;
}

.command-list dt,
.command-list dd {
    min-height: 42px;
    margin: 0;
    padding: 10px 8px;
    border-bottom: 1px solid #293138;
}

.command-list dd {
    color: var(--muted);
}

.command-list code {
    color: #f0c19e;
}

.online-page {
    width: min(880px, 100%);
}

.online-groups {
    margin-top: 20px;
    display: grid;
    gap: 28px;
}

.online-play {
    border-top: 1px solid var(--line);
}

.online-play > h2,
.online-play > h3 {
    margin: 0;
    padding: 16px 0 12px;
    font-size: 18px;
}

.online-room {
    padding: 12px 0;
    border-top: 1px solid #252d33;
}

.online-room > h3,
.online-room > h4 {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

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

.online-character-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 6px;
}

.online-character {
    min-height: 50px;
    display: grid;
    grid-template-columns: 36px 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #252d33;
    color: inherit;
    text-decoration: none;
}

.profile-whisper-button {
    margin-top: 10px;
}

.whisper-chat-choices {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.whisper-chat-choices .secondary-button {
    justify-content: flex-start;
    width: 100%;
}

.online-character:hover {
    background: #13181c;
}

.online-character small {
    grid-column: 3 / -1;
    margin-top: -7px;
    padding-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
}

.online-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.online-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.online-dialog .command-dialog-heading .muted {
    margin: 4px 0 0;
    font-size: 12px;
}

.online-dialog .online-groups {
    margin-top: 6px;
}

.duplicate-dialog .command-dialog-heading .muted {
    margin: 4px 0 0;
    font-size: 12px;
}

.duplicate-groups {
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.duplicate-group-row {
    display: grid;
    gap: 4px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.duplicate-group-row small {
    color: var(--muted);
}

@media print {
    :root {
        color-scheme: light;
        background: #fff;
        color: #111;
    }

    body {
        min-height: auto;
        background: #fff;
        color: #111;
    }

    .topbar,
    .workspace-tabbar,
    .footer,
    .log-actions,
    .notice {
        display: none !important;
    }

    .page-shell,
    .editor-shell {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .editor-heading {
        padding: 0 0 16px;
        border-bottom: 1px solid #888;
    }

    .editor-heading .eyebrow,
    .editor-heading .muted {
        color: #444;
    }

    .log-transcript {
        border: 0;
        background: #fff;
        color: #111;
    }

    .chat-message {
        break-inside: avoid;
    }

    .chat-message-system_join,
    .chat-message-system_leave,
    .chat-message-system_away,
    .chat-message-system_back,
    .chat-message-admin_announcement {
        color: #555;
    }
}

@media (max-width: 680px) {
    .room-background-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .npc-bot-room-grid,
    .npc-bot-behavior-grid {
        grid-template-columns: 1fr;
    }

    .npc-bot-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .npc-bot-row .row-actions {
        grid-column: 1 / -1;
    }

    .npc-bot-avatar-form {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .npc-bot-avatar-form .secondary-button {
        grid-column: 1 / -1;
    }

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

    .theme-choice-grid {
        grid-template-columns: 1fr;
    }
    .topbar,
    .footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-rules {
        display: none;
    }

    .page-shell {
        width: min(100% - 24px, 1120px);
    }

    .auth-layout {
        display: block;
        padding: 22px 0 36px;
    }

    .auth-panel {
        padding: 22px 18px;
    }

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

    .blacklist-add-form {
        grid-template-columns: 1fr;
    }

    .blacklist-add-form .secondary-button {
        width: 100%;
    }

    .admin-recent-message {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .admin-log-room-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .admin-log-room-row .secondary-button {
        width: 100%;
    }

    .admin-room-log .chat-message {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .log-pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .settings-data-export {
        align-items: stretch;
        flex-direction: column;
    }

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

    .system-status-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .system-status-row .muted {
        grid-column: 1 / -1;
    }

    .settings-data-export .secondary-button {
        width: 100%;
    }

    .auth-links,
    .dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-header {
        grid-template-columns: 1fr;
        padding-top: 32px;
    }

    .dolmorgul-dashboard-grid {
        grid-template-columns: 1fr;
    }

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

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

    .talent-card dl {
        flex-wrap: wrap;
    }

    .talent-roll-choice {
        grid-template-columns: 1fr;
    }

    .talent-roll-choice .secondary-button,
    .talent-private-targets .secondary-button {
        width: 100%;
    }

    .talent-modal {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        padding: 10px;
    }

    .embedded-modal-page .page-shell {
        padding: 10px;
    }

    .header-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .header-actions a,
    .header-actions button,
    .header-actions form,
    .header-actions form button,
    .form-actions a,
    .form-actions button {
        width: 100%;
        min-height: 48px;
    }

    .character-row {
        grid-template-columns: 44px 8px minmax(0, 1fr);
        padding: 14px 0;
    }

    .row-actions {
        grid-column: 3;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .row-actions > a,
    .row-actions > button,
    .row-actions > form,
    .row-actions > form > button {
        width: 100%;
        min-height: 46px;
    }

    .character-avatar-small {
        width: 44px;
        height: 44px;
    }

    .play-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .play-directory-row,
    .membership-request-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .play-directory-action,
    .play-directory-action form,
    .play-directory-action .primary-button,
    .play-directory-action .secondary-button,
    .play-directory-action .play-action-status {
        width: 100%;
    }

    .membership-request-row .row-actions {
        grid-column: auto;
    }

    .play-meta {
        justify-items: start;
    }

    .play-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .room-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .log-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .log-transcript {
        padding: 14px 8px;
    }

    .editor-shell {
        margin-top: 28px;
    }

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

    .play-admin-shell > .editor-heading {
        display: flex;
    }

    .play-character-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .play-character-row > .status-label,
    .play-character-actions {
        grid-column: 2;
    }

    .play-character-actions,
    .play-ban-form {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .play-character-actions form,
    .play-character-actions button {
        width: 100%;
    }

    .form-section {
        padding: 18px;
    }

    .chat-app {
        height: auto;
        min-height: 0;
    }

    .chat-page[data-workspace-mode="1"] .chat-app {
        height: calc(100vh - 102px);
        height: calc(100dvh - 102px);
        min-height: 0;
        max-width: 100vw;
        overflow: hidden;
    }

    .chat-workspace {
        display: flex;
        flex-direction: column;
    }

    .chat-page[data-workspace-mode="1"] .chat-workspace {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .workspace-tabbar {
        max-width: 100vw;
        overflow: hidden;
    }

    .workspace-tabbar > a {
        flex: 0 0 auto;
        min-width: 104px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .workspace-tab-anchor {
        min-width: 0;
        flex: 1 1 auto;
        overflow-x: auto;
    }

    .workspace-chat-tab {
        min-width: min(260px, 72vw);
        max-width: min(260px, 72vw);
    }

    .workspace-chat-tab a {
        min-width: 0;
        width: 100%;
    }

    .chat-main {
        order: 1;
    }

    .chat-compose {
        order: 2;
    }

    .participant-panel {
        order: 3;
    }

    .chat-main {
        border-right: 0;
    }

    .message-list {
        height: clamp(170px, 34dvh, 300px);
        min-height: 0;
        padding: 14px 10px;
        scroll-padding-bottom: 18px;
    }

    .chat-page[data-workspace-mode="1"] .message-list {
        height: 100%;
    }

    .chat-message {
        grid-template-columns: max-content minmax(0, 1fr) 24px;
        gap: 6px;
        font-size: 14px;
    }

    .typing-line {
        padding-left: 10px;
        padding-right: 10px;
    }

    .chat-compose {
        padding: 10px 12px 14px;
    }

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

    .compose-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .compose-buttons > button,
    .compose-buttons > a {
        width: 100%;
        min-width: 0;
        min-height: 46px;
    }

    .dashboard-online-play {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .participant-panel {
        padding: 16px 0 24px;
        border-top: 1px solid var(--line);
    }

    .participant-panel .section-heading {
        padding-left: 10px;
        padding-right: 10px;
    }

    .participant-list {
        min-height: 116px;
        max-height: 210px;
        padding: 0 10px;
    }

    .admin-user-row,
    .inline-admin-form,
    .admin-role-form {
        grid-template-columns: 1fr;
    }

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

    .admin-account-controls button,
    .admin-account-controls a,
    .admin-role-form button {
        min-height: 48px;
    }

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

    .admin-metrics > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-metrics > div:last-child {
        border-bottom: 0;
    }

    .admin-activity-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .activity-bars {
        height: 160px;
        gap: 4px;
    }

    .chat-room-bar,
    .chat-room-context,
    .chat-room-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-room-bar {
        padding: 14px 10px;
    }

    .chat-room-actions {
        width: 100%;
        margin-left: 0;
    }

    .room-switch {
        width: 100%;
    }

    .room-switch select {
        flex: 1;
        width: auto;
    }

    .command-dialog {
        padding: 17px;
    }

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

    .command-list dt {
        padding-bottom: 3px;
        border-bottom: 0;
    }

    .command-list dd {
        min-height: 34px;
        padding-top: 3px;
    }

    .online-character-list {
        grid-template-columns: 1fr;
    }
}
