:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f4f5f7;
  --line: #d9dce1;
  --text: #1c1f24;
  --muted: #6b7280;

  --add: #2f9e6b;
  --embed: #2563d9;
  --remove: #d14a4a;
  --active: #1c1f24;

  --user-pt: #2563d9;
  --random-pt: #d4a017;

  --plot-plane: rgba(244, 245, 247, 0.48);
  --plot-grid: #c4c9d1;
  --plot-grid-soft: #cfd3da;
  --plot-zero: #7f8792;
  --plot-line: #9299a4;
  --plot-outline: #ffffff;
  --heat-low: #f0f4fb;
  --heat-mid: #9cc0f0;
  --heat-high: #3f78d6;
  --bar-text-user: #ffffff;
  --bar-text-random: #1c1f24;
  --icon-filter: none;

  --radius: 3px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121519;
  --panel: #1a1e23;
  --line: #343a43;
  --text: #e7e9ed;
  --muted: #9ba3ae;

  --add: #48ad7d;
  --embed: #5b88e8;
  --remove: #df6a6a;
  --active: #3a414b;

  --user-pt: #6d98f0;
  --random-pt: #e0ad35;

  --plot-plane: rgba(35, 40, 47, 0.72);
  --plot-grid: #4a525d;
  --plot-grid-soft: #414852;
  --plot-zero: #929ba7;
  --plot-line: #77808c;
  --plot-outline: #121519;
  --heat-low: #1a2433;
  --heat-mid: #315987;
  --heat-high: #6d98f0;
  --bar-text-user: #121519;
  --bar-text-random: #121519;
  --icon-filter: invert(1);
}

:root.theme-transition *,
:root.theme-transition *::before,
:root.theme-transition *::after {
  transition-property: background-color, border-color, color, fill, stroke, filter, opacity;
  transition-duration: 0.32s;
  transition-timing-function: ease;
}

@keyframes theme-chart-refresh {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.38; }
}
:root.theme-transition .view-pane:not(.hidden) {
  animation: theme-chart-refresh 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
  :root.theme-transition *,
  :root.theme-transition *::before,
  :root.theme-transition *::after,
  .theme-selector {
    transition: none;
    animation: none;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

#controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

#app-title,
.obs-header {
  font-family: "Gloock", "Bodoni 72", Didot, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
}
#app-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
#app-title {
  margin: 0;
  padding: 2px 0 4px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  text-align: center;
}
#app-version {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

#add-row { display: flex; gap: 6px; }

#word-input {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
#word-input:focus { border-color: var(--embed); }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-add    { background: var(--add); }
.btn-embed  { background: var(--embed); padding: 10px; font-weight: 600; }
.btn-dim, .btn-method {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-dim.active, .btn-method.active {
  background: var(--active);
  color: #fff;
  border-color: var(--active);
}

#word-table {
  flex: 1;
  display: block;
  overflow-y: auto;
  border-collapse: collapse;
  width: 100%;
}
#word-rows { display: block; }
#word-rows tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 5px;
}
#word-rows td { display: block; }
.word-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-remove {
  border: none;
  background: none;
  color: var(--remove);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 8px;
}
.row-actions { display: flex; align-items: center; }
.row-shuffle {
  border: none;
  background: none;
  color: var(--random-pt);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 6px;
}
#word-rows tr.random {
  border-color: var(--random-pt);
}
#word-rows tr.random .word-label { color: var(--random-pt); }

#add-random {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px dashed var(--random-pt);
  border-radius: var(--radius);
  color: var(--random-pt);
  background: var(--bg);
  cursor: pointer;
  margin-bottom: 5px;
}

#options { display: flex; flex-direction: column; gap: 10px; }
.opt-group { display: flex; flex-direction: column; gap: 4px; }
.opt-title { color: var(--muted); font-size: 12px; }
.toggle-group { display: flex; gap: 4px; }
.check { display: flex; align-items: center; gap: 5px; cursor: pointer; }

#advanced-options {
  flex: none;
  display: flex;
  flex-direction: column;
}
#advanced-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    max-height 0.35s ease,
    opacity 0.22s ease,
    transform 0.35s ease,
    visibility 0s linear 0.35s;
}
#advanced-options.open #advanced-panel {
  max-height: 280px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}
.advanced-panel-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.btn-advanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--active);
  color: #fff;
  border: 1px solid var(--active);
  font-weight: 600;
  text-align: left;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.btn-advanced:hover,
.btn-advanced:focus-visible {
  border-color: var(--muted);
  opacity: 0.92;
}
.advanced-chevron {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 2px;
  color: #fff;
  font-size: 11px;
  transition: transform 0.3s ease;
}
#advanced-options.open .advanced-chevron { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  #advanced-panel,
  .advanced-chevron {
    transition: none;
  }
}

#model-select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
#model-select:focus { border-color: var(--embed); }

#status { min-height: 18px; color: var(--muted); font-size: 13px; }
#status.error { color: var(--remove); }

