/* The shop panel in the look of a macOS (Sonoma) app: a translucent sidebar over the desktop, a unified toolbar,
   grouped forms in the inspector, the system accent blue. Light and dark follow the system. */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --accent: #007aff;
  --accent-hi: #2b8fff;
  --accent-soft: rgba(0, 122, 255, .14);
  --focus: rgba(0, 122, 255, .42);
  --red: #ff3b30;
  --purple: #8e5cf0;

  --wall-1: #c3b3ff;
  --wall-2: #8ec1ff;
  --wall-3: #f6c8e8;
  --wall-base: #dcd6f5;

  --window: #ffffff;
  --chrome: rgba(251, 251, 253, .92);
  --sidebar: rgba(234, 232, 242, .66);
  --inspector: #f7f7f9;
  --panel: #f4f4f7;
  --group: #ffffff;
  --label: rgba(0, 0, 0, .86);
  --label2: rgba(0, 0, 0, .56);
  --label3: rgba(0, 0, 0, .32);
  --sep: rgba(0, 0, 0, .1);
  --fill: rgba(0, 0, 0, .045);
  --fill2: rgba(0, 0, 0, .075);
  --fill3: rgba(0, 0, 0, .14);
  --control: #ffffff;
  --control-border: rgba(0, 0, 0, .13);
  --control-shadow: 0 .5px 1.5px rgba(0, 0, 0, .12);
  --seg-on: #ffffff;
  --side-sel: rgba(0, 0, 0, .08);
  --well: #e9e9ee;
  --well-shadow: inset 0 1px 2px rgba(0, 0, 0, .07), inset 0 0 0 .5px rgba(0, 0, 0, .06);
  --pop: rgba(250, 250, 252, .97);
  --sheet: rgba(246, 246, 249, .9);
  --shadow-window: 0 0 0 .5px rgba(0, 0, 0, .2), 0 28px 80px rgba(40, 20, 90, .28), 0 8px 24px rgba(0, 0, 0, .12);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .14), 0 12px 36px rgba(0, 0, 0, .2);

  --side: 232px;
  --insp: 324px;
  --slot: clamp(44px, min(4.1vw, 6.4vh), 88px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #0a84ff;
    --accent-hi: #2e97ff;
    --accent-soft: rgba(10, 132, 255, .22);
    --focus: rgba(10, 132, 255, .5);
    --red: #ff453a;
    --purple: #a98bff;
    --wall-1: #4a2f99;
    --wall-2: #1d3f8f;
    --wall-3: #6b2a6e;
    --wall-base: #17132b;
    --window: #1e1e20;
    --chrome: rgba(40, 40, 43, .94);
    --sidebar: rgba(36, 33, 48, .6);
    --inspector: #232326;
    --panel: #262629;
    --group: #2c2c2f;
    --label: rgba(255, 255, 255, .88);
    --label2: rgba(255, 255, 255, .56);
    --label3: rgba(255, 255, 255, .3);
    --sep: rgba(255, 255, 255, .1);
    --fill: rgba(255, 255, 255, .055);
    --fill2: rgba(255, 255, 255, .09);
    --fill3: rgba(255, 255, 255, .18);
    --control: rgba(255, 255, 255, .1);
    --control-border: rgba(255, 255, 255, .1);
    --control-shadow: 0 .5px 1px rgba(0, 0, 0, .4);
    --seg-on: rgba(255, 255, 255, .24);
    --side-sel: rgba(255, 255, 255, .1);
    --well: #303034;
    --well-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .05);
    --pop: rgba(44, 44, 48, .97);
    --sheet: rgba(40, 40, 44, .9);
    --shadow-window: 0 0 0 .5px rgba(255, 255, 255, .12), 0 28px 80px rgba(0, 0, 0, .6), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .12), 0 12px 36px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #0a84ff;
  --accent-hi: #2e97ff;
  --accent-soft: rgba(10, 132, 255, .22);
  --focus: rgba(10, 132, 255, .5);
  --red: #ff453a;
  --purple: #a98bff;
  --wall-1: #4a2f99;
  --wall-2: #1d3f8f;
  --wall-3: #6b2a6e;
  --wall-base: #17132b;
  --window: #1e1e20;
  --chrome: rgba(40, 40, 43, .94);
  --sidebar: rgba(36, 33, 48, .6);
  --inspector: #232326;
  --panel: #262629;
  --group: #2c2c2f;
  --label: rgba(255, 255, 255, .88);
  --label2: rgba(255, 255, 255, .56);
  --label3: rgba(255, 255, 255, .3);
  --sep: rgba(255, 255, 255, .1);
  --fill: rgba(255, 255, 255, .055);
  --fill2: rgba(255, 255, 255, .09);
  --fill3: rgba(255, 255, 255, .18);
  --control: rgba(255, 255, 255, .1);
  --control-border: rgba(255, 255, 255, .1);
  --control-shadow: 0 .5px 1px rgba(0, 0, 0, .4);
  --seg-on: rgba(255, 255, 255, .24);
  --side-sel: rgba(255, 255, 255, .1);
  --well: #303034;
  --well-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .05);
  --pop: rgba(44, 44, 48, .97);
  --sheet: rgba(40, 40, 44, .9);
  --shadow-window: 0 0 0 .5px rgba(255, 255, 255, .12), 0 28px 80px rgba(0, 0, 0, .6), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .12), 0 12px 36px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.38 var(--font);
  letter-spacing: -.003em;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  background-color: var(--wall-base);
  background-image:
    radial-gradient(60% 70% at 12% 18%, var(--wall-1), transparent 70%),
    radial-gradient(55% 60% at 88% 12%, var(--wall-2), transparent 70%),
    radial-gradient(70% 60% at 70% 95%, var(--wall-3), transparent 72%);
  background-attachment: fixed;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: default; background: none; border: 0; padding: 0; margin: 0; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
