/* ------------------------------------------------------------------ */
/*  Skins Panel                                                       */
/*                                                                    */
/*  LocalCloud's look, which is Aperture's website look: black, the   */
/*  silk drifting behind everything, Pearl white on top, flat dark    */
/*  cards with fine borders, pill buttons, Segoe display type with    */
/*  bold italic for the word that matters. Tokens and component       */
/*  recipes are LocalCloud's values verbatim; what is new here is the */
/*  item tile, the weapon editor and the sliders. No frosted glass:   */
/*  backdrop blur over a full-screen app costs the GPU every repaint. */
/* ------------------------------------------------------------------ */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/assets/fonts/regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/assets/fonts/medium.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/assets/fonts/bold.ttf") format("truetype"); }

:root {
  --bg: #000000;
  /* Neutral greys, not blue-black: on pure black any blue reads as a tint. */
  --solid: #0A0A0A;
  --raise: #141414;
  --panel: rgba(7, 7, 8, .78);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --card: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .014) 70%);
  --well: rgba(255, 255, 255, .04);

  --text: #F2F4F8;
  --dim: rgba(235, 237, 245, .66);
  --muted: rgba(235, 237, 245, .42);

  /* ThemePreset.PEARL's accent, and the pearl a few shades down. */
  --accent: #E4E7EE;
  --accent-2: #A9AFBB;
  --ink: #0A0A0A;

  --green: #6BD48A;
  --red: #FF6B61;
  --amber: #FFC15E;
  /* The game's own StatTrak orange, so the tag reads as StatTrak at a glance. */
  --stattrak: #CF6A32;

  --radius: 18px;
  --side: 244px;
  --display: "Segoe UI Variable Display", "Segoe UI", "Inter", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* A damped spring, sampled - Aperture's launcher's own. */
  --spring: linear(0 0%, 0.0273 3.1%, 0.0945 6.3%, 0.1843 9.4%, 0.2841 12.5%, 0.3853 15.6%, 0.4823 18.8%, 0.5717 21.9%, 0.6515 25%, 0.7211 28.1%, 0.7805 31.3%, 0.8302 34.4%, 0.8712 37.5%, 0.9043 40.6%, 0.9307 43.8%, 0.9514 46.9%, 0.9673 50%, 0.9792 53.1%, 0.9881 56.3%, 0.9944 59.4%, 0.9988 62.5%, 1.0018 65.6%, 1.0036 68.8%, 1.0046 71.9%, 1.005 75%, 1.005 78.1%, 1.0047 81.3%, 1.0043 84.4%, 1.0039 87.5%, 1.0034 90.6%, 1.0029 93.8%, 1.0024 96.9%, 1 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); color-scheme: dark; height: 100%; }
body {
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden;
  /* No background of its own: the black is on html, so the art shows. */
  background: transparent; color: var(--text);
  font: 400 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
svg { flex: none; }
svg.i { width: 18px; height: 18px; }
::selection { background: rgba(228, 231, 238, .25); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .2); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* ------------------------------------------------------------------ */
/*  Backdrop                                                          */
/* ------------------------------------------------------------------ */

.backdrop {
  position: fixed; inset: -4%; z-index: -2; pointer-events: none;
  background: #000 url("/assets/silk.webp") center / cover no-repeat;
  /* transform-only, so it runs on the compositor and costs no repaints */
  animation: drift 80s ease-in-out infinite alternate; will-change: transform;
  transition: opacity 1s var(--ease);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 55% at 50% 48%, rgba(0, 0, 0, .5), transparent 75%),
              linear-gradient(to bottom, rgba(0, 0, 0, .1), transparent 30%, rgba(0, 0, 0, .55));
}
body[data-page="login"] .backdrop, body[data-page="boot"] .backdrop { opacity: .9; }
body[data-page="app"] .backdrop { opacity: .42; }
@keyframes drift { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.06) rotate(1.2deg); } }

/* ------------------------------------------------------------------ */
/*  Type                                                              */
/* ------------------------------------------------------------------ */

.display { margin: 0; font-family: var(--display); font-weight: 300; font-size: 44px; line-height: 1.05; letter-spacing: -.015em; }
.display em, .title em { font-style: italic; font-weight: 700; letter-spacing: -.02em; }
.title {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -.015em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; min-height: 19px; }
.brand { font-weight: 700; letter-spacing: .16em; font-size: 13px; color: var(--text); }
.brand b { color: var(--accent-2); font-weight: 700; }

