:root {
    --ink-900: #0a0907;
    --ink-800: #0f0e0b;
    --ink-700: #14120e;
    --ink-600: #1a1711;
    --ink-500: #221d16;
    --ink-400: #2c2519;
    --ink-300: #3a3124;

    --cream: #d8cbaa;
    --cream-hi: #efe3c4;
    --cream-dim: #c9bb9b;
    --cream-mute: #9d917a;
    --cream-faint: #80775f;

    --brass: #aa9162;
    --brass-hi: #d6c496;
    --brass-lo: #7b6948;
    --gold: #e2d2aa;

    --line: rgba(170, 145, 98, 0.45);
    --line-soft: rgba(170, 145, 98, 0.24);
    --line-faint: rgba(170, 145, 98, 0.12);
    --line-hard: rgba(214, 196, 150, 0.75);

    --rust: #c66b4e;
    --rust-deep: #7b3326;
    --sage: #a8bb8c;
    --sage-deep: #5d7352;
    --amber: #d0a24c;
    --amber-deep: #6f5220;
    --slate: #8098a8;
    --slate-deep: #3c4e59;

    --serif: Georgia, "Times New Roman", "Book Antiqua", serif;
    --mono: "Roboto Mono", Consolas, "Courier New", monospace;

    --chamf: 12px;
    --chamf-sm: 6px;
    --panel: linear-gradient(168deg, rgba(38, 32, 24, 0.97) 0%, rgba(20, 18, 14, 0.98) 46%, rgba(13, 12, 9, 0.99) 100%);
    --panel-sunk: linear-gradient(180deg, #0c0b08, #16130e);
    --grain:
        repeating-linear-gradient(0deg, rgba(255, 246, 219, 0.016) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px);
    --clip-panel: polygon(var(--chamf) 0, calc(100% - var(--chamf)) 0, 100% var(--chamf), 100% calc(100% - var(--chamf)), calc(100% - var(--chamf)) 100%, var(--chamf) 100%, 0 calc(100% - var(--chamf)), 0 var(--chamf));
    --clip-btn: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);

    --side-w: 214px;
    --tabbar-h: 0px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--cream);
    background: transparent;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.is-web {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(170, 145, 98, 0.10), transparent 60%),
        radial-gradient(ellipse at 50% 120%, rgba(123, 51, 38, 0.12), transparent 60%),
        var(--ink-800);
}

body.is-nui {
    user-select: none;
}

.hidden {
    display: none !important;
}

button {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(170, 145, 98, 0.45);
}

kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--cream-hi);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--line);
}

/* FRAME */

#app {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.frame {
    position: relative;
    display: flex;
    width: min(1240px, 100%);
    height: min(780px, 100%);
    clip-path: var(--clip-panel);
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.7));
    animation: frame-in 0.22s ease-out;
}

body.is-web .frame {
    width: min(1440px, 100%);
    height: 100%;
}

.frame::before {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: var(--clip-panel);
    background: linear-gradient(165deg, rgba(214, 196, 150, 0.62), rgba(170, 145, 98, 0.4) 38%, rgba(90, 76, 50, 0.5));
    z-index: -2;
}

.frame::after {
    content: "";
    position: absolute;
    inset: 1px;
    clip-path: var(--clip-panel);
    background: var(--grain), var(--panel);
    z-index: -1;
}

.frame__hairline {
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(170, 145, 98, 0.15);
    pointer-events: none;
    z-index: 0;
}

.brackets i {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 0 solid var(--brass);
    opacity: 0.8;
    pointer-events: none;
    z-index: 3;
}

.brackets .tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.brackets .tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.brackets .bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.brackets .br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

@keyframes frame-in {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
    to   { opacity: 1; transform: none; }
}

/* SIDEBAR */

.side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: var(--side-w);
    flex: 0 0 auto;
    padding: 26px 0 18px;
    border-right: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.08));
}

.side__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line-faint);
}

.side__mark {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    background: var(--brass);
    transform: rotate(45deg);
    box-shadow: 0 0 0 3px rgba(170, 145, 98, 0.18), 0 0 14px rgba(214, 196, 150, 0.25);
}

.side__mark--lg {
    width: 18px;
    height: 18px;
    margin: 0 auto 18px;
    display: block;
}

.side__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--cream-hi);
}

.side__sub {
    margin-top: 3px;
    font-size: 11px;
    font-style: italic;
    color: var(--cream-faint);
}

