.tool {
  background: var(--paper);
}
.tool body {
  padding: 0;
  background: var(--paper);
}
.tool #sheet {
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.tool #mast,
.tool #ticker,
.tool #side,
.tool #sponsors,
.tool #foot,
.tool .ad,
.tool xcl-ad,
.tool xcl-pill-ad {
  display: none !important;
}
.tool #cols {
  display: block;
}
.tool main {
  padding: 0;
}

.ed,
.ed-layer {
  --ed-ink: var(--ink);
  --ed-soft: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --ed-bg: var(--paper);
  --ed-panel: color-mix(in srgb, var(--ink) 5%, var(--paper));
  --ed-hover: color-mix(in srgb, var(--ink) 10%, var(--paper));
  --ed-line: color-mix(in srgb, var(--ink) 22%, var(--paper));
  --ed-field: var(--field);
  --ed-field-ink: var(--field-ink);
  --ed-accent: var(--link);
  --ed-on-accent: var(--paper);
  --ed-bad: var(--want);
  --ed-good: var(--mint2);
  --ed-add: color-mix(in srgb, var(--mint2) 22%, var(--field));
  --ed-del: color-mix(in srgb, var(--want) 20%, var(--field));
  --ed-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ed-r: 4px;
  font: 14px/1.45 var(--ui);
  color: var(--ed-ink);
}
.ed {
  background: var(--ed-bg);
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
:is(.ed, .ed-layer) *,
:is(.ed, .ed-layer) *::before,
:is(.ed, .ed-layer) *::after {
  box-sizing: border-box;
}
.ed-wait {
  padding: 24px;
  color: var(--ed-soft);
}

:is(.ed, .ed-layer) button,
:is(.ed, .ed-layer) .ed-btn {
  font: 13px/1 var(--ui);
  color: var(--ed-ink);
  background: var(--ed-field);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  filter: none;
}
:is(.ed, .ed-layer) button:hover,
:is(.ed, .ed-layer) .ed-btn:hover {
  background: var(--ed-hover);
}
:is(.ed, .ed-layer) button:disabled {
  opacity: 0.5;
  cursor: default;
}
:is(.ed, .ed-layer) button.ed-primary {
  background: var(--ed-accent);
  border-color: var(--ed-accent);
  color: var(--ed-on-accent);
  font-weight: 600;
}
:is(.ed, .ed-layer) button.ed-primary:hover {
  background: color-mix(in srgb, var(--ed-accent) 85%, var(--ed-ink));
}
:is(.ed, .ed-layer) button.ed-quiet {
  background: transparent;
  border-color: transparent;
}
:is(.ed, .ed-layer) button.ed-quiet:hover {
  background: var(--ed-hover);
}
:is(.ed, .ed-layer) button[aria-pressed="true"] {
  background: var(--ed-hover);
  border-color: var(--ed-soft);
}
:is(.ed, .ed-layer) :focus-visible {
  outline: 2px solid var(--ed-accent);
  outline-offset: 1px;
}
:is(.ed, .ed-layer) input,
:is(.ed, .ed-layer) select,
:is(.ed, .ed-layer) textarea {
  font: 14px/1.4 var(--ui);
  color: var(--ed-field-ink);
  background: var(--ed-field);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  padding: 6px 8px;
  width: 100%;
  max-width: none;
  box-shadow: none;
}
:is(.ed, .ed-layer) input[type="checkbox"] {
  width: auto;
  accent-color: var(--ed-accent);
}
:is(.ed, .ed-layer) a {
  color: var(--ed-accent);
}

.ed-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--ed-panel);
  border-bottom: 1px solid var(--ed-line);
}
.ed-back {
  text-decoration: none;
  white-space: nowrap;
}
.ed-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-name small {
  font-weight: 400;
  color: var(--ed-soft);
  margin-left: 6px;
}
.ed-state {
  margin-left: auto;
  color: var(--ed-soft);
  font-size: 13px;
  white-space: nowrap;
}
.ed-state.bad {
  color: var(--ed-bad);
}
.ed-state.dirty::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ed-accent);
  margin-right: 6px;
  vertical-align: 1px;
}
.ed-head .ed-acts {
  display: flex;
  gap: 6px;
}