/* ------------------------------------------------------------------ */
/*  Buttons and fields                                                */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform .4s var(--spring), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.primary { background: #FFFFFF; color: var(--ink); }
.btn.primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn.ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.btn.quiet { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn.quiet:hover { background: rgba(255, 255, 255, .12); }
.btn.danger { background: rgba(255, 107, 97, .12); color: var(--red); border-color: rgba(255, 107, 97, .24); }
.btn.danger:hover { background: rgba(255, 107, 97, .22); }
.btn.small { height: 32px; padding: 0 13px; font-size: 13px; gap: 6px; }
.btn.small svg { width: 15px; height: 15px; }
.btn.big { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn svg { width: 17px; height: 17px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--dim);
  cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .4s var(--spring);
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .08); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.93); }
.icon-btn.danger:hover { color: var(--red); background: rgba(255, 107, 97, .12); border-color: rgba(255, 107, 97, .28); }
.icon-btn svg { width: 17px; height: 17px; }

.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  background: rgba(0, 0, 0, .55); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: rgba(255, 255, 255, .22); }
.input:focus { border-color: var(--accent); background: rgba(0, 0, 0, .75); box-shadow: 0 0 0 4px rgba(228, 231, 238, .08); }
.input.num { width: 128px; flex: none; font-variant-numeric: tabular-nums; }
.input[type="number"]::-webkit-inner-spin-button { opacity: .4; }

/* A switch in place of a checkbox, Pearl when on. */
.switch { position: relative; flex: none; width: 42px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2); transition: background .25s var(--ease); }
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--dim); transition: transform .45s var(--spring), background .25s var(--ease);
}
.switch input:checked + i { background: #FFFFFF; border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--ink); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The Aperture admin tabs: a pill track, the chosen one in white. */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); flex: none; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 34px; padding: 0 12px; border-radius: 999px; border: 0;
  background: none; color: var(--dim); cursor: pointer; font-size: 13px; white-space: nowrap; transition: color .2s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: #FFFFFF; color: var(--ink); animation: pop .35s var(--spring); }
.seg button svg { width: 15px; height: 15px; }
.seg.small button { height: 28px; font-size: 12.5px; padding: 0 11px; }

.spin {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: turn .7s linear infinite;
}

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--green); }

.empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 70px 20px; color: var(--muted); text-align: center;
}
.empty > svg { width: 30px; height: 30px; stroke-width: 1.5; }
.empty small { color: var(--muted); opacity: .8; }

/* ------------------------------------------------------------------ */
/*  Sign-in                                                           */
/* ------------------------------------------------------------------ */

