


.editor {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--shell-h) - var(--footer-h));
  height: calc(100dvh - var(--shell-h) - var(--footer-h));
  background: var(--surface-ground);
  color: var(--ink-1);
}
.editor > .notice.calm:empty { display: none; }

:where(.ed-ws-head) { --row-bg: var(--surface-1); --dom: var(--line-2); --dom2: transparent; }
.ed-name {
  flex: 1 1 220px;
  max-width: 420px;
  box-sizing: border-box;
  padding: 0 var(--step-2);
  border: 1px solid transparent;
  border-radius: var(--round-1);
  background: transparent;
  color: var(--ink-1);
  font: 500 var(--type-section) / 1.2 var(--font-display);
  letter-spacing: var(--track-display);
  text-overflow: ellipsis;
}
@media (hover: hover) { .ed-name:hover { border-color: var(--line-2); } }
.ed-name:focus-visible { border-color: var(--focus); }
.ed-name:focus { border-color: var(--focus); outline: none; background: var(--surface-1); }
.ed-menu { position: relative; }
.ed-readouts {
  z-index: 40;
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
}
.ed-readout-head {
  margin: var(--step-2) 0 2px;
  font-size: var(--type-note);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ed-readout-line { margin: 0; font-size: var(--type-body); color: var(--ink-2); }
.ed-readout.ok .ed-readout-line { color: var(--ink-1); }

.ed-readout:not(.ok) .ed-readout-line { color: var(--ink-1); }
.ed-readout:not(.ok) .ed-readout-line::before { content: "Fails: "; color: var(--bad); font-weight: 650; }
.ed-readout.ok .ed-readout-head::after { content: " \2713"; color: var(--good); }
.ed-save { font-size: var(--type-note); color: var(--ink-3); }
.ed-save-failed { color: var(--bad); }
.ed-exchange { display: flex; flex-direction: column; gap: var(--step-2); }
.ed-exchange textarea { width: 100%; box-sizing: border-box; font: var(--type-body) / 1.4 var(--mono); }
.ed-exchange-row { display: flex; gap: var(--step-2); }

.ed-unreadable { margin: 0; color: var(--bad); font-size: var(--type-body); white-space: pre-line; }
:root { --ed-deck-w: 432px; }
@media (max-width: 1179.98px) { :root { --ed-deck-w: 392px; } }
@media (max-width: 1023.98px) { :root { --ed-deck-w: 352px; } }
.ed-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ed-deck-w);
  gap: var(--step-4);
  padding: var(--step-3) var(--step-4) var(--step-4);
}
.ed-cat { display: flex; flex-direction: column; gap: var(--step-2); min-width: 0; min-height: 0; }
.ed-rail { display: flex; flex-direction: column; gap: var(--step-2); }
.ed-slotbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--step-3); }
.ed-slots { --ed-tab: 0; position: relative; flex: 1 1 460px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line-1); }
.ed-slot-tab {
  min-height: 44px;
  padding: 0 var(--step-1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--type-body);
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) { .ed-slot-tab:hover { color: var(--ink-1); } }
.ed-slot-tab.on { color: var(--ink-1); font-weight: 650; background: var(--surface-2); }
:root[data-input="touch"] .ed-slot-tab { min-height: var(--touch); font-size: var(--touch-floor-ui); }
.ed-slot-line { margin: 0 0 0 auto; flex: 0 1 auto; white-space: nowrap; font-size: var(--type-note); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ed-underline {
  position: absolute;
  bottom: -1px;
  left: calc(var(--ed-tab) * 100% / 7);
  width: calc(100% / 7);
  height: 2px;
  background: var(--ink-1);
}
.ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-2); }
.ed-search { display: flex; flex: 1 1 200px; min-width: 160px; gap: var(--step-2); }
.ed-doms { display: flex; gap: 8px; }
.ed-dom {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--round-1);
  background: none;
  cursor: pointer;
}
.ed-dom::before { content: ""; position: absolute; inset: -4px; }
.ed-dom > * { opacity: 0.45; }
@media (hover: hover) { .ed-dom:hover > * { opacity: 0.75; } }
.ed-dom.on > * { opacity: 1; }
.ed-dom.on { box-shadow: 0 0 0 2px var(--ink-1); }
.ed-dom:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.ed-tool { flex: none; min-height: 32px; }

@media (max-width: 1179.98px) {
  .ed-dom { width: 32px; height: 32px; }
  .ed-shown { display: none; }
}
:root[data-input="touch"] .ed-dom { width: var(--touch); height: var(--touch); }
.ed-field { position: relative; flex: 1; min-width: 0; }
.ed-field input, .ed-mirror {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 0 var(--step-3);
  border: 1px solid var(--line-2);
  border-radius: var(--round-1);
  font: var(--type-read) / 34px var(--mono);
  letter-spacing: 0;
}
.ed-field input { position: relative; background: var(--surface-1); color: var(--ink-1); }
.ed-field input:focus { border-color: var(--focus); outline: none; }
.ed-mirror {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-color: transparent;
  color: transparent;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
}
.ed-mirror-part.bad { text-decoration: underline wavy var(--bad); text-decoration-skip-ink: none; text-underline-offset: 4px; }
.ed-clear {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--round-1);
  background: var(--surface-1);
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
}
.ed-hint { min-height: 1.3em; margin: 0; font-size: var(--type-note); color: var(--warn); }
.ed-hint:empty { min-height: 0; }
.ed-chip {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: var(--step-1);
  min-width: var(--touch);
  min-height: 32px;
  box-sizing: border-box;
  justify-content: center;
  padding: 0 var(--step-2);
  border: 1px solid var(--line-2);
  border-radius: var(--round-pill);
  background: var(--surface-1);
  color: var(--ink-2);
  font: var(--type-label) / 1 inherit;
  cursor: pointer;
}
.ed-chip::after { content: ""; position: absolute; inset: -6px 0; z-index: -1; }
@media (hover: hover) { .ed-chip:hover { border-color: var(--ink-3); } }
.ed-chip.on { border-color: var(--ink-1); background: var(--surface-2); color: var(--ink-1); font-weight: 650; }

