/* ============================================================================
 * BOX BOX - public/tune.css
 * ----------------------------------------------------------------------------
 * "Настройка". One thing on screen at a time: a box to say it in, then the
 * target to agree, then the change to approve. Nothing else competes.
 * ==========================================================================*/

/* IT HAS TO SCROLL, AND IT HAS TO FILL THE PANE.

   This was a fixed-width block with no height and no overflow, dropped into
   .rview - which is a flex column with overflow:hidden. So anything past the
   fold was clipped and unreachable (Ethan: "stuff down below the page that is
   cut and cropped out of scene"), and the block itself sat as a narrow strip
   at the top of a wide pane rather than looking like a screen ("why is it
   just some weird little thing sitting there").

   flex:1 + min-height:0 + overflow-y makes it the scrolling body of the pane,
   and the gutter is --doc-col so it lines up with every other screen. */
.tune-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px max(24px, (100% - var(--doc-col)) / 2) 64px;
}
.tune-view > * { max-width: 680px; margin-left: auto; margin-right: auto; }

.tune-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.tune-sub {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
}

/* -- step 1: say it ------------------------------------------------------- */

.tune-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.tune-input {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 14px;
}

/* .tune-examples and .tune-example are gone along with the three canned
   complaints they styled. The hunt page keeps its own chips under a different
   class: those fill an empty field with a topic, they do not submit a
   complaint on her behalf. */

/* -- what she said, echoed back ------------------------------------------- */

.tune-said {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
}

/* -- step 2: the target --------------------------------------------------- */

.tune-target {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--muted);
}

.tune-target strong {
  color: var(--accent);
  font-size: 17px;
}

.tune-note,
.tune-msg,
.tune-stat,
.tune-working {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.tune-msg {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin: 14px 0;
  color: var(--text);
}

.tune-working { color: var(--accent); }

.tune-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.tune-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
}

.tune-choice:hover { border-color: var(--accent); color: var(--accent); }

.tune-acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0 0;
}

/* -- step 3: the change --------------------------------------------------- */

.tune-errors {
  border: 1px solid #c0392b;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 16px 0;
}

.tune-errors p { margin: 0 0 6px; font-size: 13px; line-height: 1.55; }
.tune-err { color: #c0392b; }

.tune-diff {
  margin: 18px 0 0;
  font-size: 12px;
}

.tune-diff summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.tune-diff-body {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-add { color: #2e7d4f; }
.diff-del { color: #b4553a; }

.tune-done {
  font-size: 17px;
  color: var(--accent);
  margin: 0;
}

.tune-error {
  font-size: 13px;
  color: #c0392b;
  margin: 0 0 14px;
}

/* -- the way out to the real editor --------------------------------------- */

.tune-advanced {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tune-adv-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  /* 14px tall as a bare underlined line of text: unmissable with a mouse,
     genuinely hard to hit with a thumb. */
  min-height: var(--tap);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tune-adv-btn:hover { color: var(--text); }

/* .rail-item.is-advanced is gone along with the rail entry it dimmed: the
   editor is reached from .tune-adv-btn above. */

@media (max-width: 640px) {
  .tune-view { padding: 28px 16px 56px; }
}