.login { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; overflow-y: auto; height: 100%; }
.login-card {
  position: relative; width: min(400px, 100%); padding: 38px 32px 26px; border-radius: 28px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012) 60%), rgba(6, 6, 7, .86);
  border: 1px solid var(--line-2); box-shadow: 0 28px 70px rgba(0, 0, 0, .72);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: dialog-in .7s var(--spring);
}
/* A hairline of light along the top edge, as on Aperture's dialogs. */
.login-card::before {
  content: ""; position: absolute; top: 0; left: 30px; right: 30px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
}
.login-card.shake { animation: shake .4s var(--ease); }
.login-mark { width: 72px; height: 72px; margin-bottom: 6px; animation: bob 6s ease-in-out infinite; }
.login-sub { margin: -4px 0 8px; color: var(--dim); }
.login-field { position: relative; width: 100%; }
.login-field > svg { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.login-field .input { height: 54px; padding-left: 46px; border-radius: 14px; }
/* The code box reads like the code in chat: capitals, spaced out, digits all the same width. */
.code-input { font: 600 21px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; }
.code-input::placeholder { letter-spacing: .22em; color: rgba(235, 237, 245, .22); }
.login-card .btn { width: 100%; }
.login-error { margin: 0; min-height: 20px; color: #FFB3AD; font-size: 13px; }
.login-hint {
  display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 0; padding: 12px 14px; width: 100%; text-align: left;
  border-radius: 14px; background: var(--well); border: 1px solid var(--line); color: var(--dim); font-size: 13px;
}
.login-hint svg { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-2); }
.login-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.lang-btn {
  border: 0; background: none; padding: 4px 8px; border-radius: 8px; cursor: pointer; color: var(--dim);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; transition: color .2s, background .2s;
}
.lang-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* ------------------------------------------------------------------ */
/*  App shell                                                         */
/* ------------------------------------------------------------------ */

.app {
  height: 100%; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
           max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  animation: fade .4s var(--ease);
}
.mtop { display: none; }

.side {
  display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 16px 12px 12px;
  border-radius: 24px; background: rgba(6, 6, 8, .82); border: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 12px; }
.side-brand img { width: 34px; height: 34px; }
.side-who { display: flex; flex-direction: column; min-width: 0; }
.side-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.side-label { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.side-label:first-child { margin-top: 6px; }
.side-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Aperture's account-menu rows: an icon well that turns white under the pointer. */
.nav-item {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; width: 100%;
  padding: 5px 10px 5px 5px; border-radius: 13px; border: 0; background: none; text-align: left;
  color: var(--dim); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--well); border: 1px solid var(--line);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .45s var(--spring);
}
.nav-icon svg { width: 16px; height: 16px; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: var(--text); }
.nav-item:hover .nav-icon { transform: scale(1.06); }
.nav-item.on { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-item.on .nav-icon { background: #FFFFFF; border-color: transparent; color: var(--ink); }
.nav-item.out:hover { background: rgba(255, 107, 97, .08); color: #FFB3AD; }
.nav-item.out:hover .nav-icon { background: rgba(255, 107, 97, .16); border-color: rgba(255, 107, 97, .28); color: var(--red); }
.lang-glyph { font-size: 11px; font-weight: 700; letter-spacing: .06em; }

.stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; animation: rise .45s var(--ease); }
.page.still { animation: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; padding: 4px 4px 0; }
.head-text { min-width: 0; flex: 1 1 260px; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* "Both sides": the switch and its words, as one click target. */
.both { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--dim); font-size: 13px; cursor: pointer; white-space: nowrap; }
.both:hover { color: var(--text); border-color: var(--line-2); }
.side-seg button { min-width: 46px; font-weight: 700; letter-spacing: .04em; }

.grid-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 2px; }
.cat-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cat-seg::-webkit-scrollbar { display: none; }
/* Full width each and scroll, never shrink: squeezed, the Russian names ran into each other. */
.cat-seg button { flex: none; }

.search {
  display: flex; align-items: center; gap: 8px; height: 38px; width: 230px; padding: 0 8px 0 14px; margin-left: auto;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .5); color: var(--muted);
  transition: border-color .2s var(--ease), width .4s var(--spring);
}
.search:focus-within { border-color: var(--accent); width: 280px; color: var(--text); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }

.pane { position: relative; flex: 1; min-height: 0; border-radius: 22px; border: 1px solid var(--line); background: var(--card), var(--panel); overflow: hidden; }
.pane-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ------------------------------------------------------------------ */
/*  Item grids                                                        */
/* ------------------------------------------------------------------ */

.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; padding: 16px; align-content: start; }
.grid-view.dense { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }

.tile {
  position: relative; padding: 12px 10px 12px; border-radius: 16px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  transition: transform .5s var(--spring), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  /* Offscreen tiles skip layout and paint: six hundred pins scroll smoothly. */
  content-visibility: auto; contain-intrinsic-size: 176px 200px;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
.tile:active { transform: scale(.98); }
.tile.on { border-color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1px rgba(255, 255, 255, .75); }

/* The picture well: a soft light behind the item, like the inventory's. */
.art {
  position: relative; width: 100%; aspect-ratio: 1; margin-bottom: 6px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; color: var(--muted);
  background: radial-gradient(62% 62% at 50% 56%, rgba(255, 255, 255, .085), transparent 72%);
}
.tile.wide .art { aspect-ratio: 16 / 10; }
.art img {
  width: 100%; height: 100%; object-fit: contain; padding: 4%;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55));
  transition: transform .6s var(--spring);
}
.tile:hover .art img { transform: scale(1.05); }
.art.none svg { width: 30px; height: 30px; stroke-width: 1.5; }