.ed-filter { display: flex; flex-direction: column; gap: var(--step-3); }
.ed-filter-head { margin: 0; font-size: var(--type-label); font-weight: 650; }
.ed-fs { display: flex; flex-direction: column; gap: var(--step-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.ed-fs-legend { padding: 0; margin-bottom: var(--step-1); font-size: var(--type-note); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ed-fgroup { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-fl { margin: 0; font-size: var(--type-note); color: var(--ink-3); }
.ed-frow { display: flex; flex-wrap: wrap; gap: var(--step-1); }
.ed-flist { max-height: 160px; overflow-y: auto; }
.ed-fsearch { box-sizing: border-box; width: 100%; height: 32px; padding: 0 var(--step-3); border: 1px solid var(--line-2); border-radius: var(--round-1); background: var(--surface-1); color: var(--ink-1); font: inherit; }
.ed-fsearch:focus { border-color: var(--focus); outline: none; }
.ed-fname { white-space: nowrap; }
.ed-fcount { color: var(--ink-3); font-size: var(--type-note); font-variant-numeric: tabular-nums; }
.ed-chip.zero:not(.on) { opacity: 0.55; }
.ed-fswitches { display: flex; flex-wrap: wrap; gap: var(--step-1); }
.ed-switch.on::before { content: "\2713"; }

#ed-pop-filter { max-height: calc(100dvh - 16px); }
#ed-pop-filter > .ed-filter {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(var(--surface-1) 30%, transparent) top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--surface-1) 70%) bottom / 100% 24px no-repeat local,
    linear-gradient(oklch(5% 0.02 274 / 0.45), transparent) top / 100% 10px no-repeat scroll,
    linear-gradient(transparent, oklch(5% 0.02 274 / 0.45)) bottom / 100% 10px no-repeat scroll;
}
#ed-pop-filter > .ed-filter-foot { flex: none; }
.ed-filter-foot { display: flex; justify-content: space-between; gap: var(--step-3); padding-top: var(--step-3); border-top: 1px solid var(--line-1); }
.ed-active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-1); }
.ed-active-chip, .ed-active-clear {
  position: relative;
  min-height: 28px;
  padding: 0 var(--step-2);
  border: 1px solid var(--line-2);
  border-radius: var(--round-pill);
  background: var(--surface-1);
  color: var(--ink-1);
  font: var(--type-note) / 1 inherit;
  cursor: pointer;
}
.ed-active-chip::after, .ed-active-clear::after { content: ""; position: absolute; inset: -8px 0; }
@media (hover: hover) { .ed-active-chip:hover { border-color: var(--ink-3); } }
.ed-active-clear { border-color: transparent; background: none; color: var(--ink-2); text-decoration: underline; }
.ed-set { flex: 0 0 auto; min-height: var(--touch); padding-inline: var(--step-2) var(--step-3); }
.ed-set-code { font-variant: all-small-caps; letter-spacing: 0.04em; }
.ed-meter { display: inline-block; width: 40px; height: 4px; border-radius: 2px; background: var(--surface-well); overflow: hidden; }
.ed-meter-fill { display: block; height: 100%; background: var(--ink-2); }
.ed-set-runs { font-size: var(--type-note); color: var(--ink-3); white-space: nowrap; }
.ed-shown { margin-left: auto; font-size: var(--type-note); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ed-pane {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ed-grid { position: relative; }
.ed-slot { --ed-face-w: 180px; position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; }

.ed-cell { position: relative; flex: 0 0 var(--ed-face-w); width: var(--ed-face-w); }
.ed-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: var(--round-1);
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--line-2);
  color: var(--ink-1);
  font-size: var(--type-note);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.ed-counter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  height: 36px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 0 0 var(--round-2) var(--round-2);
  background: var(--surface-1);
  color: var(--ink-1);
}
@media (hover: hover) {
  .ed-cell:hover .ed-counter, .ed-cell:focus-within .ed-counter { display: flex; }
}
.ed-cstep, .ed-cchoose {
  position: relative;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--step-2);
  border: 0;
  background: none;
  color: var(--ink-1);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.ed-cchoose { font-size: var(--type-body); font-weight: 650; }
.ed-cstep::before, .ed-cchoose::before { content: ""; position: absolute; inset: -6px; }
@media (hover: hover) { .ed-cstep:hover, .ed-cchoose:hover { background: var(--surface-2); } }
.ed-cstep[aria-disabled="true"], .ed-cchoose[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }
.ed-cn, .ed-chosen { font-variant-numeric: tabular-nums; font-weight: 650; }
.ed-chosen { margin: 0 auto; }
.ed-counter-choose { justify-content: center; }
.ed-ghead { flex: 1; display: flex; align-items: flex-end; height: 36px; padding: 0 4px 6px; border-bottom: 1px solid var(--line-1); }
.ed-ghead-label, .ed-ghead th, .ed-sticky-label { font-size: var(--type-body); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ed-sticky { position: sticky; top: 0; z-index: 3; height: 0; overflow: visible; }
.ed-sticky-label { display: flex; align-items: flex-end; box-sizing: border-box; height: 36px; padding: 0 4px 6px; border-bottom: 1px solid var(--line-1); background: var(--surface-ground); }
.ed-nolegend { display: flex; align-items: center; flex-wrap: wrap; gap: var(--step-3); margin-bottom: var(--step-3); }
.ed-nolegend-text { margin: 0; color: var(--ink-2); }
.ui-skeleton-tile { margin-bottom: var(--step-3); }
.ed-face {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 0;
  border-radius: var(--round-2);
  background: none;
  cursor: pointer;
}
.ed-face-off { cursor: help; }
.ed-face > .cf-hand { width: 100%; height: 100%; }
@media (hover: hover) { .ed-face:hover > .cf { box-shadow: 0 0 0 1px var(--ink-3), 0 6px 18px rgba(0, 0, 0, 0.4); } }
.ed-face:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

.ed-face > .cf.cf-hand > .cf-window { flex: 1 1 0; min-height: 0; }
.ed-face > .cf-hand > .cf-rules {
  flex: 0 0 auto;
  box-sizing: content-box;
  max-height: calc(4 * 1.22em);
  padding: 3px 5px 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.ed-face > .cf-hand:not(.arted) > .cf-rules { max-height: calc(6 * 1.22em); -webkit-line-clamp: 6; }
.ed-face > .cf-hand > .cf-effect {
  flex: 0 0 auto;
  max-height: calc(3 * 1.22em);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.ed-face > .cf-hand > .cf-rules, .ed-face > .cf-hand > .cf-effect { font-size: clamp(10px, 7.7cqw, 15px); }

.ed-face > .cf-hand > .cf-foot {
  position: static;
  flex: 0 0 auto;
  align-items: flex-end;
  margin: auto 0 0;
  min-height: 1.3em;
  padding: 2px 4px 3px;
  box-sizing: border-box;
}

.ed-face > .cf-hand:not(:empty) > .cf-foot {
  min-height: calc(19.6cqw + 5px);
  padding-right: calc(18cqw + 8px);
}

.ed-face > .cf.cf-hand.whole.bare > .cf-ribbon { display: block; }
.ed-face > .cf.cf-hand.whole.bare > .cf-foot {
  display: flex;
  position: absolute;
  left: 4px;
  bottom: 3px;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.ed-face > .cf.cf-hand.whole.bare > .cf-foot > .cf-set { display: none; }
.ed-none { padding: var(--step-6) var(--step-4); text-align: center; color: var(--ink-2); }
.ed-step-head { margin: 0 0 var(--step-3); font: 500 var(--type-section) / 1.2 var(--font-display); letter-spacing: var(--track-display); }
.ed-none-text { margin: 0 0 var(--step-3); }

.ed-table { position: relative; display: block; width: 100%; border-collapse: collapse; }
.ed-table thead { display: block; position: sticky; top: 0; z-index: 2; background: var(--surface-ground); }
.ed-table tr { display: grid; grid-template-columns: 84px minmax(160px, 2fr) 92px 120px 56px 56px minmax(180px, 3fr) 88px 112px; align-items: center; min-height: var(--touch); }
.ed-table th { text-align: left; font-size: var(--type-note); font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 var(--step-2); }
.ed-th { min-height: var(--touch); padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.ed-tspace { display: block; }
.ed-tslot { display: block; position: absolute; top: var(--touch); left: 0; right: 0; }
.ed-tr { height: var(--touch); border-bottom: 1px solid var(--line-1); }
.ed-tr:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
@media (hover: hover) { .ed-tr:hover { background: var(--surface-1); outline: none; } }
.ed-td-name { font-weight: 600; color: var(--ink-1); }

.ed-td-name { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.ed-snip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-note); font-weight: 400; color: var(--ink-2); }

.ed-tr .ed-td-text { font-size: var(--type-note); color: var(--ink-2); }
.ed-td-en { font-style: italic; }
.ed-tr td { padding: 0 var(--step-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-body); }
.ed-tr.ed-face-off td:not(.ed-td-in) { color: var(--ink-3); }
.ed-td-set { font-variant: all-small-caps; letter-spacing: 0.04em; color: var(--ink-3); }
.ed-td-in { display: flex; align-items: center; }
.ed-in-count { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }

:root[data-compact] .ed-table tr {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-template-rows: 20px 24px 22px 20px;
  grid-template-areas: "set status in in" "name name in in" "type dom cost might" "text text text text";
  align-content: center;
  min-height: 0;
}
:root[data-compact] .ed-table thead tr { display: flex; grid-template-areas: none; min-height: var(--touch); }
:root[data-compact] .ed-table thead th { flex: 0 1 auto; padding: 0 var(--step-2); }
:root[data-compact] .ed-table thead th:nth-child(3),
:root[data-compact] .ed-table thead th:nth-child(4),
:root[data-compact] .ed-table thead th:nth-child(7),
:root[data-compact] .ed-table thead th:nth-child(8),
:root[data-compact] .ed-table thead th:nth-child(9) { display: none; }
:root[data-compact] .ed-tr { height: 92px; }
:root[data-compact] .ed-tr td { font-size: var(--type-note); min-width: 0; padding: 0 2px; }
:root[data-compact] .ed-tr .ed-td-set { grid-area: set; }
:root[data-compact] .ed-tr .ed-td-status { grid-area: status; }
:root[data-compact] .ed-tr .ed-td-name { display: contents; }
:root[data-compact] .ed-tr .ed-chipname { grid-area: name; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-body); }
:root[data-compact] .ed-tr .ed-snip { grid-area: text; padding: 0 2px; }
:root[data-compact] .ed-tr:has(.ed-snip) .ed-td-text { display: none; }
:root[data-compact] .ed-tr .ed-td-type { grid-area: type; }
:root[data-compact] .ed-tr .ed-td-dom { grid-area: dom; }
:root[data-compact] .ed-tr .ed-td-cost { grid-area: cost; }
:root[data-compact] .ed-tr .ed-td-might { grid-area: might; }
:root[data-compact] .ed-tr .ed-td-cost::before,
:root[data-compact] .ed-tr .ed-td-might::before { content: attr(data-label) " "; color: var(--ink-3); }
:root[data-compact] .ed-tr .ed-td-text { grid-area: text; }
:root[data-compact] .ed-tr .ed-td-in { grid-area: in; grid-row: 1 / 3; justify-self: end; padding: 0; }

.ed-deck {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--step-3);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: var(--step-3);
  border: 1px solid var(--line-1);
  border-radius: var(--round-2);
  background: var(--surface-1);
}

.ed-curve {
  display: grid;
  
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
@container (min-width: 352px) {
  .ed-curve { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.ed-bar {
  display: flex;
  height: 96px;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-height: var(--touch);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: var(--type-note) / 1 inherit;
  cursor: pointer;
}
.ed-bar-col { flex: 1; display: flex; align-items: flex-end; margin-inline: 2px; border-radius: 2px; background: var(--surface-well); overflow: hidden; }
.ed-bar-fill { display: block; width: 100%; min-height: 2px; background: var(--ink-3); transform-origin: 50% 100%; }
.ed-bar.on .ed-bar-fill { background: var(--ink-1); }
.ed-bar-n { text-align: center; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.ed-bar-cost { text-align: center; color: var(--ink-3); }
.ed-state { margin: auto; display: flex; flex-direction: column; align-items: center; gap: var(--step-3); text-align: center; color: var(--ink-2); }
.ed-help {
  position: fixed;
  z-index: var(--z-modal);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(420px, 92vw);
  padding: var(--step-4);
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-sheet);
}
.ed-help-head { margin: 0 0 var(--step-3); font-size: var(--type-head); }
.ed-help-list { display: grid; grid-template-columns: auto 1fr; gap: var(--step-1) var(--step-4); margin: 0 0 var(--step-4); }
.ed-help-list dt { font-family: var(--mono); color: var(--ink-1); }
.ed-help-list dd { margin: 0; color: var(--ink-2); }
.ed-copy-field { position: fixed; top: 0; left: -10000px; opacity: 0; }

.ed-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.ed-layer > * { pointer-events: none; }
.preview-note { margin: var(--step-2) 0 0; font-size: var(--type-body); color: var(--ink-2); }

:root[data-input="touch"] .ed-face { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

:root[data-input="touch"] .ed-counter { height: var(--touch); }
:root[data-input="touch"] .ed-cell.held .ed-counter { display: flex; }
:root[data-input="touch"] :is(.ed-cstep, .ed-cchoose) { min-width: var(--touch); height: var(--touch); }
.ui-sheet .ed-chip { min-height: var(--touch); font-size: var(--type-body); }
.ed-sheet-foot { position: sticky; bottom: 0; display: flex; padding-top: var(--step-3); background: var(--surface-1); }
.ed-sheet-foot .ui-btn { flex: 1; }
.ed-look-face { display: flex; justify-content: center; }
.ed-look-note { margin: 0; font-size: var(--touch-floor-prose); color: var(--ink-1); }


:root[data-input="touch"] .ed-chip { min-height: var(--touch); }

.editor .preview-host-editor {
  display: block;
  position: fixed;
  z-index: 62;
  left: 0;
  top: 0;
  width: max-content;
  max-height: none;
  overflow: visible;
  transform-origin: 0 0;
  pointer-events: none;
}
.editor .preview-host-editor > .preview-pane.empty { display: none; }
.ed-ws-head { --row-bg: var(--surface-1); display: flex; flex-direction: column; gap: var(--step-3); margin: calc(-1 * var(--step-3)) calc(-1 * var(--step-3)) 0; padding: var(--step-3); border-bottom: 1px solid var(--line-1); background: var(--row-bg); }
.ed-ws-head[class*="ur-dom2-"] { background: linear-gradient(90deg, var(--row-bg) 40%, var(--dom2-bg)); }
.ed-ws-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-1) var(--step-2); min-width: 0; }
.ed-ws-row .ed-name { flex: 1 1 140px; min-width: 0; max-width: none; font-size: var(--type-deck-name); }
.ed-ws-actions { gap: var(--step-1); }
.ed-undo .ui-icon { display: block; }
.ed-verdictbox { position: relative; min-width: 0; }
.ed-seam { position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 1px; background: var(--good); opacity: 0; pointer-events: none; }
.ed-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-1) var(--step-3); min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink-1); font: inherit; text-align: left; cursor: pointer; }
.ed-verdict::after { content: ""; position: absolute; inset: -6px 0; }
.ed-formats { display: inline-flex; gap: var(--step-2); }
.ed-format { font-size: var(--type-note); letter-spacing: var(--track-caps); text-transform: uppercase; }
.ed-format.is-ok { color: var(--ink-1); }
.ed-format.is-off { color: var(--ink-3); text-decoration: line-through; }
.ed-verdictbox > .ed-readouts { margin-top: var(--step-2); padding: var(--step-2) var(--step-3) var(--step-3); }
.ed-ws-views { display: flex; border-bottom: 1px solid var(--line-1); }
.ed-ws-tab { flex: 1; min-height: 44px; padding: 0 var(--step-2); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: inherit; font-size: var(--type-body); cursor: pointer; }
@media (hover: hover) { .ed-ws-tab:hover { color: var(--ink-1); } }
.ed-ws-tab.on { border-bottom-color: var(--ink-1); background: var(--surface-2); color: var(--ink-1); font-weight: 650; }
:root[data-input="touch"] .ed-ws-tab { min-height: var(--touch); font-size: var(--touch-floor-ui); }
.ed-ws-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--step-3); overflow-y: auto; overscroll-behavior: contain; }
.ed-ws-foot { display: flex; align-items: center; gap: var(--step-2); padding-top: var(--step-2); border-top: 1px solid var(--line-1); }

