:root {
    color-scheme: dark;
    --bg: #191919;
    --side: #1f1f1f;
    --raised: #252525;
    --hover: #2a2a2a;
    --active: #363636;
    --line: #303030;
    --text: #efefef;
    --text-2: #a3a3a3;
    --text-3: #888888;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Geist", sans-serif;
    font-size: 14px;
    line-height: 20px;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
menu {
    margin: 0;
}

h1,
h2,
h3 {
    font-weight: 500;
}

ul,
ol,
menu {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.button:hover {
    background: #ffffff;
}

.button:active {
    transform: scale(0.98);
}

.button-ghost {
    background: none;
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--text);
}

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

.icon-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-2);
    font-size: 16px;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-button:hover {
    background: var(--hover);
    color: var(--text);
}

.form label {
    display: grid;
    gap: 8px;
    color: var(--text-2);
    font-size: 13px;
}

.form input,
.form select,
.form textarea {
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s var(--ease);
}

.form input,
.form select {
    height: 40px;
}

.form textarea {
    padding: 10px 12px;
    resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    border-color: #5c5c5c;
    outline: none;
}

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

.login-form {
    display: grid;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    padding: 32px 24px 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--side);
}

.login-form p {
    color: var(--text-2);
}

.login-error {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--raised);
}

.login-form h1 {
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 28px;
}

.login-form .button {
    height: 40px;
    margin-top: 8px;
}

.app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    width: auto;
    height: 100vh;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--side);
    color: var(--text);
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.logo {
    font-size: 17px;
    font-weight: 500;
}

.nav li + li {
    margin-top: 2px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    transition: background-color 0.15s var(--ease);
}

.nav a:hover {
    background: var(--hover);
}

.nav a.active {
    background: var(--active);
}

.nav .bi {
    font-size: 16px;
}

.group {
    margin-top: 24px;
}

.group summary {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin-bottom: 4px;
    padding: 0 8px;
    color: var(--text-2);
    font-size: 13px;
    list-style: none;
    cursor: pointer;
}

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

.group summary .bi {
    font-size: 11px;
    transition: transform 0.15s var(--ease);
}

.group:not([open]) summary .bi {
    transform: rotate(-90deg);
}

.account {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
}

.user {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    margin-right: auto;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: 8px;
    background: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s var(--ease);
}

.user:hover {
    background: var(--line);
}

.user::before {
    content: attr(data-initial);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-right: 2px;
    border-radius: 50%;
    background: var(--avatar, none) center / cover no-repeat, var(--active);
    font-size: 12px;
}

.user small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-3);
    font-size: 14px;
    font-weight: 400;
}

.user small::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.user .bi {
    color: var(--text-3);
    font-size: 11px;
}

.user-menu {
    position: fixed;
    inset: auto auto 48px 8px;
    width: 240px;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.user-menu a,
.user-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
    transition: background-color 0.15s var(--ease);
}

.user-menu a:hover,
.user-menu button:hover {
    background: var(--line);
}

.user-menu .bi {
    color: var(--text-2);
    font-size: 16px;
}

.user-menu li + li {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    grid-area: topbar;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.topbar .sidebar-toggle {
    display: none;
}

.home {
    grid-area: main;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 784px;
    min-height: calc(100vh - 48px);
    margin: 0 auto;
    padding: 64px 32px 96px;
}

.home h1 {
    font-size: 40px;
    line-height: 48px;
    letter-spacing: -0.02em;
}

.sections h2 {
    margin: 48px 0 12px;
    color: var(--text-2);
    font-size: 13px;
}

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

.sections a {
    display: grid;
    grid-template-columns: 1fr auto;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: background-color 0.15s var(--ease);
}

.sections a:hover {
    background: var(--raised);
}

.sections .bi {
    color: var(--text-2);
    font-size: 16px;
}

.sections .bi-chevron-right {
    color: var(--text-3);
    font-size: 14px;
    transition: transform 0.15s var(--ease);
}

.sections a:hover .bi-chevron-right {
    transform: translateX(2px);
}

.sections h3 {
    grid-column: 1 / -1;
    margin-top: 40px;
    font-size: 15px;
}

.sections p {
    grid-column: 1 / -1;
    margin-top: 4px;
    color: var(--text-2);
    font-size: 13px;
}

.content {
    grid-area: main;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 32px 96px;
}

.content.wide {
    max-width: none;
}

.content h2 {
    margin: 40px 0 12px;
    color: var(--text-2);
    font-size: 13px;
}

.page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 4px 24px;
}

