/* The three working screens: compose, live campaign detail, DNS audit.
   Split from screens.css to stay under the 300-line file cap. */

/* ---- Compose ----------------------------------------------------------- */
.compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: var(--s-5);
  height: 100%;
  padding: var(--s-5) var(--s-6);
  overflow: hidden;
}
.compose-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; overflow-y: auto; padding-bottom: var(--s-4); }
.compose-side { display: flex; flex-direction: column; gap: var(--s-4); overflow-y: auto; padding-bottom: var(--s-4); }
.editor {
  flex: 1 1 auto;
  min-height: 300px;
  width: 100%;
  padding: var(--s-4);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--t-12);
  line-height: 1.7;
  resize: none;
  tab-size: 2;
}
.editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.preview-frame {
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: var(--r-md);
  background: #fff;
  display: block;
}
.preview-phone { width: 375px; max-width: 100%; margin: 0 auto; }

/* ---- Custom header rows ------------------------------------------------ */
/* Name is narrower than value on purpose: header names are short and values are
   where a long URL or a rendered placeholder actually needs the room. */
.header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: var(--s-2);
  align-items: center;
}
.header-row + .header-row { margin-top: var(--s-2); }
@media (max-width: 640px) {
  .header-row { grid-template-columns: minmax(0, 1fr) auto; }
  .header-row [data-h-value] { grid-column: 1 / -1; }
}

/* ---- Full-size preview dialog ----------------------------------------- */
.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}
/* The stage is the neutral surround the message sits on, so the mobile width
   reads as a device rather than as a page that failed to fill its container. */
.preview-stage {
  display: flex;
  justify-content: center;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.preview-full {
  height: min(70vh, 860px);
  border: 0;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--shadow-2);
  transition: width var(--d-slow) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .preview-full { transition: none; }
}

.score-head { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-5); }
.score-num {
  font-size: var(--t-34);
  font-weight: var(--w-semibold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rule {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-12);
}
.rule-weight {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: var(--w-semibold);
  min-width: 34px;
  text-align: right;
}
.rule-fix { color: var(--ink-2); margin-top: 3px; }
.rule-fix strong { color: var(--ink); font-weight: var(--w-medium); }

@media (max-width: 1080px) {
  .compose { grid-template-columns: minmax(0, 1fr); overflow-y: auto; height: auto; }
  .compose-main, .compose-side { overflow: visible; }
}

/* ---- Campaign detail ---------------------------------------------------- */
.progress-head { display: flex; align-items: baseline; gap: var(--s-3); }
.progress-pct {
  font-size: var(--t-34);
  font-weight: var(--w-semibold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-5);
}
.counter-value {
  font-size: var(--t-20);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.counter-label { font-size: var(--t-11); color: var(--ink-3); }

.log {
  max-height: 420px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--t-12);
  overflow-anchor: none;
}
.log-line {
  display: flex;
  gap: var(--s-3);
  padding: 5px var(--s-5);
  border-bottom: 1px solid var(--hairline);
  animation: log-in var(--d-base) var(--ease);
}
.log-line:last-child { border-bottom: 0; }
.log-time { color: var(--ink-3); flex: none; }
.log-to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-status { margin-left: auto; flex: none; font-weight: var(--w-medium); }
.log-line[data-status="sent"] .log-status { color: var(--ok-ink); }
.log-line[data-status="failed"] .log-status,
.log-line[data-status="bounced"] .log-status { color: var(--bad-ink); }
.log-line[data-status="sending"] .log-status { color: var(--ink-3); }
.log-err { color: var(--bad-ink); font-size: var(--t-11); padding: 0 var(--s-5) 5px calc(var(--s-5) + 62px); }
@keyframes log-in { from { opacity: 0; background: var(--accent-soft); } to { opacity: 1; } }

/* ---- Domains ------------------------------------------------------------ */
.audit-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}
.audit-row:last-child { border-bottom: 0; }
.audit-name { font-weight: var(--w-semibold); font-size: var(--t-13); }
.audit-detail { min-width: 0; font-size: var(--t-13); }
.audit-found {
  font-family: var(--font-mono);
  font-size: var(--t-11);
  color: var(--ink-2);
  margin-top: var(--s-1);
  word-break: break-all;
}
.audit-fix { grid-column: 1 / -1; margin-top: var(--s-2); }
@media (max-width: 640px) {
  .audit-row { grid-template-columns: 1fr auto; }
  .audit-name { grid-column: 1 / -1; }
}

.score-ring { display: grid; place-items: center; position: relative; flex: none; }
.score-ring output {
  position: absolute;
  font-size: var(--t-13);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}
