:root {
  color-scheme: light;
  --canvas: #f3f4f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --ink: #17201e;
  --muted: #737b77;
  --line: #dde1dc;
  --line-strong: #cbd1ca;
  --gold: #b58a37;
  --gold-soft: #f5ecda;
  --jade: #297d6b;
  --jade-soft: #e4f1ed;
  --danger: #b24f49;
  --sidebar: #121a18;
  --shadow: 0 16px 40px rgba(24, 31, 29, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(440px, 0.85fr);
  background: var(--surface);
}

.login-visual {
  position: relative;
  min-height: 680px;
  padding: 34px 42px 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(45, 22, 15, 0.18), rgba(24, 16, 14, 0.78)),
    url("/assets/guild-fortress.png?v=20260824") center 48% / cover;
  color: #f3ecdc;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(10, 16, 15, 0.25), transparent 45%);
}

.login-brand,
.sidebar-brand,
.login-brand p,
.sidebar-brand p,
.workspace-header,
.workspace-header > div,
.header-actions,
.sync-status,
.stats-band article,
.stats-band article > p,
.records-toolbar,
.records-toolbar > div,
.filters,
.search-field,
.date-field,
.group-heading,
.group-heading > div,
.record-row,
.player-cell,
.time-cell,
.row-actions,
.status-label,
.sidebar-footer,
.screenshot-dialog header,
.screenshot-dialog header > div,
.back-link,
.credential-field,
.login-button {
  display: flex;
  align-items: center;
}

.login-brand,
.sidebar-brand {
  gap: 12px;
}

.login-brand > span,
.sidebar-brand > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 209, 140, 0.62);
  color: #ead18c;
  font-family: "Songti SC", STSong, serif;
  font-size: 21px;
}

