:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #e8edf0;
  background: #0f1d27
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

main {
  max-width: 1180px;
  margin: auto;
  padding: 24px
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334856;
  padding-bottom: 20px
}

header a {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none
}

header span {
  font-size: 14px;
  color: #b9cbd5;
  margin-left: 12px
}

a {
  color: #d5b877
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0
}

nav a {
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none
}

.active,
button.primary {
  background: #d5b877;
  color: #14232e
}

h1 {
  font-size: 28px
}

h2 {
  font-size: 20px
}

p {
  line-height: 1.6;
  color: #b9cbd5
}

label {
  display: block;
  margin: 12px 0;
  color: #b9cbd5
}

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #476171;
  border-radius: 5px;
  background: #172c3b;
  color: white;
  padding: 11px;
  font: inherit
}

textarea {
  font-family: ui-monospace, monospace;
  font-size: 13px
}

button {
  padding: 10px 15px;
  border: 1px solid #476171;
  border-radius: 5px;
  background: #203747;
  color: #fff;
  cursor: pointer;
  font: inherit
}

button:disabled {
  opacity: .4;
  cursor: default
}

button:hover {
  border-color: #d5b877
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #d5b877;
  outline-offset: 3px
}

.message {
  border-left: 4px solid #b5d49f;
  background: #203528;
  padding: 14px;
  color: white
}

.error {
  border-color: #ff9c9c;
  background: #3e232c
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px
}

.cards section,
.gallery-card,
fieldset {
  border: 1px solid #334856;
  background: #162a38;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0
}

.gallery-card img {
  width: 240px;
  max-width: 100%;
  height: 135px;
  object-fit: cover;
  border-radius: 5px
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.login {
  max-width: 440px;
  margin: 60px auto
}

.table-wrap {
  overflow: auto
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 13px
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #334856
}

.status {
  font-size: 24px;
  color: #d5b877
}

.history {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 12px 0
}

iframe {
  width: 100%;
  height: 600px;
  border: 1px solid #334856;
  background: white;
  margin-top: 20px
}

[hidden] {
  display: none !important
}

@media(max-width:600px) {
  main {
    padding: 16px
  }

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

input[type=checkbox] {
  display: inline-block;
  width: auto;
  margin: 0 8px 0 0;
  padding: 0
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid #476171;
  border-radius: 8px;
  background: #203747;
  color: #fff;
  text-decoration: none;
  font: inherit
}

.admin-button.primary {
  background: #d5b877;
  color: #14232e
}

.admin-button:hover {
  border-color: #d5b877
}

.brief-list {
  border: 1px solid #334856;
  border-radius: 14px;
  margin: 24px 0
}

.brief-list table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto
}

.brief-list th {
  color: #d5b877;
  background: #162a38;
  white-space: nowrap
}

.brief-list th,
.brief-list td {
  padding: 16px;
  border-bottom: 1px solid #334856;
  vertical-align: middle
}

.brief-list tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .035)
}

.brief-list tbody tr:hover {
  background: rgba(213, 184, 119, .065)
}

.brief-list tr:last-child td {
  border-bottom: 0
}

.brief-list td:first-child {
  font-weight: 600;
  white-space: nowrap
}

.brief-list td:nth-child(2) {
  width: 50%
}

.brief-list .actions {
  min-width: 160px;
  gap: 8px
}

.brief-list a {
  text-decoration: none
}

.brief-editor-tabs {
  gap: 6px;
  border-bottom: 1px solid #476171;
  padding-bottom: 10px
}

.brief-editor-tabs button[aria-selected=true] {
  background: #d5b877;
  color: #14232e
}

.brief-rich-editor {
  min-height: 320px;
  background: #172c3b;
  border: 1px solid #476171;
  border-radius: 8px;
  padding: 20px;
  line-height: 1.6;
  overflow: auto
}

.brief-rich-editor:focus {
  outline: 2px solid #d5b877;
  outline-offset: 3px
}

.brief-rich-editor h2,
.brief-rich-editor h3 {
  margin-top: 16px
}

.brief-rich-editor td,
.brief-rich-editor th {
  border: 1px solid #476171
}

.brief-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0
}

.brief-migration {
  margin-top: 48px;
  border-top: 1px solid #334856;
  padding-top: 20px
}