.ed-note {
  margin: 10px 14px 0;
  padding: 8px 10px;
  border: 1px solid var(--ed-line);
  border-left: 4px solid var(--ed-accent);
  border-radius: var(--ed-r);
  background: var(--ed-panel);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.ed-note.bad {
  border-left-color: var(--ed-bad);
}
.ed-note > span {
  flex: 1 1 260px;
}

.ed-fields {
  margin: 10px 14px 0;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  background: var(--ed-panel);
}
.ed-fields > summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.ed-fields > summary::-webkit-details-marker {
  display: none;
}
.ed-fields > summary::before {
  content: "▸";
  color: var(--ed-soft);
  width: 10px;
}
.ed-fields[open] > summary::before {
  content: "▾";
}
.ed-fields > summary small {
  font-weight: 400;
  color: var(--ed-soft);
}
.ed-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 4px 10px 12px;
}
.ed-f {
  display: flex;
  flex-direction: column;
  gap: 3px;
  grid-column: span 6;
  min-width: 0;
}
.ed-f.w3 {
  grid-column: span 3;
}
.ed-f.w4 {
  grid-column: span 4;
}
.ed-f.w8 {
  grid-column: span 8;
}
.ed-f.w12 {
  grid-column: span 12;
}
.ed-f > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-soft);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ed-f > span em {
  font-style: normal;
  font-weight: 400;
}
.ed-f > small {
  color: var(--ed-soft);
  font-size: 12px;
}
.ed-f .ed-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ed-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 6px;
}
.ed-check > span {
  color: var(--ed-ink);
  font-weight: 400;
  font-size: 13px;
}
.ed-sub {
  grid-column: span 12;
  border-top: 1px solid var(--ed-line);
  padding-top: 10px;
  font-weight: 600;
  font-size: 12px;
  color: var(--ed-soft);
}
.ed-kv {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr) auto;
  gap: 6px;
  align-items: center;
}
.ed-kv textarea,
.ed-lines {
  font: 13px/1.4 var(--ed-mono);
  resize: vertical;
}

.ed-tools {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 14px 0;
  padding: 5px;
  border: 1px solid var(--ed-line);
  border-bottom: 0;
  border-radius: var(--ed-r) var(--ed-r) 0 0;
  background: var(--ed-panel);
  position: sticky;
  top: 49px;
  z-index: 15;
}
.ed-tools .ed-sep {
  width: 1px;
  align-self: stretch;
  background: var(--ed-line);
  margin: 2px 3px;
}
.ed-tools button {
  padding: 4px 7px;
  font-size: 12.5px;
}
.ed-tools .ed-push {
  margin-left: auto;
}
.ed-seg {
  display: inline-flex;
}
.ed-seg button {
  border-radius: 0;
  margin-left: -1px;
}
.ed-seg button:first-child {
  border-radius: var(--ed-r) 0 0 var(--ed-r);
  margin-left: 0;
}
.ed-seg button:last-child {
  border-radius: 0 var(--ed-r) var(--ed-r) 0;
}

.ed-work {
  flex: none;
  display: flex;
  margin: 0 14px;
  height: calc(100vh - 96px);
  min-height: 420px;
  border: 1px solid var(--ed-line);
  border-radius: 0 0 var(--ed-r) var(--ed-r);
}
.ed-panes {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.ed[data-view="write"] .ed-panes {
  grid-template-columns: minmax(0, 1fr);
}
.ed[data-view="write"] .ed-preview-wrap {
  display: none;
}
.ed[data-view="preview"] .ed-panes {
  grid-template-columns: minmax(0, 1fr);
}
.ed[data-view="preview"] .ed-src-wrap {
  display: none;
}
.ed-src-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}
.ed textarea.ed-src {
  flex: 1;
  border: 0;
  border-radius: 0;
  resize: none;
  padding: 14px 16px;
  font: 14px/1.6 var(--ed-mono);
  height: 100%;
  tab-size: 2;
}
.ed textarea.ed-src.raw {
  background: color-mix(in srgb, var(--ed-accent) 4%, var(--ed-field));
}
.ed-src-wrap.drop::after {
  content: "Drop to upload";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--ed-accent);
  border-radius: var(--ed-r);
  background: color-mix(in srgb, var(--ed-accent) 12%, transparent);
  color: var(--ed-accent);
  font-weight: 600;
  pointer-events: none;
}
.ed-preview-wrap {
  border-left: 1px solid var(--ed-line);
  overflow: auto;
  min-height: 0;
  background: var(--paper);
}
.ed[data-view="preview"] .ed-preview-wrap {
  border-left: 0;
}
@media (max-width: 1280px) {
  .ed.media-open[data-view="split"] .ed-panes {
    grid-template-columns: minmax(0, 1fr);
  }
  .ed.media-open[data-view="split"] .ed-preview-wrap {
    display: none;
  }
}
.ed-preview {
  padding: 14px 20px 30px;
  font: 15px/1.55 var(--serif);
}
.ed-preview h1.t {
  margin-top: 0;
}

.ed-foot {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0 14px 14px;
  padding: 6px 2px;
  color: var(--ed-soft);
  font-size: 12px;
}
.ed-foot .over {
  color: var(--ed-bad);
  font-weight: 600;
}
.ed-foot .ed-miss a {
  color: var(--ed-bad);
}