.login-brand p,
.sidebar-brand p {
  margin: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.login-brand strong,
.sidebar-brand strong {
  font-size: 14px;
}

.login-brand small,
.sidebar-brand small {
  color: rgba(239, 233, 218, 0.56);
  font-size: 9px;
}

.login-quote p {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.25;
}

.login-quote span {
  display: block;
  margin-top: 14px;
  color: rgba(242, 236, 221, 0.6);
  font-size: 13px;
}

.login-panel {
  min-height: 680px;
  padding: 56px 10vw;
  display: grid;
  place-items: center;
}

.login-panel form {
  width: min(100%, 390px);
}

.back-link {
  width: fit-content;
  margin-bottom: 66px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.back-link svg {
  width: 16px;
}

.login-panel h1 {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 34px;
}

.login-description {
  margin: 10px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.login-control + .login-control {
  margin-top: 18px;
}

.credential-field {
  min-height: 52px;
  padding-left: 14px;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.credential-field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181, 138, 55, 0.09);
}

.credential-field > svg {
  width: 17px;
  color: var(--gold);
}

.credential-field input {
  min-width: 0;
  height: 50px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.credential-field button {
  width: 48px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.credential-field button svg {
  width: 17px;
}

.login-error {
  min-height: 18px;
  margin: 7px 0 3px;
  color: var(--danger);
  font-size: 11px;
}

.login-error.is-success {
  color: var(--jade);
}

.login-button {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  justify-content: space-between;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-button svg {
  width: 17px;
}

.demo-hint {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.demo-hint code {
  color: var(--jade);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  width: 232px;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #e9ece7;
}

.sidebar-brand {
  padding: 0 8px 30px;
}

.sidebar nav {
  flex: 1;
}

.sidebar nav > p {
  margin: 0 10px 10px;
  color: #68716d;
  font-size: 10px;
}

.sidebar nav a,
.sidebar nav button {
  width: 100%;
  min-height: 44px;
  margin-bottom: 5px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aeb6b1;
  font-size: 12px;
}

.sidebar nav button {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sidebar nav a:hover,
.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f2f4f0;
}

.sidebar nav a.is-active {
  border-left: 2px solid #d0ad61;
  background: rgba(212, 182, 114, 0.1);
  color: #f2e4c6;
}

.sidebar nav a > svg,
.sidebar nav button > svg {
  width: 17px;
}

.sidebar nav a > span {
  min-width: 23px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  color: #c6ccc8;
  font-size: 9px;
}

.sidebar nav .nav-tail {
  width: 13px;
  margin-left: auto;
  color: #68716d;
}

.sidebar-footer {
  padding: 15px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 9px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #30473f;
  color: #cbe3da;
  font-size: 12px;
}

.sidebar-footer p {
  min-width: 0;
  margin: 0;
  flex: 1;
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.sidebar-footer strong {
  font-size: 11px;
}

.sidebar-footer span {
  margin-top: 2px;
  color: #76807a;
  font-size: 9px;
}

.sidebar-footer button,
.mobile-menu,
.icon-button,
.screenshot-dialog header button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sidebar-footer button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #78827c;
}

.sidebar-footer button:hover {
  color: #e7ebe7;
}

.sidebar-footer button svg {
  width: 15px;
}

.workspace {
  min-width: 0;
  grid-column: 2;
  padding: 20px 28px 40px;
}

.workspace-header {
  min-height: 50px;
  justify-content: space-between;
  gap: 24px;
}

.workspace-header > div:first-child {
  gap: 12px;
}

.workspace-header h1 {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 24px;
}

.workspace-header h1 + p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.mobile-menu {
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
}

.mobile-menu svg {
  width: 20px;
}

.header-actions {
  gap: 9px;
}

.sync-status {
  margin-right: 5px;
  gap: 6px;
  color: var(--jade);
  font-size: 10px;
}

.sync-status svg {
  width: 14px;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.primary-button svg,
.secondary-button svg {
  width: 15px;
}

.stats-band {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(25, 35, 31, 0.04);
}

.stats-band article {
  min-height: 76px;
  padding: 14px 20px;
  gap: 12px;
}

.stats-band article + article {
  border-left: 1px solid var(--line);
}

.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.stat-icon svg {
  width: 17px;
}

.stat-icon.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.stat-icon.jade {
  background: var(--jade-soft);
  color: var(--jade);
}

.stat-icon.graphite {
  background: #e9ece9;
  color: #394541;
}

.stats-band article > p {
  min-width: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 3px 5px;
}

.stats-band small {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}

.stats-band strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 21px;
}

.stats-band p span {
  align-self: flex-end;
  padding-bottom: 3px;
  color: #9aa19d;
  font-size: 9px;
}

.records-tool {
  min-height: 390px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.records-toolbar {
  min-height: 54px;
  padding: 9px 16px 9px 18px;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.records-toolbar > div:first-child {
  flex: 0 0 auto;
  align-items: baseline;
  gap: 10px;
}

.records-toolbar h2 {
  margin: 0;
  font-size: 15px;
}

.records-toolbar h2 + span {
  color: var(--muted);
  font-size: 10px;
}

.filters {
  justify-content: flex-end;
  gap: 8px;
}

.search-field,
.date-field {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.search-field {
  width: 180px;
  padding: 0 10px;
  gap: 7px;
}

.search-field:focus-within,
.date-field:focus-within {
  border-color: #aeb6af;
}

.search-field svg {
  width: 14px;
  color: #8f9792;
}

.search-field input,
.date-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}

.search-field input {
  width: 100%;
  height: 30px;
}

.date-field {
  padding: 0 8px;
  gap: 5px;
}

.date-field span {
  color: #969e99;
  font-size: 9px;
}

.date-field input {
  width: 108px;
}

.filters .icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #727c77;
}

.filters .icon-button:hover {
  background: var(--surface-soft);
}

.filters .icon-button svg {
  width: 15px;
}

.loading-state,
.empty-state {
  min-height: 310px;
  padding: 50px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  text-align: center;
}

.loading-state {
  gap: 10px;
  font-size: 11px;
}

.loading-state svg {
  width: 20px;
  color: var(--gold);
}

.empty-state > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: #eef0ed;
  color: #8e9791;
}

.empty-state svg {
  width: 20px;
}

.empty-state h3 {
  margin: 14px 0 5px;
  color: #4a5551;
  font-size: 13px;
}

.empty-state p {
  margin: 0;
  font-size: 10px;
}

.group-block + .group-block {
  border-top: 10px solid var(--canvas);
}

.group-heading {
  min-height: 42px;
  padding: 0 16px;
  justify-content: space-between;
  background: #f6f0e3;
  border-top: 1px solid #dfd2b7;
  border-bottom: 1px solid #dfd2b7;
  box-shadow: inset 4px 0 0 var(--gold);
}

.group-heading > div {
  gap: 9px;
}

.group-heading time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
}

.group-heading strong {
  color: #785d28;
  font-size: 12px;
}

.group-heading span {
  color: var(--muted);
  font-size: 9px;
}

.group-heading > span {
  padding: 3px 7px;
  border: 1px solid #dfd2b7;
  background: rgba(255, 255, 255, 0.68);
  color: #785d28;
  font-weight: 700;
}

.group-player-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #dfeae5;
  color: var(--jade) !important;
  font-size: 10px !important;
  font-weight: 700;
}

.person-subgroups {
  background: #fff;
}

.person-subgroup + .person-subgroup {
  border-top: 2px solid var(--canvas);
}

.person-subheading {
  min-height: 32px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e5ebe6;
  background: #f4f8f5;
}

.person-subheading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.person-subheading strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.person-subheading > span {
  flex: 0 0 auto;
  padding: 2px 7px;
  background: var(--surface);
  color: var(--jade);
  border: 1px solid #d8e6de;
  font-size: 9px;
}

.table-head,
.record-row {
  display: grid;
  grid-template-columns: 54px minmax(130px, 1.3fr) minmax(120px, 1fr) minmax(120px, 1fr) 80px;
  align-items: center;
  column-gap: 12px;
}

.table-head {
  min-height: 28px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: #959d98;
  font-size: 9px;
}

.record-row {
  min-height: 50px;
  padding: 6px 16px;
  border-bottom: 1px solid #edf0ec;
}

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

.record-row:hover {
  background: #fbfcfa;
}

.screenshot-thumb {
  width: 46px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #e9ece8;
  cursor: zoom-in;
}

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

.player-cell {
  min-width: 0;
  gap: 7px;
}

.player-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #edf1ed;
  color: #51605b;
  font-size: 10px;
  font-weight: 700;
}

.player-cell > span {
  min-width: 0;
}

.player-cell strong,
.player-cell small,
.time-cell strong,
.time-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-cell strong {
  font-size: 11px;
}

.player-cell small {
  margin-top: 1px;
  color: #9aa19d;
  font-size: 9px;
}

.time-cell {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.time-cell strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.time-cell span {
  color: #9aa19d;
  font-size: 9px;
}

.status-label {
  width: fit-content;
  gap: 6px;
  color: var(--jade);
  font-size: 10px;
}

.status-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52a18e;
}

.row-actions {
  min-width: 0;
  justify-content: space-between;
  gap: 4px;
}

.delete-record-button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: #a2a8a4;
  cursor: pointer;
}

.delete-record-button:hover {
  border-color: #e5c7c4;
  background: #fbefee;
  color: var(--danger);
}

.delete-record-button svg {
  width: 14px;
}

.screenshot-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0;
  background: #0c100f;
  color: #f0f1ed;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.65);
}

.screenshot-dialog::backdrop {
  background: rgba(5, 8, 7, 0.84);
  backdrop-filter: blur(4px);
}

.screenshot-dialog header {
  min-height: 62px;
  padding: 0 12px 0 18px;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.screenshot-dialog header > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.screenshot-dialog header p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.screenshot-dialog header span {
  color: #78817c;
  font-size: 9px;
}

.screenshot-dialog header button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #9ca49f;
}

.screenshot-dialog header button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.screenshot-dialog header button svg {
  width: 18px;
}

.screenshot-stage {
  height: min(76vh, 760px);
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(45deg, #0e1311 25%, transparent 25%),
    linear-gradient(-45deg, #0e1311 25%, transparent 25%),
    #0b0e0d;
  background-size: 16px 16px;
}

.screenshot-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.password-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(13, 20, 18, 0.28);
}

.password-dialog::backdrop {
  background: rgba(9, 14, 12, 0.64);
  backdrop-filter: blur(3px);
}

.password-dialog form {
  margin: 0;
}

.password-dialog header {
  min-height: 72px;
  padding: 14px 14px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.password-dialog header .eyebrow {
  margin-bottom: 3px;
}

.password-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.password-dialog header > button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-dialog header > button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.password-dialog header > button svg {
  width: 18px;
}

.password-dialog-body {
  padding: 18px 20px 10px;
}

.password-dialog-body label {
  display: block;
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 700;
}

.password-dialog-body .password-input + label {
  margin-top: 15px;
}

.password-input {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.password-input:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181, 138, 55, 0.09);
}

.password-input svg {
  width: 16px;
  color: var(--gold);
}

.password-input input {
  min-width: 0;
  height: 42px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.password-form-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.password-dialog footer {
  min-height: 62px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.dialog-secondary-button,
.dialog-primary-button {
  min-height: 36px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.dialog-secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.dialog-primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.dialog-primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.dialog-primary-button svg {
  width: 15px;
}

.delete-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(13, 20, 18, 0.28);
}

.delete-dialog::backdrop {
  background: rgba(9, 14, 12, 0.64);
  backdrop-filter: blur(3px);
}

.delete-dialog form {
  margin: 0;
}

.delete-dialog header {
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.delete-dialog header > div {
  min-width: 0;
  flex: 1;
}

.delete-dialog header .eyebrow {
  margin-bottom: 3px;
  color: var(--danger);
}

.delete-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.delete-dialog-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #fbefee;
  color: var(--danger);
}

.delete-dialog-icon svg {
  width: 17px;
}

.delete-dialog header > button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.delete-dialog header > button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.delete-dialog header > button svg {
  width: 18px;
}

.delete-dialog-body {
  padding: 20px 20px 12px;
}

.delete-dialog-body > p:first-child {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 700;
}

.delete-dialog-body > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.delete-form-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.delete-dialog footer {
  min-height: 62px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.dialog-danger-button {
  min-height: 36px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #a8433e;
  background: #a8433e;
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.dialog-danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.dialog-danger-button svg {
  width: 15px;
}

.admin-toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 12px 15px;
  transform: translateY(16px);
  background: var(--ink);
  color: white;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.admin-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.sidebar-scrim {
  display: none;
}

.spin {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1050px) {
  .workspace {
    padding-inline: 22px;
  }

  .records-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 16px;
  }

  .filters {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-field {
    flex: 1 1 180px;
  }
}

@media (max-width: 820px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 280px;
    padding: 24px 28px 30px;
  }

  .login-quote p {
    font-size: 30px;
  }

  .login-panel {
    min-height: auto;
    padding: 42px 24px 70px;
  }

  .back-link {
    margin-bottom: 38px;
  }

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

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 9;
    inset: 0;
    display: block;
    background: rgba(8, 12, 11, 0.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    grid-column: 1;
  }

  .mobile-menu {
    display: grid;
  }

  .sync-status {
    display: none;
  }

  .stats-band {
    grid-template-columns: 1fr;
  }

  .stats-band article {
    min-height: 88px;
  }

  .stats-band article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .table-head {
    display: none;
  }

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

  .record-row .time-cell:nth-of-type(3) {
    display: none;
  }

  .record-row .row-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 20px 12px 40px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-header > div:first-child {
    width: 100%;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    flex: 1;
    justify-content: center;
  }

  .records-toolbar {
    padding-inline: 14px;
  }

  .date-field {
    flex: 1 1 130px;
  }

  .date-field input {
    width: 100%;
  }

  .group-heading {
    padding-inline: 14px;
  }

  .group-heading > div {
    flex-wrap: wrap;
  }

  .person-subheading {
    padding-inline: 14px;
  }

  .record-row {
    min-height: 82px;
    padding-inline: 14px;
    grid-template-columns: 68px minmax(0, 1fr) 66px;
    column-gap: 9px;
  }

  .player-cell .player-avatar {
    display: none;
  }

  .row-actions .status-label {
    gap: 0;
    font-size: 0;
  }

  .screenshot-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .password-dialog footer,
  .delete-dialog footer {
    padding-inline: 14px;
  }

  .password-dialog footer button,
  .delete-dialog footer button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