.side__nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.nav-group {
    padding: 14px 22px 6px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--cream-faint);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 22px;
    font-size: 13px;
    letter-spacing: 0.4px;
    color: var(--cream-dim);
    text-align: left;
    transition: color 0.12s, background 0.12s;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    color: var(--brass-lo);
    transition: color 0.12s;
}

.nav-item:hover {
    color: var(--cream-hi);
    background: linear-gradient(90deg, rgba(170, 145, 98, 0.1), transparent);
}

.nav-item:hover svg {
    color: var(--brass);
}

.nav-item.active {
    color: var(--gold);
    background: linear-gradient(90deg, rgba(170, 145, 98, 0.2), rgba(170, 145, 98, 0.02));
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--brass-hi);
    box-shadow: 0 0 8px rgba(214, 196, 150, 0.6);
}

.nav-item.active svg {
    color: var(--brass-hi);
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    font-family: var(--mono);
    font-size: 10.5px;
    text-align: center;
    color: #120f09;
    background: var(--amber);
    clip-path: var(--clip-btn);
}

.side__foot {
    padding: 14px 22px 0;
    font-size: 11px;
    color: var(--cream-faint);
    border-top: 1px solid var(--line-faint);
}

.side__foot .btn {
    width: 100%;
    margin-top: 8px;
}

/* MAIN */

.main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.head__titles {
    flex: 1;
    min-width: 0;
}

.head__eyebrow {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--brass);
}

.head__title {
    margin-top: 2px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--cream-hi);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.head__staff {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--cream-dim);
}

.head__staff .tag {
    margin: 0;
}

.head__back,
.head__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--cream-mute);
    border: 1px solid var(--line-soft);
    clip-path: var(--clip-btn);
    background: rgba(0, 0, 0, 0.25);
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.head__back:hover,
.head__close:hover {
    color: var(--cream-hi);
    border-color: var(--line);
    background: rgba(170, 145, 98, 0.12);
}

body.is-web .head__close {
    display: none;
}

.content {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 28px 28px;
}

.content.split {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.25fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 18px;
    overflow: hidden;
    padding-bottom: 22px;
}

.pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pane__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

/* TYPOGRAPHY */

.eyebrow {
    margin-bottom: 8px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--cream-mute);
}

.section {
    margin-bottom: 22px;
}

.section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.section__title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--brass-hi);
}

.section__rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

.muted {
    color: var(--cream-mute);
}

.faint {
    color: var(--cream-faint);
    font-style: italic;
}

.mono {
    font-family: var(--mono);
    font-size: 12px;
}

.empty {
    padding: 34px 12px;
    text-align: center;
    font-style: italic;
    color: var(--cream-faint);
}

.empty::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    margin: 0 auto 12px;
    background: var(--brass-lo);
    transform: rotate(45deg);
    opacity: 0.6;
}

/* CARDS */

.card {
    position: relative;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(12, 11, 8, 0.75), rgba(22, 19, 14, 0.6));
    border: 1px solid var(--line-soft);
    box-shadow: inset 0 1px 0 rgba(255, 246, 219, 0.04), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
}

.card + .card {
    margin-top: 10px;
}

.grid > .card + .card {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 10px;
}

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

.grid--info {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1px;
    background: var(--line-faint);
    border: 1px solid var(--line-faint);
}

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

.stat {
    padding: 14px 16px 12px;
}

.stat__value {
    font-size: 28px;
    font-weight: 600;
    color: var(--cream-hi);
    letter-spacing: 0.5px;
}

.stat__value small {
    font-size: 14px;
    color: var(--cream-faint);
}

.stat__label {
    margin-top: 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cream-mute);
}

.stat--alert .stat__value {
    color: var(--amber);
}

.info {
    padding: 10px 12px;
    background: rgba(12, 11, 8, 0.85);
    min-width: 0;
}

button.info {
    grid-column: span 2;
    text-align: left;
    transition: background 0.12s;
}

button.info:hover {
    background: rgba(40, 34, 25, 0.95);
}

.info__label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--cream-faint);
}

.info__value {
    margin-top: 3px;
    font-size: 13.5px;
    color: var(--cream-hi);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* TAGS */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--brass-hi);
    border: 1px solid var(--line);
    background: rgba(170, 145, 98, 0.1);
    clip-path: var(--clip-btn);
    white-space: nowrap;
    vertical-align: middle;
}

