.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
}
aside { padding-top: 20px; align-self: start; position: sticky; top: 0; }
.work { min-width: 0; }

.file {
  display: block;
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file:hover { color: var(--ink); }
.file[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
.new {
  width: 100%;
  height: 32px;
  margin-top: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 13px;
}
.new:hover { border-color: var(--ink); }

.try { padding: 20px 0; border-bottom: 1px solid var(--line); }
.try > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.try-row { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.try-row textarea { margin: 0 !important; min-height: 40px; }
.try-row .primary { height: auto; min-width: 72px; }
.try .hint { margin-top: 6px; font-size: 12px; }
#try-result:not(:empty) { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.verdict { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.answers { margin: 0; padding: 0 14px; list-style: none; }
.answers li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.answers li:first-child { border-top: 0; }
.answers .value { flex: 1; color: var(--text-2); }
.answers .conf { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
#try-result > .hint, #try-result > .warn { padding: 10px 14px; margin: 0; }

.name { margin-top: 20px; }
#editor > details { margin-top: 20px; }
#editor > details > summary { font-weight: 600; font-size: 14px; padding: 2px 0; }
summary .grow { flex: 1; }
.count { color: var(--text-3); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.section-hint { margin: 2px 0 8px 20px; }

.ask { margin-left: 20px; border-top: 1px solid var(--line); }
.ask:first-of-type { border-top: 0; }
.ask > summary { padding: 9px 0; min-width: 0; }
.ask-id { font-weight: 500; white-space: nowrap; }
.badge { flex: none; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.badge::before { content: "·"; margin-right: 8px; }
.badge.routes { color: var(--text-2); }
.preview { flex: 1; min-width: 0; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview:not(:empty)::before { content: "—"; margin-right: 8px; }
.body { padding: 2px 0 14px 20px; }
.pair, .criterion { display: grid; gap: 10px; margin-top: 10px; }
.pair { grid-template-columns: 1fr 1fr; }
.criterion { grid-template-columns: 1fr 1.6fr 32px; align-items: end; }
.criterion.score { grid-template-columns: 1fr 32px; }
.body > label { margin-top: 10px; }
.note { margin-top: 8px; }
.warn { margin: 4px 0; font-size: 13px; color: var(--danger); }

button.text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin: 10px 12px 2px 0;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 12.5px;
}
button.text::before { content: "+"; font-size: 14px; line-height: 1; color: var(--text-2); }
button.text:hover { border-color: var(--ink); }
button.text:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.text.danger { border: 0; padding: 0; color: var(--danger); }
button.text.danger::before { content: none; }
button.text.danger:hover { text-decoration: underline; }
button.text[data-action="add-shared"] { margin-left: 20px; }
button.icon {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
}
button.icon:hover { color: var(--danger); }

.route { margin-left: 20px; padding: 10px 0 6px; border-top: 1px solid var(--line); }
.route:first-child { border-top: 0; }
.route-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.route-label { font-family: var(--mono); font-size: 12.5px; }
.route.empty .route-label { color: var(--text-3); }
.route .ask { margin-left: 0; }
.route.orphan .route-label { color: var(--danger); }

.sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 12px 0 4px 20px; }
.slider { display: grid; gap: 6px; align-content: start; }
.slider span { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 13px; }
.slider output { font-variant-numeric: tabular-nums; }
.slider small { color: var(--text-2); font-size: 12px; line-height: 1.4; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  margin: 8px 0;
  background: var(--line-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }
input[type="range"]:focus { outline: none; }
input[type="range"]:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }

.divider { margin: 24px 0 0; border: 0; border-top: 1px solid var(--line); }
.delete { display: block; margin: 32px 0 0; padding: 0; border: 0; background: transparent; color: var(--danger); font-size: 13px; }
.delete:hover { text-decoration: underline; }
.delete-note { margin-top: 32px; }

#json-dialog { width: min(880px, calc(100vw - 32px)); height: min(80vh, 760px); }
#confirm-field { margin: -6px 0 16px; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
#json-close { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); font-size: 13px; }
#json-body { margin: 0; padding: 16px; height: calc(100% - 49px); overflow: auto; background: var(--surface); line-height: 1.55; }

@media (max-width: 760px) {
  .layout, .sliders, .pair { grid-template-columns: 1fr; }
  .layout { gap: 0; }
  aside { position: static; padding-bottom: 12px; }
  .criterion { grid-template-columns: 1fr 32px; }
  .criterion label:nth-child(2) { grid-column: 1; }
}