.ed-clear-deck { margin-inline-start: auto; color: var(--bad-ink); }
.ed-view { display: flex; flex-direction: column; gap: var(--step-3); min-width: 0; }


.ed-ws-body { container-type: inline-size; }
.ed-sec { display: flex; flex-direction: column; gap: var(--step-1); min-width: 0; }
.ed-sec-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--step-3); }
@container (max-width: 280px) {
  .ed-sec-pair { grid-template-columns: minmax(0, 1fr); }
}
.ed-sec-head, .ed-group-head { display: flex; align-items: center; gap: var(--step-2); margin: 0; font-size: var(--type-note); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ed-sec-head { justify-content: space-between; min-height: 32px; }
.ed-sec-name { flex: none; }
.ed-sec-count { margin-right: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ed-sec-head.done .ed-sec-count { color: var(--ink-1); }
.ed-sec-menus, .ed-sec-head > .ed-auto { display: inline-flex; align-items: center; gap: var(--step-1); text-transform: none; letter-spacing: 0; }
.ed-group { display: flex; flex-direction: column; }
.ed-group-head { margin-top: var(--step-2); padding-bottom: 2px; border-bottom: 1px solid var(--line-1); }
.ed-group-n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ed-lines { display: flex; flex-direction: column; }
.ed-line { display: flex; align-items: center; gap: var(--step-2); min-height: 44px; padding: 0; min-width: 0; }
.ed-line-one { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.ed-line-one > .ed-change { grid-column: 1 / -1; justify-self: start; }
.ed-line-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; overflow-wrap: break-word; }
.ed-line.faulted .ed-line-name { color: var(--bad); }
.ed-line-empty { min-height: 40px; padding: 0 var(--step-3); border: 1px dashed var(--line-2); border-radius: var(--round-1); background: none; color: var(--ink-2); font: inherit; font-size: var(--type-body); text-align: left; cursor: pointer; }
@media (hover: hover) { .ed-line-empty:hover { border-color: var(--ink-3); color: var(--ink-1); } }
.ed-cost { flex: none; display: inline-flex; align-items: center; gap: 2px; min-width: 2.2em; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ed-pips { display: inline-flex; gap: 1px; }
.ed-pip { display: inline-flex; }
.ed-tag { padding: 0 var(--step-1); border: 1px solid var(--line-2); border-radius: var(--round-1); font-size: var(--type-note); color: var(--ink-2); }
.ed-mark { font-size: var(--type-note); color: var(--ink-3); }
.ed-mark.warn { color: var(--warn); }
.ed-fault { color: var(--bad); font-weight: 800; }
.ed-cn { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-1); }
.ed-step { width: var(--touch); height: var(--touch); padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 18px; cursor: pointer; }
@media (hover: hover) { .ed-step:hover { color: var(--ink-1); } }
.ed-step[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }
.ed-main-empty { margin: var(--step-2) 0; font-size: var(--type-body); color: var(--ink-3); }


.ed-art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--step-2); }
@container (min-width: 560px) {
  .ed-art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ed-art-grid > .ed-cell { width: auto; flex: none; }
.ed-stat { display: flex; flex-direction: column; gap: var(--step-1); min-width: 0; }
.ed-stat-head { margin: 0; font-size: var(--type-note); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ed-stat-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 3ch; align-items: center; gap: var(--step-2); min-height: 28px; }
.ed-stat-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ed-stat-bar { height: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.ed-stat-fill { display: block; height: 100%; background: var(--ink-3); }
.ed-stat-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-1); }
.ed-stat-note { margin: 0; font-size: var(--type-note); color: var(--ink-3); }