.page-head h1 {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -0.01em;
}

.page-head p {
    grid-column: 1;
    color: var(--text-2);
}

.page-head .button,
.page-head .actions {
    grid-column: 2;
    grid-row: 1 / 3;
}

.page-head .actions {
    display: flex;
    gap: 8px;
}

.report-form .hint {
    color: var(--text-2);
    font-size: 13px;
}

.table {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    border-spacing: 0;
    overflow: hidden;
}

.table th {
    height: 40px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--side);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 400;
    text-align: left;
}

.table td {
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
}

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

.tabs {
    margin: 32px 0 16px;
    overflow-x: auto;
}

.tabs ul {
    display: flex;
    gap: 4px;
}

.tabs button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-2);
    white-space: nowrap;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.tabs button:hover {
    background: var(--hover);
    color: var(--text);
}

.tabs button.active {
    background: var(--active);
    color: var(--text);
}

.tabs small {
    color: var(--text-3);
    font-size: 12px;
}

.filters + .list {
    margin-top: 0;
}

.tabs[hidden] + .filters,
.page-head + .filters {
    margin-top: 32px;
}

.filters select:only-of-type {
    flex: 0 1 280px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filters input,
.filters select {
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s var(--ease);
}

.filters input:focus,
.filters select:focus {
    border-color: #5c5c5c;
    outline: none;
}

.filters select {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    color: var(--text-2);
}

.find {
    position: relative;
    flex: 1 1 100%;
}

.find .bi {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--text-3);
    transform: translateY(-50%);
}

.find input {
    width: 100%;
    padding: 0 12px 0 36px;
}