.tag--sage { color: var(--sage); border-color: rgba(168, 187, 140, 0.5); background: rgba(93, 115, 82, 0.2); }
.tag--rust { color: var(--rust); border-color: rgba(198, 107, 78, 0.5); background: rgba(123, 51, 38, 0.22); }
.tag--slate { color: var(--slate); border-color: rgba(128, 152, 168, 0.5); background: rgba(60, 78, 89, 0.25); }
.tag--amber { color: var(--amber); border-color: rgba(208, 162, 76, 0.5); background: rgba(111, 82, 32, 0.25); }
.tag--plain { color: var(--cream-mute); border-color: var(--line-soft); background: transparent; }

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    transform: rotate(45deg);
    background: var(--sage);
    flex: 0 0 auto;
}

.dot--rust { background: var(--rust); }
.dot--amber { background: var(--amber); }
.dot--faint { background: var(--cream-faint); }

/* BUTTONS */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--cream);
    background: linear-gradient(180deg, rgba(58, 49, 36, 0.85), rgba(26, 23, 17, 0.9));
    border: 1px solid var(--line);
    clip-path: var(--clip-btn);
    transition: color 0.12s, background 0.12s, border-color 0.12s, transform 0.06s;
    white-space: nowrap;
}

.btn svg {
    width: 15px;
    height: 15px;
    color: var(--brass);
}

.btn:hover {
    color: var(--cream-hi);
    border-color: var(--line-hard);
    background: linear-gradient(180deg, rgba(80, 67, 46, 0.9), rgba(36, 31, 22, 0.95));
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    color: var(--cream);
    border-color: var(--line);
    background: linear-gradient(180deg, rgba(58, 49, 36, 0.85), rgba(26, 23, 17, 0.9));
}

.btn--primary {
    color: #15110a;
    border-color: var(--brass-hi);
    background: linear-gradient(180deg, var(--brass-hi), var(--brass));
}

.btn--primary svg {
    color: #15110a;
}

.btn--primary:hover {
    color: #0b0905;
    background: linear-gradient(180deg, var(--gold), var(--brass-hi));
}

.btn--danger {
    color: #f3d2c5;
    border-color: rgba(198, 107, 78, 0.65);
    background: linear-gradient(180deg, rgba(123, 51, 38, 0.85), rgba(70, 28, 20, 0.92));
}

.btn--danger svg {
    color: #f0b4a0;
}

.btn--danger:hover {
    color: #fff0e8;
    border-color: var(--rust);
    background: linear-gradient(180deg, rgba(150, 62, 46, 0.95), rgba(90, 36, 26, 0.95));
}

.btn--ghost {
    background: transparent;
    border-color: var(--line-soft);
}

.btn--small {
    min-height: 26px;
    padding: 4px 9px;
    font-size: 9.5px;
    letter-spacing: 1.3px;
}

.btn--block {
    width: 100%;
}

.btn.is-on {
    color: var(--gold);
    border-color: var(--brass-hi);
    background: linear-gradient(180deg, rgba(110, 92, 58, 0.75), rgba(46, 39, 27, 0.9));
    box-shadow: inset 0 0 12px rgba(214, 196, 150, 0.18);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool {
    flex-direction: column;
    gap: 7px;
    min-height: 72px;
    padding: 12px 10px;
    font-size: 10px;
    white-space: normal;
    text-align: center;
}

.tool svg {
    width: 20px;
    height: 20px;
}

/* FORMS */

.field {
    display: block;
    margin-bottom: 14px;
}

.field__label {
    display: block;
    margin-bottom: 5px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cream-mute);
}

.field__label em {
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    color: var(--cream-faint);
}

.field__hint {
    margin-top: 5px;
    font-size: 11px;
    font-style: italic;
    color: var(--cream-faint);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 11px;
    font-family: var(--serif);
    font-size: 14px;
    color: var(--cream-hi);
    background: var(--panel-sunk);
    border: 1px solid var(--line-soft);
    border-bottom-color: var(--line);
    outline: none;
    border-radius: 0;
    transition: border-color 0.12s, box-shadow 0.12s;
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--cream-faint);
    font-style: italic;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--line-hard);
    box-shadow: 0 0 0 1px rgba(214, 196, 150, 0.15), inset 0 0 10px rgba(170, 145, 98, 0.08);
}

.textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.45;
}