#brief-editor {
  scroll-margin-top: 20px
}

.brief-format-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #162a38;
  padding: 12px;
  border: 1px solid #476171;
  border-radius: 8px
}

.brief-format-toolbar select {
  width: auto;
  margin: 0;
  padding: 8px
}

.brief-format-toolbar button {
  padding: 8px 10px
}

.brief-rich-editor {
  min-height: 440px
}

.brief-rich-editor table {
  width: 100%;
  border-collapse: collapse
}

.brief-rich-editor th {
  background: #203747;
  color: #d5b877
}

.brief-rich-editor th,
.brief-rich-editor td {
  padding: 12px;
  border: 1px solid #476171;
  min-width: 70px
}

.brief-rich-editor tbody tr:nth-child(even) {
  background: #ffffff08
}

.brief-rich-editor img {
  max-width: 100%;
  height: auto
}

.brief-rich-editor blockquote {
  border-left: 3px solid #d5b877;
  padding-left: 16px
}

.brief-rich-editor a {
  color: #d5b877;
  text-decoration: underline
}

.backend-nav {
  align-items: center;
  padding: 8px;
  background: #162a38;
  border: 1px solid #334856;
  border-radius: 10px;
  position: relative;
  z-index: 10
}

.backend-nav details {
  position: relative
}

.backend-nav summary {
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 6px;
  color: #e8edf0
}

.backend-nav details[data-current] summary {
  color: #d5b877
}

.backend-nav details>div {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #162a38;
  border: 1px solid #476171;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 28px #0006
}

.backend-nav details a {
  display: block
}

.backend-nav a:hover,
.backend-nav summary:hover {
  background: #203747
}

.editor-more {
  position: relative
}

.editor-more summary {
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid #476171;
  border-radius: 5px
}

.editor-more>div {
  position: absolute;
  right: 0;
  top: 100%;
  width: 280px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: #162a38;
  border: 1px solid #476171;
  box-shadow: 0 8px 24px #0006;
  z-index: 5
}

.brief-format-toolbar {
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px
}

.brief-rich-editor {
  min-height: 280px
}

.visual-field {
  margin: 18px 0
}

.plain-text-editor .brief-rich-editor {
  min-height: 100px;
  white-space: pre-wrap
}

.fine-print {
  font-size: 13px;
  margin: 8px 0
}

.backend-nav summary:focus-visible,
.editor-more summary:focus-visible {
  outline: 2px solid #d5b877;
  outline-offset: 2px
}

@media(max-width:600px) {
  .backend-nav details>div {
    position: static
  }

  .editor-more>div {
    right: auto;
    left: 0
  }
}

.access-tree {
  margin: 24px 0;
  border: 1px solid #334856;
  border-radius: 12px;
  background: #162a38;
  padding: 16px
}

.access-tree ul {
  list-style: none;
  margin: 8px 0 8px 12px;
  padding: 0 0 0 16px;
  border-left: 1px solid #476171
}

.access-tree summary {
  padding: 12px;
  cursor: pointer;
  color: #d5b877;
  font-weight: 600;
  border-radius: 6px
}

.access-tree summary:hover {
  background: #203747
}

.access-tree summary:focus-visible {
  outline: 2px solid #d5b877;
  outline-offset: 2px
}

.access-leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 12px;
  border-bottom: 1px solid #334856
}

.access-leaf:last-child {
  border-bottom: 0
}

.access-page-name {
  min-width: 0
}

.access-page-name small {
  display: block;
  color: #b9cbd5;
  font-size: 12px;
  margin-top: 6px;
  overflow-wrap: anywhere
}

.access-leaf form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-shrink: 0
}

.access-leaf select {
  width: 210px;
  margin: 0
}

.access-tree-actions {
  margin-top: 24px
}

@media(max-width:700px) {
  .access-leaf {
    align-items: stretch;
    flex-direction: column;
    gap: 12px
  }

  .access-leaf form {
    flex-wrap: wrap
  }

  .access-leaf select {
    flex: 1;
    min-width: 150px
  }

  .access-tree ul {
    margin-left: 4px;
    padding-left: 10px
  }
}

.pilot-member-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.pilot-member-results button {
  text-align: left
}

.pilot-config-divider {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid #476171
}