.roster {
    max-height: calc(100vh - 248px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.roster .table {
    display: table;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.roster th {
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.roster th,
.roster td {
    padding-right: 10px;
    padding-left: 10px;
}

.roster td {
    height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.roster .nowrap,
.table .nowrap {
    white-space: nowrap;
}

.roster abbr {
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: help;
}

.roster small {
    display: block;
    color: var(--text-3);
    font-size: 12px;
    line-height: 16px;
}

.roster .id {
    color: var(--text-2);
    font-family: monospace;
    font-size: 12px;
    white-space: nowrap;
}

.table a {
    text-decoration: underline;
    text-decoration-color: var(--text-3);
    text-underline-offset: 3px;
}

.table .bi {
    margin-right: 8px;
}

.waiting {
    color: var(--text-2);
}

.approved {
    color: var(--text);
}

.rejected {
    color: var(--text-3);
}

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

.profile::before {
    content: attr(data-initial);
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--avatar, none) center / cover no-repeat, var(--active);
    font-size: 22px;
    font-weight: 500;
}

.profile h1 {
    align-self: end;
    font-size: 28px;
    line-height: 36px;
}

.profile p {
    align-self: start;
    color: var(--text-2);
}

.details {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.details dt,
.details dd {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.details dt:first-of-type,
.details dd:first-of-type {
    border-top: 0;
}

.details dt {
    color: var(--text-2);
}

.history {
    margin-left: 4px;
    border-left: 1px solid var(--line);
}

.history li {
    position: relative;
    padding: 0 0 24px 24px;
}

.history li:last-child {
    padding-bottom: 0;
}

.history li::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-3);
}

.history li:first-child::before {
    background: var(--text);
}

.history time {
    display: block;
    color: var(--text-3);
    font-size: 13px;
}

.professions {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas:
        "head head"
        "list viewer"
        "list job";
    column-gap: 24px;
    max-width: 1200px;
}

.professions .page-head {
    grid-area: head;
    margin-bottom: 32px;
}

.job-list {
    position: sticky;
    top: 72px;
    grid-area: list;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.job-list li + li {
    margin-top: 2px;
}

.job-list button {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-2);
    text-align: left;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.job-list button:hover {
    background: var(--hover);
    color: var(--text);
}

.job-list button.active {
    background: var(--active);
    color: var(--text);
}

.stage {
    position: relative;
    grid-area: viewer;
}

.viewer {
    display: block;
    width: 100%;
    height: 560px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #1c1c1c;
}

.anim {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(25, 25, 25, 0.85);
}

.anim select {
    height: 32px;
    max-width: 220px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.anim select:hover {
    background: var(--hover);
}

.anim select option,
.anim select optgroup {
    background: var(--raised);
}

.job {
    grid-area: job;
    padding-top: 24px;
}

.content .job h2 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 20px;
    line-height: 28px;
}

.job h3 {
    margin: 24px 0 12px;
    color: var(--text-2);
    font-size: 13px;
}

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

.weapons li {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 13px;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
    text-decoration: underline;
    text-decoration-color: var(--text-3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s var(--ease);
}

.link:hover {
    text-decoration-color: var(--text);
}

.table small {
    display: block;
    color: var(--text-3);
    font-size: 12px;
    line-height: 16px;
    text-decoration: none;
}

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

.chips li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 13px;
}

.chips button {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-3);
}

.chips button:hover {
    color: var(--text);
}

.report-body {
    padding: 20px;
}

.report-body h3 {
    margin: 20px 0 10px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
}

.report-body .details {
    grid-template-columns: 160px minmax(0, 1fr);
}

.participants {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 20px;
    padding: 0;
    border: 0;
}

.participants legend {
    margin-bottom: 8px;
    padding: 0;
    color: var(--text-2);
    font-size: 13px;
}

.participants .chips {
    grid-column: 1 / -1;
}

.participants .chips:empty {
    display: none;
}

.form input[type="file"] {
    height: auto;
    padding: 8px 12px;
    color: var(--text-2);
}

.shots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px;
}

.shots:empty {
    display: none;
}

.shots img {
    display: block;
    width: 96px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.shots li {
    position: relative;
}

.shots button {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text);
    font-size: 14px;
}

.shots button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.modal {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 12px 0 20px;
    border-bottom: 1px solid var(--line);
}

.modal h2 {
    font-size: 16px;
}

.settings {
    width: min(840px, calc(100% - 32px));
    height: min(560px, calc(100% - 32px));
}

.settings[open] {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
}

.settings header {
    grid-column: 1 / -1;
}

.settings-nav {
    padding: 12px;
    border-right: 1px solid var(--line);
}

.settings-nav li + li {
    margin-top: 2px;
}

.settings-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
    transition: background-color 0.15s var(--ease);
}

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

.settings-nav button.active {
    background: var(--active);
}

.settings-nav .bi {
    color: var(--text-2);
    font-size: 16px;
}

.settings-panel {
    padding: 20px 24px 32px;
    overflow-y: auto;
}

.settings-panel h3 {
    margin-bottom: 4px;
    font-size: 15px;
}

.settings-panel small {
    display: block;
    margin-top: 2px;
    color: var(--text-2);
    font-size: 13px;
}

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

.rows dt,
.rows dd {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.rows dt:first-of-type,
.rows dd:first-of-type {
    border-top: 0;
}

.rows dd {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 24px;
    color: var(--text-2);
}

.toggles li + li {
    border-top: 1px solid var(--line);
}

.toggles label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 24px;
    padding: 16px 0;
    cursor: pointer;
}

.toggles small {
    grid-column: 1;
}

.toggles input {
    position: relative;
    grid-row: 1 / 3;
    grid-column: 2;
    width: 36px;
    height: 20px;
    margin: 0;
    border-radius: 10px;
    background: var(--active);
    appearance: none;
    cursor: pointer;
    transition: background-color 0.15s var(--ease);
}

.toggles input::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-2);
    transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}

.toggles input:checked {
    background: var(--text);
}

.toggles input:checked::before {
    background: var(--bg);
    transform: translateX(16px);
}

.report {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow-y: auto;
}

.form .check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
}

.form .check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--text);
}

.report-form {
    display: grid;
    gap: 16px;
    padding-bottom: 20px;
}

.report-form label,
.report-form .hint,
.report-form .form-warning,
.report-form .form-error,
.report-form footer {
    padding: 0 20px;
}

.report-form header {
    margin-bottom: 4px;
}

.report-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.bell {
    position: relative;
}

.bell[data-count]:not([data-count="0"])::after {
    content: attr(data-count);
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
}

.notifications {
    position: fixed;
    inset: auto auto 48px 8px;
    width: 320px;
    max-height: min(480px, calc(100vh - 64px));
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.notifications[popover]:popover-open {
    display: flex;
    flex-direction: column;
}

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

.notifications h2 {
    font-size: 14px;
    font-weight: 600;
}

.notifications ul {
    overflow-y: auto;
    padding: 4px;
}

.notifications a {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-2);
    text-decoration: none;
    transition: background-color 0.15s var(--ease);
}

