:root {
  color-scheme: light;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  background: #f4f1ea;
  color: #1c1915;
  --wv-banner-font: Georgia, serif;
  --wv-banner-color: #1c1915;
  --wv-banner-size: 16px;
  --wv-heading-font: Georgia, serif;
  --wv-heading-color: #1c1915;
  --wv-heading-size: 24px;
  --wv-label-font: Georgia, serif;
  --wv-label-color: #1c1915;
  --wv-label-size: 14px;
  --wv-input-font: Georgia, serif;
  --wv-input-color: #1c1915;
  --wv-input-size: 16px;
  --wv-button-font: Georgia, serif;
  --wv-button-color: #f7f4ee;
  --wv-button-size: 16px;
  --wv-table-font: Consolas, monospace;
  --wv-table-color: #1c1915;
  --wv-table-size: 13px;
  --wv-error-font: Georgia, serif;
  --wv-error-color: #8a2a1a;
  --wv-error-size: 16px;
}

body {
  margin: 0 auto;
  max-width: 960px;
  padding: 1.5rem;
}

#login-banner {
  margin: 0 0 1rem;
  padding: 0.45rem 0.7rem;
  background: #fffdf8;
  border: 1px solid #d9d2c5;
  border-radius: 6px;
  font-family: var(--wv-banner-font);
  font-size: var(--wv-banner-size);
  color: var(--wv-banner-color);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

#app-nav {
  display: flex;
  gap: 0.5rem;
  margin-right: auto;
}

#app-nav[hidden] {
  display: none;
}

#app-nav a {
  color: #1c1915;
  text-decoration: none;
  border: 1px solid #b7ad9e;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  background: #fffdf8;
}

#app-nav a[aria-current="page"] {
  background: #3d4a34;
  border-color: #3d4a34;
  color: #f7f4ee;
}

@media (max-width: 640px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title logout"
      "nav nav";
    align-items: center;
  }

  header h1 {
    grid-area: title;
  }

  #logout {
    grid-area: logout;
    justify-self: end;
  }

  #app-nav {
    grid-area: nav;
    margin-right: 0;
  }

  .logs-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .logs-heading .user-picker {
    margin-left: 0;
    width: 100%;
  }

  .logs-heading .user-picker input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
  }

  #logs-form,
  #logs-form label {
    max-width: 100%;
    min-width: 0;
  }

  #filter-event,
  #filter-plan {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

h1, h2 {
  font-weight: 600;
  letter-spacing: 0;
  font-family: var(--wv-heading-font);
  font-size: var(--wv-heading-size);
  color: var(--wv-heading-color);
}

h1 {
  margin: 0;
}

.logs-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.logs-heading h2 {
  margin: 0;
}

.logs-heading .user-picker {
  flex: 1 1 42ch;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

.logs-heading .user-picker-field > label {
  flex: 1 1 42ch;
  min-width: 0;
}

#admin-account-filter {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

section {
  background: #fffdf8;
  border: 1px solid #d9d2c5;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--wv-label-font);
  font-size: var(--wv-label-size);
  color: var(--wv-label-color);
}

input,
select {
  font-family: var(--wv-input-font);
  font-size: var(--wv-input-size);
  color: var(--wv-input-color);
  min-width: 16rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #b7ad9e;
  border-radius: 4px;
  background: #fff;
}

button {
  font-family: var(--wv-button-font);
  font-size: var(--wv-button-size);
  padding: 0.45rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #3d4a34;
  background: #3d4a34;
  color: var(--wv-button-color);
  cursor: pointer;
}

button:hover {
  background: #2c3626;
}

#logout {
  background: transparent;
  color: #1c1915;
  border-color: #1c1915;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--wv-table-font);
  font-size: var(--wv-table-size);
  color: var(--wv-table-color);
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e4ddd2;
}

th {
  font-family: inherit;
  font-size: inherit;
}

p[role="alert"],
#explorer-delete-status.is-error,
#plan-delete-status.is-error,
#activity-delete-status.is-error,
#logs-status.is-error,
#settings-status.is-error {
  font-family: var(--wv-error-font);
  font-size: var(--wv-error-size);
  color: var(--wv-error-color);
}

#settings-form h2,
#style-fields {
  flex: 1 0 100%;
}

#style-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.style-type {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0;
  border: 1px solid #d9d2c5;
  border-radius: 6px;
  padding: 0.6rem 0.8rem 0.8rem;
}

.style-type legend {
  padding: 0 0.3rem;
  font-family: var(--wv-label-font);
  font-size: var(--wv-label-size);
  color: var(--wv-label-color);
}

.style-type select {
  min-width: 12rem;
}

.style-type input[type="color"] {
  min-width: 3rem;
  width: 3rem;
  padding: 0.15rem;
}

.style-type input[type="number"] {
  min-width: 5.5rem;
}

#explorer-delete-plans {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.explorer-delete {
  margin-top: 0.8rem;
}

#explorer-dialog,
#plan-dialog,
#activity-dialog {
  border: 1px solid #d9d2c5;
  border-radius: 8px;
  background: #fffdf8;
  color: #1c1915;
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.2rem;
}

#explorer-dialog::backdrop,
#plan-dialog::backdrop,
#activity-dialog::backdrop {
  background: rgba(28, 25, 21, 0.35);
}

.explorer-plan-row,
.explorer-activity-row {
  cursor: pointer;
}

.explorer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.explorer-bar h2 {
  margin: 0;
}

.explorer-fields {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.8rem;
}

.explorer-fields dt {
  margin: 0;
  font-weight: 600;
}

.explorer-fields dd {
  margin: 0;
}

#filter-event {
  width: 18rem;
  max-width: 100%;
  min-width: 0;
}

.user-picker-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
}

.user-picker-field > label {
  flex: 1 1 12rem;
  min-width: 0;
}

.user-picker-clear {
  background: transparent;
  color: #1c1915;
  border-color: #1c1915;
}

.filter-clearable {
  position: relative;
  display: block;
}

.filter-clearable input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 1.75rem;
}

.filter-clear {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1c1915;
  line-height: 1;
}

.filter-clear:hover {
  background: transparent;
  color: #1c1915;
}

.plan-menu {
  position: fixed;
  z-index: 6;
  margin: 0;
  padding: 0.15rem 0;
  list-style: none;
  background: #fffdf8;
  border: 1px solid #b7ad9e;
  border-radius: 4px;
  min-width: 11rem;
  max-width: calc(100vw - 1rem);
  box-shadow: 0 2px 8px rgba(28, 25, 21, 0.12);
}

.plan-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fffdf8;
  color: #1c1915;
  border: 0;
  border-radius: 0;
}

.plan-menu button:hover {
  background: #f4f1ea;
}

.user-picker-chosen {
  margin: 0.2rem 0 0;
  min-height: 1.1em;
  font-size: 0.85rem;
}

.user-picker-results {
  position: absolute;
  z-index: 3;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fffdf8;
  border: 1px solid #b7ad9e;
  border-radius: 4px;
  max-height: 14rem;
  overflow: auto;
}

.user-picker-results button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fffdf8;
  color: #1c1915;
  border: 0;
  border-bottom: 1px solid #e4ddd2;
  border-radius: 0;
}

.user-picker-results li:last-child button {
  border-bottom: 0;
}

.user-picker-results button:hover {
  background: #f4f1ea;
}

.user-picker-note {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}
