:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  background: #f6f5f2;
  color: #25212b;
  line-height: 1.5;
  --muted: #625c68;
  --accent: #584079;
  --tint: #eee8f5;
  --border: #ded9e2;
  --surface: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.05rem;
}
p,
small {
  color: var(--muted);
}
small {
  display: block;
  font-size: 0.85rem;
}
p + p {
  margin-top: 0.75rem;
}
.app-header {
  background: #272031;
  color: white;
  min-height: 68px;
  padding: 0.65rem max(1rem, calc((100vw - 1376px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.brand,
.account,
.toolbar,
.dialog-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.brand {
  gap: 0.7rem;
  font-weight: 750;
}
.brand small {
  display: inline;
  color: #ded0ed;
  margin-left: 0.35rem;
  font-weight: 500;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e9dcf8;
  color: #423057;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}
button,
.file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}
button:hover,
.file:hover {
  background: var(--tint);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
}
.primary:hover {
  background: #463261;
}
.account button {
  background: transparent;
  border-color: #736581;
}
.account button:hover {
  background: #42364e;
}
.welcome,
.empty,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}
.welcome,
.empty {
  padding: clamp(1.25rem, 5vw, 3rem);
}
.welcome {
  width: min(35rem, calc(100% - 2rem));
  margin: clamp(1.5rem, 7vw, 5rem) auto 1rem;
}
.welcome p,
.empty p {
  margin: 0.75rem 0 1.25rem;
}
#status {
  margin: 1rem auto 0;
  width: min(1376px, calc(100% - 2rem));
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  overflow-wrap: anywhere;
}
#status[data-error='true'],
#tester-status[data-error='true'] {
  background: #fff1ef;
  color: #862c24;
  border-color: #d18279;
}
#workspace {
  width: min(1376px, calc(100% - 2rem));
  margin: 1rem auto 3rem;
  display: grid;
  grid-template-columns: minmax(190px, 245px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}
aside {
  min-width: 0;
  padding: 0.75rem 0;
}
aside h2 {
  margin-bottom: 0.85rem;
}
aside > button,
.file {
  width: 100%;
}
.import-control {
  margin: 0.5rem 0 1rem;
}
#drafts {
  display: grid;
  gap: 0.3rem;
}
#drafts p {
  padding: 0.5rem;
  font-size: 0.875rem;
}
.draft {
  justify-content: flex-start;
  text-align: left;
  overflow-wrap: anywhere;
  border-color: transparent;
  background: transparent;
}
.draft[aria-current='true'],
.editor-nav [aria-current='true'] {
  background: var(--tint);
  color: #493261;
  border-color: #d9cbe7;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.55rem 0 1rem;
}
.editor-heading {
  min-width: 0;
}
#draft-state {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}
.editor-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.editor-nav button {
  background: transparent;
  border-color: transparent;
}
.editor-nav button:hover {
  background: var(--tint);
}
.editor-panel {
  padding: clamp(1rem, 3vw, 2rem);
}
.editor-panel > h2 {
  margin-bottom: 0.85rem;
}
.editor-panel > p {
  margin-top: 0.85rem;
}
label {
  display: block;
  margin: 0.95rem 0;
  font-weight: 650;
  font-size: 0.9rem;
}
label small {
  font-weight: 400;
  margin-top: 0.35rem;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #afa7b7;
  border-radius: 0.5rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  margin-top: 0.3rem;
}
input[readonly] {
  background: #f4f2f6;
}
textarea {
  resize: vertical;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.check input {
  width: 1.2rem;
  min-height: 0;
  height: 1.2rem;
  margin: 0;
  accent-color: var(--accent);
}
.row {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.row label {
  flex: 1 1 12rem;
  margin: 0;
}
#character-fields > h3 {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.section {
  background: #f7f5f9;
  padding: 1rem;
  border-radius: 0.65rem;
  margin: 0.75rem 0;
}
.section label:first-child {
  margin-top: 0;
}
details {
  margin-top: 1rem;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
}
#sources {
  overflow-wrap: anywhere;
}
dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: 88vh;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  color: inherit;
}
dialog::backdrop {
  background: #24182eb3;
}
.dialog-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
}
#test-access {
  max-width: 30rem;
}
#tester-status {
  margin-top: 1rem;
  padding: 0.65rem;
  border-radius: 0.5rem;
  background: var(--tint);
}
#preview-content h4 {
  margin: 1rem 0 0.25rem;
}
#preview-content p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
:focus-visible,
.import-control input:focus-visible + label {
  outline: 3px solid #9460c6;
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 680px) {
  #workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--border);
  }
  #drafts {
    max-height: 10rem;
    overflow: auto;
  }
}