.ed-media {
  width: 360px;
  flex: none;
  border-left: 1px solid var(--ed-line);
  background: var(--ed-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ed-media[hidden] {
  display: none;
}
.ed-mhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ed-line);
  font-weight: 600;
}
.ed-mhead button {
  margin-left: auto;
}
.ed-drop {
  margin: 10px;
  padding: 14px 10px;
  border: 2px dashed var(--ed-line);
  border-radius: var(--ed-r);
  text-align: center;
  color: var(--ed-soft);
  font-size: 13px;
}
.ed-drop.drop {
  border-color: var(--ed-accent);
  background: color-mix(in srgb, var(--ed-accent) 10%, transparent);
  color: var(--ed-accent);
}
.ed-drop p {
  margin: 0 0 8px;
}
.ed-drop small {
  display: block;
  margin-top: 8px;
}
.ed-queue {
  list-style: none;
  margin: 0 10px;
  padding: 0;
}
.ed-queue li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ed-line);
  font-size: 12px;
}
.ed-queue li b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-queue li.bad em {
  color: var(--ed-bad);
}
.ed-queue li.done em {
  color: var(--ed-good);
}
.ed-queue em {
  font-style: normal;
  color: var(--ed-soft);
}
.ed-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--ed-line);
  overflow: hidden;
}
.ed-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ed-accent);
  transition: width 0.15s;
}
.ed-mtabs {
  display: flex;
  gap: 4px;
  padding: 10px 10px 6px;
}
.ed-mtabs button {
  flex: 1;
  padding: 5px 6px;
}
.ed-mfind {
  padding: 0 10px 8px;
}
.ed-lib {
  flex: 1;
  overflow: auto;
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}
.ed-lib button {
  padding: 0;
  height: 96px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ed-field);
}
.ed-lib button img,
.ed-lib button .vid {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--ed-soft);
}
.ed-lib button span {
  font-size: 10px;
  padding: 3px 4px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ed-soft);
  text-align: left;
}
.ed-lib button.on {
  outline: 2px solid var(--ed-accent);
  outline-offset: 1px;
}
.ed-lib .ed-empty {
  grid-column: 1 / -1;
  color: var(--ed-soft);
  font-size: 13px;
  padding: 10px 0;
}
.ed-pick {
  border-top: 1px solid var(--ed-line);
  padding: 10px;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.ed-pick[hidden] {
  display: none;
}
.ed-pick .ed-pickhead {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ed-pick img,
.ed-pick video {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--ed-r);
  border: 1px solid var(--ed-line);
  flex: none;
}
.ed-pick code {
  font: 12px var(--ed-mono);
  word-break: break-all;
}
.ed-pick .ed-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ed-pop {
  position: fixed;
  z-index: 50;
  width: min(420px, calc(100vw - 20px));
  background: var(--ed-bg);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 25%, transparent);
  padding: 10px;
  display: grid;
  gap: 8px;
  font: 14px/1.4 var(--ui);
  color: var(--ed-ink);
}
.ed-pop label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-soft);
}
.ed-pop ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
}
.ed-pop li {
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ed-pop li small {
  color: var(--ed-soft);
}
.ed-pop li.on,
.ed-pop li:hover {
  background: var(--ed-hover);
}
.ed-pop .ed-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.ed-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ed-dialog {
  width: min(900px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--ed-bg);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 35%, transparent);
}
.ed-dialog > header,
.ed-dialog > footer {
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.ed-dialog > header {
  border-bottom: 1px solid var(--ed-line);
  font-weight: 600;
}
.ed-dialog > header small {
  font-weight: 400;
  color: var(--ed-soft);
}
.ed-dialog > footer {
  border-top: 1px solid var(--ed-line);
  flex-wrap: wrap;
}
.ed-dialog > footer label {
  flex: 1 1 300px;
}
.ed-dialog .ed-body {
  overflow: auto;
  padding: 10px 14px;
  display: grid;
  gap: 10px;
}
.ed-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.ed-checks li::before {
  content: "•";
  margin-right: 6px;
  color: var(--ed-soft);
}
.ed-checks li.bad {
  color: var(--ed-bad);
  font-weight: 600;
}
.ed-checks li.ok {
  color: var(--ed-good);
}
.ed-diff {
  font: 12.5px/1.5 var(--ed-mono);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r);
  overflow: auto;
  background: var(--ed-field);
  color: var(--ed-field-ink);
}
.ed-diff div {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0 10px 0 28px;
  text-indent: -18px;
}
.ed-diff .add {
  background: var(--ed-add);
}
.ed-diff .del {
  background: var(--ed-del);
}
.ed-diff .gap {
  color: var(--ed-soft);
  background: var(--ed-panel);
  text-indent: 0;
  padding-left: 10px;
}
.ed-err {
  color: var(--ed-bad);
  font-weight: 600;
}

.ed-read {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.ed-read textarea {
  font: 13px/1.55 var(--ed-mono);
  min-height: 70vh;
}

@media (max-width: 900px) {
  .ed-f,
  .ed-f.w3,
  .ed-f.w4,
  .ed-f.w8 {
    grid-column: span 12;
  }
  .ed-panes {
    grid-template-columns: minmax(0, 1fr);
  }
  .ed[data-view="split"] .ed-preview-wrap {
    display: none;
  }
  .ed-work {
    height: 75vh;
  }
  .ed-media {
    position: fixed;
    inset: auto 0 0 0;
    width: auto;
    height: 70vh;
    max-height: 70vh;
    z-index: 40;
    border-left: 0;
    border-top: 1px solid var(--ed-line);
    box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 25%, transparent);
  }
  .ed-tools {
    top: 0;
    position: static;
  }
  .ed-head {
    position: static;
  }
  .ed-state {
    margin-left: 0;
    width: 100%;
    order: 5;
  }
}