.tile-name {
  width: 100%; font-size: 13px; line-height: 1.3; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-meta { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.skinned .tile-meta { color: var(--dim); }
.tile-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; white-space: nowrap;
  background: rgba(255, 255, 255, .08); color: var(--dim);
}
.tag svg { width: 11px; height: 11px; }
.tag.st { background: rgba(207, 106, 50, .2); color: #F0A070; }

/* Equipped: a white check in the corner. Moved aside when the corner action is there too. */
.tile-on {
  position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: #FFFFFF; color: var(--ink); animation: pop .35s var(--spring);
}
.tile-on svg { width: 14px; height: 14px; stroke-width: 3; }
.tile:has(.tile-act) .tile-on { right: 46px; }

.tile-star, .tile-act {
  position: absolute; top: 7px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, .55); color: var(--dim); cursor: pointer;
  transition: opacity .15s, background .2s, color .2s, transform .4s var(--spring);
}
.tile-star { left: 7px; opacity: 0; }
.tile-act { right: 7px; }
.tile-star svg, .tile-act svg { width: 15px; height: 15px; }
.tile:hover .tile-star, .tile:focus-within .tile-star, .tile-star.on { opacity: 1; }
.tile-star:hover { color: var(--amber); background: rgba(0, 0, 0, .75); transform: scale(1.08); }
.tile-star.on { color: var(--amber); }
.tile-star.on svg { fill: currentColor; }
.tile-act:hover { background: #FFFFFF; color: var(--ink); transform: scale(1.08); }

/* ------------------------------------------------------------------ */
/*  Weapon editor                                                     */
/* ------------------------------------------------------------------ */

.dialog.editor { width: min(1180px, 100%); height: min(860px, calc(100dvh - 32px)); }
.dialog.editor .dialog-body { overflow: hidden; display: flex; padding-bottom: 18px; }
.ed { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; }

.ed-preview {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 0; overflow-y: auto;
  border-radius: 20px; border: 1px solid var(--line); background: var(--card), rgba(0, 0, 0, .35);
}
.ed-art .art { aspect-ratio: 4 / 3; margin: 0; background: radial-gradient(60% 58% at 50% 56%, rgba(255, 255, 255, .12), transparent 72%); }
.ed-name { font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.ed-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.ed-tags .tag { font-variant-numeric: tabular-nums; }

.ed-slots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.slot-gap { flex: 1; }
.slot {
  width: 44px; height: 44px; border-radius: 13px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); background: rgba(255, 255, 255, .02); color: var(--muted);
  transition: border-color .2s, background .2s, transform .4s var(--spring), box-shadow .2s;
}
.slot svg { width: 20px; height: 20px; }
.slot:hover { border-color: rgba(255, 255, 255, .4); color: var(--text); transform: translateY(-2px); }
.slot.full { border-style: solid; border-color: var(--line); background: var(--well); }
.slot .art { margin: 0; aspect-ratio: 1; background: none; }
.slot .art img { padding: 2px; filter: none; }
.slot.on { border-color: #FFFFFF; box-shadow: 0 0 0 1px #FFFFFF; }
.slot.charm { border-radius: 50%; }

/* The 3D view (test, AK-47 only). While it is on, the preview column gets the larger share. */
.ed-art { position: relative; }
.ed.three { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); }
.view3d {
  position: relative; width: 100%; height: min(52vh, 470px); border-radius: 16px; overflow: hidden; touch-action: none;
  background: radial-gradient(60% 58% at 50% 56%, rgba(255, 255, 255, .1), transparent 72%);
}
.view3d[hidden] { display: none; }
.view3d-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.view3d-canvas:active { cursor: grabbing; }
.view3d-badge {
  position: absolute; left: 10px; top: 10px; z-index: 1; pointer-events: none; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); background: rgba(0, 0, 0, .45);
}
.view3d-hint { position: absolute; left: 12px; right: 12px; bottom: 9px; z-index: 1; pointer-events: none; font-size: 12px; color: var(--dim); text-align: center; }
.view3d-toggle {
  position: absolute; right: 8px; top: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .5); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.view3d-toggle svg { width: 15px; height: 15px; }
.view3d-toggle:hover { border-color: rgba(255, 255, 255, .4); }

.ed-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.ed-tabs .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
.ed-tabs .seg::-webkit-scrollbar { display: none; }
.ed-tabs .seg button { flex: 1 0 auto; }
.ed-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.ed-tab { display: flex; flex-direction: column; gap: 4px; }
.ed-tools {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(10, 10, 11, .94);
}
.ed-tools .search { margin-left: 0; flex: 1 1 200px; width: auto; }
.ed-tools .search:focus-within { width: auto; }
.ed-tab .grid-view { padding: 14px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.ed-tab .grid-view.dense { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.ed-tab .empty { padding: 50px 20px; }
.pick-title { margin: 12px 16px 0; }
.note { display: flex; align-items: flex-start; gap: 8px; margin: 6px 16px 14px; }
.note svg { width: 14px; height: 14px; margin-top: 3px; }
.btn.more { align-self: center; margin: 0 0 14px; }
.slot-seg { flex-wrap: wrap; }
.slot-seg .dot { width: 6px; height: 6px; }

/* ------------------------------------------------------------------ */
/*  Forms                                                             */
/* ------------------------------------------------------------------ */

.form { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.field { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--well); }
.field.compact { gap: 6px; padding: 10px 14px; }
.field p { margin: 0; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-head label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.field-head label svg { width: 16px; height: 16px; color: var(--accent-2); }
.field-sub { margin-top: -6px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big-num { font: 600 24px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.counter { font-variant-numeric: tabular-nums; }

/* A slider in the house style: a thin track, filled in Pearl up to the thumb. --v is set by script. */
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: none; cursor: pointer;
  --v: 0%;
}
.range::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(to right, var(--accent) 0 var(--v), rgba(255, 255, 255, .14) var(--v) 100%);
}
.range::-moz-range-track { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .14); }
.range::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%;
  background: #FFFFFF; border: 0; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 3px 8px rgba(0, 0, 0, .5);
  transition: transform .35s var(--spring);
}
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; border: 0; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(228, 231, 238, .4); }

.bands { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.band {
  height: 30px; min-width: 42px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: none; color: var(--dim); cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .05em;
  transition: background .2s, color .2s, border-color .2s;
}
.band:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }
.band.on { background: #FFFFFF; color: var(--ink); border-color: transparent; }

.advanced { border-radius: 16px; border: 1px solid var(--line); background: var(--well); padding: 0 14px; }
.advanced > summary {
  display: flex; align-items: center; gap: 8px; height: 46px; cursor: pointer; list-style: none; color: var(--dim); font-weight: 500;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary svg { width: 16px; height: 16px; }
.advanced > summary:hover { color: var(--text); }
.advanced[open] { padding-bottom: 12px; }
.advanced[open] > summary { color: var(--text); }
.advanced > p { margin: 0 0 10px; }
.advanced .field { background: rgba(0, 0, 0, .25); margin-top: 8px; }

.picked { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--well); }
.picked .art { width: 64px; margin: 0; aspect-ratio: 1; }
.picked-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.picked-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.charm-form { padding-bottom: 0; }
.glove-form { padding: 0; }
.glove-art .art { aspect-ratio: 16 / 10; margin: 0; background: radial-gradient(60% 58% at 50% 56%, rgba(255, 255, 255, .12), transparent 72%); }

/* ------------------------------------------------------------------ */
/*  Presets                                                           */
/* ------------------------------------------------------------------ */

.preset-list { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.preset {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025); animation: rise .4s var(--ease) both;
  transition: border-color .2s, background .2s;
}
.preset:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .045); }
.preset-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--well); border: 1px solid var(--line); color: var(--dim); }
.preset-icon svg { width: 18px; height: 18px; }
.preset-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.preset-text b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.preset-acts .icon-btn { width: 36px; height: 36px; }