#cost {
  align-self: center;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#cost .cost-label { color: var(--muted); }
#cost #cost-value { color: var(--add); }

#workspace {
  display: grid;
  --obs-width: clamp(340px, 32vw, 460px);
  grid-template-columns: 1fr 40px var(--obs-width);
  gap: 6px;
  padding: 8px;
  overflow: hidden;
  transition: grid-template-columns 0.3s ease;
}
#workspace.obs-hidden { grid-template-columns: 1fr 40px 0px; }
#workspace.no-transition { transition: none; }

#view {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#plot-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  box-shadow: 0 5px 18px rgba(28, 31, 36, 0.07);
}
#tabs {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 52px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.tab {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
}
.tab.active {
  border-color: var(--line);
  border-bottom-color: var(--bg);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.tab:disabled { opacity: 0.45; cursor: default; }

@media (min-width: 768px) and (max-width: 1100px) {
  .tab {
    flex: 1;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
  }
}

#dim-bar,
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 8px 0;
}

#neighborhood-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px) minmax(0, 1fr);
  min-height: 64px;
  padding: 10px 14px 4px;
}

#neighborhood-bar label {
  justify-self: end;
}
#dim-bar.hidden,
.view-toolbar.hidden,
#neighborhood-bar.hidden { display: none; }

.view-toolbar label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#neighborhood-select {
  width: 100%;
  min-width: 240px;
  max-width: 360px;
  height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

#neighborhood-select:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 1px;
}

#views {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.view-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
}
.view-pane.hidden { display: none; }

#empty-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
#empty-hint.hidden { display: none; }

#obs-toggle {
  width: 40px;
  height: clamp(120px, 20%, 180px);
  align-self: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  padding: 12px 0;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
#workspace:not(.obs-hidden) #obs-toggle { cursor: pointer; }
.obs-toggle-arrow {
  order: 0;
  flex: none;
  color: var(--muted);
  transition: color 0.2s ease;
}
.obs-toggle-label {
  order: 1;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  writing-mode: vertical-rl;
  white-space: nowrap;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transform: scaleX(0.72);
  transform-origin: left;
  transition:
    max-width 0.32s ease,
    margin-left 0.32s ease,
    opacity 0.18s ease,
    transform 0.32s ease;
}

@media (min-width: 768px) {
  #obs-toggle:hover,
  #obs-toggle:focus-visible {
    border-color: var(--muted);
    transform: translateX(-1px);
  }
  #obs-toggle:hover .obs-toggle-arrow,
  #obs-toggle:focus-visible .obs-toggle-arrow {
    color: var(--text);
  }
  #obs-toggle:hover .obs-toggle-label,
  #obs-toggle:focus-visible .obs-toggle-label {
    max-width: 16px;
    margin-left: 7px;
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #obs-toggle,
  .obs-toggle-arrow,
  .obs-toggle-label {
    transition: none;
  }
}

#observations {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0 8px;
}
#obs-resize-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8px;
  cursor: ew-resize;
  touch-action: none;
}
.obs-header {
  font-size: 26px;
  line-height: 1.1;
  text-align: center;
  padding: 0 0 8px;
}
.obs-topic {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 2px 2px;
}
#obs-list > .obs-topic:first-child { padding-top: 0; }
#obs-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.book {
  min-width: 320px;
  flex: none;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  overflow: hidden;
}
.book-spine {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  cursor: pointer;
}
.book-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.book-divider {
  align-self: stretch;
  width: 4px;
  margin: -10px 0; 
  background: #fff;
}
.book-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  background: var(--bg);
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.book.open .book-body {
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px 12px 12px;
}
.book-body h1 { font-size: 16px; margin: 12px 0 6px; }
.book-body h2 { font-size: 14px; margin: 12px 0 4px; color: var(--muted); }
.book-body p, .book-body li { font-size: 13px; line-height: 1.5; }
.book-body table { border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.book-body th, .book-body td { border: 1px solid var(--line); padding: 3px 8px; }
.book-body blockquote {
  margin: 8px 0;
  padding: 4px 10px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.book-body code {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0 3px;
}
.book-body img { max-width: 100%; border-radius: var(--radius); margin: 6px 0; }
.book-body a { color: var(--embed); text-decoration: underline; cursor: pointer; }
.book-body hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.book-load {
  margin-top: 10px;
  border: none;
  border-radius: var(--radius);
  background: var(--embed);
  color: #fff;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 22, 26, 0.55);
}
#overlay[hidden] { display: none; }
.overlay-box { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#overlay-text { color: #fff; font-size: 30px; }
.loadbar {
  width: 300px;
  height: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.loadbar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius);
  background: #fff;
  transition: width 0.2s ease;
}

#funds-modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 360px;
  text-align: center;
  background: var(--bg);
  color: var(--text);
}
#funds-modal::backdrop { background: rgba(20, 22, 26, 0.55); }
#funds-msg { font-size: 18px; margin: 0 0 18px; }
.donate-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--muted);
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
}
#funds-close { display: block; margin: 16px auto 0; background: var(--active); }