.notifications a:hover {
    background: var(--line);
}

.notifications .unread a {
    background: var(--hover);
    color: var(--text);
}

.notifications small {
    color: var(--text-3);
    font-size: 12px;
}

.notifications .empty {
    margin: 0;
    padding: 24px 14px;
}

.empty,
.more {
    margin-top: 24px;
    color: var(--text-3);
}

.missing {
    padding: 20px;
    color: var(--text-2);
}

.settings-panel .form-error {
    margin-top: 12px;
}

.form-warning {
    color: #e5c07b;
    font-size: 13px;
}

.form-error {
    color: #e5a3a3;
    font-size: 13px;
}

.list {
    margin-top: 16px;
}

.queue {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.queue a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.queue a:hover {
    background: var(--hover);
    color: var(--text);
}

.queue strong {
    color: var(--text);
    font-weight: 600;
}

.review {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.review footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.remove {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.files a {
    display: block;
}

.roster .icon-button {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

@media (min-width: 861px) {
    .sidebar-hidden {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "topbar"
            "main";
    }

    .sidebar-hidden .sidebar {
        display: none;
    }

    .sidebar-hidden .topbar {
        padding-left: 8px;
    }

    .sidebar-hidden .topbar .sidebar-toggle {
        display: grid;
    }
}

@media (max-width: 860px) {
    .app {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "topbar"
            "main";
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        height: auto;
    }

    .sidebar:not(:popover-open) {
        display: none;
    }

    .sidebar::backdrop {
        background: rgba(0, 0, 0, 0.6);
    }

    .topbar {
        padding: 0 8px;
    }

    .topbar .sidebar-toggle {
        display: grid;
    }

    .home {
        justify-content: flex-start;
        min-height: 0;
        padding: 48px 16px 64px;
    }

    .home h1 {
        font-size: 32px;
        line-height: 40px;
    }

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

    .sections h3 {
        margin-top: 24px;
    }

    .content {
        padding: 32px 16px 64px;
    }

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

    .filters select {
        flex-basis: calc(50% - 4px);
    }

    .page-head > .button,
    .page-head .actions {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-top: 12px;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

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

    .details dd {
        padding-top: 0;
        border-top: 0;
    }

    .settings {
        width: calc(100% - 16px);
        height: calc(100% - 16px);
    }

    .settings[open] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
    }

    .settings-nav {
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .settings-nav ul {
        display: flex;
        gap: 4px;
    }

    .settings-nav li + li {
        margin-top: 0;
    }

    .settings-nav button {
        width: auto;
        white-space: nowrap;
    }

    .report {
        width: calc(100% - 16px);
    }

    .professions {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "list"
            "viewer"
            "job";
    }

    .job-list {
        position: static;
        max-height: none;
        margin-bottom: 16px;
    }

    .job-list ul {
        display: flex;
        gap: 4px;
        overflow-x: auto;
    }

    .job-list li + li {
        margin-top: 0;
    }

    .job-list button {
        white-space: nowrap;
    }

    .viewer {
        height: 420px;
    }
}

.promotion h3 {
    font-size: 15px;
    font-weight: 500;
}

.criteria {
    display: grid;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.criteria > li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-2);
}

.criteria > li + li {
    border-top: 1px solid var(--line);
}

.criteria > li.done {
    color: var(--text);
}

.criteria small {
    display: block;
    color: var(--text-3);
    font-size: 13px;
}

.criteria .check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}

.criteria .check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--text);
}

.content .promotion .hint,
.content .promotion .form-error {
    margin-top: 12px;
}

.content .promotion .hint {
    color: var(--text-2);
}

.content .promotion .button {
    margin-top: 16px;
}

.report-form .promotion {
    padding: 0 20px;
}

.report-form .promotion .hint {
    padding: 0;
}

.report-form .criteria > li {
    padding: 8px 12px;
}

.characters {
    width: min(420px, calc(100% - 32px));
}

.characters .hint {
    padding: 16px 20px 0;
    color: var(--text-2);
    font-size: 13px;
}

.character-list {
    display: grid;
    gap: 4px;
    padding: 12px 12px 16px;
}

.character-list button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: none;
    text-align: left;
    transition: background-color 0.15s var(--ease);
}

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