h1, h2, h3, h4, h5, p { margin: 0; }

/* Symbols drawn like SF Symbols: thin rounded strokes in the text colour. */
.sym { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; }
.sym svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* The desktop and the window ------------------------------------------------------------------------------------ */

.desktop { position: fixed; inset: 0; display: grid; }
.window {
  position: relative;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow-window);
}
@media (min-width: 1680px) and (min-height: 960px) {
  .desktop { padding: clamp(24px, 2.2vw, 48px); }
  .window { border-radius: 12px; }
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  -webkit-backdrop-filter: blur(60px) saturate(1.9);
  backdrop-filter: blur(60px) saturate(1.9);
  border-right: .5px solid var(--sep);
}
.traffic { display: flex; gap: 8px; padding: 19px 20px 0; height: 52px; flex: none; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .14); }
.traffic i:nth-child(1) { background: #ff5f57; }
.traffic i:nth-child(2) { background: #febc2e; }
.traffic i:nth-child(3) { background: #28c840; }
.side-scroll { flex: 1; overflow: auto; padding: 2px 0 12px; }
.sidebar h5 { font-size: 11px; font-weight: 600; color: var(--label3); padding: 10px 20px 5px; }
.side-item {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 20px); height: 28px; margin: 0 10px 1px;
  padding: 0 10px 0 calc(10px + var(--depth, 0) * 16px);
  border-radius: 7px; font-size: 13px; text-align: left;
}
.side-item .sym { color: var(--accent); }
.side-item:hover { background: var(--fill); }
.side-item.on { background: var(--side-sel); font-weight: 500; }
.side-item.sub { height: 26px; color: var(--label2); }
.side-item.sub.on { color: var(--label); }
.side-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--label3); flex: none; }
.account { display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px 18px; border-top: .5px solid var(--sep); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: #fff; background: linear-gradient(140deg, #b58cff, #3f63e6);
}
.account-name { flex: 1; min-width: 0; font-weight: 500; line-height: 1.2; }
.account-name small { display: block; font-size: 11px; font-weight: 400; color: var(--label2); }