.ed-badge { display: flex; flex-direction: column; align-items: flex-end; }
.ed-badge-more { font-size: var(--type-note); font-weight: 500; color: var(--ink-2); }
.ed-sec-head.over .ed-sec-count { color: var(--warn); }
.ed-sec-note { margin: 0; font-size: var(--type-note); color: var(--warn); }


.ed-handle { display: none; }
.ed-ws-main { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: var(--step-3); }
@media (max-width: 599.98px) {
  :root[data-compact] .editor { height: calc(100dvh - var(--shell-h) - var(--rail-h) - env(safe-area-inset-bottom, 0px)); }
  :root[data-compact] .ed-body { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 var(--step-4) 56px; }
  :root[data-compact] .editor .preview-host-editor { display: none; }
  :root[data-compact] .ed-deck {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px));
    height: 56px;
    gap: 0;
    padding: 0;
    border-width: 1px 0 0;
    border-radius: var(--round-2) var(--round-2) 0 0;
  }
  :root[data-compact] .ed-deck[data-deck-sheet="rest"] > .ed-ws-main { visibility: hidden; }
  :root[data-compact] .ed-deck[data-deck-sheet="half"] { height: 50dvh; }
  :root[data-compact] .ed-deck[data-deck-sheet="full"] { height: calc(100dvh - var(--shell-h) - var(--rail-h) - env(safe-area-inset-bottom, 0px) - 24px); }
  :root[data-compact] .ed-handle {
    position: relative;
    flex: none;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--step-3);
    height: 56px;
    padding: 12px var(--step-4) 0;
    border: 0;
    background: none;
    color: var(--ink-1);
    font: inherit;
    font-size: var(--touch-floor-ui);
    text-align: left;
    cursor: pointer;
  }
  :root[data-compact] .ed-handle:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
  :root[data-compact] .ed-handle-bar { position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  :root[data-compact] .ed-handle-count { font-weight: 650; font-variant-numeric: tabular-nums; }
  :root[data-compact] .ed-handle-chev { color: var(--ink-2); }
  :root[data-compact] .ed-deck > .ed-ws-main { overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--step-4) var(--step-3); }
  :root[data-compact] .ed-ws-head { margin: 0 calc(-1 * var(--step-4)); padding: var(--step-3) var(--step-4); }
  :root[data-compact] .ed-ws-views { position: sticky; top: 0; z-index: 2; background: var(--surface-1); }
  :root[data-compact] .ed-ws-body { flex: none; overflow: visible; }
  
  :root[data-compact] .ed-toolbar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--step-2); }
  :root[data-compact] .ed-search { grid-row: 1; grid-column: 1; min-width: 0; }
  :root[data-compact] .ed-tool[data-ed-open="filter"] { grid-row: 1; grid-column: 2; }
  :root[data-compact] .ed-tool[data-ed-open="view"] { grid-row: 1; grid-column: 3; }
  :root[data-compact] .ed-tool[data-ed-open="type"], :root[data-compact] .ed-shown { display: none; }
  :root[data-compact] .ed-doms { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; }
  :root[data-compact] .ed-active { grid-column: 1; grid-row: 3; }
  :root[data-compact] .ed-slot-line { grid-column: 2; grid-row: 3; justify-self: end; margin: 0; }
  :root[data-compact] .ed-hint { grid-column: 1 / -1; }
}