.select {
    padding-right: 30px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--brass) 50%),
        linear-gradient(135deg, var(--brass) 50%, transparent 50%),
        var(--panel-sunk);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%, 0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
}

/* DROPDOWNS */

.dropdown {
    display: flex;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.dropdown:focus,
.dropdown:focus-visible {
    outline: none;
}

.dropdown.is-open {
    border-color: var(--line-hard);
    box-shadow: 0 0 0 1px rgba(214, 196, 150, 0.15), inset 0 0 10px rgba(170, 145, 98, 0.08);
}

.dropdown__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown__label.is-placeholder {
    font-style: italic;
    color: var(--cream-faint);
}

.dropdown__menu {
    position: fixed;
    z-index: 95;
    overflow-y: auto;
    padding: 4px 0;
    background: var(--grain), linear-gradient(180deg, #1c1813, #100e0b);
    border: 1px solid var(--line);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 10px 26px rgba(0, 0, 0, 0.7);
    animation: fade-in 0.1s ease-out;
}

.dropdown__option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13.5px;
    text-align: left;
    color: var(--cream);
    border-bottom: 1px solid var(--line-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.08s, color 0.08s;
}

.dropdown__option:last-child {
    border-bottom: none;
}

.dropdown__option:hover,
.dropdown__option:focus {
    outline: none;
    color: var(--cream-hi);
    background: linear-gradient(90deg, rgba(170, 145, 98, 0.2), transparent);
}

.dropdown__option.is-selected {
    color: var(--gold);
    box-shadow: inset 2px 0 0 var(--brass-hi);
}

.input--code {
    font-family: var(--mono);
    font-size: 24px;
    text-align: center;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-row > .field {
    flex: 1;
    margin-bottom: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.toolbar .search {
    flex: 1;
    min-width: 180px;
}

.search {
    position: relative;
}

.search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--brass-lo);
    pointer-events: none;
}

.search .input {
    padding-left: 34px;
}

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--cream-dim);
    cursor: pointer;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--brass);
}

/* SEGMENTED */

.segmented {
    display: inline-flex;
    border: 1px solid var(--line-soft);
    clip-path: var(--clip-btn);
    background: rgba(0, 0, 0, 0.3);
}

.segmented button {
    padding: 7px 13px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cream-mute);
    transition: color 0.12s, background 0.12s;
}

.segmented button + button {
    border-left: 1px solid var(--line-faint);
}

.segmented button.active {
    color: #15110a;
    background: linear-gradient(180deg, var(--brass-hi), var(--brass));
}

/* LISTS */

.list {
    border: 1px solid var(--line-soft);
    background: rgba(8, 7, 5, 0.45);
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line-faint);
    transition: background 0.1s;
}

.row:last-child {
    border-bottom: none;
}

button.row:hover,
.row.is-link:hover {
    background: linear-gradient(90deg, rgba(170, 145, 98, 0.12), transparent 80%);
    cursor: pointer;
}

.row.active {
    background: linear-gradient(90deg, rgba(170, 145, 98, 0.22), rgba(170, 145, 98, 0.03));
    box-shadow: inset 2px 0 0 var(--brass-hi);
}

.row__id {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 26px;
    padding: 0 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--brass-hi);
    border: 1px solid var(--line-soft);
    background: rgba(0, 0, 0, 0.35);
    clip-path: var(--clip-btn);
}

.row__main {
    flex: 1;
    min-width: 0;
}

.row__title {
    font-size: 14px;
    color: var(--cream-hi);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row__sub {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--cream-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--cream-faint);
    white-space: nowrap;
}

.row__text {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--cream-dim);
    white-space: pre-wrap;
    word-break: break-word;
}

.more {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

/* PLAYER DETAIL */

.detail__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.detail__name {
    font-size: 20px;
    color: var(--cream-hi);
    line-height: 1.2;
}

.detail__sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--cream-mute);
}

.detail__tags {
    margin-top: 8px;
}

.detail__tags .tag:first-child {
    margin-left: 0;
}

.action-group {
    margin-bottom: 14px;
}

.action-group .eyebrow {
    margin-bottom: 6px;
}

.idlist {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--cream-dim);
    line-height: 1.7;
    word-break: break-all;
}

.idlist button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1px 0;
}

.idlist button:hover {
    color: var(--gold);
}

/* CHAT */

.chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bubble {
    max-width: 86%;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--cream-hi);
    background: rgba(20, 18, 14, 0.9);
    border: 1px solid var(--line-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.bubble--staff {
    align-self: flex-end;
    background: linear-gradient(180deg, rgba(58, 49, 36, 0.8), rgba(36, 31, 22, 0.85));
    border-color: var(--line);
}

.bubble__by {
    margin-bottom: 3px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--brass);
}

.bubble__by span {
    margin-left: 6px;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: none;
    color: var(--cream-faint);
}

.composer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.composer .input {
    flex: 1;
}

/* CODE DISPLAY */

.code-display {
    margin: 6px 0 14px;
    padding: 18px 10px;
    font-family: var(--mono);
    font-size: 34px;
    letter-spacing: 8px;
    text-align: center;
    color: var(--gold);
    background: var(--panel-sunk);
    border: 1px solid var(--line);
    text-shadow: 0 0 18px rgba(214, 196, 150, 0.25);
    user-select: all;
}

/* MODAL */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 3, 0.62);
    animation: fade-in 0.15s ease-out;
}

.modal {
    position: relative;
    width: min(460px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    clip-path: var(--clip-panel);
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.75));
    animation: modal-in 0.18s ease-out;
}

.modal--wide {
    width: min(620px, 100%);
}

.modal::before {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: var(--clip-panel);
    background: linear-gradient(165deg, rgba(214, 196, 150, 0.62), rgba(170, 145, 98, 0.4) 38%, rgba(90, 76, 50, 0.5));
    z-index: -2;
}

.modal::after {
    content: "";
    position: absolute;
    inset: 1px;
    clip-path: var(--clip-panel);
    background: var(--grain), var(--panel);
    z-index: -1;
}

.modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--line-soft);
}

.modal__title {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--cream-hi);
}

.modal__body {
    padding: 18px 22px 6px;
    overflow-y: auto;
}

.modal__text {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cream-dim);
}

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 22px 20px;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* TOASTS */

.toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(320px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    gap: 10px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--cream-hi);
    background: var(--grain), var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    animation: toast-in 0.2s ease-out;
}

.toast--error { border-left-color: var(--rust); }
.toast--success { border-left-color: var(--sage); }

.toast.leaving {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.2s, transform 0.2s;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: none; }
}

/* LOGIN */

.login {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.frame--login {
    width: min(420px, 100%);
    height: auto;
}

.login__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 40px 34px 34px;
}

.login__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3.4px;
    text-align: center;
    text-transform: uppercase;
    color: var(--cream-hi);
}

.login__sub {
    margin-top: 6px;
    margin-bottom: 22px;
    font-style: italic;
    text-align: center;
    color: var(--cream-faint);
}

.login__steps {
    margin: 0 0 22px 18px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--cream-dim);
}

.login__error {
    margin-bottom: 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: #f0b4a0;
    border: 1px solid rgba(198, 107, 78, 0.5);
    background: rgba(123, 51, 38, 0.2);
}

/* PLAYER REPORTS */

#reports-app {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.frame--reports,
body.is-web .frame--reports {
    width: min(1000px, 100%);
    height: min(660px, 100%);
}

.rp-side {
    min-height: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 300px;
    flex: 0 0 auto;
    padding: 26px 16px 16px;
    border-right: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.08));
}

.rp-side__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px 14px;
    border-bottom: 1px solid var(--line-faint);
}

.rp-side__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.rp-side__list .row__title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rp-side__list .row__title .tag {
    margin-left: 0;
}

.rp-unread {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    background: var(--gold);
    box-shadow: 0 0 8px rgba(226, 210, 170, 0.7);
}

.rp-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.rp-main__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 26px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.rp-head__tags .tag {
    margin-left: 0;
}

.rp-back {
    display: none;
}

.rp-main__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 18px 26px 22px;
}

.rp-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.rp-closed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-faint);
}

.rp-new__text {
    flex: 1;
    min-height: 160px;
}

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

/* TABBAR */

.tabbar {
    display: none;
}

/* SPLIT DETAIL ON NARROW DESKTOP */