#admin-nav,
#operations {
  width: min(1376px, calc(100% - 2rem));
  margin: 1rem auto;
}
#admin-nav {
  display: flex;
  gap: 0.5rem;
}
#admin-nav [aria-current='page'] {
  background: var(--tint);
  color: var(--accent);
  border-color: #d9cbe7;
}
#operations {
  margin-bottom: 3rem;
}
#operations .editor-heading p {
  margin-top: 0.35rem;
}
.monitor-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.monitor-heading span {
  color: var(--muted);
  font-size: 0.85rem;
}
.party-filters {
  margin-top: 1rem;
  max-width: 42rem;
}
.party-table {
  overflow-x: auto;
  margin-top: 0.6rem;
}
.party-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.party-table th,
.party-table td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.party-table th {
  white-space: nowrap;
  background: #f7f5f9;
}
.party-table td:first-child {
  min-width: 12rem;
  overflow-wrap: anywhere;
}
.party-table td:last-child {
  min-width: 10rem;
}
.party-table small {
  margin-top: 0.2rem;
}
.party-stage {
  display: inline-block;
  background: var(--tint);
  color: var(--accent);
  border-radius: 0.4rem;
  padding: 0.12rem 0.4rem;
  white-space: nowrap;
}
.party-stage[data-status='complete'] {
  background: #e3f2e8;
  color: #25583b;
}
#party-feedback {
  font-size: 0.9rem;
}
#party-feedback[data-error='true'] {
  color: #862c24;
}
#more-parties {
  margin-top: 0.85rem;
}
.coverage p {
  margin-top: 0.65rem;
}

#users {
  width: min(1376px, calc(100% - 2rem));
  margin: 1rem auto 3rem;
}
#users .editor-heading p {
  margin-top: 0.35rem;
}
#user-search-form {
  margin-top: 0;
}
#user-feedback,
#user-party-feedback {
  font-size: 0.9rem;
}
#user-feedback[data-error='true'],
#user-party-feedback[data-error='true'] {
  color: #862c24;
}
#user-details-account {
  overflow-wrap: anywhere;
  margin-bottom: 0.65rem;
}
#user-party-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#user-party-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  overflow-wrap: anywhere;
}
.load-more {
  margin-top: 0.85rem;
}

.party-link {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  justify-content: flex-start;
  padding-inline: 0.35rem;
  margin-inline-start: -0.35rem;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}
#party-details-title,
#party-details-id {
  overflow-wrap: anywhere;
}
#party-details-feedback {
  margin: 0.4rem 0 1rem;
  font-size: 0.9rem;
}
#party-details-feedback[data-error='true'] {
  color: #862c24;
}
#party-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.5rem;
  margin: 0.6rem 0 1.35rem;
}
#party-progress > div {
  background: #f7f5f9;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
}
#party-progress dt {
  font-size: 0.8rem;
  color: var(--muted);
}
#party-progress dd {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-weight: 650;
}
#party-character-list,
#party-character-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#party-character-list > li {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}
.character-invite-heading,
#party-character-list li li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
}
#party-character-list li li {
  margin-top: 0.4rem;
}
#party-character-list .party-stage {
  font-size: 0.8rem;
}
.party-stage[data-status='active'],
.party-stage[data-status='claimed'] {
  background: #e3f2e8;
  color: #25583b;
}
.party-stage[data-status='expired'],
.party-stage[data-status='revoked'] {
  background: #f7e8e4;
  color: #7e382d;
}
#party-invite-note {
  margin-top: 0.45rem;
  font-size: 0.875rem;
}

#unlock-current-round,
#unlock-round-announcement {
  border-color: #d9cbe7;
  color: var(--accent);
}
.party-audit {
  margin: 0.75rem 0 1.35rem;
}
#party-audit-empty {
  margin-top: 0.45rem;
  font-size: 0.875rem;
}
#party-audit-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}
#party-audit-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
