/* ============================================================
   PASSAGE by Khoshà — Google Workspace email delivery panel.
   Companion to googlemail.js. Only the pieces the shared
   component classes in styles.css don't already cover (.pill,
   .btn, .fld, .help, .muted, .m-card).

   Mobile-first: base rules target a 390px phone; inputs are 16px so
   iOS Safari never zooms on focus. Long values (email addresses,
   SMTP errors, the redirect URI) all wrap rather than widen the
   card — nothing here may create horizontal overflow.
   ============================================================ */

.gm-panel {
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  background: var(--bone);
  padding: 14px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.gm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.gm-head > div { min-width: 0; flex: 1 1 auto; }
/* Without this the button is treated as shrinkable and "Check now"
   wraps to one word per line at 390px. */
.gm-head #gmRecheck { flex: 0 0 auto; white-space: nowrap; min-height: 32px; }
.gm-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
}
.gm-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.gm-verdict-line {
  flex: 1 1 100%;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.gm-verdict-line b { color: var(--ink); font-weight: 600; }

.gm-lede {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ---- what we ask Google for: stated plainly, including the
        negative, because a firm handing over mailbox access to a
        vendor deserves to read the limit, not infer it ---- */
.gm-scopes {
  background: var(--paper);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.gm-scopes b {
  display: block;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.gm-scopes ul { margin: 0 0 8px; padding-left: 18px; }
.gm-scopes li { margin: 2px 0; }
.gm-scopes-neg { display: block; color: var(--green); font-weight: 500; }

/* ---- connected account ---- */
.gm-acct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin-bottom: 12px;
}
.gm-acct-main { min-width: 0; flex: 1 1 200px; }
.gm-acct-email {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.gm-acct-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }

.gm-fromname { margin-bottom: 12px; }
.m-card .gm-fromname input,
.gm-panel .gm-fromname input { font-size: 16px; min-height: 44px; }

/* ---- notes / results ---- */
.gm-note {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--stroke-soft);
  color: var(--ink-soft);
}
.gm-warn {
  border-color: rgba(140, 59, 46, .30);
  background: rgba(140, 59, 46, .06);
  color: var(--red);
}
.gm-note b { color: inherit; }
.gm-note code, .gm-uri {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: var(--bone-2);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
.gm-uri { display: inline-block; margin-top: 5px; padding: 5px 7px; }

.gm-result {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.gm-result.ok  { background: rgba(30, 58, 51, .08);  color: var(--green); }
.gm-result.err { background: rgba(140, 59, 46, .08); color: var(--red); }

/* ---- actions: wrap on a phone, never a horizontal scrollbar ---- */
.gm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gm-actions .btn { min-height: 40px; }

/* ---- failures: read-only, deliberately no retry control ---- */
.gm-fails {
  margin-top: 14px;
  border-top: 1px solid var(--stroke-soft);
  padding-top: 10px;
}
.gm-fails > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  list-style: none;
  padding: 4px 0;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.gm-fails > summary::-webkit-details-marker { display: none; }
.gm-fails > summary::before { content: "▸"; margin-right: 7px; color: var(--gold); }
.gm-fails[open] > summary::before { content: "▾"; }

.gm-fail-head { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 10px; }
.gm-fail-head b { color: var(--red); }
.gm-fail-note { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; line-height: 1.45; }
.gm-fail-empty { font-size: 12.5px; color: var(--ink-faint); padding: 6px 0; }

.gm-fail {
  border-top: 1px solid var(--stroke-soft);
  padding: 9px 0;
}
.gm-fail-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.gm-fail-subj { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.gm-fail-when { font-size: 11.5px; color: var(--ink-faint); flex: 0 0 auto; }
.gm-fail-to  { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.gm-fail-err { font-size: 11.5px; color: var(--red); margin-top: 3px; line-height: 1.4; overflow-wrap: anywhere; }

/* ---- from ~560px there is room to relax the padding ---- */
@media (min-width: 560px) {
  .gm-panel { padding: 16px 18px; }
  .gm-title { font-size: 15px; }
}