.main { display: grid; grid-template-rows: 52px minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--window); }
.body { display: grid; grid-template-columns: minmax(0, 1fr) var(--insp); min-height: 0; }

/* Toolbar -------------------------------------------------------------------------------------------------------- */

.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 10px;
  background: var(--chrome);
  border-bottom: .5px solid var(--sep);
  min-width: 0;
}
.toolbar .title { min-width: 0; flex: 0 1 auto; margin-right: auto; }
.toolbar h1 { font-size: 15px; font-weight: 650; letter-spacing: -.012em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--label2); white-space: nowrap; overflow: hidden; }
.crumbs button { color: var(--label2); border-radius: 4px; padding: 0 2px; }
.crumbs button:hover { color: var(--accent); }
.crumbs .crumb-sep { width: 10px; height: 10px; color: var(--label3); }
.tools { display: flex; align-items: center; gap: 10px; flex: none; }
.btn-group { display: flex; gap: 2px; }
.toolbar-search { width: clamp(170px, 15vw, 280px); }

/* Controls ------------------------------------------------------------------------------------------------------- */

.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 28px; border-radius: 7px; color: var(--label2); flex: none;
}
.icon-btn:hover:not(:disabled) { background: var(--fill2); color: var(--label); }
.icon-btn:active:not(:disabled) { background: var(--fill3); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.small { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.small .sym { width: 13px; height: 13px; }
.icon-btn.danger:hover:not(:disabled) { color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 13px; border-radius: 7px;
  background: var(--control); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.btn .sym { width: 14px; height: 14px; }
.btn:active:not(:disabled) { filter: brightness(.94); }
.btn.primary { color: #fff; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); box-shadow: 0 .5px 1.5px rgba(0, 60, 160, .35), inset 0 .5px 0 rgba(255, 255, 255, .22); }
.btn.destructive.primary { background: linear-gradient(180deg, #ff5b52, var(--red)); box-shadow: 0 .5px 1.5px rgba(160, 0, 0, .35); }
.btn:disabled { color: var(--label3); background: var(--fill); box-shadow: inset 0 0 0 .5px var(--control-border); }
.btn.wide { width: 100%; height: 32px; margin-top: 18px; }
.btn .spinner { --s: 13px; }

.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--fill2); gap: 1px; }
.segmented button {
  height: 24px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--label);
  transition: background-color .15s, box-shadow .15s; white-space: nowrap;
}
.segmented button:hover:not(.on):not(:disabled) { background: var(--fill); }
.segmented button.on { background: var(--seg-on); box-shadow: 0 1px 2.5px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .05); }
.segmented button:disabled { color: var(--label3); }
.segmented.small button { height: 21px; padding: 0 9px; font-size: 12px; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap > .sym { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--label2); pointer-events: none; }
.search-field {
  width: 100%; height: 28px; padding: 0 8px 0 28px; border-radius: 8px; border: 0;
  background: var(--fill2); font-size: 13px;
}
.search-field::placeholder, .field::placeholder { color: var(--label3); }
.search-field:focus { outline: none; box-shadow: 0 0 0 3px var(--focus); background: var(--control); }

.field {
  width: 100%; max-width: 190px; padding: 4px 8px; border-radius: 6px; border: 0;
  background: var(--control); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
  font-size: 13px;
}
textarea.field { resize: vertical; min-height: 46px; line-height: 1.35; max-width: none; }
.field:focus { outline: none; box-shadow: 0 0 0 3px var(--focus), inset 0 0 0 .5px var(--accent); }

.stepper { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.stepper-field {
  width: 50px; height: 24px; padding: 0 7px; border: 0; border-radius: 6px; text-align: right;
  background: var(--control); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.stepper-field:focus { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.stepper-arrows {
  display: grid; grid-template-rows: 1fr 1fr; width: 15px; height: 24px; border-radius: 5px; overflow: hidden;
  background: var(--control); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
}
.stepper-arrows button { display: grid; place-items: center; }
.stepper-arrows button:active:not(:disabled) { background: var(--fill3); }
.stepper-arrows button:disabled i { opacity: .3; }
.stepper-arrows i { width: 5px; height: 5px; border: solid var(--label); border-width: 1.5px 1.5px 0 0; }
.stepper-arrows i.up { transform: translateY(1.5px) rotate(-45deg); }
.stepper-arrows i.down { transform: translateY(-1.5px) rotate(135deg); }

.switch { position: relative; width: 36px; height: 21px; border-radius: 11px; background: var(--fill3); transition: background-color .18s; flex: none; }
.switch i { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2.5px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .06); transition: transform .18s cubic-bezier(.3, .7, .4, 1); }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(15px); }

.slider-wrap { position: relative; padding: 2px 0 0; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; margin: 0; display: block; }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p), var(--fill3) var(--p)); }
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p), var(--fill3) var(--p)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .1); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.slider:focus-visible { box-shadow: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus); }
.ticks { display: flex; justify-content: space-between; padding: 1px 8px 0; }
.ticks i { width: 1.5px; height: 4px; border-radius: 1px; background: var(--fill3); }
.ticks i.on { background: var(--accent); opacity: .6; }

