:root {
  --space: 8px;

  --surface-1: #eae4df;
  --surface-2: #f1edea;
  --surface-3: #f9f4f1;

  --ink: #011627;
  --ink-rgb: 1 22 39;
  --ink-70: rgb(var(--ink-rgb) / .7);
  --ink-40: rgb(var(--ink-rgb) / .4);
  --ink-10: rgb(var(--ink-rgb) / .1);

  --accent: #8b1e2d;
  --accent-rgb: 139 30 45;
  --accent-70: rgb(var(--accent-rgb) / .7);
  --accent-40: rgb(var(--accent-rgb) / .4);
  --accent-10: rgb(var(--accent-rgb) / .1);
  --accent-text: #7a1a27;
  --accent-surface: #8b1e2d;
  --accent-surface-hover: color-mix(in srgb, var(--accent-surface) 90%, white);

  --danger: #ad2727;
  --danger-rgb: 173 39 39;
  --danger-40: rgb(var(--danger-rgb) / .4);
  --danger-10: rgb(var(--danger-rgb) / .1);
  --danger-text: #9e2323;

  --notice: #f37145;
  --notice-rgb: 243 113 69;
  --notice-10: rgb(var(--notice-rgb) / .1);
  --notice-text: #c4521f;

  --success: #006833;
  --success-rgb: 0 104 51;
  --success-10: rgb(var(--success-rgb) / .1);
  --success-text: #006833;

  --on-strong: #f6f1ee;
  --shadow-rgb: var(--ink-rgb);
  --panel-radius: var(--space);
  --control-radius: 4px;
  --line: var(--ink-40);
  --scrollbar-thumb: var(--ink-40);
  color-scheme: light;
  color: var(--ink);
  background: var(--surface-1);
  font-family: "IBM Plex Sans", "Calibri", Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}

:root[data-theme="dark"] {
  --surface-1: #14100e;
  --surface-2: #221c19;
  --surface-3: #2d2521;

  --ink: #f0ece9;
  --ink-rgb: 240 236 233;

  --accent: #a83240;
  --accent-rgb: 168 50 64;
  --accent-text: #e0838d;
  --accent-surface: #a83240;

  --danger-text: #e07a7a;
  --notice-text: #f5895f;
  --success: #00823e;
  --success-rgb: 0 130 62;
  --success-text: #3bb273;

  --on-strong: #f0ece9;
  --shadow-rgb: 0 0 0;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
  outline-color: var(--accent-surface);
}

body {
  margin: 0;
  background: var(--surface-1);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
}

/* Buttons carry their hover affordance in --hover-ring so that borderless,
   background-less controls (sidebar links, icon buttons) can opt out with
   `--hover-ring: none` and fill their background instead. */
button,
.button {
  --hover-ring: inset 0 0 0 2px var(--ink-40);
  min-height: 32px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--surface-3);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  font: inherit;
  text-decoration: none;
}

button:hover:not(:disabled),
.button:hover {
  box-shadow: var(--hover-ring);
}

button:disabled {
  color: var(--ink-40);
  cursor: default;
  background: var(--ink-10);
  box-shadow: none;
}

/* Selection is a tint only; the accent ring is its hover response. */
button.selected {
  --hover-ring: inset 0 0 0 2px var(--accent-40);
  background: var(--accent-10);
  color: var(--accent-text);
}

.accent-button,
.danger-button {
  --hover-ring: none;
  font-weight: 700;
}

.accent-button {
  background: var(--accent-surface);
  color: var(--on-strong);
}

.accent-button:hover:not(:disabled),
a.accent-button:hover {
  background: var(--accent-surface-hover);
}

.accent-button:disabled {
  background: var(--accent-10);
  color: var(--accent-text);
}

.danger-button {
  --hover-ring: inset 0 0 0 2px var(--danger-40);
  background: var(--danger-10);
  color: var(--danger-text);
}

.danger-button:disabled {
  background: var(--danger-10);
  color: var(--danger-text);
  opacity: .6;
}

.icon-button {
  --hover-ring: none;
  width: 32px;
  min-height: 32px;
  background: transparent;
  color: var(--ink-70);
  padding: 0;
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--ink);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

button svg {
  flex: none;
}

input,
textarea,
select {
  min-height: 32px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--surface-3);
  color: inherit;
  padding: 5px 10px;
  font: inherit;
}

input {
  cursor: text;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-40);
}

input:not([type="checkbox"]):not([type="radio"]):hover:not(:disabled),
textarea:hover:not(:disabled) {
  box-shadow: inset 0 0 0 2px var(--ink-40);
}

input[type="checkbox"] {
  appearance: none;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-70);
  margin: 0;
  padding: 0;
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  grid-area: 1 / 1;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

input[type="checkbox"]:hover:not(:disabled):not(:checked)::after {
  content: "";
  grid-area: 1 / 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

input[type="checkbox"]:checked {
  color: var(--accent-surface);
}

input[type="checkbox"]:checked::before {
  background: currentColor;
  box-shadow: inset 0 0 0 3px var(--surface-3);
}

input[type="checkbox"]:checked:hover:not(:disabled)::before {
  background: transparent;
  box-shadow: none;
}

input[type="checkbox"]:checked:hover:not(:disabled)::after {
  content: "";
  grid-area: 1 / 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.1;
}

h2 {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden],
.hidden {
  display: none !important;
}

/* Page scaffolding shared by every signed-in page. */
.page-shell {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--space) * 2) calc(var(--space) * 3) calc(var(--space) * 6);
}

.page {
  display: none;
}

.page.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--space) * 2);
}

.page-header {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: var(--space);
}

.page-header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.page-header p {
  color: var(--ink-70);
  font-size: 13px;
  line-height: 1.3;
}

.page-header h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-header h1 b {
  font-weight: 700;
}

.back-btn {
  --hover-ring: none;
  width: 36px;
  min-height: 36px;
  flex: none;
  border-radius: var(--panel-radius);
  background: transparent;
  color: var(--ink);
  padding: 0;
  margin-left: calc(var(--space) * -1);
}

.back-btn:hover:not(:disabled),
a.back-btn:hover {
  background: var(--surface-2);
}

.back-btn svg {
  width: 22px;
  height: 22px;
}

.panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--space) * 1.5);
  border-radius: var(--panel-radius);
  background: var(--surface-2);
  padding: calc(var(--space) * 2);
}

.panel-heading {
  display: grid;
  gap: 2px;
}

.panel-heading p {
  color: var(--ink-70);
  font-size: 13px;
  line-height: 1.3;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-70);
  padding: calc(var(--space) * 2);
  font-size: 14px;
  text-align: center;
}

.loader {
  display: none;
  width: 20px;
  height: 20px;
  margin: calc(var(--space) * 3) auto;
  border: 2px solid var(--ink-10);
  border-top-color: var(--accent-surface);
  border-radius: 999px;
  animation: spin .7s linear infinite;
}

.loader-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin .7s linear infinite;
}

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

@media (max-width: 720px) {
  .page-shell {
    padding: var(--space) calc(var(--space) * 1.5) calc(var(--space) * 4);
  }

  .panel {
    padding: calc(var(--space) * 1.5);
  }
}