@media (max-width: 1080px) {
    :root {
        --side-w: 188px;
    }

    .content.split {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .content.split .pane--list.has-detail {
        display: none;
    }

    .content.split .pane--detail:not(.has-detail) {
        display: none;
    }
}

/* PHONE */

@media (max-width: 760px) {
    #reports-app {
        padding: 0;
    }

    .frame--reports,
    body.is-web .frame--reports {
        width: 100%;
        height: 100%;
    }

    .rp-side {
        width: 100%;
        padding: calc(18px + var(--safe-t)) 16px 16px;
        border-right: none;
    }

    .frame--reports.has-thread .rp-side {
        display: none;
    }

    .frame--reports:not(.has-thread) .rp-main {
        display: none;
    }

    .rp-back {
        display: grid;
    }

    .rp-main__head {
        padding: calc(14px + var(--safe-t)) 16px 12px;
    }

    .rp-main__body {
        padding: 14px 16px calc(16px + var(--safe-b));
    }
    :root {
        --tabbar-h: 62px;
    }

    #app {
        padding: 0;
    }

    .frame,
    body.is-web .frame {
        width: 100%;
        height: 100%;
        clip-path: none;
        filter: none;
        flex-direction: column;
        animation: none;
    }

    .frame::before,
    .frame__hairline,
    .brackets {
        display: none;
    }

    .frame::after {
        inset: 0;
        clip-path: none;
    }

    .frame--login {
        height: auto;
    }

    .frame--login::before {
        display: block;
        clip-path: var(--clip-panel);
    }

    .frame--login::after {
        inset: 1px;
        clip-path: var(--clip-panel);
    }

    .side {
        display: none;
    }

    .head {
        padding: calc(14px + var(--safe-t)) 16px 12px;
        gap: 10px;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
    }

    .head__title {
        font-size: 18px;
    }

    .head__staff .staff-name {
        display: none;
    }

    .content {
        padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 20px);
        -webkit-overflow-scrolling: touch;
    }

    .content.split {
        display: block;
        overflow-y: auto;
        padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
    }

    .tabbar {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 5;
        display: flex;
        height: calc(var(--tabbar-h) + var(--safe-b));
        padding-bottom: var(--safe-b);
        background: linear-gradient(180deg, rgba(20, 18, 14, 0.97), rgba(10, 9, 7, 0.99));
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.45);
    }

    .tab {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--cream-faint);
    }

    .tab svg {
        width: 20px;
        height: 20px;
    }

    .tab.active {
        color: var(--gold);
    }

    .tab.active::before {
        content: "";
        position: absolute;
        top: -1px;
        left: 26%;
        right: 26%;
        height: 2px;
        background: var(--brass-hi);
        box-shadow: 0 0 10px rgba(214, 196, 150, 0.6);
    }

    .tab .nav-badge {
        position: absolute;
        top: 6px;
        left: 54%;
        margin: 0;
        min-width: 16px;
        padding: 0 4px;
        font-size: 9px;
    }

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

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

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

    .tool {
        min-height: 76px;
        padding: 10px 4px;
        font-size: 9px;
        letter-spacing: 1px;
    }

    .stat__value {
        font-size: 24px;
    }

    .btn {
        min-height: 42px;
        padding: 9px 14px;
    }

    .btn--small {
        min-height: 34px;
    }

    .action-group .btn-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-group .btn-row .btn {
        width: 100%;
    }

    .row {
        padding: 12px;
        min-height: 56px;
    }

    .row__meta .hide-sm {
        display: none;
    }

    .dropdown__option {
        padding: 12px 14px;
        font-size: 15px;
    }

    .input,
    .select,
    .textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .toolbar {
        gap: 8px;
    }

    .toolbar .search {
        flex-basis: 100%;
    }

    .segmented {
        width: 100%;
    }

    .segmented button {
        flex: 1;
        padding: 10px 6px;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal,
    .modal--wide {
        width: 100%;
        max-height: 92%;
        clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%, 0 14px);
        animation: sheet-in 0.22s ease-out;
    }

    .modal::before,
    .modal::after {
        clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%, 0 14px);
    }

    .modal__foot {
        padding-bottom: calc(18px + var(--safe-b));
    }

    .modal__foot .btn {
        flex: 1;
    }

    .toasts {
        top: auto;
        right: 16px;
        bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
    }

    .code-display {
        font-size: 28px;
        letter-spacing: 5px;
    }

    @keyframes sheet-in {
        from { transform: translateY(40px); opacity: 0; }
        to   { transform: none; opacity: 1; }
    }
}

@media (hover: none) {
    button.row:hover,
    .row.is-link:hover,
    .nav-item:hover {
        background: none;
    }
}