.spinner { --s: 16px; position: relative; display: inline-block; width: var(--s); height: var(--s); flex: none; }
.spinner i { position: absolute; left: 50%; top: 0; width: 9%; height: 28%; margin-left: -4.5%; border-radius: 2px; background: currentColor; transform-origin: 50% 178%; opacity: .25; animation: tick .8s linear infinite; }
.spinner i:nth-child(1) { transform: rotate(0deg); animation-delay: -.7s; }
.spinner i:nth-child(2) { transform: rotate(45deg); animation-delay: -.6s; }
.spinner i:nth-child(3) { transform: rotate(90deg); animation-delay: -.5s; }
.spinner i:nth-child(4) { transform: rotate(135deg); animation-delay: -.4s; }
.spinner i:nth-child(5) { transform: rotate(180deg); animation-delay: -.3s; }
.spinner i:nth-child(6) { transform: rotate(225deg); animation-delay: -.2s; }
.spinner i:nth-child(7) { transform: rotate(270deg); animation-delay: -.1s; }
.spinner i:nth-child(8) { transform: rotate(315deg); animation-delay: 0s; }
@keyframes tick { 0% { opacity: .9; } 100% { opacity: .22; } }

/* Item icons ------------------------------------------------------------------------------------------------------ */

.icon {
  position: relative; display: inline-block; flex: none; isolation: isolate;
  width: 32px; height: 32px;
  background: var(--img) center / contain no-repeat;
  image-rendering: pixelated;
}
.icon.none { image-rendering: auto; opacity: .8; }
.icon.dyed::after, .icon.glint::before {
  content: ""; position: absolute; inset: 0;
  -webkit-mask: var(--img) center / contain no-repeat;
  mask: var(--img) center / contain no-repeat;
}
.icon.dyed::after { background: var(--tint); mix-blend-mode: multiply; }
.icon.team::after { background: linear-gradient(135deg, #e0625c 0 50%, #5b86e5 50% 100%); }
.icon.glint::before {
  z-index: 1;
  background: linear-gradient(115deg, transparent 38%, rgba(196, 140, 255, .85) 48%, rgba(150, 110, 255, .5) 52%, transparent 62%) 0 0 / 300% 100%;
  mix-blend-mode: screen;
  animation: glint 3.6s linear infinite;
}
@keyframes glint { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.icon.mini { width: 14px; height: 14px; }
.icon.tiny { width: 16px; height: 16px; }
.icon.small { width: 26px; height: 26px; }
.icon.big { width: 46px; height: 46px; }
.icon.drag-ghost { position: fixed; top: -200px; width: 48px; height: 48px; }

/* The chest ------------------------------------------------------------------------------------------------------- */

.content { display: grid; grid-template-rows: var(--chest-h, auto) 7px minmax(140px, 1fr); min-height: 0; min-width: 0; }
.chest-area { overflow: auto; min-height: 0; padding: 20px 24px 18px; display: grid; justify-items: center; align-items: start; }
.chest-card {
  padding: 12px 14px 12px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: inset 0 0 0 .5px var(--sep);
}
.chest-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 2px 10px; }
.chest-title span { font-weight: 600; font-size: 13px; }
.chest-title small { font-size: 11.5px; color: var(--label2); }
.chest { display: grid; grid-template-columns: repeat(9, var(--slot)); gap: 4px 6px; }

.slot { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px; position: relative; }
.slot:focus-visible { box-shadow: none; }
.slot:focus-visible .well { box-shadow: var(--well-shadow), 0 0 0 3px var(--focus); }
.slot .well {
  position: relative; display: grid; place-items: center;
  width: var(--slot); height: var(--slot); border-radius: 10px;
  background: var(--well); box-shadow: var(--well-shadow);
  transition: box-shadow .14s, background-color .14s, transform .14s;
}
.slot .well > .icon { width: 70%; height: 70%; filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .18)); }
.slot:hover:not(.reserved) .well { background: color-mix(in srgb, var(--well) 88%, var(--label) 6%); }
.slot.sel .well { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.slot.over .well { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); transform: scale(1.05); }
.slot.dropped .well { animation: drop .32s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes drop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
.slot.shake .well { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.slot.reserved .well {
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--fill) 5px 6px), var(--panel);
  box-shadow: inset 0 0 0 1px var(--fill2);
  color: var(--label3);
}
.count {
  position: absolute; right: 3px; bottom: 3px; min-width: 17px; height: 15px; padding: 0 4px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 650; color: #fff; background: rgba(28, 28, 32, .62);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.badge {
  position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  box-shadow: 0 0 0 2px var(--panel);
}
.badge .sym { width: 11px; height: 11px; }
.badge .sym svg { stroke-width: 1.8; }
.badge.gives { background: var(--purple); }
.slot.section .badge.gives { display: none; }
.cap {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  height: 15px; font-size: 11px; color: var(--label2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cap b { font-weight: 600; color: var(--label); }
.cap .sym { width: 10px; height: 10px; }
.slot.section .cap { color: var(--accent); }
.slot.buy .cap { color: var(--purple); }

.split-handle { position: relative; cursor: row-resize; }
.split-handle::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: .5px; background: var(--sep); }
.split-handle::after { content: ""; position: absolute; left: 50%; top: 1.5px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--fill3); opacity: 0; transition: opacity .15s; }
.split-handle:hover::after { opacity: 1; }

