/* ============================================================================
   The code panel on the landing page: the code for what is on this computer,
   and the box a saved code is pasted into.
   common.css has the tokens and says what each color is allowed to mean.
   Amber here is the code that is about to be used; a refusal is red with a
   mark and a sentence; done is green with a mark and a sentence.
   ========================================================================= */

.code-panel { display: grid; gap: 10px; min-width: 0; }
.code-panel > * { min-width: 0; }

.code-panel h2 { font-size: 1.15rem; margin: 0; }
.code-panel p { margin: 0; }
.code-about { color: var(--dim); font-size: 0.95rem; max-width: 62ch; }

.code-unsaved {
  padding: 8px 12px;
  background: var(--panel-lo);
  border-left: 6px solid var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.code-use-head {
  margin-top: 12px !important;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
}

.code-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: -4px;
}

/* A code is one long word. It has to break anywhere, inside its box, or it
   pushes the page wider than a phone. */
.code-box {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--rule-hot);
  border-radius: 0;
  padding: 9px 12px;
  resize: none;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
}
.code-box[readonly] { background: var(--panel-lo); overflow: hidden; }

.copy-note { font-size: 0.95rem; color: var(--dim); }
.copy-note .marked { font-weight: 700; }

/* ------------------------------------------------- what was pasted, answered */

.code-msg { display: grid; gap: 12px; min-width: 0; }
.code-msg:empty { display: none; }
.code-msg > * { min-width: 0; }

.code-msg .marked { align-items: baseline; }
.code-refused {
  padding: 10px 14px;
  background: var(--red-fill);
  border-left: 6px solid var(--red);
}
.code-done {
  padding: 10px 14px;
  background: var(--green-fill);
  border-left: 6px solid var(--green);
}

/* The two sides, before anything is replaced. */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare .side {
  border: 2px solid var(--rule);
  background: var(--paper);
  padding: 12px 14px;
  min-width: 0;
}
/* The one being acted on. Its label says which it is. */
.compare .side.incoming { border-color: var(--amber); box-shadow: inset 6px 0 0 var(--amber); padding-left: 20px; }

.compare .lbl { font-size: 0.9rem; font-weight: 700; color: var(--dim); margin-bottom: 6px; }
.compare .topic-line { font-size: 0.9rem; color: var(--dim); margin-top: 8px; }
.compare .lbl + .topic-line { margin-top: 0; }
.compare .big { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.compare .det { font-size: 0.95rem; line-height: 1.35; overflow-wrap: anywhere; }
.compare .played { font-size: 0.9rem; color: var(--dim); margin-top: 8px; }

.code-warn { font-weight: 700; }
.code-same { color: var(--dim); }

@media (max-width: 768px) {
  .compare { grid-template-columns: 1fr; }
  .code-box { font-size: 0.9rem; padding: 8px 10px; }
}