#utility-links {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}
#theme-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 91px;
  height: 41px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  cursor: pointer;
}
.theme-selector {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  height: calc(100% - 6px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.32s ease, border-color 0.32s ease;
}
:root[data-theme="dark"] .theme-selector { transform: translateX(100%); }
:root.theme-transition .theme-selector {
  transition-property: transform, background-color, border-color;
  transition-duration: 0.32s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.theme-option {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  opacity: 0.42;
  transition: opacity 0.2s ease;
}
.theme-option img {
  width: 22px;
  height: 22px;
  filter: var(--icon-filter);
}
:root:not([data-theme="dark"]) .theme-option-light,
:root[data-theme="dark"] .theme-option-dark {
  opacity: 1;
}
#theme-toggle:hover,
#theme-toggle:focus-visible {
  border-color: var(--muted);
}
.utility-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.utility-icon:hover,
.utility-icon:focus-visible {
  border-color: var(--muted);
  opacity: 1;
}
.utility-icon img {
  display: block;
  width: 100%;
  height: 100%;
  filter: var(--icon-filter);
}

@media (max-width: 767px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #app {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  #controls {
    flex: none;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  #app-title {
    padding-top: max(2px, env(safe-area-inset-top));
    font-size: 34px;
  }

  #word-input,
  #model-select,
  .btn,
  .tab,
  .check {
    min-height: 44px;
  }

  #word-input,
  #model-select {
    font-size: 16px;
  }

  #word-table {
    flex: none;
    max-height: min(40vh, 320px);
    max-height: min(40dvh, 320px);
    overscroll-behavior: contain;
  }

  #word-rows tr {
    min-height: 44px;
    padding: 0 4px 0 8px;
  }

  .word-label {
    flex: 1;
    min-width: 0;
  }

  .row-remove,
  .row-shuffle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  #add-random {
    min-height: 44px;
    padding: 8px;
  }

  .check {
    width: fit-content;
  }

  #advanced-options.open #advanced-panel {
    max-height: 340px;
  }

  #workspace,
  #workspace.obs-hidden {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
    overflow: visible;
    transition: none;
  }

  #view {
    height: 70vh;
    height: min(70dvh, 640px);
    min-height: 360px;
  }

  #tabs,
  #dim-toggle {
    width: 100%;
  }

  #tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
  }

  #tabs .tab {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 12px;
    line-height: 1.2;
  }

  #tabs .tab:not(:last-child) {
    border-right: 1px solid var(--line);
  }

  #tabs .tab.active {
    background: var(--panel);
    border-bottom-color: var(--line);
  }

  .tab,
  .btn-dim {
    flex: 1;
    padding: 8px;
  }

  .view-toolbar {
    align-items: center;
    flex-direction: row;
  }

  #neighborhood-bar {
    display: flex;
    justify-content: center;
  }

  #neighborhood-select {
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    font-size: 16px;
  }

  #obs-toggle {
    width: 100%;
    height: 44px;
    align-self: stretch;
    flex-direction: row;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: none;
  }

  .obs-toggle-label {
    order: 1;
    max-width: none;
    margin: 0;
    overflow: visible;
    opacity: 1;
    writing-mode: horizontal-tb;
    font-size: 13px;
    letter-spacing: 0;
    transform: none;
  }

  .obs-toggle-arrow {
    order: 0;
  }

  #workspace:not(.obs-hidden) #obs-toggle {
    cursor: pointer;
  }

  #obs-resize-handle {
    display: none;
  }

  #workspace.obs-hidden #observations {
    display: none;
  }

  #observations {
    width: 100%;
    overflow: visible;
    padding: 8px 0 0;
  }

  #obs-list {
    overflow: visible;
  }

  .book {
    width: 100%;
    min-width: 0;
  }

  .book-spine {
    min-height: 44px;
  }

  .book-title {
    min-width: 0;
    white-space: nowrap;
  }

  .book.open .book-body {
    max-height: 70vh;
    max-height: 70dvh;
  }

  .book-body table,
  .book-body pre {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .book-load {
    min-height: 44px;
  }

  #overlay {
    padding: 16px;
  }

  .overlay-box {
    width: 100%;
  }

  #overlay-text {
    font-size: clamp(22px, 8vw, 30px);
    text-align: center;
  }

  .loadbar {
    width: min(300px, 100%);
  }

  #funds-modal {
    width: calc(100% - 32px);
    max-width: 360px;
    padding: 24px 18px;
  }

  #utility-links {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .utility-icon {
    width: 52px;
    height: 52px;
    padding: 11px;
  }

  #theme-toggle {
    width: 110px;
    height: 52px;
    border-radius: 2px;
  }

  .theme-selector {
    border-radius: 2px;
  }

  .theme-option img {
    width: 26px;
    height: 26px;
  }
}