/* ------------------------------------------------------------------ */
/*  Menus                                                             */
/* ------------------------------------------------------------------ */

/* The account menu and the dialogs share one surface: a faint top-lit
   gradient over near-black and a hairline of light along the top edge. */
.menu, .dialog {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012) 60%), var(--solid);
  border: 1px solid var(--line-2);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .72), 0 2px 0 rgba(255, 255, 255, .02) inset;
}
.menu::before, .dialog::before {
  content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
}

.menu.floating {
  position: fixed; z-index: 70; width: 252px; padding: 8px; border-radius: 18px;
  transform-origin: top right; animation: menu-in .38s var(--spring);
}
.menu.leave { animation: menu-out .16s var(--ease) forwards; pointer-events: none; }
.menu-title {
  padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu-item {
  display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 11px; width: 100%;
  padding: 5px 10px 5px 5px; border-radius: 12px; border: 0; background: none; text-align: left;
  color: var(--dim); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
  animation: menu-row .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 22ms + 30ms);
}
.menu-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--well); border: 1px solid var(--line);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .45s var(--spring);
}
.menu-icon svg { width: 15px; height: 15px; }
.menu-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .055); color: var(--text); outline: none; }
.menu-item:hover .menu-icon, .menu-item:focus-visible .menu-icon { background: #FFFFFF; border-color: transparent; color: var(--ink); transform: scale(1.06); }
.menu-item.out:hover, .menu-item.out:focus-visible { background: rgba(255, 107, 97, .08); color: #FFB3AD; }

/* ------------------------------------------------------------------ */
/*  Dialogs and toasts                                                */
/* ------------------------------------------------------------------ */

.dialog-back {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .6), rgba(0, 0, 0, .86)); animation: fade .22s var(--ease);
}
.dialog-back.leave { animation: fade-out .2s var(--ease) forwards; pointer-events: none; }
/* min-width 0: a dialog is a grid item of its backdrop, and a grid item grows to its content
   by default - on a phone the editor's tab bar pushed it wider than the screen. */
