.edit-mode {
  display: inline-flex;
  align-self: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #325565;
  background: #061821;
}
.edit-mode button {
  min-height: 38px;
  padding: .4rem .75rem;
  border-color: transparent;
  background: transparent;
  color: #abc9d3;
  white-space: nowrap;
  font: 600 1rem var(--display);
}
.edit-mode button[aria-pressed="true"] {
  background: #194655;
  border-color: #4b8494;
  color: #f2fbfc;
}
body[data-edit-mode="live"] #file-context,
body[data-edit-mode="live"] .hud-bar nav,
body[data-edit-mode="live"] .hud-bar > :is(#hud-resources, #edit-currencies, #build-guides, #guide),
body[data-edit-mode="live"] #main > :not(#live-view),
body[data-edit-mode="live"] #toast-area {display: none !important}
body[data-edit-mode="live"] .hud-bar {
  justify-content: space-between;
  align-items: center;
}
body[data-edit-mode="live"] .hud-bar:has(#file-edit[hidden]) {
  justify-content: flex-start;
}
#live-context {gap: .75rem}
.live-identity, .live-context-actions, .live-devices, .live-setup-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.live-identity {min-width: 0; font: 600 1.125rem var(--display)}
.live-identity strong {font-size: clamp(1.375rem, 3vw, 1.625rem); overflow-wrap: anywhere}
.live-identity span:not(.signal) {color: #a8d6df}
#live-character-name:empty {display: none}
#live-level:not(:empty) {
  padding: .15rem .45rem;
  background: #153b48;
  color: #b7ecf1;
}
#live-target:not(:empty) {color: var(--muted)}
.live-context-actions button, .live-devices button {min-height: 38px}
.live-devices {gap: 3px}
.live-devices button {padding: .35rem .65rem}
.live-devices button[aria-pressed="true"] {border-color: #76dce8; background: #194555}
#live-view {margin-inline: auto}
.live-setup {
  width: min(940px, calc(100% - 24px));
  max-width: none;
  max-height: 87vh;
  max-height: 87dvh;
  margin: auto;
  inset: 0;
  overflow: auto;
  padding: clamp(1rem, 4vw, 2.25rem);
  border: 1px solid #366374;
  border-top: 2px solid #7ed4e4;
  background: radial-gradient(ellipse at 18% -30%, #235262 0, transparent 72%), #0a202c;
  color: var(--ink);
  box-shadow: 0 18px 48px #02091080;
}
.live-setup::backdrop {background: #010b13c4}
.live-setup h1 {color: #d9f1f4; text-transform: none; font-size: clamp(2.45rem, 6vw, 4.125rem)}
.live-setup p {margin: 0; color: #bfd6de; line-height: 1.55}
.live-setup-intro p:first-of-type {font-size: 1.075rem; margin-top: .5rem; color: #e0f0f3}
.live-setup-intro p + p {margin-top: .3rem}
.live-steps {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 1px;
  padding: 0;
  margin: 1.5rem 0 1.1rem;
  background: #376170;
  border: 1px solid #376170;
  list-style: none;
}
.live-steps li {padding: clamp(.85rem, 2vw, 1.25rem); min-width: 0; background: #0a1c26}
.live-steps strong {display: block; margin-bottom: .45rem; color: #bceef4; font: 600 1.5rem var(--display)}
.live-steps summary {color: #bceef4; cursor: pointer; padding-block: .45rem; font-weight: 600}
.live-steps details + details {margin-top: .35rem; padding-top: .35rem; border-top: 1px solid #34505d}
.live-steps details[open] > p {margin-top: .45rem}
.live-steps .live-button {margin-top: .75rem}
.live-steps #live-kit-status:not(:empty) {margin-top: .5rem; font-size: .875rem}
#live-kit-download[aria-busy="true"] {cursor: progress}
.live-commands {display: flex; gap: .45rem; flex-wrap: wrap; margin: .65rem 0}
.live-commands code {
  padding: .4rem .55rem;
  border: 1px solid #345e6e;
  background: #071620;
  color: #d0f2f6;
  overflow-wrap: anywhere;
}
.live-commands button, .live-setup-actions button {min-height: 42px}
.live-button, .live-primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .9rem;
  border: 1px solid #47788a;
  border-radius: 2px;
  background: #123644;
  color: #ebfaff;
  text-align: center;
  text-decoration: none;
  font-weight: 650;
}
.live-button:hover, .live-button:focus-visible {border-color: #91dee8; background: #1b4756}
.live-primary:not(:disabled) {background: #215e6b; border-color: #78c5d1}
#live-open-local {flex-direction: column; align-items: flex-start}
#live-open-local small {color: #d1e9ee; font-size: .75rem}
#live-setup-note {margin-top: .55rem}
#live-welcome {margin-block: 2rem; padding: clamp(1rem, 4vw, 2rem); border: 1px solid #366374; background: #0a202c}
#live-welcome h1 {font-size: 3rem; text-transform: none}
#live-welcome p {margin-block: .5rem 1rem; color: #bfd6de}
.live-status:not(:empty) {margin-top: .65rem; color: #bfe6f1; line-height: 1.4}
.live-status[data-error="true"] {color: #ffce96}
#live-status:not(:empty) {
  margin: -.75rem 0 1rem;
  padding: .65rem .75rem;
  background: #0e2a36;
  border-left: 2px solid #6bb0c5;
}
#live-locations {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: .6rem;
}
#live-locations button {min-height: 44px; background-color: transparent}
#live-locations small {margin-left: .3rem; color: #9dbfc9}
#live-scene {grid-template-columns: minmax(285px, .75fr) minmax(0, 1fr); align-items: start}
#live-scene:has(#live-character-art:not([hidden])) {grid-template-columns: minmax(420px, 1.25fr) minmax(0, 1fr)}
#live-scene:has(#live-loadout[hidden]) {display: block; max-width: 1390px; margin: 0 auto}
#live-search {padding-inline-start: 34px}
@media (min-width: 901px) {
  #live-loadout:not([hidden]) ~ .catalog {align-self: stretch}
}
#live-loadout {width: min(100%, 425px); margin: 0 auto}
#live-scene:has(#live-character-art:not([hidden])) #live-loadout {margin: 0 0 0 auto; width: min(55%, 385px)}
#live-portrait {
  position: absolute;
  top: 0;
  left: calc(clamp(-145px, -10vw, -50px) - var(--portrait-offset, 0px));
  width: clamp(465px, 64vw, 925px);
  height: auto;
  opacity: .85;
  filter: drop-shadow(0 18px 30px #020a12cc);
}
#live-wheel .mark-diamond {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  color: #a8d9e3;
}
#live-wheel .live-empty-slot {opacity: .8}
#live-wheel .live-empty-slot .tile-name {bottom: 37%}
#live-equipment-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
#live-equipment-slots > * {grid-column: span 2}
#live-equipment-slots [data-slot="4"], #live-equipment-slots [data-slot="5"] {grid-column: span 3}
#live-equipment-slots .live-empty-slot {min-height: 72px; justify-content: center}
.live-empty-slot .tile-name {color: #a7c4ce}
#live-scene .catalog-heading {gap: .75rem; margin-bottom: .7rem}
#live-scene .catalog-heading span {text-align: right}
.live-filters select {max-width: 160px}
.live-filters input[type="search"] {width: 100%; min-width: 0; padding-inline: .6rem}
.live-import-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .75rem;
  margin: .5rem 0;
  padding: .65rem;
  border: 1px solid #295363;
  background: #0a1b25;
}
.live-import-tools label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #b9d6df;
  font-size: .9rem;
}
.live-import-tools input {max-width: 5rem}
.live-import-tools :is(input, select) {min-height: 38px; padding: .35rem .45rem}
.live-location-note:not(:empty) {
  margin: .35rem 0 .65rem;
  color: #a5c2cc;
  font-size: .85rem;
  line-height: 1.45;
}
#live-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
#live-scene:has(#live-loadout[hidden]) #live-items {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
#live-items .gear-tile {min-height: 98px; flex: 1}
#live-items .gear-tile .art-type {
  display: grid;
  min-height: 40px;
  flex: 1;
  place-items: center;
  color: var(--muted);
  font-size: .8rem;
}
.live-library-card {display: flex; flex-direction: column; min-width: 0}
.live-library-card > button:last-child {min-height: 42px; padding: .35rem .3rem; font-size: .85rem}
.live-library-card .gear-tile {border-bottom: 0}
#live-more {display: block; min-height: 42px; margin: .75rem auto .1rem}
#live-items .empty {padding: 1rem 0; color: #adc8d0}
#live-items .empty button {display: block; margin-top: .65rem}
#live-detail {
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(430px, calc(100vw - 22px));
  max-height: 86vh;
  max-height: 86dvh;
  overflow: auto;
  background: #081a25;
  border: 1px solid #648797;
  border-top: 3px solid var(--rar, #6bc6d9);
  border-radius: 2px;
  box-shadow: 0 10px 35px #000b;
}
#live-detail::backdrop {background: #010911a6}
.live-detail-content {padding: .9rem}
.live-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .45rem;
  color: #b8d7e0;
  font: 600 1rem var(--display);
}
.live-detail-top button {min-height: 36px; padding: .3rem .55rem}
.live-detail-actions {
  display: grid;
  gap: .45rem;
  padding-top: .75rem;
  margin-top: .75rem;
  border-top: 1px solid #2b4b59;
}
.live-detail-actions > * {min-width: 0}
.live-detail-actions button {min-height: 42px; text-align: left}
.live-detail-actions p {color: #bdd4dc; line-height: 1.4; font-size: .9rem}
.live-equipped-label {margin-top: .35rem; color: #b6dce4; font-size: .73rem}

@media (max-width: 900px) {
  #live-scene:has(#live-character-art:not([hidden])) {grid-template-columns: minmax(310px, 1fr) minmax(0, 1fr)}
  #live-scene:has(#live-character-art:not([hidden])) #live-loadout {width: min(62%, 385px)}
}
@media (max-width: 760px) {
  #live-context {padding-inline: 14px}
  #live-context button, .edit-mode button, .live-filters :is(input, select), .live-import-tools :is(input, select) {min-height: 44px}
  .live-context-actions {gap: .4rem}
  #live-scene, #live-scene:has(#live-character-art:not([hidden])) {display: block}
  #live-loadout {width: min(100%, 315px); margin: 0 auto .9rem}
  #live-scene:has(#live-character-art:not([hidden])) #live-loadout {width: min(63%, 315px); margin: 0 0 .9rem auto}
  #live-portrait {left: calc(-28vw - var(--portrait-offset, 0px)); width: clamp(385px, 105vw, 630px)}
  #live-scene:has(#live-loadout[hidden]) #live-items {grid-template-columns: repeat(3, minmax(0, 1fr))}
  .live-filters select {max-width: 132px}
}
@media (max-width: 540px) {
  .live-steps {grid-template-columns: minmax(0, 1fr); margin-top: 1rem}
  .live-commands button, .live-setup-actions button {min-height: 44px}
  .edit-mode button {padding-inline: .49rem}
  #live-locations {gap: 0}
  #live-locations button {flex: 1 0 auto; padding-inline: .44rem; font-size: 1.0625rem}
  #live-context button {padding-inline: .5rem}
  .live-filters, .live-import-tools {gap: .35rem}
  .live-filters :is(input, select), .live-import-tools :is(input, select) {font-size: 16px}
  #live-scene:has(#live-loadout[hidden]) #live-items, #live-items {grid-template-columns: repeat(2, minmax(0, 1fr))}
}

.live-withdrawal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin: -.4rem 0 1rem;
  padding: .75rem;
  border: 1px solid #437386;
  background: #0e2a36;
  color: #d3eaf0;
}
.live-withdrawal > div {display: flex; flex-wrap: wrap; gap: .4rem}
.live-withdrawal button {min-height: 42px}
#live-detail .roll-head h2 {
  color: #f0ede4;
  font: 600 1.25rem/1.12 'Ubuntu Sans', 'Liberation Sans Narrow', sans-serif;
  margin: 0;
}