:root[data-compact] .ed-rail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--step-1) var(--step-2); }
:root[data-compact] .ed-slotbar { display: contents; }
:root[data-compact] .ed-slots { grid-column: 1 / -1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; }
:root[data-compact] .ed-slots::-webkit-scrollbar { display: none; }
:root[data-compact] .ed-slot-tab { flex: none; scroll-snap-align: start; padding: 0 var(--step-4); border-bottom: 2px solid transparent; }
:root[data-compact] .ed-slot-tab.on { border-bottom-color: var(--ink-1); }
:root[data-compact] .ed-underline { display: none; }
:root[data-compact] .ed-active { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }


@media (min-width: 600px) {
  :root[data-compact] .editor { height: calc(100dvh - var(--shell-h) - env(safe-area-inset-bottom, 0px)); }
  :root[data-compact] .ed-body { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--step-2); padding: 0 var(--step-3) var(--step-2); }
  :root[data-compact] .editor .preview-host-editor { display: none; }
  :root[data-compact] .ed-rail { align-items: center; }
  :root[data-compact] .ed-slots { grid-column: 1; grid-row: 1; }
  :root[data-compact] .ed-toolbar { grid-column: 2; grid-row: 1; display: flex; gap: var(--step-1); }
  :root[data-compact] .ed-slot-line, :root[data-compact] .ed-hint:empty { display: none; }
  :root[data-compact] .ed-active { grid-column: 1 / -1; grid-row: 2; }
  :root[data-compact] .ed-deck { padding: var(--step-2); gap: var(--step-2); }
  :root[data-compact] .ed-ws-head { margin: calc(-1 * var(--step-2)) calc(-1 * var(--step-2)) 0; padding: var(--step-2); gap: 0; flex-flow: row nowrap; align-items: center; }
  :root[data-compact] .ed-ws-head > .ed-ws-row { display: contents; }
  :root[data-compact] .ed-ws-head .ed-name { order: 0; flex: 1 1 0; min-width: 88px; }
  :root[data-compact] .ed-ws-head .ed-save-saved, :root[data-compact] .ed-ws-head .ed-save-idle { display: none; }
  :root[data-compact] .ed-ws-head .ed-save { order: 1; }
  :root[data-compact] .ed-ws-head .ed-verdictbox { order: 2; flex: 0 1 auto; min-width: 0; max-width: 42%; }
  :root[data-compact] .ed-ws-head .ed-verdict { flex-wrap: nowrap; max-width: 100%; }
  :root[data-compact] .ed-ws-head .ed-verdict .ui-pill { min-width: 0; }
  :root[data-compact] .ed-ws-head .ed-verdict .ui-pill-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :root[data-compact] .ed-ws-head .ed-formats { display: none; }
  :root[data-compact] .ed-ws-head .ed-menu { order: 3; flex: none; }
  :root[data-compact] .ed-ws-main { gap: var(--step-2); }
  :root[data-compact] .ed-sec-head { flex-wrap: wrap; }
  :root[data-compact] .ed-sec-menu { white-space: nowrap; padding-inline: var(--step-2); }
  
  :root[data-compact] .ed-view-list > [data-ed-sec="main"] { order: -1; }
}