.dialog { width: min(460px, 100%); min-width: 0; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 24px; animation: dialog-in .55s var(--spring); }
.dialog.wide { width: min(1100px, 100%); }
.dialog-back.leave .dialog { animation: dialog-out .2s var(--ease) forwards; }

.dialog-head { position: relative; flex: none; display: flex; align-items: flex-start; gap: 14px; padding: 22px 18px 0 22px; }
.dialog-head::after {
  content: ""; position: absolute; inset: 0 0 -24px; pointer-events: none; border-radius: 24px 24px 0 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.2px); background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, #000, transparent);
}
.dialog-icon {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  background: #FFFFFF; color: var(--ink); box-shadow: 0 0 0 5px rgba(255, 255, 255, .05), 0 10px 24px rgba(0, 0, 0, .45);
}
.dialog-icon svg { width: 20px; height: 20px; }
.dialog-title { position: relative; z-index: 1; flex: 1; min-width: 0; padding-top: 2px; }
.dialog h3 { margin: 0; font-size: 19px; font-weight: 600; font-family: var(--display); line-height: 1.25; overflow-wrap: anywhere; }
.dialog-sub { margin: 4px 0 0; font-size: 13px; color: var(--dim); line-height: 1.5; }
.dialog-sub:empty { display: none; }
.dialog-x {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin: -4px 0 0 4px;
  border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .45s var(--spring);
}
.dialog-x:hover { background: rgba(255, 255, 255, .07); color: var(--text); transform: rotate(90deg); }
.dialog-x svg { width: 16px; height: 16px; }
.dialog-body { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; padding: 18px 22px 22px; }
.dialog-body:empty { display: none; }
.dialog-body > p { margin: 0; color: var(--dim); }
.dialog-foot {
  flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px;
  border-top: 1px solid var(--line); background: rgba(0, 0, 0, .28); border-radius: 0 0 24px 24px;
}

.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none; padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; min-width: 200px; max-width: 400px;
  background: var(--raise); border: 1px solid var(--line-2); box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
  font-size: 13.5px; animation: toast .5s var(--spring); pointer-events: auto;
}
.toast svg { width: 17px; height: 17px; color: var(--accent-2); }
.toast.ok svg { color: var(--green); }
.toast.bad { border-color: rgba(255, 107, 97, .3); }
.toast.bad svg { color: var(--red); }
.toast .spin { width: 16px; height: 16px; color: var(--accent-2); }
.toast.leave { animation: out .25s var(--ease) forwards; }