/* The library ----------------------------------------------------------------------------------------------------- */

.library { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.lib-head { display: flex; align-items: center; gap: 14px; padding: 8px 18px 8px; flex-wrap: wrap; }
.lib-count { font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; }
.lib-hint { margin-left: auto; font-size: 12px; color: var(--label3); }
.lib-grid {
  overflow: auto; padding: 4px 12px 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 2px; align-content: start;
}
.lib-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 4px 7px; border-radius: 9px; text-align: center;
  content-visibility: auto; contain-intrinsic-size: 88px 86px;
}
.lib-item .icon { width: 38px; height: 38px; }
.lib-item span:last-child {
  font-size: 11px; line-height: 1.25; color: var(--label);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lib-item:hover { background: var(--fill); }
.lib-item:focus-visible { box-shadow: none; background: var(--accent); }
.lib-item:focus-visible span:last-child { color: #fff; }
.lib-item:active { transform: scale(.97); }
.lib-empty { display: grid; place-content: center; text-align: center; gap: 4px; color: var(--label2); padding: 24px; }
.lib-empty small { color: var(--label3); }

/* The inspector --------------------------------------------------------------------------------------------------- */

.inspector { overflow: auto; min-height: 0; padding: 18px 16px 28px; background: var(--inspector); border-left: .5px solid var(--sep); }
.insp-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.big-well { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 13px; background: var(--well); box-shadow: var(--well-shadow); }
.big-well:hover { box-shadow: var(--well-shadow), inset 0 0 0 2px var(--fill3); }
.big-well .count { right: 6px; bottom: 4px; }
.insp-title h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.insp-title p { font-size: 12px; color: var(--label2); }
.insp-title code { font: 11px var(--mono); color: var(--label3); }
.insp-type { margin: 16px 0 6px; }
.insp-type .segmented { display: flex; }
.insp-type .segmented button { flex: 1; padding: 0 4px; }
.type-note { font-size: 12px; color: var(--label2); padding: 0 2px; }

.group { margin-top: 18px; }
.group h3 { font-size: 12px; font-weight: 600; color: var(--label2); padding: 0 4px 6px; }
.group-box { border-radius: 10px; background: var(--group); box-shadow: inset 0 0 0 .5px var(--sep), 0 .5px 1px rgba(0, 0, 0, .04); overflow: hidden; }
.group-box > * + * { border-top: .5px solid var(--sep); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 7px 10px 7px 12px; }
.form-row > label { flex: none; }
.form-row.top { align-items: flex-start; flex-direction: column; gap: 6px; }
.form-row.tip { min-height: 0; padding: 9px 12px; font-size: 12px; color: var(--label2); text-align: left; }
.row-note { font-size: 12px; color: var(--label2); padding: 8px 12px; }
.form-row .row-note { padding: 0; }

.price-well, .popup {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
  height: 36px; padding: 0 8px 0 5px; border-radius: 8px; text-align: left;
  background: var(--control); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
}
.price-well span:not(.sym):not(.icon), .popup > span:not(.sym):not(.icon) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-well .icon { width: 26px; height: 26px; }
.popup { height: 42px; }
.popup small, .give small, .menu-item small { display: block; font-size: 11px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 12px; height: 12px; color: var(--label2); }
.bad { color: var(--red); }

.ench { padding: 8px 10px 8px 12px; }
.ench-top { display: flex; align-items: center; gap: 8px; }
.ench-top .ench-name { flex: 1; min-width: 0; }
.ench-name b { margin-left: 6px; font-weight: 600; color: var(--purple); }
.ench .slider-wrap { margin: 6px 30px 0 0; }

.add-row { display: flex; align-items: center; gap: 7px; width: 100%; padding: 10px 12px; color: var(--accent); font-weight: 500; text-align: left; }
.add-row .sym { width: 14px; height: 14px; }
.add-row:hover { background: var(--fill); }
.add-row.muted { color: var(--label2); font-weight: 400; }
.give-actions > * + * { border-top: .5px solid var(--sep); }

.give { display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 12px; }
.give.same { color: var(--label2); }
.give.same span:last-child { min-width: 0; }
.give:not(.same) { display: block; padding: 0; }
.give-line { display: flex; align-items: center; padding-right: 8px; }
.give-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 4px 7px 6px; text-align: left; }
.give-main > span:last-child { min-width: 0; }
.give-main:hover { background: var(--fill); }
.disclose { width: 12px; height: 12px; color: var(--label2); transition: transform .16s; }
.give.open .disclose { transform: rotate(90deg); }
.give-edit { padding: 0 10px 12px 12px; background: var(--fill); }
.give-edit .group { margin-top: 10px; }

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; padding: 10px 12px 12px; }
.swatch { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25); position: relative; }
.swatch.on { box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25), 0 0 0 2px var(--group), 0 0 0 4px var(--accent); }
.swatch.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.colour-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; }