:root[data-input="touch"] .ed-name { min-height: var(--touch); font-size: var(--type-input); }
:root[data-input="touch"] :is(.ed-clear, .ed-active-chip, .ed-active-clear, .ed-fsearch, .ed-verdict, .ed-line-empty, .ed-undo, .ed-tool) { min-height: var(--touch); }
:root[data-input="touch"] :is(.ed-clear, .ed-undo, .ed-sec-dir) { min-width: var(--touch); }


.ed-line > .ed-cstep { width: 44px; height: 44px; padding: 0; }
.ed-clear::before { content: ""; position: absolute; inset: -4px; }


.ed-sec-pair { gap: var(--step-2); }
.ed-sec-pair .ed-sec-head { min-height: 24px; }
.ed-line-one { position: relative; min-height: 44px; }
.ed-line-one > .ed-change { position: absolute; inset: 0; grid-column: auto; width: 100%; height: 100%; padding: 0; border-radius: var(--round-1); background: none; font-size: 12px; color: transparent; }
@media (hover: hover) { .ed-line-one > .ed-change:hover { background: var(--surface-2); opacity: 0.4; } }
.ed-line-one > .ed-change:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
.ed-sec-fold { flex: 1; display: flex; align-items: center; gap: var(--step-2); min-width: 0; min-height: var(--touch); padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .ed-sec-fold:hover .ed-sec-name { color: var(--ink-1); } }
.ed-sec-fold:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.ed-sec-chev { margin-left: auto; padding-right: var(--step-2); font-size: 16px; color: var(--ink-2); }
.ed-sec[data-open="false"] > .ed-lines { display: none; }
.ed-sec[data-open="false"] > .ed-sec-head > .ed-auto { display: none; }
:root[data-input="touch"] .ed-sec-fold { min-height: var(--touch); }