/* ------------------------------------------------------------------ */
/*  Motion                                                            */
/* ------------------------------------------------------------------ */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes menu-row { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ */
/*  Narrow screens                                                    */
/* ------------------------------------------------------------------ */

/* A laptop or a half-screen window: the sidebar folds to an icon rail. */
@media (max-width: 1080px) {
  :root { --side: 74px; }
  .side { padding: 14px 10px 10px; align-items: center; }
  .side-brand { padding: 0 0 10px; }
  .side-who, .nav-label, .side-label { display: none; }
  .side-nav { gap: 4px; padding-top: 8px; }
  .nav-item { grid-template-columns: 1fr; padding: 4px; justify-items: center; width: auto; }
  .nav-icon { width: 40px; height: 40px; border-radius: 12px; }
}

/* The editor's preview goes on top of the tabs instead of beside them. */
@media (max-width: 900px) {
  .dialog.editor { height: calc(100dvh - 24px); }
  .ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .ed-preview { display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-areas: "art name" "art tags" "slots slots"; gap: 6px 14px; padding: 12px; overflow: visible; }
  .ed-art { grid-area: art; }
  .ed-name { grid-area: name; align-self: end; font-size: 18px; }
  .ed-tags { grid-area: tags; align-self: start; }
  .ed-slots { grid-area: slots; margin-top: 4px; padding-top: 10px; }
  .slot { width: 42px; height: 42px; border-radius: 12px; }
  /* With the 3D view on, the model gets the full width and the name goes under it. */
  .ed.three { grid-template-columns: minmax(0, 1fr); }
  .ed.three .ed-preview { grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "name" "tags" "slots"; }
  .view3d { height: 38vh; }
}

/* A phone: the model leaves room for the list under it. */
@media (max-width: 640px) {
  .view3d { height: 27vh; }
}

/* A phone: a top bar for the account buttons, the sidebar becomes a tab bar
   along the bottom (thumb reach), dialogs fill the screen. */
@media (max-width: 640px) {
  .app {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
             calc(84px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .mtop {
    display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 20px;
    background: rgba(6, 6, 8, .86); border: 1px solid var(--line);
  }
  .mtop-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
  .mtop-who small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop .icon-btn { width: 38px; height: 38px; }

  .side {
    position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    flex-direction: row; padding: 6px 4px; border-radius: 22px; background: rgba(8, 8, 10, .94);
  }
  .side-brand, .side-foot, .side-label { display: none !important; }
  .side-nav { flex-direction: row; justify-content: space-around; padding: 0; gap: 0; overflow: visible; }
  .nav-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 1px; }
  .nav-item .nav-label { display: block; font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-icon { width: 38px; height: 30px; border-radius: 10px; }
  .nav-item:hover { background: none; }

  .page { gap: 10px; }
  .title { font-size: 24px; }
  .head { padding: 2px 2px 0; }
  .tools { width: 100%; gap: 8px; }
  .both { flex: 1; justify-content: center; }
  .search, .search:focus-within { flex: 1 1 100%; width: auto; margin-left: 0; height: 42px; }
  .search input { font-size: 16px; } /* 16px stops iOS zooming into the field */
  .grid-tools { gap: 8px; }
  .pane { border-radius: 18px; }
  .grid-view { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 10px; }
  .grid-view.dense { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .tile { padding: 9px 7px 10px; border-radius: 14px; contain-intrinsic-size: 140px 170px; }
  .tile-name { font-size: 12px; }
  .tile-meta { font-size: 11px; }
  .tile-star { opacity: 1; }
  .tile-star:not(.on) { color: var(--muted); }

  .dialog-back { padding: 0; place-items: end stretch; }
  .dialog { width: 100%; max-height: 100dvh; border-radius: 24px 24px 0 0; animation: sheet-in .5s var(--spring); }
  .dialog.editor { height: 100dvh; border-radius: 0; }
  .dialog-foot { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .dialog-foot .btn { flex: 1; min-width: 0; }
  .dialog-foot .spacer { display: none; }
  /* Three buttons do not fit a phone in words; Reset keeps its icon, which is unambiguous in red. */
  .dialog-foot .btn.danger { flex: none; width: 46px; padding: 0; }
  .dialog-foot .btn.danger span { display: none; }
  .ed-seg button svg { display: none; }
  .ed-seg button { padding: 0 12px; }
  .ed-tools { padding: 10px; }
  .ed-tab .grid-view { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; padding: 10px; }
  .ed-tab .grid-view.dense { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .preset { flex-wrap: wrap; }
  .preset-acts { width: 100%; justify-content: flex-end; }
  .toasts { left: 10px; right: 10px; bottom: calc(90px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
}

@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