.character-list button.active {
    background: var(--active);
}

.character-list small {
    display: block;
    color: var(--text-3);
    font-size: 12px;
}

.ai-chat {
    position: fixed;
    inset: auto auto 48px 8px;
    width: min(420px, calc(100vw - 16px));
    height: min(560px, calc(100vh - 64px));
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ai-chat[popover]:popover-open {
    display: flex;
    flex-direction: column;
}

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

.ai-chat h2 {
    font-size: 14px;
    font-weight: 600;
}

.ai-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
}

.ai-messages li {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--hover);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-messages .question {
    align-self: flex-end;
    background: var(--active);
}

.ai-messages .typing {
    color: var(--text-3);
}

.ai-messages strong {
    font-weight: 600;
}

.ai-chat .empty {
    flex: 1;
    margin: 0;
    padding: 24px 14px;
}

.ai-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
}

.ai-form textarea {
    min-height: 40px;
    max-height: 160px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.ai-form .form-error {
    grid-column: 1 / -1;
}

.compact select {
    flex: 0 1 240px;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.podium li {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--side);
}

.podium .place-1 {
    border-color: var(--text-3);
    background: var(--raised);
}

.podium .medal {
    color: var(--text-3);
    font-size: 12px;
}

.podium h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
}

.podium h3::before {
    content: attr(data-initial);
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--avatar, none) center / cover no-repeat, var(--active);
    font-size: 14px;
}

.podium p {
    color: var(--text-2);
    font-size: 13px;
}

.podium strong {
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    column-gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.stats dt {
    color: var(--text-2);
    font-size: 13px;
}

.stats dd {
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
}

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

.chart {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

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

.chart figcaption {
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 13px;
}

.chart svg text {
    fill: var(--text-3);
    font: 11px "Geist", sans-serif;
}

.chart .grid {
    stroke: var(--line);
    stroke-width: 1;
}

.chart .cross {
    stroke: var(--text-3);
    stroke-width: 1;
}

.chart .hit {
    fill: transparent;
}

.chart .dot {
    stroke: var(--bg);
    stroke-width: 2;
}

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

.bar-list li {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
}

.bar-list p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-list small {
    margin-left: 6px;
    color: var(--text-3);
    font-size: 12px;
}

.bar-list .track {
    width: 100%;
}

.bar-list strong {
    font-weight: 500;
    text-align: right;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 12px;
    color: var(--text-2);
    font-size: 12px;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-tip {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: 2px;
    max-width: 260px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--raised);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    pointer-events: none;
}

.chart-tip strong {
    font-weight: 600;
}

.chart-tip small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
    font-size: 12px;
}

.ranking .mine td {
    background: var(--hover);
}

.rules {
    margin-top: 24px;
    color: var(--text-2);
}

.rules summary {
    cursor: pointer;
    color: var(--text);
}

.rules ul {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding-left: 18px;
    list-style: disc;
}

@media (max-width: 860px) {
    .podium,
    .charts {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .bar-list li {
        grid-template-columns: 90px minmax(0, 1fr) 48px;
    }
}

.files figure {
    display: grid;
    gap: 4px;
    width: 140px;
    margin: 0;
}

.files img {
    width: 140px;
    height: 88px;
}

.files figcaption {
    color: var(--text-3);
    font-size: 12px;
    line-height: 16px;
}

.files figcaption.stale,
.files figcaption.future {
    color: #e5c07b;
}

.legacy-note {
    margin-bottom: 16px;
    color: var(--text-2);
    font-size: 13px;
}

.notifications header menu {
    display: flex;
    gap: 12px;
}

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

.roster-preview {
    display: block;
    max-height: 50vh;
    margin: 0 20px;
    width: calc(100% - 40px);
    overflow: auto;
}

.roster-preview th,
.roster-preview td {
    white-space: nowrap;
}

.roster-preview small {
    min-width: 220px;
    max-width: 260px;
    white-space: normal;
    color: #e5c07b;
}

.roster-preview .blocked td {
    color: var(--text-3);
}

.criteria .marks {
    display: flex;
    align-items: center;
    gap: 16px;
}

.criteria .marks li:empty {
    display: none;
}

.criteria .extra {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 13px;
}

.criteria .extra input {
    width: 64px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