@media (min-width: 600px) {
  :root[data-compact] .ed-toolbar { display: contents; }
  :root[data-compact] .ed-rail { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  :root[data-compact] .ed-slots { grid-column: 1 / 2; grid-row: 1; }
  :root[data-compact] .ed-tool[data-ed-open="filter"] { grid-column: 2; grid-row: 1; }
  :root[data-compact] .ed-tool[data-ed-open="view"] { grid-column: 3; grid-row: 1; }
  :root[data-compact] .ed-search { grid-column: 1; grid-row: 2; min-width: 0; flex: none; }
  :root[data-compact] .ed-doms { grid-column: 2 / -1; grid-row: 2; gap: 2px; justify-content: flex-end; }
  :root[data-compact] .ed-dom { width: 36px; height: 36px; }
  :root[data-input="touch"][data-compact] .ed-dom { width: var(--touch); height: var(--touch); }
  :root[data-compact] .ed-slot-tab { padding: 0 var(--step-2); font-size: 13px; }
  :root[data-compact] .ed-active { grid-row: 3; }
  :root[data-compact] .ed-ws-foot { display: none; }
  :root[data-compact] .ed-ws-views .ed-ws-tab { min-height: 36px; }
  :root[data-input="touch"][data-compact] .ed-ws-views .ed-ws-tab { min-height: var(--touch); }
  :root[data-compact] .ed-ws-body { overflow-y: auto; }
  :root[data-compact] .ed-sec-head { min-height: 28px; }
}

@media (min-width: 600px) {
  
  :root[data-compact] .ed-slots { mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  :root[data-compact] .ed-ws-head { padding-block: 4px; margin-block-start: -8px; }
  :root[data-compact] .ed-ws-main { gap: 0; }
}


.ed-face:has(> .cf.t-battlefield) { aspect-ratio: 1039 / 744; }

.ed-art-grid.ed-art-land { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-active-chip, .ed-active-clear { flex: none; white-space: nowrap; }
.ed-unreadable { overflow-wrap: anywhere; }



@media (max-width: 1179.98px) {
  .ed-slots { display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; grid-template-columns: none; }
  .ed-slots::-webkit-scrollbar { display: none; }
  .ed-slot-tab { flex: 1 0 auto; padding: 0 var(--step-3); font-size: 13px; }
  .ed-slot-tab.on { box-shadow: inset 0 -2px 0 var(--ink-1); }
  .ed-underline { display: none; }
  .ed-search { flex: 1 1 140px; min-width: 120px; }
  .ed-doms { gap: 4px; }
  .ed-dom { width: 30px; height: 30px; }
  .ed-ws-actions { flex-wrap: nowrap; gap: 2px; }
  .ed-ws-actions .ui-btn-md { padding-inline: var(--step-2); }
  .ed-ws-actions .ed-undo { min-width: 36px; }
  .ed-verdict { flex-wrap: nowrap; }
  .ed-formats { display: none; }
}
@media (max-width: 859.98px) and (min-width: 600px) {
  :root:not([data-compact]) .ed-doms { order: 5; flex: 1 0 100%; justify-content: space-between; }
}
@media (max-width: 1023.98px) {
  .ed-body { gap: var(--step-3); padding-inline: var(--step-3); }
}

@media (max-width: 599.98px) {
  :root[data-compact] .ed-ws-head { flex-flow: row wrap; align-items: center; gap: 0 var(--step-2); padding-block: var(--step-2); }
  :root[data-compact] .ed-ws-head > .ed-ws-row { display: contents; }
  :root[data-compact] .ed-ws-head .ed-name { order: 0; flex: 1 1 0; min-width: 90px; }
  :root[data-compact] .ed-ws-head .ed-save-saved, :root[data-compact] .ed-ws-head .ed-save-idle { display: none; }
  :root[data-compact] .ed-ws-head .ed-save { order: 1; }
  :root[data-compact] .ed-ws-head .ed-menu { order: 2; flex: none; }
  :root[data-compact] .ed-ws-head .ed-verdictbox { order: 1; flex: 0 1 auto; min-width: 0; }
  :root[data-compact] .ed-ws-head .ed-verdict { flex-wrap: nowrap; }
  
  :root[data-compact] .ed-view-list > [data-ed-sec="main"] { order: -1; }
  :root[data-compact] .ed-ws-foot { padding-block: var(--step-1); }
}

[data-sheet="ed-view"] .ui-pop-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
[data-sheet="ed-view"] .ui-pop-check { display: none; }
[data-sheet="ed-view"] .ui-pop-item[aria-checked="true"] { background: var(--surface-2); font-weight: 650; box-shadow: inset 0 -2px 0 var(--ink-1); }
[data-sheet="ed-view"] .ui-pop-head { grid-column: 1 / -1; }
[data-sheet="ed-view"] .ui-pop-item { padding-inline: var(--step-2); }

@container (max-width: 300px) {
  .ed-sec-head { flex-wrap: wrap; }
  .ed-sec-menus { flex: 1 0 100%; }
}



.ed-thumb-pick { position: relative; flex: none; display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 4px; }
.ed-thumb-pick::before { content: ""; position: absolute; inset: -6px; }
.ed-thumb-pick:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

.ed-line-one > .ed-thumb-pick { z-index: 1; }
.ed-stack {
  position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; box-sizing: border-box;
  border: 1px solid var(--ink-2); border-radius: 2px; background: var(--surface-1);
  box-shadow: -2px -2px 0 -1px var(--surface-1), -2px -2px 0 0 var(--ink-2);
}
.ed-arts { font-size: var(--type-note); color: var(--ink-2); }

.ed-art-chip { position: relative; min-width: 32px; height: 32px; padding: 0 var(--step-2); border: 1px solid var(--line-2); border-radius: var(--round-1); background: var(--surface-1); color: var(--ink-1); font: inherit; font-size: var(--type-note); font-weight: 650; cursor: pointer; }
.ed-art-chip::before { content: ""; position: absolute; inset: -6px; }
@media (hover: hover) { .ed-art-chip:hover { background: var(--surface-2); } }
.ed-art-chip:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

.ed-arts-chip { position: absolute; left: 0; top: 0; z-index: 2; min-height: 44px; min-width: 44px; padding: 0 var(--step-2) 8px; border: 0; background: none; color: var(--ink-1); font: inherit; font-size: var(--type-note); font-weight: 650; cursor: pointer; }

.ed-arts-chip::before { content: ""; position: absolute; inset: 6px 6px auto 6px; height: 24px; z-index: -1; box-sizing: border-box; border: 1px solid var(--line-2); border-radius: var(--round-1); background: var(--surface-1); }
@media (hover: hover) { .ed-arts-chip:hover::before { background: var(--surface-2); } }
.ed-arts-chip:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

.ed-look-arts { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: var(--step-2) 4px; }
.ed-look-art { flex: none; width: 72px; min-height: 44px; margin: 0; padding: 4px; font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; display: grid; gap: 4px; justify-items: center; touch-action: manipulation; }
.ed-look-art.on { border-color: var(--ink-1); background: var(--surface-2); }
.ed-look-art:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.ed-look-art-img { width: 100%; aspect-ratio: 744 / 1039; object-fit: contain; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface-well); }
.ed-look-art-cap { font-size: 11px; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }


.pp .pp-option, .pp .pp-label, .pp .pp-count { font-size: 12px; }
.pp .pp-label { overflow-wrap: break-word; }
@media (max-width: 599.98px) { .pp.pp { --pp-w: 84px; } }

:root[data-compact] .ed-table tr.ed-ghead { display: flex; }


.ed-cost-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 2px; box-sizing: border-box; border-radius: 12px; background: #161821; border: 1px solid var(--line-2); color: #fff; font-size: var(--type-note); font-weight: 700; }
.ed-line-read > .ed-cn { flex: none; min-width: 3ch; text-align: left; color: var(--ink-2); }
.ed-line > .ed-cost { margin-inline-start: auto; }
.ed-sec-piles { align-items: start; }
@container (max-width: 360px) {
  .ed-sec-piles { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: fine) {
  .ed-sec-piles .ed-cstep { width: 28px; }
}
.ed-grip { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 8px; cursor: col-resize; touch-action: none; }
.ed-grip::after { content: ""; position: absolute; top: 50%; left: 2px; width: 3px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--line-2); }
@media (hover: hover) { .ed-grip:hover::after { background: var(--ink-3); } }
.ed-grip:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
.ed-grip[data-dragging]::after { background: var(--ink-1); }
:root[data-compact] .ed-grip { display: none; }
@media (max-width: 699.98px) { .ed-grip { display: none; } }

.bm-anchor { position: fixed; width: 0; height: 0; pointer-events: none; }
.bm-anchor[hidden] { display: none; }

#ed-bmenu { min-width: 232px; z-index: var(--z-sheet); }
.bm-wrap { position: relative; display: flex; flex-direction: column; }
.bm-item { width: 100%; text-align: start; }
.bm-chev { color: var(--ink-3); }
.bm-sub {
  position: absolute;
  top: calc(-1 * var(--step-1) - 1px);
  left: 100%;
  z-index: var(--z-sheet);
  display: flex;
  flex-direction: column;
  min-width: 128px;
  padding: var(--step-1) 0;
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-1);
  box-shadow: var(--win-shadow);
}
.bm-sub[hidden] { display: none; }
.bm-wrap.is-flip > .bm-sub { left: auto; right: 100%; }
.bm-item[aria-expanded="true"] { background: var(--surface-2); }
@media (max-width: 699.98px) {
  .bm-sub { position: static; border: 0; box-shadow: none; padding: 0 0 0 var(--step-4); min-width: 0; }
  .bm-wrap.is-flip > .bm-sub { right: auto; }
}


.ed-line[data-ed-spine] { position: relative; isolation: isolate; border-radius: var(--round-1); }
.ed-line[data-ed-spine] > .ed-cost { margin-inline-start: 0; }
.ed-spine-band { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; background: var(--surface-1); pointer-events: none; }
.ed-spine-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; opacity: 0.4; -webkit-mask-image: linear-gradient(90deg, transparent 6%, #000 52%, transparent 100%); mask-image: linear-gradient(90deg, transparent 6%, #000 52%, transparent 100%); }
.ed-copies { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.ed-copy { display: block; width: 6px; height: 12px; border-radius: 2px; border: 1px solid var(--ink-3); background: transparent; }
.ed-copies[data-n="1"] > .ed-copy:nth-child(-n+1),
.ed-copies[data-n="2"] > .ed-copy:nth-child(-n+2),
.ed-copies:not([data-n="0"], [data-n="1"], [data-n="2"]) > .ed-copy { background: var(--ink-1); border-color: var(--ink-1); }

@media (max-width: 600px) { .ed-copies { display: none; } }
:root[data-compact] .ed-copies { display: none; }