.insp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.insp-actions.column { flex-direction: column; align-items: stretch; max-width: 230px; margin: 20px auto 0; }
.insp-page { text-align: center; padding-top: 18px; }
.insp-page h2 { font-size: 15px; font-weight: 650; margin-top: 14px; }
.insp-page > p { font-size: 12.5px; color: var(--label2); margin-top: 3px; }
.insp-page .group { text-align: left; margin-top: 26px; }
.insp-empty-art { width: 64px; height: 64px; margin: 0 auto; border-radius: 15px; display: grid; place-items: center; background: var(--well); box-shadow: var(--well-shadow); color: var(--label3); }
.insp-empty-art .sym { width: 28px; height: 28px; }
.insp-empty-art.dashed { background: none; box-shadow: none; border: 1.5px dashed var(--fill3); }

/* Popovers, menus, sheets, HUD ----------------------------------------------------------------------------------- */

.popover {
  position: fixed; z-index: 50; padding: 12px; border-radius: 12px;
  background: var(--pop); box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  animation: pop-in .14s cubic-bezier(.2, .9, .3, 1.1);
}
.popover.above { transform-origin: 50% 100%; }
.popover.below { transform-origin: 50% 0; }
.popover.leaving { animation: pop-out .12s ease-in forwards; }
.pop-arrow { position: absolute; width: 14px; height: 14px; background: var(--pop); transform: rotate(45deg); border-radius: 2px; }
.popover.below .pop-arrow { top: -6px; box-shadow: -.5px -.5px 0 rgba(0, 0, 0, .1); }
.popover.above .pop-arrow { bottom: -6px; box-shadow: .5px .5px 0 rgba(0, 0, 0, .1); }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.97); } }
.picker h4 { font-size: 13px; font-weight: 600; padding: 0 2px 9px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 2px; max-height: 330px; overflow: auto; margin: 8px -4px 0; padding: 0 4px; }
.pick-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 3px 6px; border-radius: 8px; text-align: center; }
.pick-item .icon { width: 32px; height: 32px; }
.pick-item span:last-child { font-size: 10.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-item:hover, .pick-item:focus-visible { background: var(--accent); color: #fff; box-shadow: none; }
.empty-note { grid-column: 1 / -1; padding: 18px 8px; text-align: center; color: var(--label2); font-size: 12px; }
.ench-list { max-height: 360px; overflow: auto; margin: 8px -4px 0; padding: 0 4px; }
.ench-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 8px; }
.ench-row:hover { background: var(--fill); }
.ench-row .ench-name { font-size: 13px; line-height: 1.2; }
.ench-row .ench-name small { display: block; font-size: 11px; color: var(--label3); }
.ench-row.fit .ench-name::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); margin: 0 6px 1px 0; }
.levels { display: flex; gap: 3px; flex: none; }
.levels button { min-width: 26px; height: 22px; padding: 0 4px; border-radius: 5px; background: var(--fill2); font-size: 11.5px; font-weight: 600; }
.levels button:hover, .levels button:focus-visible { background: var(--accent); color: #fff; box-shadow: none; }
.menu { display: flex; flex-direction: column; gap: 1px; max-height: 360px; overflow: auto; margin: -6px; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; text-align: left; }
.menu-item > span:not(.icon):not(.sym) { flex: 1; min-width: 0; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item:hover small { color: rgba(255, 255, 255, .8); }

.sheet-back { position: absolute; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; background: rgba(0, 0, 0, .14); animation: fade .18s; }
.sheet-back.leaving { animation: fade .18s reverse forwards; }
.sheet {
  margin-top: 64px; width: 300px; padding: 20px 16px 16px; border-radius: 12px; text-align: center;
  background: var(--sheet); -webkit-backdrop-filter: blur(40px) saturate(1.6); backdrop-filter: blur(40px) saturate(1.6);
  box-shadow: var(--shadow-pop), 0 30px 70px rgba(0, 0, 0, .25);
  animation: sheet-in .22s cubic-bezier(.2, .9, .3, 1);
}
.sheet-icon { width: 56px; height: 56px; }
.sheet h2 { font-size: 13.5px; font-weight: 650; margin-top: 10px; }
.sheet p { font-size: 12px; color: var(--label); margin-top: 6px; line-height: 1.4; }
.sheet-buttons { display: flex; gap: 8px; margin-top: 18px; }
.sheet-buttons .btn { flex: 1; }
@keyframes sheet-in { from { transform: translateY(-14px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.hud {
  position: fixed; left: 50%; bottom: 44px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 13px; border-radius: 12px;
  background: rgba(36, 36, 40, .82); color: #fff; font-weight: 500;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: hud-in .22s cubic-bezier(.2, .9, .3, 1.1);
}
.hud .sym { color: #30d158; }
.hud.warn .sym { color: #ffd60a; }
.hud.leaving { opacity: 0; transform: translate(-50%, 6px); transition: opacity .25s, transform .25s; }
@keyframes hud-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.97); } }

/* Login ----------------------------------------------------------------------------------------------------------- */

.login-stage { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login {
  width: min(380px, 100%); padding: 34px 32px 28px; border-radius: 18px; text-align: center;
  background: var(--sheet); -webkit-backdrop-filter: blur(50px) saturate(1.8); backdrop-filter: blur(50px) saturate(1.8);
  box-shadow: var(--shadow-window);
  animation: sheet-in .3s cubic-bezier(.2, .9, .3, 1);
}
.login.leaving { transition: opacity .25s, transform .25s; opacity: 0; transform: scale(.97); }
.login.loading { width: auto; display: flex; align-items: center; gap: 10px; padding: 16px 22px; color: var(--label2); border-radius: 12px; }
.login-icon { width: 76px; height: 76px; filter: drop-shadow(0 6px 14px rgba(80, 50, 200, .3)); }
.login h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-top: 12px; }
.login-sub { color: var(--label2); margin-top: 2px; }
.code { display: flex; justify-content: center; gap: 6px; margin: 26px 0 20px; }
.code span {
  width: 38px; height: 50px; display: grid; place-items: center; border-radius: 9px;
  background: var(--group); box-shadow: var(--control-shadow), inset 0 0 0 .5px var(--control-border);
  font: 600 24px/1 var(--mono); letter-spacing: 0;
}
.code span.dash { width: 12px; background: none; box-shadow: none; position: relative; }
.code span.dash::after { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--label3); }
.login-msg { font-size: 15px; font-weight: 600; margin-top: 22px; }
.code + .login-msg { margin-top: 0; }
.login-msg.bad { color: var(--red); }
.login-hint { font-size: 12.5px; color: var(--label2); margin-top: 6px; line-height: 1.4; }
.login-wait { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 12.5px; color: var(--label2); }
.login-wait span:last-child:not(.spinner) { font-variant-numeric: tabular-nums; color: var(--label3); }
.progress { height: 4px; border-radius: 2px; background: var(--fill2); margin-top: 12px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear; }

/* Smaller screens ------------------------------------------------------------------------------------------------- */

@media (max-width: 1360px) {
  :root { --side: 208px; --insp: 296px; }
  .lib-hint { display: none; }
}
@media (max-width: 1120px) {
  :root { --side: 184px; --insp: 272px; }
  .toolbar-search { width: 150px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .desktop { position: static; display: block; }
  .window { display: block; }
  .sidebar { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .traffic, .account small { display: none; }
  .side-scroll { padding-top: 8px; }
  .main { display: block; }
  .toolbar { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .tools { flex-wrap: wrap; width: 100%; }
  .toolbar-search { flex: 1 1 100%; width: auto; }
  .lib-head .segmented { max-width: 100%; overflow-x: auto; }
  .body { display: block; }
  .content { display: block; }
  .chest-area { padding: 12px 16px; }
  .chest-card { padding: 10px 8px; width: 100%; }
  :root { --slot: calc((100vw - 32px - 16px - 8 * 4px) / 9); }
  .chest { gap: 4px; }
  .cap { font-size: 9px; }
  .split-handle { display: none; }
  .library { height: 60vh; border-top: .5px solid var(--sep); }
  .inspector { border-left: 0; border-top: .5px solid var(--sep); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .icon.glint::before { animation: none; background-position: 40% 0; }
}
